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(); } } }
$rightset = array(); } !$rightset['setstyles'] && Showmsg('undefined_action'); if (empty($_POST['step'])) { extract(L::style()); require_once PrintEot('ajax'); ajax_footer(); } else { PostCheck(); S::gp(array('set', 'setskin')); if (!is_array($set)) { Showmsg('undefined_action'); } foreach ($set as $key => $value) { if (in_array($key, array('tablewidth', 'mtablewidth'))) { if (!preg_match('/(%|px|em)/i', $value)) { $set[$key] .= 'px'; } } } $pwSQL = S::sqlSingle(array('bgcolor' => $set['bgcolor'], 'linkcolor' => $set['linkcolor'], 'tablecolor' => $set['tablecolor'], 'tdcolor' => $set['tdcolor'], 'tablewidth' => $set['tablewidth'], 'mtablewidth' => $set['mtablewidth'], 'headcolor' => $set['headcolor'], 'headborder' => $set['headborder'], 'headfontone' => $set['headfontone'], 'headfonttwo' => $set['headfonttwo'], 'cbgcolor' => $set['cbgcolor'], 'cbgborder' => $set['cbgborder'], 'cbgfont' => $set['cbgfont'], 'forumcolorone' => $set['forumcolorone'], 'forumcolortwo' => $set['forumcolortwo'])); $rs = $db->get_one("SELECT sid FROM pw_styles WHERE name=" . S::sqlEscape($setskin) . " AND uid='0'"); if ($rs) { $db->update("UPDATE pw_styles SET {$pwSQL} WHERE name=" . S::sqlEscape($setskin) . " AND uid='0'"); } else { $db->update("INSERT INTO pw_styles SET {$pwSQL}"); } require_once R_P . 'admin/cache.php'; updatecache_sy($setskin); Showmsg('operate_success'); }
if (!$_POST['step']) { $yes_Y = 'checked'; include PrintEot('setstyles'); exit; } else { S::gp(array('setting'), 'P'); $setting[0] = S::escapeChar($setting[0]); if (empty($setting[0])) { adminmsg('style_empty'); } elseif (file_exists(D_P . "data/style/{$setting['0']}.php")) { adminmsg('style_exists'); } 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'); $db->update("INSERT INTO pw_styles (name,stylepath,tplpath,yeyestyle,bgcolor,linkcolor,tablecolor,tdcolor,tablewidth,mtablewidth,headcolor,headborder,headfontone,headfonttwo,cbgcolor,cbgborder,cbgfont,forumcolorone,forumcolortwo,extcss) VALUES ('{$setting['0']}','{$setting['0']}','{$setting['1']}','{$setting['2']}','{$setting['3']}','{$setting['4']}','{$setting['5']}','{$setting['6']}','{$setting['7']}','{$setting['8']}','{$setting['9']}','{$setting['10']}','{$setting['11']}','{$setting['12']}','{$setting['13']}','{$setting['14']}','{$setting['15']}','{$setting['16']}','{$setting['17']}','{$setting['18']}')"); updatecache_sy($setting[0]); adminmsg('style_add_success'); } } elseif ($action == 'del') { PostCheck($verify); S::gp(array('sid')); if ($sid == $skin) { adminmsg('style_del_error'); } $db->update("DELETE FROM pw_styles WHERE name=" . S::sqlEscape($sid, false)); if (file_exists(D_P . "data/style/{$sid}.php")) { if (P_unlink(D_P . "data/style/{$sid}.php")) { P_unlink(D_P . "data/style/{$sid}_css.htm"); unset($db_styledb[$sid]); setConfig('db_styledb', $db_styledb); updatecache_c();