立即免费下载 Discuz!6.1.0正式版
Discuz! 6.1.0 使用说明
Discuz!NT升级至v2.1
开放源码下载
UCenter Home 1.2 正式版发布
官方站 | 帮助文档
基于ECShop的免费网店托管-卖否
PHP实战精英班培训 | LAMP培训大连
Discuz!收费服务内容及价格
论坛免费升级 手握手
Discuz!/ECShop 专用官方虚拟主机
注册付费广告征集
Comsenz 招聘信息
网店系统ECShop v2.6.0正式版火热发布
基于Discuz!的免费论坛空间5D6D
第二届PHP中国开源发展及人才状况调查
发新话题
打印

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

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

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

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

安装方法如下:
1、后台升级数据库
复制内容到剪贴板
代码:
INSERT INTO `cdb_settings` VALUES ('show_toplist', '1');
2、编辑文件admin/setting.inc.php(后台显示功能设置内添加开关)
查找:
复制内容到剪贴板
代码:
showsetting('settings_nocacheheaders', 'settingsnew[nocacheheaders]', $settings['nocacheheaders'], 'radio');
下面添加:
复制内容到剪贴板
代码:
showsetting('settings_show_toplist', 'settingsnew[show_toplist]', $settings['show_toplist'], 'radio');
3、编辑语言包templates/default/admincp.lang.php(后台管理页面显示的文字)
查找:
复制内容到剪贴板
代码:
'settings_forumjump_comment' => '选择“是”将在列表页面下部显示快捷跳转菜单。注意: 当分论坛很多时,本功能会严重加重服务器负担',
下面添加:
复制内容到剪贴板
代码:
'settings_show_toplist' => '显示首页四格',
'settings_show_toplist_comment' => '选则“是”将在首页显示首页四格',
4、 include/cache.func.php
查找
复制内容到剪贴板
代码:
'medals'        => array('medals')
上面加
复制内容到剪贴板
代码:
'toplist'        => array('newthread', 'newreply', 'topdigest', 'topviews'),//TOPLIST_首页四格_全Cache版_By oytktk
继续查找
复制内容到剪贴板
代码:
case 'medals':
                        $table = 'medals';
                        $cols = 'medalid, name, image';
                        $conditions = "WHERE available='1'";
                        break;
上面加
复制内容到剪贴板
代码:
//首页四格TOPLIST_CACHE版, By oytktk 代码首
                case 'newthread':
                        $table = 'threads t';
                        $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
                        $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.displayorder!='-1' ORDER BY t.dateline DESC LIMIT 0, 10";
                        break;

                case 'newreply':
                        $table = 'threads t';
                        $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
                        $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";
                        break;
                case 'topdigest':
                        $table = 'threads t';
                        $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';
                        $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE digest>0 ORDER BY rand() LIMIT 0, 10";
                        break;
               
                case 'topviews':
                        $table = 'threads t';
                        $view = rand(1,3)==1 ? 'views' : 'replies';
                        $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
                        $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.displayorder!='-1' ORDER BY t.$view DESC LIMIT 0, 10";
                        break;

                //首页四格TOPLIST_CACHE版, By oytktk 代码尾
再找:
复制内容到剪贴板
代码:
case 'settings':
                        $data['qihoo_links'] = array();
                        while($setting = $db->fetch_array($query))
上面加
复制内容到剪贴板
代码:
//首页四格TOPLIST_CACHE版, By oytktk 代码首

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

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

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

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


                //首页四格TOPLIST_CACHE版, By oytktk 代码尾
5、 include/newthread.inc.php
查找
复制内容到剪贴板
代码:
updatepostcredits('+', $discuz_uid, $postcredits);
下面加
复制内容到剪贴板
代码:
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('newthread');
6、 include/newreply.inc.php
查找
复制内容到剪贴板
代码:
updatepostcredits('+', $discuz_uid, $replycredits);
下面加
复制内容到剪贴板
代码:
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('newthread');
7、include/editpost.inc.php
查找
复制内容到剪贴板
代码:
updatepostcredits('-', $orig['authorid'], ($isfirstpost ? $postcredits : $replycredits));
下面加
复制内容到剪贴板
代码:
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('newthread');
8、index.php
查找
复制内容到剪贴板
代码:
$catlist = $forumlist = $sublist = array();
$threads = $posts = $todayposts = $fids = 0;
下面加
复制内容到剪贴板
代码:
//首页四格TOPLIST_CACHE版, By oytktk 代码首
        if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'category_hk2 ') === FALSE) {
                $categorys_hk2 = 'collapsed_no.gif';
                $collapse['category_hk2'] = '';
        } else {
                $categorys_hk2 = 'collapsed_yes.gif';
                $collapse['category_hk2'] = 'display: none';
        }
        
        if($categorys_hk2 == 'collapsed_no.gif'){
        require_once DISCUZ_ROOT.'./forumdata/cache/cache_toplist.php';
        $toplistloop = $_DCACHE['newthread'];
        }
        //首页四格TOPLIST_CACHE版, By oytktk 代码尾
9、topicadmin.php
查找
复制内容到剪贴板
代码:
showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'),
上面加
复制内容到剪贴板
代码:
require_once DISCUZ_ROOT.'./include/cache.func.php';
        updatecache('newthread');
10、templates/default/discuz.htm
查找
复制内容到剪贴板
代码:
<!--{if !empty($advlist['text'])}-->
        <div style="clear: both; margin-top: 5px;">
        <div class="spaceborder" style="width: {TABLEWIDTH}">
        <table cellspacing="1" border="0" cellpadding="{TABLESPACE}" width="100%" style="background: {BGBORDER}">$advlist[text]</table>
        </div><br></div>
<!--{/if}-->
在下面加
复制内容到剪贴板
代码:
<!--{if empty($gid)}-->
<!--{if $show_toplist}-->
<div style="clear: both; margin-top: 5px">
{template toplist}
<br>
</div>
<!--{/if}-->
<!--{/if}-->
11、下载附件toplist.rar上传至相应的目录内即可!其中topview文件夹上传至论坛跟目录,toplist.htm文件上传至templates/default

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

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

附件

toplist.rar (309.18 KB)

2006-9-12 03:37, 下载次数: 1708

Snap4.gif (35.56 KB)

2006-9-12 03:37

Snap4.gif

本帖最近评分记录
  • freddy 威望 +5 我很赞同 2006-10-18 16:43
  • freddy +2 我很赞同 2006-10-18 16:43
测试下!
引用:
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的就用的这个版本,下午插上
冰火图城 “图”个痛快 进去看看
支持顶上
如果热门图片能自动采集附件图片就完美了
支持
谢谢

发新话题
版块跳转