更新懒人包,下载附件上传覆盖就可以了!GBK版本 UTF-8版本请勿直接覆盖,请先转码!手动修改办法请参见附件包里的说明文件!
懒人包包括以下扩展修改的 第一条和第二条!第三条可自行修改!不需要的也可以根据修改方法反修改去掉就可以了!
一、打开 forum.php 查找- $navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['forum']);
复制代码 在下面添加- $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
- $hack_cut_str =60; // 这里修改标题长度
- $fids = array();
- if (file_exists("./data/cache/cache_forums.php")){
- require_once "./data/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 ".DB::table('forum_forum')." WHERE type='forum' OR type='sub'");
- while ($row = DB::fetch($query)){
- $fids[$row['fid']] = 5; // 这里是第二处调用条数需要和前面的设置一样。
- }
- }
- $limit_counts = 0;
- foreach ($fids as $k => $v){
- $sql .= "(SELECT t.*, f.name FROM ".DB::table('forum_thread')." t LEFT JOIN ".DB::table('forum_forum')." 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($query)){
- $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
- $row['date']= gmdate('m-d/H:i', $row['dateline'] + $_G['setting']['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;
- }
- //每版最新主题--结束
复制代码 |