投票等特殊贴里添加评分功能

`1.viewthread_special.inc.php
查找

$multipage = multi($repostnum, $ppp, $page, “viewthread.php?tid=$tid&do=$do&extra=$extra”.(isset($highlight) ? “&highlight=”.rawurlencode($highlight) : ‘’));
后面加$ratelogpids = 0; 查找if($attachpids) { 前面加if($ratelogpids) { $query = $db->query("SELECT * FROM {$tablepre}ratelog WHERE pid IN ($ratelogpids) ORDER BY dateline DESC"); while($ratelog = $db->fetch_array($query)) { if(count($postlist[$ratelog['pid']]['ratelog']) < $ratelogrecord) { $ratelog['dateline'] = gmdate("$dateformat $timeformat", $ratelog['dateline'] + $timeoffset * 3600); $ratelog['score'] = $ratelog['score'] > 0 ? '+'.$ratelog['score'] : $ratelog['score']; $ratelog['reason'] = dhtmlspecialchars($ratelog['reason']); $postlist[$ratelog['pid']]['ratelog'][] = $ratelog; } } } 2.viewthread_debate.inc.php 查找$postlist = $post = array(); 后面加$ratelogpids = 0; 查找ksort($postlist);
前面加``if($ratelogpids) {
$query = $db->query(“SELECT FROM {$tablepre}ratelog WHERE pid IN ($ratelogpids) ORDER BY dateline DESC”);
while($ratelog = $db->fetch_array($query)) {
if(count($postlist[$ratelog[‘pid’]][‘ratelog’]) < $ratelogrecord) {
$ratelog[‘dateline’] = gmdate(“$dateformat $timeformat”, $ratelog[‘dateline’] + $timeoffset
3600);
$ratelog[‘score’] = $ratelog[‘score’] > 0 ? ‘+’.$ratelog[‘score’] : $ratelog[‘score’];
$ratelog[‘reason’] = dhtmlspecialchars($ratelog[‘reason’]);
$postlist[$ratelog[‘pid’]][‘ratelog’][] = $ratelog;
}
}
}
3.viewthread_trade.inc.php
查找$tradespids = array();
后面加

$ratelogpids = 0;
查找

if(($do == ‘viewtrade’ || $do == ‘viewall’) && $tradespids) {
前面加

if($ratelogpids) {
$query = $db->query(“SELECT FROM {$tablepre}ratelog WHERE pid IN ($ratelogpids) ORDER BY dateline DESC”);
while($ratelog = $db->fetch_array($query)) {
if(count($postlist[$ratelog[‘pid’]][‘ratelog’]) < $ratelogrecord) {
$ratelog[‘dateline’] = gmdate(“$dateformat $timeformat”, $ratelog[‘dateline’] + $timeoffset
3600);
$ratelog[‘score’] = $ratelog[‘score’] > 0 ? ‘+’.$ratelog[‘score’] : $ratelog[‘score’];
$ratelog[‘reason’] = dhtmlspecialchars($ratelog[‘reason’]);
$postlist[$ratelog[‘pid’]][‘ratelog’][] = $ratelog;
}
}
}
4.viewthread_*_post.htm
//添加评分按钮
查找

{lang edit}

在前面加

{lang removerate}


{lang rate}

//添加已评分标记
查找

在后面加
$post[ratings]

//添加显示评分记录
查找

在前面加

{lang thread_rate_log_lately}

$ratelog[username]
{$extcredits[$ratelog[extcredits]][title]}
*$ratelog[score]

$ratelog[reason]
$ratelog[dateline]

`