@extract($db->get_one('SELECT SUM(topic) AS threads,SUM(article) AS posts FROM pw_forumdata')); $hits = $db->get_value('SELECT SUM(hits) FROM pw_threads'); $cachetime = $timestamp + 60 * 60 * 12; /** writeover(D_P.'data/bbscache/admin_cache.php',"<?php die;?>$cachetime|$pw_size|$o_size|$dbversion|$max_upload|$max_ex_time|$sys_mail|$totalmember|$threads|$posts|$hits|$yposts\r\n{$cachetext[1]}"); **/ pwCache::setData(D_P . 'data/bbscache/admin_cache.php', "<?php die;?>{$cachetime}|{$pw_size}|{$o_size}|{$dbversion}|{$max_upload}|{$max_ex_time}|{$sys_mail}|{$totalmember}|{$threads}|{$posts}|{$hits}|{$yposts}\r\n{$cachetext[1]}"); } $altertime = gmdate('Y-m-d H:i', $timestamp + $db_timedf * 3600); $systemtime = $db_cvtime == 0 ? $altertime : gmdate('Y-m-d H:i', time() + $db_timedf * 3600); $sysversion = PHP_VERSION; $sysos = str_replace('PHP/' . $sysversion, '', S::getServer('SERVER_SOFTWARE')); $ifcookie = isset($_COOKIE) ? 'SUCCESS' : 'FAIL'; } if (!$job || $job == 'desktop') { if (S::inArray($admin_name, $manager)) { $u = 1; if (pwWritable(D_P . 'data/sql_config.php')) { $warnid += 1; } if (is_dir('data')) { $warnid += 2; } if (ini_get('register_globals')) { $warnid += 4; } if (file_exists('admin.php')) { $warnid += 8; } if (!$db_ifsafecv || strpos($db_safegroup, ',3,') === false || strpos($db_safegroup, ',4,') === false || strpos($db_safegroup, ',5,') === false) { $warnid += 16; } if ($pw_size > 500) {
$config['creditset'] = addslashes(serialize($creditset)); } if (is_array($creditpay['name']) && !empty($creditpay['name'])) { $cpay = array(); foreach ($creditpay['name'] as $key => $value) { if (isset($credit->cType[$value]) && !isset($cpay[$value])) { $cpay[$value] = array('rmbrate' => intval($creditpay['rmbrate'][$key]), 'rmblest' => round($creditpay['rmblest'][$key], 2), 'virement' => intval($creditpay['virement'][$key])); } } is_array($cpay) && !empty($cpay) && ($config['creditpay'] = $cpay); } $config['creditlog'] = is_array($creditlog) ? $creditlog : array(); unset($creditpay, $creditset, $creditlog); } if ($admintype == 'reg' || $settingdb['reg']) { if (!pwWritable(D_P . 'data/bbscache/dbreg.php') && !chmod(D_P . 'data/bbscache/dbreg.php', 0777)) { adminmsg('dbreg_777'); } InitGP(array('reg'), 'P', 0); InitGP(array('namelen', 'pwdlen', 'regcredit'), 'P', 2); $reg['email'] = trim($reg['email'], ','); $reg['banemail'] = trim($reg['banemail'], ','); $reg['banname'] = trim($reg['banname'], ','); $reg['allowsameip'] = trim($reg['allowsameip'], ','); $reg['rgpermit'] = nl2br(ieconvert($reg['rgpermit'])); $reg['welcomemsg'] = ieconvert($reg['welcomemsg']); $reg['whyregclose'] = ieconvert($reg['whyregclose']); if (abs($reg['timeend'] - $reg['timestart']) > 150) { adminmsg('reg_timelimit'); } if ($namelen['max'] < 1 || $namelen['max'] > 15) {
${$rt['db_name']} = $rt['db_value']; } } $filepath = array(D_P . 'data/', D_P . 'data/sql_config.php', D_P . 'data/bbscache/', D_P . 'data/forums/', D_P . 'data/guestcache/', D_P . 'data/groupdb/', D_P . 'data/style/', D_P . 'data/tmp/', D_P . 'data/tplcache/', D_P . 'data/package/', R_P . "{$db_attachname}/", R_P . "{$db_attachname}/cn_img/", R_P . "{$db_attachname}/mini/", R_P . "{$db_attachname}/mutiupload/", R_P . "{$db_attachname}/photo/", R_P . "{$db_attachname}/pushpic/", R_P . "{$db_attachname}/thumb/", R_P . "{$db_attachname}/upload/", R_P . "{$db_htmdir}/", R_P . "{$db_htmdir}/channel/"); $filemode = array(); foreach ($filepath as $key => $value) { if (substr($value, -1) == '/') { $value = substr($value, 0, strlen($value) - 1); if (!file_exists($value)) { @mkdir($value, 0777); @touch("{$value}/index.html"); } } if (!file_exists($value)) { $filemode[$key] = 1; } elseif (!pwWritable($value)) { $filemode[$key] = 2; } else { $filemode[$key] = 0; } } } elseif ($adminitem == 'searchcheck') { /*文件搜索检查*/ if (empty($action)) { $dirlist = ''; $fp = opendir('./'); while ($filename = readdir($fp)) { if ($filename != '.' && $filename != '..' && is_dir($filename)) { $dirlist .= "<option value=\"{$filename}\">/{$filename}</option>"; } }
} else { $db->update("INSERT INTO pw_styles" . " SET " . S::sqlSingle(array('name' => $key, 'customname' => $customname[$key], 'ifopen' => $ifopen[$key], 'stylepath' => $stylepath, 'tplpath' => $tplpath, 'yeyestyle' => $yeyestyle, 'bgcolor' => $bgcolor, 'linkcolor' => $linkcolor, 'tablecolor' => $tablecolor, 'tdcolor' => $tdcolor, 'tablewidth' => $tablewidth, 'mtablewidth' => $mtablewidth, 'headcolor' => $headcolor, 'headborder' => $headborder, 'headfontone' => $headfontone, 'headfonttwo' => $headfonttwo, 'cbgcolor' => $cbgcolor, 'cbgborder' => $cbgborder, 'cbgfont' => $cbgfont, 'forumcolorone' => $forumcolorone, 'forumcolortwo' => $forumcolortwo, 'extcss' => $extcss))); } $ifopen[$key] == 1 && ($styledb[$key] = array($customname[$key], $ifopen[$key], $tplpath)); } setConfig('db_styledb', $styledb); setConfig('db_defaultstyle', $defaultstyle); updatecache_c(); adminmsg('operate_success'); } elseif ($action == 'edit') { S::gp(array('sid')); if (!$_POST['step']) { //* include_once S::escapePath(D_P."data/style/$sid.php"); extract(pwCache::getData(S::escapePath(D_P . "data/style/{$sid}.php"), false)); ifcheck($yeyestyle, 'yes'); $css_777 = pwWritable(D_P . "data/style/{$tplpath}_css.htm") ? 1 : 0; $style_css = pwCache::readover(D_P . "data/style/{$tplpath}_css.htm"); $style_css = explode('<!--css-->', $style_css); $style_css = str_replace('$', "\$", $style_css[1]); include PrintEot('setstyles'); exit; } else { S::gp(array('setting'), 'P'); $basename .= "&action=edit&sid={$sid}"; strpos($setting[7], '%') === false && strpos(strtolower($setting[7]), 'px') === false && ($setting[7] .= 'px'); strpos($setting[8], '%') === false && strpos(strtolower($setting[8]), 'px') === false && ($setting[8] .= 'px'); $rs = $db->get_one("SELECT sid FROM pw_styles WHERE name=" . S::sqlEscape($sid, false)); if ($rs) { $db->update("UPDATE pw_styles" . " SET " . S::sqlSingle(array('stylepath' => $setting[0], 'tplpath' => $setting[1], 'yeyestyle' => $setting[2], 'bgcolor' => $setting[3], 'linkcolor' => $setting[4], 'tablecolor' => $setting[5], 'tdcolor' => $setting[6], 'tablewidth' => $setting[7], 'mtablewidth' => $setting[8], 'headcolor' => $setting[9], 'headborder' => $setting[10], 'headfontone' => $setting[11], 'headfonttwo' => $setting[12], 'cbgcolor' => $setting[13], 'cbgborder' => $setting[14], 'cbgfont' => $setting[15], 'forumcolorone' => $setting[16], 'forumcolortwo' => $setting[17], 'extcss' => $setting[18])) . ' WHERE name=' . S::sqlEscape($sid)); } else { $db->update("INSERT INTO pw_styles" . " SET " . S::sqlSingle(array('name' => $sid, 'ifopen' => '1', 'stylepath' => $setting[0], 'tplpath' => $setting[1], 'yeyestyle' => $setting[2], 'bgcolor' => $setting[3], 'linkcolor' => $setting[4], 'tablecolor' => $setting[5], 'tdcolor' => $setting[6], 'tablewidth' => $setting[7], 'mtablewidth' => $setting[8], 'headcolor' => $setting[9], 'headborder' => $setting[10], 'headfontone' => $setting[11], 'headfonttwo' => $setting[12], 'cbgcolor' => $setting[13], 'cbgborder' => $setting[14], 'cbgfont' => $setting[15], 'forumcolorone' => $setting[16], 'forumcolortwo' => $setting[17], 'extcss' => $setting[18])));