==============================================
插件名称:缓存版首页N格右侧竖排
适用版本:DZ6.1/6.0正式版
源码作者:太多了,看首页N格的横排就知道
插件作者:fucenyuan
版权所有:[/url]
修改难度:易
修改文件:templates\default\discuz.htm、 templates\default\header.htm、根目录\index.php
新增文件:有,具体请看附件
其他说明:本竖排版源码采用了首页N格横排,并对新贴、新回复、热门贴等设置了非JS调用的缓存版,因本人技术有限,代码粗糙,如您有更好的办法欢迎指导,不胜感激。
================================================
ps:因DZ6.1自带了数据调用功能,因此,列表页和内容页就不做DZ6.1的了,这两天我再放出DZ6.0的列表页右侧N格竖排和内容页右侧N格竖排!具体详情请关注请贴或[url]http://www.ycdgxt.cn/thread-4412-1-1.html
特别说明:
-----------------------------------------------------------
1、本插件站内搜索栏里的数据为本人本社区的数据,你只需更改成你的论坛即可使用(包括热门关键词也要改)
2、最下面的阿里妈妈广告是深圳永诚娱乐社区的广告,你换成自己的广告代码即可,如无需使用,删除
<div align=center class="mainbox forumlist">
<script type="text/JavaScript">
alimama_pid="mm_11031226_1020092_2256609";
alimama_titlecolor="0000FF";
alimama_descolor ="000000";
alimama_bgcolor="FFFFFF";
alimama_bordercolor="E6E6E6";
alimama_linkcolor="008000";
alimama_bottomcolor="FFFFFF";
alimama_anglesize="0";
alimama_bgpic="0";
alimama_icon="0";
alimama_sizecode="35";
alimama_width=200;
alimama_height=250;
alimama_type=2;
</script>
<script src="http://a.alimama.cn/inf.js" type=text/javascript>
</script>
</div>
这段代码即可
3、积极分子那里调用的是DZ后台的活跃会员数据,将那段代码改成你自己的即可使用,如不需要也可删除。
4、顺序可以自行调节
5、另外,我还放了个在右侧调用论坛图片的hotpic2.php如需使用,自行加代码即可。
6、如使用有问题或需要帮助请联系本人QQ:79214401
或登录本人论坛:深圳永诚娱乐社区 http://www.ycdgxt.cn
---------------------------------------------------------------------------
手动安装说明:(如不需要手动,可使用附件中的覆盖版,建议使用手动安装)
--------------------------------------------------------
1、修改discuz.htm(如您使用的风格里也有这个文件,一样要修改)
查找:
- <!--{if !empty($insenz['vfstatus'])}--><script type="text/javascript" src="campaign.php?action=list"></script><!--{/if}-->
复制代码 在上面加上:- <TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0 class="outbox">
- <TBODY>
- <TR>
-
- <TD vAlign=top>
复制代码 查找:- <!--{if $_DCACHE['forumlinks']}-->
复制代码 在上面加上:2、修改header.htm(如您使用的风格里也有这个文件,一样要修改)
在</head>上面加上:- <script type="text/javascript" src="include/javascript/weather.js"></script>
复制代码 3、修改index.php
查找:- $memberenc = rawurlencode($lastmember);
- $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码 在下面加上:
- $today = mktime (0,0,0,date("m") ,date("d"),date("Y"));
- $build_date = mktime (0,0,0,11,01,2007);//请修改后面的三个数字,分别代表你论坛运行第一天的月,日,年。
- $build_days = (int)(($today-$build_date)/(24*3600));
- //论坛新贴开始//
- $hack_cut_str =25; //修改标题显示字数
- $hack_cut_strauthor = 9;
- $new_post_threadlist = array();
- $nthread = array();
- $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 10");
- while($nthread = $db->fetch_array($query)) {
- $nthread['forumname'] = $nthread['name'];
- $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
- $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
- $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
- $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
- if($nthread['highlight']) {
- $string = sprintf('%02d', $nthread['highlight']);
- $stylestr = sprintf('%03b', $string[0]);
- $nthread['highlight'] = 'style="';
- $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
- $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
- $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
- $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
- $nthread['highlight'] .= '"';
- } else {
- $nthread['highlight'] = '';
- }
- $new_post_threadlist[] = $nthread;
- }
- //论坛新贴结束//
- //新回复
- $hack_cut_str = 23; //标题字数
- $hack_cut_strauthor = 9;
- $new_reply_threadlist = array();
- $rthread = array();
- $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.lastpost DESC LIMIT 0, 10");
- while($rthread = $db->fetch_array($query)) {
- $rthread['forumname'] = ereg_replace('<[^>]*>','',$rthread['name']);
- $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
- $rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
- $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
- $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
- if($rthread['highlight']) {
- $string = sprintf('%02d', $rthread['highlight']);
- $stylestr = sprintf('%03b', $string[0]);
- $rthread['highlight'] = 'style="';
- $rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
- $rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
- $rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
- $rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
- $rthread['highlight'] .= '"';
- } else {
- $rthread['highlight'] = '';
- }
- $new_reply_threadlist[] = $rthread;
- }//新回复结束
- //热帖
- $hack_cut_str = 25; //标题字数
- $hack_cut_strauthor = 9;
- $new_hot_threadlist = array();
- $mthread = array();
- $ctime=$timestamp-3600*24*7;//最后7是天数为本周
- $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND t.dateline>$ctime AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.replies DESC LIMIT 0, 10");
- while($mthread = $db->fetch_array($query)) {
- $mthread['forumname'] = ereg_replace('<[^>]*>','',$mthread['name']);
- $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
- $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
- $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
- $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
- if($mthread['highlight']) {
- $string = sprintf('%02d', $mthread['highlight']);
- $stylestr = sprintf('%03b', $string[0]);
- $mthread['highlight'] = 'style="';
- $mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
- $mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
- $mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
- $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
- $mthread['highlight'] .= '"';
- } else {
- $mthread['highlight'] = '';
- }
- $new_hot_threadlist[] = $mthread;
- }
- //热帖结束
- //精华帖
- $hack_cut_str = 25; //标题字数
- $hack_cut_strauthor = 9;
- $new_digest_threadlist = array();
- $dthread = array();
- $dtime=$timestamp-3600*24*30;//最后30是天数为本月
- $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND t.dateline>$dtime AND t.digest in (1,2,3) AND f.fid not in (0) AND t.displayorder not in (-1,-2) order by RAND() desc limit 0, 10");
- while($dthread = $db->fetch_array($query)) {
- $dthread['forumname'] = ereg_replace('<[^>]*>','',$dthread['name']);
- $dthread['view_subject'] = cutstr($dthread['subject'],$hack_cut_str);
- $dthread['view_lastposter'] = cutstr($dthread['lastposter'],$hack_cut_strauthor);
- $dthread['date']= gmdate("$dateformat $timeformat", $dthread['dateline'] + $timeoffset * 3600);
- $dthread['lastreplytime']= gmdate("$dateformat $timeformat", $dthread[lastpost] + ($timeoffset * 3600));
- if($dthread['highlight']) {
- $string = sprintf('%02d', $dthread['highlight']);
- $stylestr = sprintf('%03b', $string[0]);
- $dthread['highlight'] = 'style="';
- $dthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
- $dthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
- $dthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
- $dthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
- $dthread['highlight'] .= '"';
- } else {
- $dthread['highlight'] = '';
- }
- $new_digest_threadlist[] = $dthread;
- }
- //精华帖结束
复制代码 ---------------------------------------------------------------------
最后,将附件中的文件传到论坛即可!
好了,安装结束,记得在后台更新缓存哦!
回贴顶贴是一个良好公民的义务!! |