維克斯討論區
[完整版]首頁四格 for Discuz! 5.0
在此感謝瑋少
我知道下面有了,可是我覺得這個比較完整,轉貼自AL8 Forum。
首頁四格(含高亮顯示)修改只需3步,for Discuz! 5.0
適用版本:discuz5.0
作者:ytc
修改:瑋少
修改文件:index.php
修改模板:index.htm
功能:含高亮顯示,但會增加兩個查詢
演示: [ 訪客無法瀏覽此圖片或下載點,請先註冊或登入會員。]
1.上傳模版indexfour.htm到templates/default
2.修改index.php
找
$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
在下面加上
//新貼//
$hack_cut_str = 36; //修改標題顯示字數
$new_post_threadlist = array();
$nthread = array();
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
$nthread['forumname'] = $nthread['name'];
$nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
$nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
$nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
if($nthread['highlight']) {
$string = sprintf('%02d', $nthread['highlight']);
$stylestr = sprintf('%03b', $string[0]);
$nthread['highlight'] = 'style="';
$nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$nthread['highlight'] .= '"';
} else {
$nthread['highlight'] = '';
}
[ 瀏覽完整內容請先註冊或登入會員。]
附件: 您所在的用戶組無法下載或查看附件 - 立即升級用戶組
|