0x80) { $c = $str[$i].$str[$i+1]; $i++; if(isset($pinyins[$c])) { if($ishead==0) { $restr .= $pinyins[$c]; } else { $restr .= $pinyins[$c][0]; } }else { $restr .= "_"; } }else if( preg_match("/[a-z0-9]/i", $str[$i]) ) { $restr .= $str[$i]; } else { $restr .= "_"; } } if($isclose==0) { unset($pinyins); } return $restr; } /** * 创建目录 * * @access public * @param string $spath 目录名称 * @return string */ function SpCreateDir($spath) { global $cfg_dir_purview,$cfg_basedir,$cfg_ftp_mkdir,$isSafeMode; if($spath=='') { return true; } $flink = false; $truepath = $cfg_basedir; $truepath = str_replace("\\","/",$truepath); $spaths = explode("/",$spath); $spath = ""; foreach($spaths as $spath) { if($spath=="") { continue; } $spath = trim($spath); $truepath .= "/".$spath; if(!is_dir($truepath) || !is_writeable($truepath)) { if(!is_dir($truepath)) { $isok = MkdirAll($truepath,$cfg_dir_purview); } else { $isok = ChmodAll($truepath,$cfg_dir_purview); } if(!$isok) { echo "创建或修改目录:".$truepath." 失败!
"; CloseFtp(); return false; } } } CloseFtp(); return true; } function jsScript($js) { $out = "\n"; return $out; } /** * 获取编辑器 * * @access public * @param string $fname 表单名称 * @param string $fvalue 表单值 * @param string $nheight 内容高度 * @param string $etype 编辑器类型 * @param string $gtype 获取值类型 * @param string $isfullpage 是否全屏 * @return string */ function SpGetEditor($fname,$fvalue,$nheight="350",$etype="Basic",$gtype="print",$isfullpage="false",$bbcode=false) { global $cfg_ckeditor_initialized; if(!isset($GLOBALS['cfg_html_editor'])) { $GLOBALS['cfg_html_editor']='fck'; } if($gtype=="") { $gtype = "print"; } if($GLOBALS['cfg_html_editor']=='fck') { require_once(DEDEINC.'/FCKeditor/fckeditor.php'); $fck = new FCKeditor($fname); $fck->BasePath = $GLOBALS['cfg_cmspath'].'/include/FCKeditor/' ; $fck->Width = '100%' ; $fck->Height = $nheight ; $fck->ToolbarSet = $etype ; $fck->Config['FullPage'] = $isfullpage; if($GLOBALS['cfg_fck_xhtml']=='Y') { $fck->Config['EnableXHTML'] = 'true'; $fck->Config['EnableSourceXHTML'] = 'true'; } $fck->Value = $fvalue ; if($gtype=="print") { $fck->Create(); } else { return $fck->CreateHtml(); } } else if($GLOBALS['cfg_html_editor']=='ckeditor') { $code = << EOT; if($gtype=="print") { echo $code; } else { return $code; } } else { /* // ------------------------------------------------------------------------ // 当前版本,暂时取消dedehtml编辑器的支持 // ------------------------------------------------------------------------ require_once(DEDEINC.'/htmledit/dede_editor.php'); $ded = new DedeEditor($fname); $ded->BasePath = $GLOBALS['cfg_cmspath'].'/include/htmledit/' ; $ded->Width = '100%' ; $ded->Height = $nheight ; $ded->ToolbarSet = strtolower($etype); $ded->Value = $fvalue ; if($gtype=="print") { $ded->Create(); } else { return $ded->CreateHtml(); } */ } } /** * 获取更新信息 * * @return void */ function SpGetNewInfo() { global $cfg_version,$dsql; $nurl = $_SERVER['HTTP_HOST']; if( preg_match("#[a-z\-]{1,}\.[a-z]{2,}#i",$nurl) ) { $nurl = urlencode($nurl); } else { $nurl = "test"; } $phpv = phpversion(); $sp_os = PHP_OS; $mysql_ver = $dsql->GetVersion(); $seo_info = $dsql->GetOne("SELECT * FROM `#@__plus_seoinfo` ORDER BY id DESC"); $add_query = ''; if ( $seo_info ) { $add_query .= "&alexa_num={$seo_info['alexa_num']}&alexa_area_num={$seo_info['alexa_area_num']}&baidu_count={$seo_info['baidu_count']}&sogou_count={$seo_info['sogou_count']}&haosou360_count={$seo_info['haosou360_count']}"; } $query = " SELECT COUNT(*) AS dd FROM `#@__member` "; $row1 = $dsql->GetOne($query); if ( $row1 ) $add_query .= "&mcount={$row1['dd']}"; $query = " SELECT COUNT(*) AS dd FROM `#@__arctiny` "; $row2 = $dsql->GetOne($query); if ( $row2 ) $add_query .= "&acount={$row2['dd']}"; $offUrl = "http://new"."ver.a"."pi.de"."decms.com/index.php?c=info57&version={$cfg_version}&formurl={$nurl}&phpver={$phpv}&os={$sp_os}&mysqlver={$mysql_ver}{$add_query}"; return $offUrl; } ?>