版本是 3.2.1 在原本的服务器上运行无错,移植到新的服务器就有这个问题,大概就是服务器配置的缘故了。 官方上也相关的文章。http://wordpress.org/support/topic/25-imagemedia-uploader-problems 是apache Mod_Security 的缘故。如果你能够修改你服务器的httpd.conf文件的话,删除里面关于mod_security部分就可以了。不过多数wordpress玩家是没有权限修改这个文件的,那就只好修改.htaccess文件了。在.htaccess文件里面加上一行: <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> 这样就可以关闭 Mod_Security。
PHP的数据类型转换属于强制转换,允许转换的PHP数据类型有: (int)、(integer):转换成整形 (float)、(double)、(real):转换成浮点型 (string):转换成字符串 (bool)、(boolean):转换成布尔类型 (array):转换成数组 (object):转换成对象 PHP数据类型有三种转换方式: 在要转换的变量之前加上用括号括起来的目标类型 使用3个具体类型的转换函数,intval()、floatval()、strval() 使用通用类型转换函数settype(mixed var,string type) 第一种转换方式: (int) (bool) (float) (string) (array) (object) <?php $num1=3.14; $num2=(int)$num1; var_dump($num1); //输出float(3.14) var_dump($num2); //输出int(3) ?> 第二种转换方式: intval() floatval() strval() <?php $str=”123.9abc”; $int=intval($str); //转换后数值:123 $float=floatval($str); //转换后数值:123.9 $str=strval($float); //转换后字符串:”123.9″ ?> 第三种转换方式: settype(); <?php $num4=12.8; $flg=settype($num4,”int”); var_dump($flg); //输出bool(true) var_dump($num4); //输出int(12) ?> from:http://banu.blog.163.com/blog/static/231464820101122114438674/
UTF8 中文截取 其中对字符串预先 __() 处理,可以从 qtranslate 中取出当前语言部分然后进行截取。 function utf8Substr($str, $from, $len) { if ($len == 0){ return __($str); }else{ return preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$from.'}'. '((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*#s', '$1',__($str)); } } //use utf8Substr($recent["post_title"],0,14); function utf8_trim($str) { $len = strlen($str); for ($i=strlen($str)-1; $i>=0; $i-=1){ $hex .= ' '.ord($str[$i]); $ch = ord($str[$i]); if (($ch & 128)==0) return(substr($str,0,$i)); if (($ch & [...]
This piece of code should do it for you. Place this code in your theme’s functions.php file. You can add customizations to the custom_password_form() function – just don’t use print or echo – the function must return a value. <?php add_filter( 'the_password_form', 'custom_password_form' ); function custom_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) [...]

Posted on 26, 十











