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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

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

[复制链接]
weaver2000 发表于 2006-9-12 03:37:48 | 显示全部楼层 |阅读模式
由于此插件安装较为复杂,特别向您推荐: 超简单首页四格,带后台控制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 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x

评分

1

查看全部评分

HY清风 发表于 2006-9-12 03:55:39 | 显示全部楼层
测试下!
回复

使用道具 举报

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

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

Discuz! 5『插件.风格.美化.功能』HY清风 收集整理贴!最大免费影视迅雷下载站超爽5G视频空间1G网络硬盘
回复

使用道具 举报

shuyufeng 发表于 2006-9-12 05:21:50 | 显示全部楼层
还是原班人马自己升级自己的插件来得放心
回复

使用道具 举报

 楼主| weaver2000 发表于 2006-9-12 06:10:09 | 显示全部楼层
感谢HY清风的赏识!!!
回复

使用道具 举报

zbb260202 发表于 2006-9-12 10:19:18 | 显示全部楼层
老大自己更新,跟进!
回复

使用道具 举报

kndy 发表于 2006-9-12 11:01:00 | 显示全部楼层
4.1的就用的这个版本,下午插上
回复

使用道具 举报

飞天雪狐 发表于 2006-9-12 11:18:44 | 显示全部楼层
支持顶上
回复

使用道具 举报

xuyulai 发表于 2006-9-12 11:48:01 | 显示全部楼层
如果热门图片能自动采集附件图片就完美了
回复

使用道具 举报

xinruby02 发表于 2006-9-12 12:15:16 | 显示全部楼层
支持
谢谢
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-29 05:04 , Processed in 0.200085 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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