原帖由 ミ順⑦Zi嘫 于 2008-5-9 01:16 发表
请问楼主一下.好像主题高亮时,最新主题那一列不会高亮的哦!还是我自己搞错.还有就是那显示今天发贴多少那数字,比喻删了贴后不会减少.
今日發帖數字,DZ本來就是這樣的了
主題列表高亮- //每版最新主题--开始
- $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
- $hack_cut_str =60; // 这里修改标题长度
- $fids = array();
- if (file_exists("./forumdata/cache/cache_forums.php")){
- require_once "./forumdata/cache/cache_forums.php";
- if (is_array($_DCACHE['forums'])){
- foreach ($_DCACHE['forums'] as $k => $v){
- if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
- $fids[$k] = 5; // 这里是第一处调用条数需要和后面的设置一样。
- }
- }
- }
- if (count($fids) < 1){
- $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
- while ($row = $db->fetch_array($query)){
- $fids[$row['fid']] = 5; // 这里是第二处调用条数需要和前面的设置一样。
- }
- }
- $limit_counts = 0;
- foreach ($fids as $k => $v){
- $sql .= "(SELECT t.*, f.name FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid='$k' AND t.closed NOT LIKE 'moved|%' AND t.displayorder>=0 ORDER BY t.dateline DESC LIMIT $v) UNION ";
- }
- if ($sql){
- $sql = substr($sql,0,strlen($sql)-6);
- }
- $query = $db->query($sql);
- while ($row = $db->fetch_array($query)){
- $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
- $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
- if($row['highlight']) {
- $string = sprintf('%02d', $row['highlight']);
- $stylestr = sprintf('%03b', $string[0]);
- $row['highlight'] = 'style="';
- $row['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
- $row['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
- $row['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
- $row['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
- $row['highlight'] .= '"';
- } else {
- $row['highlight'] = '';
- }
- ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
- }
- //每版最新主题--结束
复制代码 |