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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[原創]今日論壇之星 cache 版

[复制链接]
charispoon 发表于 2005-9-19 12:00:52 | 显示全部楼层 |阅读模式
laoyang想要的~
這是我的第2個作品~
希望大家多多支持~

作者:就是我啦~
功能:免查詢數據庫!當會員發新帖子時才更新數據~
修改檔案:include/cache.php,include/newthread.php,index.php,模板index.htm
展示:  http://lucksforum.com

打開 include/cache.php



  1. 'index'                => array(
复制代码


後方加

  1. 'bestpostmemberpd',
复制代码




  1. case ranks:
  2.                         $table = $GLOBALS['table_ranks'];
  3.                         $cols='ranktitle,postshigher,stars,color';
  4.                         $conditions = "WHERE 1 ORDER BY postshigher desc";
  5.                         break;
复制代码


後方加



  1. /////////////today forum star hack by Charis start///////////
  2. case bestpostmemberpd:
  3. $timestamp=time();
  4.                         $table = $GLOBALS['table_posts'];
  5.                         $cols="author, COUNT(*) AS postnum";
  6.                         $conditions = "WHERE dateline >= '".($timestamp - 86400)."' GROUP BY author ORDER BY  postnum DESC LIMIT 1";
  7.                         break;
  8. /////////////today forum star hack by Charis end///////////
复制代码




  1. case 'announcements_forum':
复制代码


上方加


  1. /////////////today forum star hack by Charis start///////////
  2. case bestpostmemberpd:
  3. $data = $db->fetch_row($query);
  4. break;
  5. /////////////today forum star hack by Charis end///////////
复制代码


打開include/newthread.php




  1. showmessage('post_newthread_succeed', "viewthread.php?tid=$tid");
复制代码


若沒有則找

  1. ?><meta http-equiv="refresh"
复制代码


上方加


  1. @require_once DISCUZ_ROOT.'./include/cache.php';
  2. updatecache('bestpostmemberpd');
复制代码


打開index.php



  1. $discuz_action = 1;
复制代码


上方加


  1. /////////////today forum star hack by Charis start///////////
  2. list($bestpostmember['name'], $bestpostmember['post']) = $_DCACHE['bestpostmemberpd'];
  3. /////////////today forum star hack by Charis end///////////
复制代码



打開模版 index.htm
在適當的位置加

  1. {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 编辑 ]
freddy 发表于 2005-9-19 12:01:54 | 显示全部楼层
沙发!
回复

使用道具 举报

freddy 发表于 2005-9-19 12:02:35 | 显示全部楼层
嘿嘿!支持一个~无查询版的!
回复

使用道具 举报

karl907 发表于 2005-9-19 12:10:21 | 显示全部楼层
支持......小F又在抢了....我下次一定和你争....今天就到此...去睡了...888
回复

使用道具 举报

jimmyjimmyqqq 发表于 2005-9-19 12:16:35 | 显示全部楼层
我又搶,沙發,沒有了
回复

使用道具 举报

laoyang 发表于 2005-9-21 10:59:02 | 显示全部楼层
今天才搜索到,坚决支持!
回复

使用道具 举报

sdywd 发表于 2005-9-21 14:30:33 | 显示全部楼层
应该贴图出来看看效果哦
回复

使用道具 举报

qtwrk 发表于 2005-9-22 05:16:45 | 显示全部楼层
TMD
沙发 板凳  连地板都没了
回复

使用道具 举报

雪火阿累 发表于 2005-10-30 20:33:18 | 显示全部楼层
打開模版 index.htm
在適當的位置加


CODE:[Copy to clipboard]{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}-->

这要放在在哪??在適當的位置是在哪.

还有一个 小JM小改動-公告加發貼之星美化欄!

https://discuz.dismall.com/viewth ... jimmyqqq&page=1

也在改模版 index.htm
是不是这两个都有改期...
回复

使用道具 举报

17小菜 发表于 2006-1-12 16:00:18 | 显示全部楼层
好东西!
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 09:54 , Processed in 0.123422 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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