laoyang想要的~
這是我的第2個作品~
希望大家多多支持~
作者:就是我啦~
功能:免查詢數據庫!當會員發新帖子時才更新數據~
修改檔案:include/cache.php,include/newthread.php,index.php,模板index.htm
展示: http://lucksforum.com
打開 include/cache.php
找
後方加
找
- case ranks:
- $table = $GLOBALS['table_ranks'];
- $cols='ranktitle,postshigher,stars,color';
- $conditions = "WHERE 1 ORDER BY postshigher desc";
- break;
复制代码
後方加
- /////////////today forum star hack by Charis start///////////
- case bestpostmemberpd:
- $timestamp=time();
- $table = $GLOBALS['table_posts'];
- $cols="author, COUNT(*) AS postnum";
- $conditions = "WHERE dateline >= '".($timestamp - 86400)."' GROUP BY author ORDER BY postnum DESC LIMIT 1";
- break;
- /////////////today forum star hack by Charis end///////////
复制代码
找
- case 'announcements_forum':
复制代码
上方加
- /////////////today forum star hack by Charis start///////////
- case bestpostmemberpd:
- $data = $db->fetch_row($query);
- break;
- /////////////today forum star hack by Charis end///////////
复制代码
打開include/newthread.php
找
- showmessage('post_newthread_succeed', "viewthread.php?tid=$tid");
复制代码
若沒有則找
- ?><meta http-equiv="refresh"
复制代码
上方加
- @require_once DISCUZ_ROOT.'./include/cache.php';
- updatecache('bestpostmemberpd');
复制代码
打開index.php
找
上方加
- /////////////today forum star hack by Charis start///////////
- list($bestpostmember['name'], $bestpostmember['post']) = $_DCACHE['bestpostmemberpd'];
- /////////////today forum star hack by Charis end///////////
复制代码
打開模版 index.htm
在適當的位置加
- {lang stats_main_topposter} <!--{if $bestpostmember['post'] >0}--><a href="viewpro.php?username=$bestpostmember['name']">$bestpostmember['name']</a> - {lang stats_main_total_posted} $bestpostmember['post'] {lang index_posts}<!--{else}-->暫時沒有<!--{/if}-->
复制代码
先上傳cache.php
然後上傳模板 index.htm
最後更新緩存!~
完成~如有錯誤請指教~~謝謝
[ 本帖最后由 charispoon 于 2005-9-19 12:50 编辑 ] |