2011-04-18 14:39?來源 未知
修改feedback.php,在“評論內容類表”代碼的前面加上以下代碼:
//最近熱門評論
$feedback_hot = "";
$nearTime = 60; //最近評論的文章的發布日期(表示多少天前)
$minTime = time() - (3600 * 24 * $nearTime);
if($topID==0) $hotquery = "Select ID,title From cmsxx_archives where ID<>'$aid' And senddate>$minTime order by goodpost desc limit 0,25";
else $hotquery = "Select ID,title From cmsxx_archives where ID<>'$aid' And senddate>$minTime And typeid=$topID order by goodpost desc limit 0,25";
$dlist->dsql->Execute("hotq",$hotquery);
while($myrow = $dlist->dsql->GetArray("hotq")){
$feedback_hot .= "<div class='nndiv'>·<a href='feedback.php?aid={$myrow['ID']}'>{$myrow['title']}</a></div>\r\n";
}
$dlist->dsql->FreeResult("hotq");
這樣就可以在feedback_templet.htm模板中,用代碼 <?php echo $feedback_hot ?>來調用了。
編輯: 溫州視線