首页| 版块| 我的| 发帖| 消息
主题:2013年11月1日:帖子点亮插件上线测试
zhangjingyu 
帖内置顶相关代码
//帖内置顶相关处理
if ($topped_count) {
    $topped_page_num = $db_readperpage;
    $start_limit = (int)($page-1)*$db_readperpage - 1;
    if ($start_limit < 0) {
        $topped_page_num += $start_limit;
        $start_limit = 0;
    }
    $topped_count - $start_limit < $db_readperpage && $topped_page_num = $topped_count - $start_limit;
    $topped_page_num = $topped_page_num < 0 ? 0 : $topped_page_num;
    if ($topped_count > $start_limit) {
        $limit = S::sqlLimit($start_limit,$topped_page_num);
        $query = $db->query("SELECT t.floor, p.* $fieldadd FROM pw_poststopped t
            LEFT JOIN $pw_posts p ON t.pid = p.pid $tablaadd
            WHERE t.tid = ".S::sqlEscape($tid)." AND t.fid = '0' AND t.pid != '0' AND p.ifcheck = '1' ORDER BY t.uptime desc $limit");
        while ($rd = $db->fetch_array($query)) {
            $_uids[$rd['authorid']] = 'UID_'.$rd['authorid'];
            $rd['aid'] && $_pids[$rd['pid']] = $rd['pid'];
            $rd['istop'] = "topped";
            $_page = ceil(($rd['floor'] + 1 + $topped_count)/$db_readperpage);
            $rd['jumpurl'] = "read.php?tid=$tid&page=$_page#".$rd['pid'];
            //$rd['remindinfo'] = '';
            $readdb[] = $rd;
            $pids[] = $rd['pid'];
        }
    }
}
list($replies,$hits) = array(intval($read['replies']),intval($read['hits']));
置顶 (来自$read[floor]楼)
帖内置顶表 pw_poststopped
fid    tid    pid    floor uptime overtime
zhangjingyu回帖于2018-08-03 16:44[查看电脑版]
下一页 (1/2)
下一楼»:pw_flightlog帖子点亮记录
idpidtiduid
«上一楼:差不多,收支平衡嘛!点亮只加分,小心被刷(⊙o⊙)哦。

——本帖通过莘祺网手机版回复.

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