Example #1
0
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();
        }
    }
}
Example #2
0
    $cateid = $db->get_value("SELECT cateid FROM pw_topicmodel WHERE modelid=" . S::sqlEscape($modelid));
    $count = $db->get_value("SELECT COUNT(*) as count FROM pw_topicmodel WHERE cateid=" . S::sqlEscape($cateid));
    if ($count == 1) {
        Showmsg('model_mustone');
    }
    $db->update("DELETE FROM pw_topicmodel WHERE modelid=" . S::sqlEscape($modelid));
    $db->update("DELETE FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid));
    $tablename = GetTopcitable($modelid);
    $query = $db->query("SELECT tid FROM {$tablename}");
    while ($rt = $db->fetch_array($query)) {
        $tids[] = $rt['tid'];
    }
    $delarticle = L::loadClass('DelArticle', 'forum');
    $delarticle->delTopicByTids($tids);
    $db->query("DROP TABLE IF EXISTS {$tablename}");
    updatecache_topic();
    echo "success\t{$cateid}";
    ajax_footer();
}
function getModeldbByCateid($cateid)
{
    global $db;
    $cateid && ($sql = "WHERE cateid=" . S::sqlEscape($cateid));
    $query = $db->query("SELECT * FROM pw_topicmodel {$sql} ORDER BY vieworder ASC");
    while ($rt = $db->fetch_array($query)) {
        $modedb[$rt['modelid']] = $rt;
    }
    return $modedb;
}
function getFieldSqlByType($type)
{