Ejemplo n.º 1
0
 include_once TDISCUZ_ROOT . './source/class/class_core.php';
 include_once TDISCUZ_ROOT . './source/function/function_core.php';
 $cachelist = array();
 $discuz =& discuz_core::instance();
 $discuz->cachelist = $cachelist;
 $discuz->init_cron = false;
 $discuz->init_setting = false;
 $discuz->init_user = false;
 $discuz->init_session = false;
 $discuz->init_misc = false;
 $discuz->init();
 $_G['siteurl'] = str_replace('source/plugin/tools/', '', $_G['siteurl']);
 require_once libfile('function/cache');
 updatecache();
 include_once libfile('function/block');
 blockclass_cache();
 //note 清除群组缓存
 require_once libfile('function/group');
 $groupindex['randgroupdata'] = $randgroupdata = grouplist('lastupdate', array('ff.membernum', 'ff.icon'), 80);
 $groupindex['topgrouplist'] = $topgrouplist = grouplist('activity', array('f.commoncredits', 'ff.membernum', 'ff.icon'), 10);
 $groupindex['updateline'] = TIMESTAMP;
 $groupdata = DB::fetch_first("SELECT SUM(todayposts) AS todayposts, COUNT(fid) AS groupnum FROM " . DB::table('forum_forum') . " WHERE status='3' AND type='sub'");
 $groupindex['todayposts'] = $groupdata['todayposts'];
 $groupindex['groupnum'] = $groupdata['groupnum'];
 save_syscache('groupindex', $groupindex);
 DB::query("TRUNCATE " . DB::table('forum_groupfield'));
 $tpl = dir(DISCUZ_ROOT . './data/template');
 while ($entry = $tpl->read()) {
     if (preg_match("/\\.tpl\\.php\$/", $entry)) {
         @unlink(DISCUZ_ROOT . './data/template/' . $entry);
     }
Ejemplo n.º 2
0
function add_diy_template($template, $arr)
{
    global $_G;
    $template = stripslashes($template);
    include_once libfile('function/block');
    block_parse_template($template, $arr);
    $appVer = $_G['setting']['version'];
    if ($appVer != 'X2') {
        $arr = daddslashes($arr);
    }
    $hash = $arr['hash'];
    $result = C::t('#sanree_brand#sanree_brand_businesses')->fix_get_block($hash);
    if ($result) {
        C::t('#sanree_brand#sanree_brand_businesses')->fix_update_block($hash, $arr);
    } else {
        C::t('#sanree_brand#sanree_brand_businesses')->fix_insert_block($arr);
    }
    require_once libfile('function/cache');
    updatecache('blockclass');
    blockclass_cache();
}