首页| 版块| 我的| 发帖| 消息
主题:那些“消失”在主题列表页的主题
zhangjingyu 
打开require/updateforum.php
“function updatetop() {
    global $db,$timestamp;
    if ($timestamp) {
        $db->update("DELETE FROM pw_poststopped WHERE pid = '0' AND fid != '0' AND overtime != '0' AND overtime < $timestamp ");
    }
    $fids = array();
    $query = $db->query("SELECT t.* FROM pw_poststopped t WHERE t.pid = '0' AND t.fid != '0' ");
    $fids = array();
    while ($rt = $db->fetch_array($query)) {
        $fids[$rt['fid']]['topthreads'] .= $fids[$rt['fid']]['topthreads'] ? ','.$rt['tid'] : $rt['tid'];
        if ($rt['uptime'] == $rt['fid']) {
            $fids[$rt['fid']]['top1']++;
        } else {
            $fids[$rt['fid']]['top2']++;
        }
    }
    //update kmd threads
    $kmdService = L::loadClass('kmdservice', 'forum');
    $kmdInfo = $kmdService->getKmdInfosByStatus(KMD_THREAD_STATUS_OK);
    if (is_array($kmdInfo)){
        $kmdTids = array();
        foreach ($kmdInfo as $v){
            if(!$v['tid'] || !$v['fid']) continue;
            $kmdTids[$v['fid']][$v['tid']] = null;
        }
        foreach ($kmdTids as $fid=>$v){
            $fids[$fid]['topthreads'] .= $fids[$fid] ? ','.implode(',', array_keys($v)) : implode(',', array_keys($v));
        }
    }
    
    //* $db->update("UPDATE pw_forumdata SET top1 = '', top2 = '' , topthreads = '' ");
    pwQuery::update('pw_forumdata', null, null, array('top1'=>'', 'top2'=>'', 'topthreads'=>''));
    $_fids = array();
    foreach ($fids as $key => $value) {
        if (is_array($value)) {
            $_fids[] = $key;
            //* $db->update("UPDATE pw_forumdata SET  " . S::sqlSingle($value) . " WHERE fid =  ".S::sqlEscape($key));
            pwQuery::update('pw_forumdata', 'fid=:fid', array($key), $value);
        }
    }
    if (!empty($_fids)) {
        require_once(R_P.'admin/cache.php');
        $_fids = S::sqlEscape($_fids);
        updatecache_forums($_fids);
    }
}”(
zhangjingyu回帖于2019-02-19 21:52[查看电脑版]
下一页 (1/3)
下一楼»:(见32楼)虽然楼上的代码看不懂,但稍微看下,就感觉我晕了!
pw_poststopped是帖子置顶数 ..
«上一楼:在admin目录检索“topped”,aboutcache.php
“} elseif($_POST['action']==&# ..

查看全部回帖(50)
«返回主帖