首页 投票等特殊贴里添加评分功能
文章
取消

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

1.viewthread_special.inc.php 查找 <a id="more"></a> $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}](misc.php?action=viewratings&tid=$tid&pid=$post[pid] "{lang rate_view}")

$ratelog[username]
{$extcredits[$ratelog[extcredits]][title]}
_*$ratelog[score]__
_$ratelog[reason]

$ratelog[dateline]

`

本文由作者按照 CC BY-NC-SA 4.0 进行授权
热门标签

更改出售帖子时不用点其他信息

大家都来抵制QQ

Comments powered by Disqus.

热门标签