function updateAreaStaticRefreshTime($timeToUpdate = 0) { global $db; require_once R_P . 'admin/cache.php'; $update = array('area_static_next', 'string', $timeToUpdate, ''); $db->update("REPLACE INTO pw_hack VALUES (" . pwImplode($update) . ')'); updatecache_conf('area', true); }
function setoParams($config) { global $db; $updatecache = false; foreach ($config as $key => $value) { if (${'o_' . $key} != $value) { $db->pw_update('SELECT hk_name FROM pw_hack WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $value, 'vtype' => 'string')) . ' WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => "o_{$key}", 'vtype' => 'string', 'hk_value' => $value))); $updatecache = true; } } $updatecache && updatecache_conf('o', true); }
function updatecache($array = '') { if (empty($array) || !is_array($array)) { updatecache_i(1); if (R_P == D_P || !file_exists(D_P . 'data/bbscache/config.php') || !file_exists(D_P . 'data/bbscache/dbreg.php')) { updatecache_c(); } updatecache_p(1); updatecache_w(); updatecache_sy(); updatecache_g(); updatecache_bk(); updatecache_df(); updatecache_ol(); updatecache_mddb(1); updatecache_ml(); updatecache_f(1); updatecache_l(1); updatecache_gr(1); updatecache_inv(); updatecache_plan(); updatecache_ftp(); updatecache_field(1); updatecache_form(); updatecache_help(); cache_read(); updatecache_hotforum(); updatecache_openforum(); updatecache_topic(); updatecache_postcate(); updateCacheActivity(); updatecache_conf('nf', false, 'newinfo_config.php'); //updateStampCache(); //updateBlockCache(); } else { foreach ($array as $value) { $value(); } } }
function updatePurviewCache() { $purviews = $this->findAll('', 0, 0); $editadmin = array(); foreach ($purviews as $pruview) { foreach ($pruview['columns'] as $column) { $editadmin[$column][] = $pruview['username']; } } setConfig('cms_editadmin', $editadmin, null, true); updatecache_conf('cms', true); }
function updateAreaChannels() { global $db; $channels = $this->getChannels(); $db->update("REPLACE INTO pw_hack SET hk_name='area_channels',vtype='array',hk_value=" . S::sqlEscape(serialize($channels), false)); updatecache_conf('area', true); return true; }
function updatecache_cnc_s() { global $db; $styledb = $style_relation = array(); $query = $db->query('SELECT id,cname,upid FROM pw_cnstyles WHERE ifopen=1 ORDER BY upid ASC,vieworder ASC'); while ($rt = $db->fetch_array($query)) { $styledb[$rt['id']] = array('cname' => $rt['cname'], 'upid' => $rt['upid']); if ($rt['upid']) { $style_relation[$rt['upid']][] = $rt['id']; } else { $style_relation[$rt['id']] = array(); } } $styledb = serialize($styledb); $style_relation = serialize($style_relation); $db->pw_update("SELECT hk_name FROM pw_hack WHERE hk_name='o_styledb'", 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $styledb, 'vtype' => 'array')) . " WHERE hk_name='o_styledb'", 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => 'o_styledb', 'vtype' => 'array', 'hk_value' => $styledb))); $db->pw_update("SELECT hk_name FROM pw_hack WHERE hk_name='o_style_relation'", 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $style_relation, 'vtype' => 'array')) . " WHERE hk_name='o_style_relation'", 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => 'o_style_relation', 'vtype' => 'array', 'hk_value' => $style_relation))); updatecache_conf('o', true); }
function updatecache_cnc() { global $db; $classdb = array(); $query = $db->query('SELECT fid,cname FROM pw_cnclass WHERE ifopen=1'); while ($rt = $db->fetch_array($query)) { $classdb[$rt['fid']] = $rt['cname']; } $classdb = serialize($classdb); $db->pw_update("SELECT hk_name FROM pw_hack WHERE hk_name='o_classdb'", 'UPDATE pw_hack SET ' . pwSqlSingle(array('hk_value' => $classdb, 'vtype' => 'array')) . " WHERE hk_name='o_classdb'", 'INSERT INTO pw_hack SET ' . pwSqlSingle(array('hk_name' => 'o_classdb', 'vtype' => 'array', 'hk_value' => $classdb))); updatecache_conf('o', true); }
} } require_once PrintApp('admin'); } else { S::gp(array('creditset', 'creditlog'), 'GP'); S::gp(array('config', 'phopen', 'groups'), 'GP', 2); require_once R_P . 'admin/cache.php'; setConfig('db_phopen', $phopen); updatecache_c(); $config['photos_groups'] = is_array($groups) ? ',' . implode(',', $groups) . ',' : ''; $updatecache = false; $config['photos_creditset'] = ''; if (is_array($creditset) && !empty($creditset)) { foreach ($creditset as $key => $value) { foreach ($value as $k => $v) { $creditset[$key][$k] = round($v, $k == 'rvrc' ? 1 : 0); } } $config['photos_creditset'] = addslashes(serialize($creditset)); } is_array($creditlog) && !empty($creditlog) && ($config['photos_creditlog'] = addslashes(serialize($creditlog))); foreach ($config as $key => $value) { if (${'o_' . $key} != $value) { $db->pw_update('SELECT hk_name FROM pw_hack WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $value, 'vtype' => 'string')) . ' WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => "o_{$key}", 'vtype' => 'string', 'hk_value' => $value))); $updatecache = true; } } $updatecache && updatecache_conf('o', true); adminmsg('operate_success'); } }
S::gp(array('seo', 'seoset'), 'P'); foreach ($seo as $key => $value) { $seo = array(); $seo['cid'] = $key; $seo['seotitle'] = trim(strip_tags($value['seotitle'])); $seo['seodesc'] = trim(strip_tags($value['seodesc'])); $seo['seokeywords'] = trim(strip_tags($value['seokeywords'])); $columnService->updateColumnSEO($seo); } foreach ($seoset as $key => $value) { foreach ($value as $k => $var) { $seoset[$key][$k] = S::escapeChar(strip_tags($var)); } } setConfig('cms_seoset', $seoset, null, true); updatecache_conf('cms', true); adminmsg('operate_success', "{$basename}&mode={$db_mode}"); } else { $channles = $columnService->getAllOrderColumns(); include PrintMode('seoset'); } /** * @param unknown_type $level */ function getColumnLevelHtml($level) { if ($level == 0) { return '<i class="expand expand_b"></i>'; } else { $html .= ''; for ($i = 1; $i < $level; $i++) {
@(include_once A_P . 'lib/utility.class.php'); @(include_once A_P . 'lang/lang_o_hot.php'); $utility = new HotModuleUtility(); if (empty($action)) { InitGP(array("hot_baseSet"), 'P'); if ($hot_baseSet == "baseSet") { InitGP(array("config", "hot_userGroup"), 'P'); $config["hot_groups"] = ',' . implode(',', (array) $hot_userGroup) . ','; $cacheFlag = false; foreach ($config as $key => $value) { if (${'o_' . $key} != $value) { $db->pw_update("SELECT * FROM pw_hack WHERE hk_name=" . pwEscape('o_' . $key), "UPDATE pw_hack SET vtype=" . pwEscape('string') . ", hk_value=" . pwEscape($value) . " WHERE hk_name=" . pwEscape('o_' . $key), "INSERT INTO pw_hack SET hk_name=" . pwEscape('o_' . $key) . ", vtype=" . pwEscape('string') . ", hk_value=" . pwEscape($value)); $cacheFlag = true; } } $cacheFlag && updatecache_conf('o', true); adminmsg('operate_success'); } else { $hot_userGroup = ''; $num = ''; foreach ($ltitle as $key => $value) { if (!in_array($key, array(1, 2, 6, 7))) { $num++; $tr = $num % 4 == 0 ? '</tr><tr>' : ''; $checked = strpos($o_hot_groups, "," . $key . ",") !== false ? 'checked' : ''; $hot_userGroup .= "<td><input type=\"checkbox\" name=\"hot_userGroup[]\" value=\"{$key}\" " . $checked . " /> {$value} </td>" . $tr; } } $hot_userGroup && ($hot_userGroup = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr>{$hot_userGroup}</tr></table>"); ifcheck($o_hot_open, "hot_open"); }
$nf_order[$orderid]['mode'] = $bbsinfo; } else { $bbsinfo = explode(',', $nf_order[$orderid]['mode']); foreach ($bbsinfo as $val) { ${$val} = 'checked'; } include PrintEot('rebang'); exit; } } elseif (!$_POST['step']) { include PrintEot('rebang'); exit; } if ($_POST['step'] == '2') { InitGP(array('updatetime'), 'P'); $nf_order[$orderid]['updatetime'] = is_numeric($updatetime) ? intval($updatetime) : '0'; setConfig('nf_order', $nf_order); updatecache_conf('nf', false, 'newinfo_config.php'); adminmsg('operate_success', "{$basename}&action=rebang"); } } function orderCmp($row1, $row2) { if ($row2['order'] > $row1['order']) { return 1; } elseif ($row2['order'] < $row1['order']) { return -1; } else { return strcmp($row1['cachetime'], $row2['cachetime']); } }
adminmsg('用户名不存在'); } if ($mgid && $ltitle[$mgid] && in_array($mgid, $gids)) { //TODO 权限 $db->update("UPDATE pw_members SET groupid=" . intval($mgid) . " WHERE uid=" . intval($rt['uid'])); } $rt = $db->get_value("SELECT hk_value FROM pw_hack WHERE hk_name='area_editadmin'"); $area_editadmin = $rt ? unserialize($rt) : array(); $index = $scr == 'index' ? 'index' : intval($cateid); $editadmin = explode(',', $area_editadmin[$index]); $editadmin[] = $user; $editadmin = array_unique($editadmin); $area_editadmin[$index] = trim(implode(',', $editadmin), ','); $update = array('area_editadmin', 'array', serialize($area_editadmin), ''); $db->update("REPLACE INTO pw_hack VALUES (" . pwImplode($update, false) . ')'); updatecache_conf('area', true); adminmsg('operate_success'); } ajax_footer(); exit; } elseif ($action == 'mgroup') { //会员所在用户组 $user = GetGP('user'); if (empty($user)) { echo '请输入用户名'; ajax_footer(); } $mgid = $db->get_one("SELECT uid,groupid FROM pw_members WHERE username=" . pwEscape($user)); $ltitle['-1'] = '普通会员'; if ($mgid && $ltitle[$mgid['groupid']]) { if ($mgid['groupid'] != -1) {
function cache() { $query = $this->db->query("SELECT * FROM pw_nav WHERE isshow=1 ORDER BY type,upid,view"); $nav_cache = $nav_other = $nav_main = $nav_head = $nav_foot = array(); while ($navdb = $this->db->fetch_array($query)) { list($navdb['color'], $navdb['b'], $navdb['i'], $navdb['u']) = explode('|', $navdb['style']); $key = $navdb['nkey'] ? 'KEY' . $navdb['nkey'] : 'ID' . $navdb['nid']; if ($navdb['type'] == "foot") { $nav_foot[$key] = array('html' => $this->_getHtmlText($navdb), 'pos' => $navdb['pos']); } elseif ($navdb['type'] == "head") { $nav_head[$key] = array('html' => $this->_getHtmlText($navdb), 'pos' => $navdb['pos']); } elseif ($navdb['type'] == "main") { $nav_main[$key] = array('html' => $this->_getHtmlText($navdb), 'pos' => $navdb['pos']); } else { $nav_other[$navdb['nid']] = $navdb; } } foreach ($nav_other as $value) { $key = $value['nkey'] ? 'KEY' . $value['nkey'] : 'ID' . $value['nid']; if (!$value['upid']) { $nav_cache[$value['type']][$key] = array('html' => $this->_getHtmlText($value)); } else { $upkey = $nav_other[$value['upid']]['nkey'] ? 'KEY' . $nav_other[$value['upid']]['nkey'] : 'ID' . $nav_other[$value['upid']]['nid']; $nav_cache[$value['type']][$upkey]['child'][$key] = array('html' => $this->_getHtmlText($value)); } } require_once R_P . 'admin/cache.php'; setConfig('db_headnav', $nav_head); setConfig('db_footnav', $nav_foot); setConfig('db_mainnav', $nav_main); foreach ($nav_cache as $key => $value) { if (strpos($key, 'bbs_') !== false) { $key = str_replace('bbs_', 'db_', $key); setConfig($key, $value); } else { $this->db->update("REPLACE INTO pw_hack SET hk_name=" . pwEscape($key, false) . ",vtype='array',hk_value=" . pwEscape(serialize($value), false)); } } foreach (array_keys($GLOBALS['db_modes']) as $value) { if ($value != 'bbs') { updatecache_conf($value, true); } } updatecache_c(); }
include PrintEot('setting'); exit; } else { S::gp(array('config', 'siteName'), 'P', 0); if (!pwWritable(D_P . 'data/bbscache/config.php') && !chmod(D_P . 'data/bbscache/config.php', 0777)) { adminmsg('config_777'); } if ($admintype == 'basic' || $settingdb['basic']) { S::gp(array('visitgroup', 'postctl', 'schctl', 'cajax'), 'P', 2); S::gp(array('siteName')); foreach ((array) $siteName as $key => $value) { if ($key == 'bbs') { $config['bbsname'] = $value; } else { setConfig($key . '_sitename', $value, null, true); updatecache_conf($key, true); } } //state $config['adminreason'] = strip_tags($config['adminreason']); $config['admingradereason'] = strip_tags($config['admingradereason']); $config['visitmsg'] = ieconvert($config['visitmsg']); $config['whybbsclose'] = ieconvert($config['whybbsclose']); $postctl['poststart'] > 23 && ($postctl['poststart'] = 0); $postctl['poststartminute'] = (int) $postctl['poststartminute']; $postctl['postendminute'] = (int) $postctl['postendminute']; $postctl['poststartminute'] > 59 && ($postctl['poststartminute'] = 59); $postctl['poststartminute'] < 0 && ($postctl['poststartminute'] = 0); $postctl['postendminute'] > 59 && ($postctl['postendminute'] = 59); $postctl['postendminute'] < 0 && ($postctl['postendminute'] = 0); $postctl['postend'] > 23 && ($postctl['postend'] = 0);
} P_unlink(S::escapePath(D_P . 'data/tplcache/' . $filename)); } closedir($fp); $navlists = array('nkey' => $mode, 'type' => 'main', 'pos' => '-1', 'title' => strip_tags($m_name), 'style' => '', 'link' => $db_modedomain[$mode] ? $db_modedomain[$mode] : 'index.php?m=' . $mode, 'alt' => '', 'target' => $target, 'view' => 0, 'upid' => 0, 'isshow' => 1); $navConfigService = L::loadClass('navconfig', 'site'); /* @var $navConfigService PW_NavConfig */ $exist = $navConfigService->getByKey($mode, PW_NAV_TYPE_MAIN); if ($exist) { $navConfigService->update($exist['nid'], $navlists); } else { $navConfigService->add(PW_NAV_TYPE_MAIN, $navlists); } } updatecache_c(); updatecache_conf($mode); $installfile = S::escapePath(R_P . 'mode/' . $mode . '/config/install.php'); if (is_file($installfile)) { ObHeader($basename . "&mode={$mode}&action=setting"); } else { adminmsg('operate_success'); } } elseif ($action == 'setting') { S::gp(array('mode', 'step')); $installfile = S::escapePath(R_P . 'mode/' . $mode . '/config/install.php'); is_file($installfile) && (require_once $installfile); } elseif ($action == 'fourmtypecache') { S::gp('m', null, '1'); !array_key_exists($m, $db_modes) && adminmsg('mode_have_noopen'); $fp = opendir(D_P . 'data/bbscache/'); while ($filename = readdir($fp)) {
function setPortalHtmlTime($sign) { global $timestamp; require_once R_P . 'admin/cache.php'; extract(pwCache::getData(D_P . 'data/bbscache/portalhtml_config.php', false)); if (!$portalhtml_times) { $portalhtml_times = array(); } $portalhtml_times[$sign] = $timestamp; setConfig('portalhtml_times', $portalhtml_times, null, true); updatecache_conf('portalhtml', true); }
/** * 设置某个可视化页面的是否需要静态更新状态 * @param $sign * @param $state */ function setPortalStaticState($sign, $state = 0) { require_once R_P . 'admin/cache.php'; $portal_staticstate = $this->getPortalStaticState(); $portal_staticstate[$sign] = (int) $state; setConfig('portal_staticstate', $portal_staticstate, null, true); updatecache_conf('portal', true); }
function updateGroupLevel() { global $db; $array = $upgrade = array(); $query = $db->query("SELECT * FROM pw_cnlevel ORDER BY ltype,lpoint,id"); while ($rt = $db->fetch_array($query)) { $array[$rt['id']] = $rt['ltitle']; if ($rt['ltype'] == 'common') { $upgrade[$rt['id']] = $rt['lpoint']; } } $array = serialize($array); $upgrade = serialize($upgrade); $db->pw_update("SELECT hk_name FROM pw_hack WHERE hk_name='o_groups_level'", 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $array, 'vtype' => 'array')) . " WHERE hk_name='o_groups_level'", 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => "o_groups_level", 'vtype' => 'array', 'hk_value' => $array))); $db->pw_update("SELECT hk_name FROM pw_hack WHERE hk_name='o_groups_levelneed'", 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $upgrade, 'vtype' => 'array')) . " WHERE hk_name='o_groups_levelneed'", 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => "o_groups_levelneed", 'vtype' => 'array', 'hk_value' => $upgrade))); updatecache_conf('o', true); }