Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] 首页四格+社区之星后台控制全Cache版 FOR DZ5.0正式版

[复制链接]
PHP论坛 发表于 2006-9-3 21:44:28 | 显示全部楼层 |阅读模式
插件名称:
整合首页四格cache + 社区发贴之星(今日+昨日+本周+本月+本年发贴排行)后台控制全Cache版FOR DISCUZ 5.0 正式版

插件修改:PHP论坛

插件原作者:(Discuz4.1版)33201,oytktk (靖飒),scropion~

数据库升级:有

安装难度:中

修改文件:
           index.php      
           topicadmin.php
           admin\settings.inc.php
           include\cache.func.php
           include\editpost.inc.php
           include\newreply.inc.php
           include\newthread.inc.php
           templates\default\admincp.lang.php
           templates\default\discuz.htm
           
插件演示地址http://www.230770.com/index.php

整合了首页四格cache版和社区法帖之星,可以在后台开启关闭相关版面。

图片演示如下:


安装方法请看二楼。

[ 本帖最后由 PHP论坛 于 2007-2-8 15:51 编辑 ]
 楼主| PHP论坛 发表于 2006-9-3 21:44:48 | 显示全部楼层
         

请大家小心小心再小心。仔细仔细再仔细。。错误的出现多半是因为你的粗心造成的.

所有代码已经重新编辑。整理,去掉多余的空格和回车.请2006年09月04号中午12点钟之前修改后有BUG的站长们重新对照修改;

请大家一定要备份需要修改的文件!!!   不想备份请不要进行任何修改。。。。。




=============================================================
                                插件安装步骤:
(后台"论坛功能"设置内添加开关),下面"编辑文件admin/settings.inc.php"中的代码。还有最后修改DISCUZ.HTM时候的代码都是用来在后台控制是否显示发帖冠军,而且我在后台亲自试验成功,确实是带后台的。如果你不想让他在前台显示。请在后台设定以后。记得更新缓存)

如果不想要后台控制的话,可以跳过1-3步

1.后台升级数据库(在cdb_settings添加一个show_poststar一个值)
  1. INSERT INTO `cdb_settings` VALUES ('show_poststar', '1');
复制代码


2.编辑文件admin/settings.inc.php

查找:
  1. showsetting('settings_nocacheheaders', 'settingsnew[nocacheheaders]', $settings['nocacheheaders'], 'radio');
复制代码


下面添加:

  1. showsetting('settings_show_poststar', 'settingsnew[show_poststar]', $settings['show_poststar'], 'radio');
复制代码


3,编辑语言包admincp.lang.php(后台管理页面显示的文字)
查找:
  1. 'settings_forumjump_comment' => '选择“是”将在列表页面下部显示快捷跳转菜单。注意: 当分论坛很多时,本功能会严重加重服务器负担',
复制代码


下面添加:
  1. 'settings_show_poststar' => '显示发帖冠军',
  2. 'settings_show_poststar_comment' => '选则“是”将在首页显示发帖冠军',
复制代码


4. 编辑文件  include/cache.func.php

查找
  1. 'medals'        => array('medals')
复制代码


上面加

  1. 'toplist'        => array('newthread', 'newreply', 'topdigest', 'topviews'),//TOPLIST_首页四格_全Cache版_By oytktk
  2. 'poststar'        => array('daystar', 'yestodaystar','weekstar', 'monthstar', 'yearstar'),
复制代码


继续查找
  1. case 'medals':
  2.                         $table = 'medals';
  3.                         $cols = 'medalid, name, image';
  4.                         $conditions = "WHERE available='1'";
  5.                         break;
复制代码


上面加

  1. //首页四格TOPLIST_CACHE版, By oytktk 代码首
  2.                 case 'newthread':
  3.                         $table = 'threads t';
  4.             $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
  5.                         $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.displayorder!='-1' ORDER BY t.dateline DESC LIMIT 0, 10";
  6.                         break;

  7.                 case 'newreply':
  8.                         $table = 'threads t';
  9.         $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
  10.                         $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.replies>0 and t.displayorder!='-1'  ORDER BY t.lastpost DESC LIMIT 0, 10";
  11.                         break;
  12.                 case 'topdigest':
  13.                         $table = 'threads t';
  14.        $cols = 't.tid, t.fid, t.author, t.subject, t.digest, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight,f.name';
  15.        $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE digest>0 ORDER BY rand() LIMIT 0, 10";
  16.                         break;
  17.                
  18.                 case 'topviews':
  19.                         $table = 'threads t';
  20.                         $view = rand(1,3)==1 ? 'views' : 'replies';
  21.    $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
  22.                         $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.displayorder!='-1' ORDER BY t.$view DESC LIMIT 0, 10";
  23.                         break;

  24.                 //首页四格TOPLIST_CACHE版, By oytktk 代码尾
  25. //===============社区明星BY 33201 开始
  26.                 case 'daystar':
  27.                         $month=date(n);
  28.                         $date=date(j);
  29.                         $year=date(Y);
  30.                         $time=mktime(0,0,0,$month,$date,$year);
  31.                         $table = 'posts p';
  32.                         $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
  33.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline>$time  group by p.authorid order by num desc limit 0,10";
  34.                         break;
  35.                 case 'yestodaystar':
  36.                         $month=date(n);
  37.                         $date=date(j);
  38.                         $year=date(Y);
  39.                         $time=mktime(0,0,0,$month,$date,$year);
  40.                         $ytime=mktime(0,0,0,$month,$date-1,$year);
  41.                         $table = 'posts p';
  42.                         $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
  43.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline<=$time and p.dateline>$ytime  group by p.authorid order by num desc limit 0,10";
  44.                         break;
  45.                 case 'weekstar':
  46.                         $month=date(n);
  47.                         $date=date(j);
  48.                         $year=date(Y);
  49.                         $week=date(w);
  50.                         $time=mktime(0,0,0,$month,$date,$year);
  51.                         $weektime=mktime(0,0,0,$month,$date-$week,$year);
  52.                         $table = 'posts p';
  53.                         $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
  54.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline>=$weektime  group by p.authorid order by num desc limit 0,10";
  55.                         break;
  56.                 case 'monthstar':
  57.                         $month=date(n);
  58.                         $year=date(Y);
  59.                         $monthtime=mktime(0,0,0,$month,1,$year);
  60.                         $table = 'posts p';
  61.                         $cols = 'count(p.pid) as
  62. num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
  63.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline>=$monthtime  group by p.authorid order by num desc limit 0,10";
  64.                         break;
  65.                
  66.                 case 'yearstar':
  67.                         $year=date(Y);
  68.                         $yeartime=mktime(0,0,0,1,1,$year);
  69.                         $table = 'posts p';
  70.                         $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
  71.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline>=$yeartime  group by p.authorid order by num desc limit 0,10";
  72.                         break;

  73. //===================社区明星BY 33201 结束
复制代码


再找:
  1. case 'settings':
  2.                         $data['qihoo_links'] = array();
  3.                         while($setting = $db->fetch_array($query))
复制代码


上面加
  1. //首页四格TOPLIST_CACHE版, By oytktk 代码首

  2.                 case 'newthread':
  3.                         $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  4.                         while($topthread = $db->fetch_array($query)) {
  5.                                 $threadcolor = sprintf('%02d', $topthread['highlight']);
  6.                                 $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
  7.                                 $topthread['subjectc'] = cutstr($topthread['subject'], 28);
  8.                       $topthread['threadcolor'] = $threadcolor[1] ? " style="color: ".$colorarray[$threadcolor[1]].""" : NULL;
  9.                                 $topthread['dateline'] = gmdate("Y-m-d H:i", $topthread['dateline'] + $timeoffset * 3600);
  10.                                 $topthread['lastpost'] = gmdate("Y-m-d H:i", $topthread['lastpost'] + $timeoffset * 3600);
  11.                                 $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
  12.                                 $data[] = $topthread;
  13.                         }
  14.                         break;

  15.                 case 'newreply':
  16.                         $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  17.                         while($topthread = $db->fetch_array($query)) {
  18.                                 $threadcolor = sprintf('%02d', $topthread['highlight']);
  19.                                 $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
  20.                                 $topthread['subjectc'] = cutstr($topthread['subject'], 26);
  21.                      $topthread['threadcolor'] = $threadcolor[1] ? " style="color: ".$colorarray[$threadcolor[1]].""" : NULL;
  22.                                 $topthread['dateline'] = gmdate("Y-m-d H:i", $topthread['dateline'] + $timeoffset * 3600);
  23.                                 $topthread['lastpost'] = gmdate("Y-m-d H:i", $topthread['lastpost'] + $timeoffset * 3600);
  24.                                 $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
  25.                                 $data[] = $topthread;
  26.                         }
  27.                         break;

  28.                 case 'topdigest':
  29.                         $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  30.                         while($topthread = $db->fetch_array($query)) {
  31.                                 $threadcolor = sprintf('%02d', $topthread['highlight']);
  32.                                 $digest = array('1'=>'[Ⅰ]','2'=>'[Ⅱ]','3'=>'[Ⅲ]');
  33.                                 $topthread['subjectc'] = $digest[$topthread['digest']]."-".cutstr($topthread['subject'], 23);
  34.                                 $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
  35.                        $topthread['threadcolor'] = $threadcolor[1] ? " style="color: ".$colorarray[$threadcolor[1]].""" : NULL;
  36.                                 $topthread['dateline'] = gmdate("Y-m-d H:i", $topthread['dateline'] + $timeoffset * 3600);
  37.                                 $topthread['lastpost'] = gmdate("Y-m-d H:i", $topthread['lastpost'] + $timeoffset * 3600);
  38.                                 $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
  39.                                 $data[] = $topthread;
  40.                         }
  41.                         break;

  42.                 case 'topviews':
  43.                         $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  44.                         while($topthread = $db->fetch_array($query)) {
  45.                                 $threadcolor = sprintf('%02d', $topthread['highlight']);
  46.                                 $topthread['subjectc'] = cutstr($topthread['subject'], 32);
  47.                $topthread['threadcolor'] = $threadcolor[1] ? " style="color: ".$colorarray[$threadcolor[1]].""" : NULL;
  48.                                 $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
  49.                                 $topthread['dateline'] = gmdate("Y-m-d H:i", $topthread['dateline'] + $timeoffset * 3600);
  50.                                 $topthread['lastpost'] = gmdate("Y-m-d H:i", $topthread['lastpost'] + $timeoffset * 3600);
  51.                                 $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
  52.                                 $data[] = $topthread;
  53.                         }
  54.                         break;


  55.                 //首页四格TOPLIST_CACHE版, By oytktk 代码尾
  56. //===================社区明星BY 33201 开始
  57.                 case 'daystar':
  58.                         while($toppost = $db->fetch_array($query)) {
  59.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  60.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  61.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  62.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  63.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  64.                                 $data[] = $toppost;
  65.                         }
  66.                         break;
  67.                 case 'yestodaystar':
  68.                         while($toppost = $db->fetch_array($query)) {
  69.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  70.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  71.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  72.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  73.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  74.                                 $data[] = $toppost;
  75.                         }
  76.                         break;
  77.                 case 'weekstar':
  78.                         while($toppost = $db->fetch_array($query)) {
  79.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  80.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  81.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  82.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  83.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  84.                                 $data[] = $toppost;
  85.                         }
  86.                         break;
  87.                 case 'monthstar':
  88.                         while($toppost = $db->fetch_array($query)) {
  89.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  90.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  91.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  92.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  93.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  94.                                 $data[] = $toppost;
  95.                         }
  96.                         break;
  97.                 case 'yearstar':
  98.                         while($toppost = $db->fetch_array($query)) {
  99.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  100.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  101.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  102.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  103.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  104.                                 $data[] = $toppost;
  105.                         }
  106.                         break;

  107. //=====================社区明星BY 33201 结束
复制代码


5. include/newthread.inc.php

查找
  1. updatepostcredits('+', $discuz_uid, $postcredits);
复制代码


下面加

  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.                 updatecache('newthread');
  3. require_once DISCUZ_ROOT.'./include/cache.func.php';
  4.                 updatecache('daystar');
复制代码


6. include/newreply.inc.php

查找
  1. updatepostcredits('+', $discuz_uid, $replycredits);
复制代码


下面加
  1.   require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.                 updatecache('newthread');
  3.   require_once DISCUZ_ROOT.'./include/cache.func.php';
  4.                 updatecache('daystar');
复制代码
7. include/editpost.inc.php

查找
  1. updatepostcredits('-', $orig['authorid'], ($isfirstpost ? $postcredits : $replycredits));
复制代码


下面加
  1.   
  2. require_once DISCUZ_ROOT.'./include/cache.func.php';
  3.                 updatecache('newthread');
复制代码


8. 编辑文件index.php

8.1查找
  1. $threads = $posts = $todayposts = $fids = 0;
复制代码


下面加
  1. //首页四格TOPLIST_CACHE版, By oytktk 代码首
  2.         if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'],

  3. 'category_hk2 ') === FALSE) {
  4.                 $categorys_hk2 = 'collapsed_no.gif';
  5.                 $collapse['category_hk2'] = '';
  6.         } else {
  7.                 $categorys_hk2 = 'collapsed_yes.gif';
  8.                 $collapse['category_hk2'] = 'display: none';
  9.         }
  10.         
  11.         if($categorys_hk2 == 'collapsed_no.gif'){
  12.         require_once DISCUZ_ROOT.'./forumdata/cache/cache_toplist.php';
  13.         $toplistloop = $_DCACHE['newthread'];
  14.         }
  15.         //首页四格TOPLIST_CACHE版, By oytktk 代码尾
复制代码


8.2 查找:

  1. require_once DISCUZ_ROOT.'./include/forum.func.php';
复制代码


下面添加:
  1. require_once DISCUZ_ROOT.'./forumdata/cache/cache_poststar.php';
  2. $month=date(n);
  3. $year=date(Y);
复制代码


8.3 查找:
  1. unset($_DCACHE['announcements']);
复制代码


下面添加:

  1. //========== 社区发帖明星 开始
  2. $nopoststar ='<td valign=top>姓名: 虚位以待! <br>积分:空<br>精华:空<br>今日发帖:空<br>总发帖量:空<br>在线时间:空<br></td><td width=16% align=center class=altbg1><IMG height=80 src="images/nopic.gif" width=80 align=center></td>';
  3. if($_DCACHE['daystar']) {
  4.         foreach($_DCACHE['daystar'] as $key => $dstar) {
  5.                 if ($key<3){
  6.                         $daystars .="<td valign=top>姓名:".$dstar[author]."<br>积分:".$dstar[credits]."<br>精华:".$dstar[digestposts]."篇<br>今日发帖:".$dstar[num]."篇<br>总发帖量:".$dstar[posts]." 篇<br>在线时间:".$dstar[oltime]." 小时<br></td><td width=16% align=center class=altbg1><IMG src=".$dstar[avatar]." width=".$dstar[avatarwidth]." height=".$dstar[avatarheight]." align=center></td>";
  7.                         $n=$key;
  8.                 }
  9.         }
  10.             if($n==0){$daystars .=$nopoststar.$nopoststar;}elseif($n==1){$daystars .=$nopoststar;}
  11. }
  12. if($_DCACHE['weekstar']) {
  13.         foreach($_DCACHE['weekstar'] as $key => $wstar) {
  14.                 if ($key<3){
  15.                         $weekstars .="<td valign=top>姓名:".$wstar[author]."<br> 积分:".$wstar[credits]."<br>精华:".$wstar[digestposts]." 篇<br>本周发帖:".$wstar[num]."篇<br>总发帖量:".$wstar[posts]." 篇<br>在线时间:".$wstar[oltime]."小时</td><TD width=16% align=center class=altbg1><IMG src=".$wstar[avatar]." width=".$wstar[avatarwidth]." height=".$wstar[avatarheight]." align=center></td>";
  16.                         $weeknum=$key;
  17.                 }
  18.     }
  19.         if($weeknum==0){$weekstars .= $nopoststar.$nopoststar;}elseif($weeknum==1){$weekstars.=$nopoststar;}
  20. }
  21. if($_DCACHE['monthstar']) {
  22.         foreach($_DCACHE['monthstar'] as $key => $mstar) {
  23.                 if ($key<3){
  24.                         $monthstars .="<td valign=top>姓名:".$mstar[author]."<br>积分:".$mstar[credits]."<br>精华:".$mstar[digestposts]."篇<br>".$month."月发帖:".$mstar[num]." 篇<br>总发帖量:".$mstar[posts]." 篇<br>在线时间:".$mstar[oltime]." 小时</td><TD width=16% align=center class=altbg1><IMG src=".$mstar[avatar]." width=".$mstar[avatarwidth]." height=".$mstar[avatarheight]." align=center></td>";
  25.                         }
  26.         }
  27. }
  28. if($_DCACHE['yearstar']) {
  29.         foreach($_DCACHE['yearstar'] as $key => $ystar) {
  30.                 if ($key<3){
  31.                         $yearstars .="<td valign=top>姓名:".$ystar[author]."<br>积分:".$ystar[credits]."<br>精华:".$ystar[digestposts]." 篇<br>".$year."年发帖:".$ystar[num]."篇<br>总发帖量:".$ystar[posts]." 篇<br>在线时间:".$ystar[oltime]." 小时</td><TD width=16% align=center class=altbg1><IMG src=".$ystar[avatar]." width=".$ystar[avatarwidth]." height=".$ystar[avatarheight]." align=center></td>";
  32.                 }
  33.     }
  34. }
  35. //========== 社区发帖明星 结束

复制代码


9. topicadmin.php

查找

  1. showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'),
复制代码


上面加
  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.         updatecache('newthread');
  3. require_once DISCUZ_ROOT.'./include/cache.func.php';
  4.                 updatecache('daystar');
复制代码


10. 修改文件:templates\default\discuz.htm

查找

  1. <!--{if !empty($newpmexists)}-->
  2.         <div style="clear: both; margin-top: 5px">
  3.         {template pmprompt}
  4.         </div>
  5. <!--{/if}-->
复制代码


下面加
  1.         
  2. <!--{if empty($gid)}-->
  3. <!--{if $show_poststar}-->
  4. <div style="clear: both; margin-top: 5px">
  5. {template toplist}
  6. </div>
  7. <!--{/if}-->
  8. <!--{/if}-->
复制代码


上传 附件里的 TOPLIST.htm到模版风格目录

11.上传附件到论坛根目录

12.后台更新缓存,一定要更新,否则可能首页无法显示
完毕!

注意:默认首页发帖状元、榜眼、探花三栏是展开的,如果你想默认改为隐藏的就将star.htm
中的

  1. <tbody id="poststar" style="display:yes">
复制代码


的 yes 修改为 none 即可!

由于时间仓促和本人水平有限,难免存在一些BUG,大家有什么意见和建议还望大家及时提出,谢谢!

[ 本帖最后由 PHP论坛 于 2006-10-22 09:02 编辑 ]
回复

使用道具 举报

 楼主| PHP论坛 发表于 2006-9-3 21:45:29 | 显示全部楼层
常见修改问题:

1.Warning: main(): Unable to access d:\usr\web\www\bbs\./forumdata/cache/cache_toplist.php in d:\usr\web\www\bbs\index.php on line 97

Warning: main(d:\usr\web\www\bbs\./forumdata/cache/cache_topli ...


修改办法:   清除forumdata/cache/目录下所有文件.后台更新缓存.然后刷新首页两次。正常

2.首页无法显示:



修改办法:  请详细查看此处。是否按照这个来修改的。如果不是也会造成首页无法显示:

8. 编辑文件index.php

8.1查找
  1. $threads = $posts = $todayposts = $fids = 0;
复制代码



  1. //首页四格TOPLIST_CACHE版, By oytktk 代码首
  2.         if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'],

  3. 'category_hk2 ') === FALSE) {
  4.                 $categorys_hk2 = 'collapsed_no.gif';
  5.                 $collapse['category_hk2'] = '';
  6.         } else {
  7.                 $categorys_hk2 = 'collapsed_yes.gif';
  8.                 $collapse['category_hk2'] = 'display: none';
  9.         }
  10.         
  11.         if($categorys_hk2 == 'collapsed_no.gif'){
  12.         require_once DISCUZ_ROOT.'./forumdata/cache/cache_toplist.php';
  13.         $toplistloop = $_DCACHE['newthread'];
  14.         }
  15.         //首页四格TOPLIST_CACHE版, By oytktk 代码尾
复制代码


3.出现如下错误提示:
Warning: main(d:\webhost\qiuqiao\web\vip\05\./forumdata/templates/1_toplist.tpl.php): failed to open stream: No such file or directory in d:\webhost\qiuqiao\web\vip\05\forumdata\templates\1_discuz.tpl.php on line 106

Warning: main(d:\webhost\qiuqiao\web\vip\05\./forumdata/templates/1_toplist.tpl.php): failed to open stream: No such file or directory in d:\webhost\qiuqiao\web\vip\05\forumdata\templates\1_discuz.tpl.php on line 106

Warning: main(): Failed opening 'd:\webhost\qiuqiao\web\vip\05\./forumdata/templates/1_toplist.tpl.php' for inclusion (include_path='.;c:\php4\pear') in d:\webhost\qiuqiao\web\vip\05\forumdata\templates\1_discuz.tpl.php on line 106

解决办法:清除\forumdata\templates目录下所有文件,然后刷新首页两次.正常..

当贴子的标题过长时,会排列多出一排来,难看!!  如何长能排列整齐???(不要排到第二行的)


修改include\cache.func.php里面的语句:
$topthread['subjectc'] = cutstr($topthread['subject'], 25);
调整红色数字就行!

4.不显示某个子板块:
可以在cache.func.php里面把代码中4个ORDER BY前全部加上and f.fid!=''(引号里是隐藏帖子所在论坛的fid号,例如:and f.fid!='3')   

如何把首页显示的“XX十大名帖 ”,更改成:“社区十大名帖”?

修改办法: 修改附件里面的toplist.htm中的如下代码修改:
<td align="left" valign="top"><b> <img src={IMGDIR}/dot.gif BORDER=0> XX十大名帖</b>

为什么我装了插件之后,在“随机挑选的精华贴子”项目下,不能随机显示精华贴子,请问如何解决!谢谢!

修改办法: 看看你的     cache.inc.php 中的  topdigest 代码部份有没有问题



[quote]原帖由 jesan888 于 2006-10-18 19:24 发表


能不能把那个滚动条去掉呀。


在TOPLIST.HTM中查找下面这一句:


  1. <td><div style="overflow:auto; height:190; width:100%;">
复制代码

找到后   去掉    这一句...


然后向下查找 这一句:


  1. <td align="left" valign="top"><b> <img src={IMGDIR}/dot.gif BORDER=0> 部落十大名帖</b>
  2.                 <hr color="{INNERBORDERCOLOR}" width="95%" size="1">
  3.                 <!--#最新贴循环开始-->
  4.                 <!--{loop $_DCACHE['topviews'] $toploop}-->
  5.                 -><a href="viewthread.php?tid=$toploop[tid]" $toploop[threadcolor] title="主题: $toploop[subject]{LF}版块:

  6. $toploop[name]{LF}作者: $toploop[author]{LF}浏览: $toploop[views]{LF}回复: $toploop[replies]{LF}最后更新: $toploop

  7. [lastposter] 于 $toploop[lastpost] 发表">$toploop[subjectc]</a> <a href="redirect.php?tid=$toploop[tid]

  8. &goto=lastpost#lastpost" title="转入查看最后回复的内容">($toploop[replies]/$toploop[views])</a><br>
  9.                 <!--{/loop}-->
  10.                 <!--#循环结束--></td>
  11.             </tr>
  12.           </table>
  13.         </div></td>
  14.     </tr>
复制代码


修改为:


  1. <td align="left" valign="top"><b> <img src={IMGDIR}/dot.gif BORDER=0> 部落十大名帖</b>
  2.                 <hr color="{INNERBORDERCOLOR}" width="95%" size="1">
  3.                 <!--#最新贴循环开始-->
  4.                 <!--{loop $_DCACHE['topviews'] $toploop}-->
  5.                 -><a href="viewthread.php?tid=$toploop[tid]" $toploop[threadcolor] title="主题: $toploop[subject]{LF}版块:

  6. $toploop[name]{LF}作者: $toploop[author]{LF}浏览: $toploop[views]{LF}回复: $toploop[replies]{LF}最后更新: $toploop

  7. [lastposter] 于 $toploop[lastpost] 发表">$toploop[subjectc]</a> <a href="redirect.php?tid=$toploop[tid]

  8. &goto=lastpost#lastpost" title="转入查看最后回复的内容">($toploop[replies]/$toploop[views])</a><br>
  9.                 <!--{/loop}-->
  10.                 <!--#循环结束--></td>
  11.             </tr>
  12.           </table>
  13.           </tr>
复制代码



OK....[/quote]




[quote]原帖由 enbony 于 2006-11-5 23:05 发表
我的好了。。
但。。只有默认风格可以用。。
其余两个的风格不能用。。
为什么呢?
我upload我的toplist.html去我的风格那里了。。。





要修改所有风格里面的   disczu.htm  


才能在新的风格里面使用。。。
[/quote]

[ 本帖最后由 PHP论坛 于 2007-1-23 21:30 编辑 ]
回复

使用道具 举报

安. 发表于 2006-9-3 21:50:49 | 显示全部楼层
楼主,你比官方还牛,5.1的.....
回复

使用道具 举报

juse 发表于 2006-9-3 21:51:20 | 显示全部楼层
我靠~!顶~!!!问一下升级数据库这个玩意会不会以后升级或者移动论坛造成麻烦
回复

使用道具 举报

zx5017 发表于 2006-9-3 21:59:09 | 显示全部楼层
D5.1???
回复

使用道具 举报

 楼主| PHP论坛 发表于 2006-9-3 21:59:59 | 显示全部楼层
这个不会。我从DISCUZ4。1升级过来的时候是装有这个插件的。升级的时候没有错误。。。


哦。。。说一下。。如果4。1里面安装过这个插件的话。好象不需要升级数据库了。。。我升级 的时候提示复制错误。。。不过大家还是升级一下吧。。。。。。。。。。。
回复

使用道具 举报

sxrm 发表于 2006-9-3 22:25:29 | 显示全部楼层
支持
回复

使用道具 举报

孤独的云 发表于 2006-9-3 22:27:11 | 显示全部楼层
支持
回复

使用道具 举报

guo23feng 发表于 2006-9-3 22:36:22 | 显示全部楼层
好多bug
index.php 用了width="16%" 结果无法打开首页
修改成width=16% 后可以打开,但是发帖之星显示一塌糊涂

看看我的演示地址http://bbs.qyup.com
在线等解决办法

[ 本帖最后由 guo23feng 于 2006-9-4 11:21 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-4 19:09 , Processed in 0.107084 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表