0){ echo('[yes]'); }else{ echo('[no]'); } /** * 初始化数据库连接 */ function PwNewDB() { if (!is_object($GLOBALS['db'])) { global $db, $database, $dbhost, $dbuser, $dbpw, $dbname, $PW, $charset, $pconnect; require_once Pcv(R_P . "require/db_$database.php"); $db = new DB($dbhost, $dbuser, $dbpw, $dbname, $PW, $charset, $pconnect); } } function searchCount($cid, $title) { global $db; $_where = ''; if ($cid) $_where .= ' AND column_id IN (' . $cid . ")"; //if ($title) $_where .= ' AND subject LIKE ' . pwEscape('%' . $title . '%'); if ($title) $_where .= ' AND subject = ' . pwEscape($title); $_where .= ' AND ifcheck <>2 '; $_sql = "SELECT COUNT(*) FROM pw_cms_article WHERE article_id " . $_where; return $db->get_value($_sql); } function managerRight($adminjob) { return If_manager && in_array($adminjob,array('rightset','manager','ystats','diyoption','optimize','modepage','sphinx','app','ajaxhandler')); } function adminRight($adminjob,$admintype){ $temp = $admintype ? $admintype : $adminjob; return adminRightCheck($temp); } function getdirname($path=null){ if (!empty($path)) { if (strpos($path,'\\')!==false) { return substr($path,0,strrpos($path,'\\')).'/'; } elseif (strpos($path,'/')!==false) { return substr($path,0,strrpos($path,'/')).'/'; } } return './'; } /** * 加载扩展 * * @param string $module 扩展模块名 * @param string $checkFunction 检测函数 * @return bool */ function Pwloaddl($module, $checkFunction = 'mysqli_get_client_info') { return extension_loaded($module) && $checkFunction && function_exists($checkFunction) ? true : false; } ?>