function query($SQL, $method = null, $error = true) { $originalSQL = $SQL; if ($this->dbpre != 'pw_') { $SQL = str_replace(array(' pw_', '`pw_', " 'pw_"), array(" {$this->dbpre}", "`{$this->dbpre}", " '{$this->dbpre}"), $SQL); } $GLOBALS['db_debug'] && (list($begintime, $begintime_sec) = explode(" ", microtime())); if ($method && function_exists('mysql_unbuffered_query')) { $query = @mysql_unbuffered_query($SQL, $this->sql); } else { $query = @mysql_query($SQL, $this->sql); } if (in_array(mysql_errno($this->sql), array(2006, 2013)) && empty($query) && $this->pconnect == 0 && !defined('QUERY')) { define('QUERY', true); @mysql_close($this->sql); sleep(2); $this->connect(); $query = $this->query($SQL); } $GLOBALS['db_debug'] && (list($endtime, $endtime_sec) = explode(" ", microtime())); $method != 'U' && $this->query_num++; if ($GLOBALS['db_debug']) { $usetime = $endtime + $endtime_sec - $begintime - $begintime_sec; $this->arr_query .= $SQL . "\t\ttime:" . $usetime . "\r\n\r\n"; $this->totaltime += $usetime; } !$query && $error && $this->halt('Query Error: ' . $SQL); require_once R_P . 'aCloud/aCloud.php'; ACloud_App_Guiding::collectSql($originalSQL); return $query; }
function pwOutPut() { global $db_htmifopen, $db_redundancy, $SCR, $groupid; $masterDb = $GLOBALS['db']->getMastdb(); if ($masterDb->arr_query) { writeover(D_P . "data/sqllist.txt", $masterDb->arr_query, 'wb'); } Update_ol(); $output = parseHtmlUrlRewrite(ob_get_contents(), $db_htmifopen); if ($db_redundancy && $SCR != 'post') { $output = str_replace(array("\r", '<!--<!---->-->', '<!---->-->', '<!--<!---->', "<!---->\n", '<!---->', '<!-- -->', "<!--\n-->", "\t\t", ' ', "\n\t", "\n\n"), array('', '', '', '', '', '', '', '', '', '', "\n", "\n"), $output); } else { $output = str_replace(array('<!--<!---->-->', '<!---->-->', '<!--<!---->', "<!---->\r\n", '<!---->', '<!-- -->', "\t\t\t"), '', $output); } if (!defined('AJAX')) { require_once R_P . 'aCloud/aCloud.php'; $output .= ACloud_App_Guiding::getApp(); } if ($SCR != 'post' && !defined('AJAX')) { $ceversion = defined('CE') ? 1 : 0; $output .= "<script type=\"text/javascript\">(function(d,t){\r\nvar url=\"http://init.phpwind.net/init.php?sitehash={$GLOBALS[db_sitehash]}&v={$GLOBALS[wind_version]}&c={$ceversion}\";\r\nvar g=d.createElement(t);g.async=1;g.src=url;d.body.insertBefore(g,d.body.firstChild);}(document,\"script\"));</script>"; } if ($groupid == 'guest' && !defined('MSG') && GetGcache()) { require_once R_P . 'require/guestfunc.php'; creatguestcache($output); } if (defined('SHOWLOG')) { Error::writeLog(); } if (defined('PW_PACK_FILES')) { pwPack::files(); } echo ObContents($output); unset($output); N_flush(); exit; }
function query($SQL, $method = null, $error = true) { $originalSQL = $SQL; if ($this->dbpre != 'pw_') { $SQL = str_replace(array(' pw_', '`pw_', " 'pw_"), array(" {$this->dbpre}", "`{$this->dbpre}", " '{$this->dbpre}"), $SQL); } $query = @mysqli_query($this->sql, $SQL, $method ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT); if (in_array(mysqli_errno($this->sql), array(2006, 2013)) && empty($query) && !defined('QUERY')) { define('QUERY', true); @mysqli_close($this->sql); sleep(2); $this->connect(); $query = $this->query($SQL); } $method != 'U' && $this->query_num++; !$query && $error && $this->halt('Query Error: ' . $SQL); require_once R_P . 'aCloud/aCloud.php'; ACloud_App_Guiding::collectSql($originalSQL); return $query; }
} PwNewDB(); unset($db_whybbsclose, $db_whycmsclose, $db_ipban, $db_diy, $dbhost, $dbuser, $dbpw, $dbname, $pconnect, $manager_pwd, $newmanager); if ($groupid == 'guest') { pwCache::getData(D_P . 'data/groupdb/group_2.php'); } elseif (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) { pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php")); } else { pwCache::getData(D_P . 'data/groupdb/group_1.php'); } visitRightByGroup(); if ($_G['pwdlimitime'] && !defined('PRO') && !S::inArray($windid, $manager) && $timestamp - 86400 * $_G['pwdlimitime'] > $winddb['pwdctime']) { Showmsg('pwdchange_prompt'); } require_once R_P . 'aCloud/aCloud.php'; ACloud_App_Guiding::runApps(SCR); require_once R_P . 'lib/cloudwind/cloudwind.class.php'; $cloud_information = CloudWind::getUserInfo(); CloudWind::sendUserInfo($cloud_information); //响应 /** * 跳转 * * @global string $db_ifjump * @param string $URL 跳转url * @param string $content 跳转提示信息 * @param int $statime 几秒后跳转 * @param bool $forcejump */ function refreshto($URL, $content, $statime = 1, $forcejump = false) {