wordpress无法上传图片

wordpress_ini_get_upload_media

wordpress 出现上传媒体文件 最大值是0的情况,多是php.ini 里面禁用了 ini_get 函数,
解决方式是,手动设置个值,在wp-include/media.php 里面

function wp_max_upload_size() {
        return 1024 * 1024 * 2 ; // phpsir 修改 最大2M
	$u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
	$p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );

	/**
	 * Filter the maximum upload size allowed in php.ini.
	 *
	 * @since 2.5.0
	 *
	 * @param int $size    Max upload size limit in bytes.
	 * @param int $u_bytes Maximum upload filesize in bytes.
	 * @param int $p_bytes Maximum size of POST data in bytes.
	 */

	return apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes );
}

帝国cms手动分表

1)帝国后台分表管理,建立phome_ecms_news_data_2表
2)insert into  phome_ecms_news_data_2(id)   select id   from  phome_ecms_news_data_1 order by id desc  limit 30001,30000; //每3万条一个分表
3) update phome_ecms_news_data_2 a ,phome_ecms_news_data_1 b set a.classid=b.classid, a.keyid=b.keyid,a.dokey=b.dokey,a.newstempid=b.newstempid,a.closepl=b.closepl,a.haveaddfen=b.haveaddfen,a.infotags=b.infotags,a.writer=b.writer,a.befrom=b.befrom,a.newstext=b.newstext where a.id=b.id; // 更新 phome_ecms_news_data_2 的其它字段
4) update phome_ecms_news set stb =2 where id in (select id from phome_ecms_news_data_2); // 更新news表的stb字段
5) 要分更多表,依次类推

关于两台优酷路由宝的LAN口问题的帖子

首先,两台路由宝问题一样
主机一台比较老的台式机,原来用的正常用的路由器(不说品牌),
我用路由宝替换下来后,听朋友讲说需要几天重启下路由宝(直接开关路由宝的外置电源插线板的通电开关,
我就直接断电重启路由宝,结果导致路由宝两个LAN口,死活都不再认网卡,电脑显示网卡未连接,

但是
但是!
路由宝换到别的机器,LAN口又能用,
我的那台式机接回原来的路由器也一切正常。
只是我再也无法老台式机器网卡能再和路由宝LAN口识别,
大家有无遇到同样的问题

获取远程ip地区

感谢 http://snowcoal.com/article/324.html

function ip_info($ip = NULL, $purpose = "location", $deep_detect = TRUE) {
  $output = NULL;
  if (filter_var($ip, FILTER_VALIDATE_IP) === FALSE) {
    $ip = $_SERVER["REMOTE_ADDR"];
    if ($deep_detect) {
      if (filter_var(@$_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP))
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
      if (filter_var(@$_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP))
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    }
  }
  $purpose  = str_replace(array("name", "\n", "\t", " ", "-", "_"), NULL, strtolower(trim($purpose)));
  $support  = array("country", "countrycode", "state", "region", "city", "location", "address");
  $continents = array(
    "AF" => "Africa",
    "AN" => "Antarctica",
    "AS" => "Asia",
    "EU" => "Europe",
    "OC" => "Australia (Oceania)",
    "NA" => "North America",
    "SA" => "South America"
  );
  if (filter_var($ip, FILTER_VALIDATE_IP) && in_array($purpose, $support)) {
    $ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip));
    if (@strlen(trim($ipdat->geoplugin_countryCode)) == 2) {
      switch ($purpose) {
        case "location":
          $output = array(
            "city"      => @$ipdat->geoplugin_city,
            "state"     => @$ipdat->geoplugin_regionName,
            "country"    => @$ipdat->geoplugin_countryName,
            "country_code"  => @$ipdat->geoplugin_countryCode,
            "continent"   => @$continents[strtoupper($ipdat->geoplugin_continentCode)],
            "continent_code" => @$ipdat->geoplugin_continentCode
          );
          break;
        case "address":
          $address = array($ipdat->geoplugin_countryName);
          if (@strlen($ipdat->geoplugin_regionName) >= 1)
            $address[] = $ipdat->geoplugin_regionName;
          if (@strlen($ipdat->geoplugin_city) >= 1)
            $address[] = $ipdat->geoplugin_city;
          $output = implode(", ", array_reverse($address));
          break;
        case "city":
          $output = @$ipdat->geoplugin_city;
          break;
        case "state":
          $output = @$ipdat->geoplugin_regionName;
          break;
        case "region":
          $output = @$ipdat->geoplugin_regionName;
          break;
        case "country":
          $output = @$ipdat->geoplugin_countryName;
          break;
        case "countrycode":
          $output = @$ipdat->geoplugin_countryCode;
          break;
      }
    }
  }
  return $output;
}

shopnc o2o 更换短信接口

修改 api\message\include\Client.php

里面的sendsms函数

function sendSMS($mobiles=array(),$content,$sendTime='',$addSerial='',$charset='GBK',$priority=5,$smsId=8888)
	{
		
		$params = array('arg0'=>$this->serialNumber,'arg1'=>$this->sessionKey,'arg2'=>$sendTime,
			'arg4'=>$content,'arg5'=>$addSerial, 'arg6'=>$charset,'arg7'=>$priority,'arg8'=>$smsId
			);
			
		/**
		 * 多个号码发送的xml内容格式是 
		 * 159xxxxxxxx
		 * 159xxxxxxx2
		 * ....
		 * 所以需要下面的单独处理
		 * 
		 */
		 
		foreach($mobiles as $mobile)
		{
			//array_push($params,new soapval("arg3",false,$mobile));
			 //此处
			 
		}
		//$result = $this->soap->call("sendSMS",$params,$this->namespace);
		
		return $result;
		
	}