BS一下35,36楼的,竟然说我放AD,我为什么晚放的原因已经说过了。请所有来用这个插件的人跟我一起BS他们!!!
声明:我是曾经参加过设计与实现某千万投资项目的PHP老手!请多支持我,今后将陆续放出更多插件。
声明2:本人现正开发一套新的论坛系统,全面支持ajax,全部开源,敬请期待
声明3:支持我的人请到我的论坛注册个ID支持下吧!!送几个IP,多些,多谢!
http://www.52jijin.com
声明4:欢迎大家和我做交换连接,有意的请PM我
帖子上方滚动显示新发的帖子
带缓存,可在计划任务中更新
1.编辑文件 include/cache.func.php
查找
- 'medals' => array('medals')
复制代码
上面加
- 'othersthread' => array('newthread'),
复制代码
继续查找
- case 'medals':
- $table = 'medals';
- $cols = 'medalid, name, image';
- $conditions = "WHERE available='1'";
- break;
复制代码
上面加
- 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, 8";
- break;
复制代码
继续查找
- case 'medals':
- while($medal = $db->fetch_array($query)) {
- $data[$medal['medalid']] = array('name' => $medal['name'], 'image' => $medal['image']);
- }
- break;
复制代码
上面加
- 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'], 32);
- $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;
复制代码
2.编辑模板 viewthread.htm
查找
- <a href="redirect.php?fid=$fid&tid=$tid&goto=nextnewset" style="font-weight: normal">{lang next_thread} ››</a>
复制代码
后面加
3.编辑文件 viewthread.php
查找
- $supe_fromdiscuz = $supe_status && $thread['itemid'] ? md5("$discuz_auth_key-$thread[itemid]") : '';
复制代码
上面加
- require_once DISCUZ_ROOT.'./forumdata/cache/cache_othersthread.php';
- $toplistloop = $_DCACHE['newthread'];
复制代码
4.新建文件 /include/crons/othersthread.inc.php
- <?php
- /*
- [Discuz!] (C)2001-2006 Comsenz Inc.
- This is NOT a freeware, use is subject to license terms
- $RCSfile: todayposts_daily.inc.php,v $
- $Revision: 1.3 $
- $Date: 2006/02/23 13:44:54 $
- */
- require_once DISCUZ_ROOT.'./include/cache.func.php';
- updatecache('newthread');
- ?>
复制代码
5.在后台管理-〉其他设置-〉计划任务中添加相应任务
6.新建模板文件 othersthread.htm
- <marquee width="300" direction="left" scrollamount="2" scrolldelay="1" onMouseOver="this.stop();" onMouseOut="this.start();">
- <!--{loop $_DCACHE['newthread'] $toploop}-->
- <a style="text-decoration:underline;" href="viewthread.php?tid=$toploop[tid]" $toploop[threadcolor] title="主题: $toploop[subject]{LF}版块: $toploop[name]{LF}作者: $toploop[author]{LF}浏览: $toploop[views]{LF}回复: $toploop[replies]{LF}最后更新: $toploop[lastposter] 于 $toploop[lastpost] 发表">$toploop[subjectc]</a>
- <!--{/loop}-->
- </marquee>
复制代码
7.更新缓存
[ 本帖最后由 albert993 于 2007-7-27 13:16 编辑 ] |