1.选择产品转换程序 | 2.设置服务器信息 | 3.配置转换过程 | 4.执行数据转换 | 5.转换完成 |
$val) { $string[$key] = daddslashes($val); } } else { $string = $trim ? trim(addslashes($string)) : addslashes($string); } return $string; } function cutstr($string, $length, $dot = '') { global $discuz_charset; if(strlen($string) <= $length) { return $string; } $strcut = ''; if(strtolower($discuz_charset) == 'utf8') { $n = $tn = $noc = 0; while ($n < strlen($string)) { $t = ord($string[$n]); if($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) { $tn = 1; $n++; $noc++; } elseif(194 <= $t && $t <= 223) { $tn = 2; $n += 2; $noc += 2; } elseif(224 <= $t && $t < 239) { $tn = 3; $n += 3; $noc += 2; } elseif(240 <= $t && $t <= 247) { $tn = 4; $n += 4; $noc += 2; } elseif(248 <= $t && $t <= 251) { $tn = 5; $n += 5; $noc += 2; } elseif($t == 252 || $t == 253) { $tn = 6; $n += 6; $noc += 2; } else { $n++; } if ($noc >= $length) { break; } } if ($noc > $length) { $n -= $tn; } $strcut = substr($string, 0, $n); } else { for($i = 0; $i < $length - strlen($dot) - 1; $i++) { $strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i]; } } return $strcut.$dot; } function parseqqicq($qqicq, $minlen = 5, $maxlen = 12) {// qq 转换 return $qqicq ? (preg_match("/^([0-9]+)$/", $qqicq) && strlen($qqicq) >= $minlen && strlen($qqicq) <= $maxlen ? $qqicq : '') : ''; } function parsesite($site) { if($site && strtolower($site) != 'http://') { $user_site = trim(preg_match("/^https?:\/\/.+/i", $site) ? $site : ($site ? 'http://'.$site : '')); return $user_site ? cutstr(htmlspecialchars($user_site), 75) : ''; } return ''; } function parsesign($sign) { $searcharray = array( '[/color]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', '[list=A]', '[*]', '[/list]', '[indent]', '[/indent]' ); $replacearray = array( '', '', '', '
', '', '', '', '', '', '', '', '' ); $pregfind = array( "/\[url\]\s*(www.|https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/|callto:\/\/|ed2k:\/\/){1}([^\[\"']+?)\s*\[\/url\]/ie", "/\[url=www.([^\[\"']+?)\](.+?)\[\/url\]/is", "/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|ed2k){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/is", "/\[email\]\s*([a-z0-9\-_.+]+)@([a-z0-9\-_]+[.][a-z0-9\-_.]+)\s*\[\/email\]/i", "/\[email=([a-z0-9\-_.+]+)@([a-z0-9\-_]+[.][a-z0-9\-_.]+)\](.+?)\[\/email\]/is", "/\[color=([^\[\<]+?)\]/i", "/\[size=([^\[\<]+?)\]/i", "/\[font=([^\[\<]+?)\]/i", "/\[align=([^\[\<]+?)\]/i", "/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is", "/\s*\[code\](.+?)\[\/code\]\s*/is", "/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies", "/\[img=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies" ); $pregreplace = array( "cuturl('\\1\\2')", "\\2", "\\3", "\\1@\\2", "\\3", "", "", "", "
", "
1.选择产品转换程序 | 2.设置服务器信息 | 3.配置转换过程 | 4.执行数据转换 | 5.转换完成 |