function PW_Appclient() { global $db_siteappkey, $timestamp, $db_sitehash, $db_siteownerid, $db_siteid, $db_bbsurl, $db_charset, $db_appifopen, $db_appbbs, $db_appo, $pwServer; $db_bbsurl = Char_cv("http://" . $pwServer['HTTP_HOST'] . substr($pwServer['PHP_SELF'], 0, strrpos($pwServer['PHP_SELF'], '/'))); if (!file_exists(D_P . "data/bbscache/forum_appinfo.php")) { require_once R_P . "admin/cache.php"; updatecache_f(); } @(include_once D_P . "data/bbscache/forum_appinfo.php"); $this->_db = $GLOBALS['db']; $this->appkey = $db_siteappkey; $this->timestamp = time(); $this->sitehash = $db_sitehash; $this->siteownerid = $db_siteownerid; $this->siteid = $db_siteid; $this->bbsurl = $db_bbsurl; $this->charset = $db_charset; $this->appifopen = $db_appifopen; $this->appbbs = $db_appbbs; $this->appo = $db_appo; $this->_appsdb = array(); $this->_app_array = array(); $this->_appslist = $this->getApplist(); $this->appinfo = $forum_appinfo; }
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 PW_Appclient() { global $db_siteappkey, $timestamp, $db_sitehash, $db_siteownerid, $db_siteid, $db_charset, $db_appifopen, $pwServer, $db_server_url, $db_bbsname; $db_bbsurl = S::escapeChar("http://" . $pwServer['HTTP_HOST'] . substr($pwServer['PHP_SELF'], 0, strrpos($pwServer['PHP_SELF'], '/'))); if (!file_exists(D_P . "data/bbscache/forum_appinfo.php")) { require_once R_P . "admin/cache.php"; updatecache_f(); } //* @include_once pwCache::getPath(D_P . "data/bbscache/forum_appinfo.php"); extract(pwCache::getData(D_P . "data/bbscache/forum_appinfo.php", false)); $this->_db = $GLOBALS['db']; $this->appkey = $db_siteappkey; $this->timestamp = $timestamp; $this->siteid = $db_siteid; $this->siteownerid = $db_siteownerid; $this->sitehash = $db_sitehash; $this->bbsname = $db_bbsname; $this->bbsurl = $db_bbsurl; $this->charset = $db_charset; $this->appifopen = $db_appifopen; $this->server_url = $db_server_url; $this->appinfo = $forum_appinfo; }
$msg = getLangInfo('cpmsg', 'operate_success'); echo $msg; ajax_footer(); } elseif ($action == 'delttype') { InitGP(array('type', 'id')); $id_array = array(); if ($type == 'top') { $query = $db->query("SELECT id FROM pw_topictype WHERE upid=" . pwEscape($id)); while ($rt = $db->fetch_array($query)) { $id_array[] = $rt['id']; } } $id_array = array_merge($id_array, array($id)); if (!empty($id_array)) { $db->update("DELETE FROM pw_topictype WHERE id IN (" . pwImplode($id_array) . ")"); updatecache_f(); $ids = implode("\t", $id_array); echo "success\t" . $ids; } else { echo 'fail'; } ajax_footer(); } function delforum($fid) { global $db, $db_guestdir, $db_guestthread, $db_guestread; $foruminfo = $db->get_one("SELECT fid,fup,forumadmin FROM pw_forums WHERE fid=" . pwEscape($fid)); $db->update("DELETE FROM pw_forums WHERE fid=" . pwEscape($fid)); $db->update("DELETE FROM pw_forumdata WHERE fid=" . pwEscape($fid)); $db->update("DELETE FROM pw_forumsextra WHERE fid=" . pwEscape($fid)); $db->update("DELETE FROM pw_permission WHERE fid>'0' AND fid=" . pwEscape($fid));
function createForum($name, $fup = 0, $descrip = '', $linkurl = '') { //创建版块 if (!$name) { return new ApiResponse(false); } //* @include_once pwCache::getPath(D_P.'data/bbscache/forum_cache.php'); extract(pwCache::getData(D_P . 'data/bbscache/forum_cache.php', false)); $forumtype = $forum[$fup]['type'] == 'category' ? 'forum' : ($forum[$fup]['type'] == 'forum' ? 'sub' : 'sub2'); /* $this->db->update("INSERT INTO pw_forums SET " . S::sqlSingle(array( 'fup' => $fup, 'type' => $forumtype, 'name' => $name, 'descrip' => $descrip, 'cms' => 0, 'ifhide' => 1, 'allowtype' => 3 ))); */ pwQuery::insert('pw_forums', array('fup' => $fup, 'type' => $forumtype, 'name' => $name, 'descrip' => $descrip, 'cms' => 0, 'ifhide' => 1, 'allowtype' => 3)); $fid = $this->db->insert_id(); $this->db->update("INSERT INTO pw_forumdata SET fid=" . S::sqlEscape($fid)); $forumset = array('lock' => 0, 'cutnums' => 0, 'threadnum' => 0, 'readnum' => 0, 'newtime' => 0, 'orderway' => 'lastpost', 'asc' => 'DESC', 'allowencode' => 0, 'anonymous' => 0, 'rate' => 0, 'dig' => 0, 'inspect' => 0, 'watermark' => 0, 'commend' => 0, 'autocommend' => 0, 'commendlist' => '', 'commendnum' => 0, 'commendlength' => 0, 'commendtime' => 0, 'addtpctype' => 0, 'ifrelated' => 0, 'relatednums' => 0, 'relatedcon' => 'ownpost', 'relatedcustom' => array(), 'rvrcneed' => 0, 'moneyneed' => 0, 'creditneed' => 0, 'postnumneed' => 0, 'sellprice' => array(), 'uploadset' => 'money 0', 'rewarddb' => '', 'allowtime' => ''); $forumset['link'] = $linkurl; $forumset = serialize($forumset); $this->db->update("INSERT INTO pw_forumsextra SET " . S::sqlSingle(array('fid' => $fid, 'forumset' => $forumset))); //* P_unlink(D_P.'data/bbscache/c_cache.php'); pwCache::deleteData(D_P . 'data/bbscache/c_cache.php'); require_once R_P . 'admin/cache.php'; updatecache_f(); require_once R_P . 'require/updateforum.php'; $forumtype != 'category' && updatetop(); return new ApiResponse($fid); }
/** * 更新删除结果 * @return unknown_type */ function setResult() { require_once R_P . 'admin/cache.php'; /** * 更新数据库 * @var unknown_type */ $sql = "UPDATE " . $this->table . " SET " . S::sqlSingle(array("forumset" => serialize($this->forumset), "commend" => serialize($this->commend))) . "WHERE fid=" . S::sqlEscape($this->fid); if ($this->db->update($sql)) { $this->setMsg(true); } /** * 更新缓存 */ updatecache_f(); }