今日論壇之星 cache 版
作者:charispoon功能:免查詢數據庫!當會員發新帖子時才更新數據~
修改檔案:include/cache.php,include/newthread.php,index.php,模板index.htm
展示: http://lucksforum.com
打開 include/cache.php
找
[code]'index' => array([/code]
後方加
[code]'bestpostmemberpd',[/code]
找
[code]case ranks:
$table = $GLOBALS['table_ranks'];
$cols='ranktitle,postshigher,stars,color';
$conditions = "WHERE 1 ORDER BY postshigher desc";
break;
[/code]
後方加
[code]/////////////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///////////
[/code]
找
[code]case 'announcements_forum':[/code]
上方加
[code]/////////////today forum star hack by Charis start///////////
case bestpostmemberpd:
$data = $db->fetch_row($query);
break;
/////////////today forum star hack by Charis end///////////
[/code]
打開include/newthread.php
找
[code]showmessage('post_newthread_succeed', "viewthread.php?tid=$tid");[/code]
若沒有則找
[code]?><meta http-equiv="refresh"[/code]
上方加
[code]@require_once DISCUZ_ROOT.'./include/cache.php';
updatecache('bestpostmemberpd');
[/code]
打開index.php
找
[code]$discuz_action = 1;[/code]
上方加
[code]/////////////today forum star hack by Charis start///////////
list($bestpostmember['name'], $bestpostmember['post']) = $_DCACHE['bestpostmemberpd'];
/////////////today forum star hack by Charis end///////////
[/code]
打開模版 index.htm
在適當的位置加
[code]{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}-->
[/code]
最後更新緩存!~
另一种显示
插件名稱:公告加發貼之星美化欄適用版本:2.5/SP1
最後更新日期:21/10/2005
作 者:jimmyjimmyqqq
修 改:/
程式指導:jimmyjimmyqqq
數據升級:/
修改文件:/
修改模板:index.htm
新增文件:/
新增模板:/
安裝難度:★☆☆☆☆
[img]http://www.discuz.net/attachments/month_0510/index.1_WPBYm83v0grx.jpg[/img]
+++++++++++++++++++++++++++++++++++
開始安裝
+++++++++++++++++++++++++++++++++++
打開index.htm
找:
[code]<!--{if empty($gid)}-->[/code]
到這個完時的
[code]<!--{/if}-->[/code]
中間取代為:
[code] <table border="0" cellspacing="{BORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%">
<tr>
<td> <table border="0" cellspacing="{BORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%">
<tr class="header">
<td colspan="3" width=75%>$bbname {lang index_announcements}</td>
<td width=25%>今日留言王子/公主</td>
</tr>
<tr bgcolor="{ALTBG2}" align="center">
<td colspan="3" align="center">
<!--{if empty($announcements)}-->
{lang index_noannouncement}
<!--{else}-->
<marquee direction="left" scrollamount="3" onMouseOver="this.stop();" onMouseOut="this.start();">
$announcements </marquee>
<!--{/if}-->
</td>
<td align="left">
<!--{if $bestpostmember['post'] >0}-->
得主 <a href="viewpro.php?username=$bestpostmember['name']"><b><font color=orange>$bestpostmember['name']</font></b></a>
| 發貼數 <b><font color=orange>$bestpostmember['post']</font></b> 篇
<!--{else}-->
暫時沒有
<!--{/if}-->
</td>
</tr>
</table></td>
</tr></table>
[/code] 打開模版 index.htm
在適當的位置加
CODE: [复制]
--------------------------------------------------------------------------------
{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}-->
雪雪..
这两要一起安..
那第一帖的那模版 index.htm
要不要放..
要放在哪? 你喜欢放在哪就放在哪...
不过建议放在这里..
<table cellspacing="{TABLESPACE}" cellpadding="0" border="0" width="{TABLEWIDTH}" align="center">
<tr><td class="smalltxt">
{lang index_your} {lang credit_title} <span class="bold">$credit</span>
{lang credit_unit} / {lang index_status}: <span class="bold">$grouptitle</span>
<!--{if $invisible}-->
/ {lang login_invisible_mode}
<!--{/if}-->
<br>{lang timenow} $currenttime, {lang your_lastvisit} $lastvisittime</td>
<td align="right" nowrap valign="bottom">{lang total} <span class="bold">$threads</span> {lang index_threads}
/ <span class="bold">$posts</span> {lang index_posts} / <span class="bold">$totalmembers</span>
{lang index_members}<br><a href="search.php?srchfrom=$newthreads&searchsubmit=yes">{lang show_newthreads}</a> |
<!--{if $discuz_uid}--><a href="search.php?srchuid=$discuz_uid&srchfrom=604800&searchsubmit=yes">{lang show_mytopics}</a> | <!--{/if}-->
<a href="digest.php">{lang digest}</a> | <a href="member.php?action=markread">{lang mark_read}</a> {lang welcome_newmember} <a href="viewpro.php?username=$memberenc"><span class="bold">$lastmember</span></a><br>
</td></tr></table> 谢谢雪雪了...
[Ylei_Au05]
页:
[1]