Manyou诚邀开发者加盟 | 常见问题
《站长》俱乐部官方群公布 城市联络员机会多多
立即免费下载 Discuz!7.0.0 正式版
安装升级指南 | 用户手册 | 新手建站学堂
基于.net架构的Discuz!NT2.6正式版发布
Comsenz公司2009年招贤纳士,期待您的加盟
Discuz!收费服务内容及价格
7月重庆、成都、西安三地社区运营实战特训速报名
Discuz!/UCHome 专用官方虚拟主机
牧场新服一起联运:豆浆机免费带回家
基于Discuz!的免费论坛空间5D6D
康盛创想《站长》俱乐部18城市互动之旅报名ing
返回列表 回复 发帖

首页四格_全Cache,后台控制,图片预览FOR DZ5.0正式版(weaver2000修改)

由于此插件安装较为复杂,特别向您推荐: 超简单首页四格,带后台控制FOR DZ5.0正式版
此插件在dz4.0时本人修改而来,其实boyzyf已经将其升级到5.0,此次在此发帖主要是修正了boyzyf升级中的一处bug以及对四格的显示做了一些美化!!!

演示:www.xm361.com
         或见附件!

安装方法如下:
1、后台升级数据库
  1. INSERT INTO `cdb_settings` VALUES ('show_toplist', '1');
复制代码
2、编辑文件admin/setting.inc.php(后台显示功能设置内添加开关)
查找:
  1. showsetting('settings_nocacheheaders', 'settingsnew[nocacheheaders]', $settings['nocacheheaders'], 'radio');
复制代码
下面添加:
  1. showsetting('settings_show_toplist', 'settingsnew[show_toplist]', $settings['show_toplist'], 'radio');
复制代码
3、编辑语言包templates/default/admincp.lang.php(后台管理页面显示的文字)
查找:
  1. 'settings_forumjump_comment' => '选择“是”将在列表页面下部显示快捷跳转菜单。注意: 当分论坛很多时,本功能会严重加重服务器负担',
复制代码
下面添加:
  1. 'settings_show_toplist' => '显示首页四格',
  2. 'settings_show_toplist_comment' => '选则“是”将在首页显示首页四格',
复制代码
4、 include/cache.func.php
查找
  1. 'medals'        => array('medals')
复制代码
上面加
  1. 'toplist'        => array('newthread', 'newreply', 'topdigest', 'topviews'),//TOPLIST_首页四格_全Cache版_By oytktk
复制代码
继续查找
  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 代码尾
复制代码
再找:
  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 代码尾
复制代码
5、 include/newthread.inc.php
查找
  1. updatepostcredits('+', $discuz_uid, $postcredits);
复制代码
下面加
  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.                 updatecache('newthread');
复制代码
6、 include/newreply.inc.php
查找
  1. updatepostcredits('+', $discuz_uid, $replycredits);
复制代码
下面加
  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.                 updatecache('newthread');
复制代码
7、include/editpost.inc.php
查找
  1. updatepostcredits('-', $orig['authorid'], ($isfirstpost ? $postcredits : $replycredits));
复制代码
下面加
  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.                 updatecache('newthread');
复制代码
8、index.php
查找
  1. $catlist = $forumlist = $sublist = array();
  2. $threads = $posts = $todayposts = $fids = 0;
复制代码
下面加
  1. //首页四格TOPLIST_CACHE版, By oytktk 代码首
  2.         if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'category_hk2 ') === FALSE) {
  3.                 $categorys_hk2 = 'collapsed_no.gif';
  4.                 $collapse['category_hk2'] = '';
  5.         } else {
  6.                 $categorys_hk2 = 'collapsed_yes.gif';
  7.                 $collapse['category_hk2'] = 'display: none';
  8.         }
  9.         
  10.         if($categorys_hk2 == 'collapsed_no.gif'){
  11.         require_once DISCUZ_ROOT.'./forumdata/cache/cache_toplist.php';
  12.         $toplistloop = $_DCACHE['newthread'];
  13.         }
  14.         //首页四格TOPLIST_CACHE版, By oytktk 代码尾
复制代码
9、topicadmin.php
查找
  1. showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'),
复制代码
上面加
  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.         updatecache('newthread');
复制代码
10、templates/default/discuz.htm
查找
  1. <!--{if !empty($advlist['text'])}-->
  2.         <div style="clear: both; margin-top: 5px;">
  3.         <div class="spaceborder" style="width: {TABLEWIDTH}">
  4.         <table cellspacing="1" border="0" cellpadding="{TABLESPACE}" width="100%" style="background: {BGBORDER}">$advlist[text]</table>
  5.         </div><br></div>
  6. <!--{/if}-->
复制代码
在下面加
  1. <!--{if empty($gid)}-->
  2. <!--{if $show_toplist}-->
  3. <div style="clear: both; margin-top: 5px">
  4. {template toplist}
  5. <br>
  6. </div>
  7. <!--{/if}-->
  8. <!--{/if}-->
复制代码
11、下载附件toplist.rar上传至相应的目录内即可!其中topview文件夹上传至论坛跟目录,toplist.htm文件上传至templates/default

12、到后台更新缓存(务必!!!)

[ 本帖最后由 weaver2000 于 2006-10-28 22:45 编辑 ]

Snap4.gif (35.56 KB)

Snap4.gif

toplist.rar (309.18 KB)

1

评分次数

  • freddy

测试下!
HY清风 收录提示
我很赞同,收录到 Discuz! 5.0『插件.风格.美化.功能』HY清风 收集整理贴!
http://www.discuz.net/thread-359738-1-1.html
感谢你发布或推荐优秀作品给本贴!众人拾柴火焰高,敲动键盘,点击鼠标,我们一起分享!
为了更方便大家检索DZ插件等功能贴,HY清风 呼吁你在发表你的作品的同时,
在本贴发个推荐链接或直接PM我,我将会在测试成功后,收录你的作品或推荐作品!

如果你想你的作品迅速被广大会员认可并使用,那么就不要吝啬一分钟的时间来完成以下操作:
被收录或被推荐方式A、回复此贴  B、论坛短消息 PM 我!点这里PM我
发送格式
Discuz! 5『插件.风格.美化.功能』HY清风 收集整理贴!
http://www.discuz.net/thread-359738-1-1.html

Discuz! 5『插件.风格.美化.功能』HY清风 收集整理贴!最大免费影视迅雷下载站超爽5G视频空间1G网络硬盘
还是原班人马自己升级自己的插件来得放心
感谢HY清风的赏识!!!
老大自己更新,跟进!
4.1的就用的这个版本,下午插上
冰火图城 “图”个痛快 进去看看
支持顶上
如果热门图片能自动采集附件图片就完美了
支持
谢谢
返回列表