AL8 Forum
»
Discuz 5.0 及 5.5 插件發佈
» AL8 首頁四格顯示 for Discuz 5.0.0 (2007.01.07 安全更新)
‹‹ 上一主題
|
下一主題 ››
434
1/22
1
2
3
4
5
6
7
8
9
10
››
›|
標題:
[D5.0]
AL8 首頁四格顯示 for Discuz 5.0.0 (2007.01.07 安全更新)
打印
|
推薦
|
訂閱
|
收藏
alan888
0000001
頭銜: Administrator
自述: skywalker
帖子: 24007
精華:
195
積分: 579305 點
現金: 78355890 元
存款: 144392954 元
閱讀權限: 120
註冊: 2003-11-13
來自: Hong Kong
狀態: 離線
#1
大
中
小
發表於 2006-10-1 01:35
資料
個人空間
主頁
短消息
加為好友
AL8 首頁四格顯示 for Discuz 5.0.0 (2007.01.07 安全更新)
凡於 2007.01.07 前修改者, 請按第二帖 "安全更新" 內容修改
繁體版
作 者: alan888
適用版本: Discuz 5.0.0
修改文件: index.php, logging.php, topicadmin.php, include/newthread.inc.php, include/newreply.inc.php, include/editpost.inc.php, include/counter.inc.php, include/cache.func.php, index 模板
加入文件: foruminfo 模板 (附件 1)
演 示:
AL8 Forum
本插件因是按本站的條件編寫, 故這插件不含安全登錄及驗証登陸, 但有連接到登入頁面
所以在下列動作時只會增加數據庫查詢 1-2 次:
1. 會員注冊: 1次 (當天注冊人數更新)
2. 會員登陸: 1次 (當天到訪人數更新)
3. 發新帖: 1次 (最新發表文章更新)
4. 回帖: 2次 (最新發表文章及最新回覆文章更新)
5. 管理動作執行: 2次 (最新發表文章及最新回覆文章更新)
本站曾經嘗試使用 Discuz 4 的 JS 調用功能, 但更新不及時而速度也跟本插件相若, 故最後還是使用此插件的辦法
注意:
1. 安裝此插件非常繁瑣, 對初學者不建議使用;
2. "是日到訪會員" 的數據是根據會員執行登入程序後更新, 如會員使用 cookies 登入, 數據會在下次其他會員使用登入程序後才更新;
3. 請子細閱讀每個安裝程序, 尤其修改 cache.func.php 部份
4. 四格顯示只提供快速登陸口, 但有安全登錄連接
5. 積分政策按兩種而設, 超過兩種左手邊第一格會較高, 可增加發帖及回帖的顯示數量平衡, 在 include/cache.func.php 內找 "DESC LIMIT 0,
11
" 將 11 (顯示 11 行) 改為修改後的行數
安裝程序
1. 修改 include/cache.func.php
修改完成此文件後請即時到後台→更新緩存
找
[Copy to clipboard]
[
-
]
CODE:
'medals' => array('medals')
更換為
[Copy to clipboard]
[
-
]
CODE:
'medals' => array('medals'),
'newtopic' => array('newtopic'),
'newreply' => array('newreply'),
'todayvisit' => array('todayvisit')
再找
[Copy to clipboard]
[
-
]
CODE:
case 'medals':
$table = 'medals';
$cols = 'medalid, name, image';
$conditions = "WHERE available='1'";
break;
在下面加上
(注意先填妥紅字部份)
填上不需要顯示帖子區域
由於使用快取檔型式, 故某些私密區不能判斷會員權限來顯示發帖及回帖, 所以要先修改及取代下紅字部份 "填上
不
需要顯示
帖子區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號" 部份, 例如希望不顯示 fid 1,3,5 便填上 "$fids="1,3,5";"
如果希望全部顯示者, 請將下兩段的
NOT IN ($fids)
(藍色字顯示部份)刪除, 否則會出現數據錯誤的顯示
QUOTE:
case newtopic:
$table = 'threads t, '.$tablepre.'forums f';
$cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
$fids="
填上
不
需要顯示發新帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號
";//例如 "1,2,3";
$conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) ORDER BY t.dateline DESC LIMIT 0, 11";
break;
case newreply:
$table = 'threads t, '.$tablepre.'forums f';
$cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
$fids="
填上
不
需要顯示回帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號
";//例如 "1,2,3";
$conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 11";
break;
case todayvisit:
$table = 'members';
$cols = "COUNT(*)";
$datecut = time() - (3600 * 24);
$conditions = "WHERE lastactivity>='$datecut' ORDER BY lastvisit DESC";
break;
找
[Copy to clipboard]
[
-
]
CODE:
$GLOBALS['totlamembers'] = $data['totalmembers'] = $db->result($query, 0);
在下面加上
[Copy to clipboard]
[
-
]
CODE:
$datecut = time() - (3600 * 24);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE regdate>='$datecut'");
$GLOBALS['todaynewmems'] = $data['todaynewmems'] = $db->result($query, 0);
找
[Copy to clipboard]
[
-
]
CODE:
case 'forumlinks':
$tightlink_text = $tightlink_logo = '';
上面加上
[Copy to clipboard]
[
-
]
CODE:
case 'newreply':
$hack_cut_str = 26;
$new_reply_threadlist = array();
$rthread = array();
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
while($rthread = $db->fetch_array($query)){
$rthread['forumname'] = $rthread['name'];
$rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
$rthread['subject'] = cutstr($rthread['subject'],46);
$rthread['date']= gmdate('Y-n-j G:i', $rthread['dateline'] + 8 * 3600);
$rthread['lastreplytime']= gmdate('Y-n-j G:i', $rthread['lastpost'] + 8 * 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 = "<a href=\"redirect.php?tid=$rthread[tid]&goto=lastpost#lastpost\" title=\"論壇: $rthread[forumname]\r\n標題: $rthread[subject]\r\n作者: $rthread[author]\r\n發表時間: $rthread[date]\r\n瀏覽次數: $rthread[views] 次\r\n回覆: $rthread[replies] 次\r\n最後回覆: $rthread[lastreplytime]\r\n最後發表: $rthread[lastposter]\" $rthread[highlight]>$rthread[view_subject]</a><br>";
$data[] = array('content' => $new_reply_threadlist);
}
break;
case 'newtopic':
$hack_cut_str = 26;
$new_post_threadlist = array();
$nthread = array();
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
while($nthread = $db->fetch_array($query)){
$nthread['forumname'] = $nthread['name'];
$nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
$nthread['subject'] = cutstr($nthread['subject'],46);
$nthread['date']= gmdate('Y-n-j G:i', $nthread['dateline'] + 8 * 3600);
$nthread['lastreplytime']= gmdate('Y-n-j G:i', $nthread[lastpost] + 8 * 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[replies] ? "<a href=\"redirect.php?tid=$nthread[tid]&goto=lastpost#lastpost\" title=\"論壇: $nthread[forumname]\r\n標題: $nthread[subject]\r\n作者: $nthread[author]\r\n發表時間: $nthread[date]\r\n瀏覽次數: $nthread[views] 次 \r\n回覆: $nthread[replies] 次\r\n最後回覆: $nthread[lastreplytime]\r\n最後發表: $nthread[lastposter]\" $nthread[highlight] >$nthread[view_subject]</a><br>" : "<a href=\"redirect.php?tid=$nthread[tid]&goto=lastpost#lastpost\" title=\"論壇: $nthread[forumname]\r\n標題: $nthread[subject]\r\n作者: $nthread[author]\r\n發表時間: $nthread[date]\r\n瀏覽次數: $nthread[views] 次\r\n回覆: 暫時沒有回覆\" $nthread[highlight] >$nthread[view_subject]</a><br>";
$data[] = array('content' => $new_post_threadlist);
}
break;
2. 修改 include/newthread.inc.php
找
[Copy to clipboard]
[
-
]
CODE:
showmessage('post_newthread_succeed', "viewthread.php?tid=$tid&extra=$extra");
在上面加上
[Copy to clipboard]
[
-
]
CODE:
require DISCUZ_ROOT.'./include/cache.func.php';
updatecache('newtopic');
3. 修改 include/newreply.inc.php
找
[Copy to clipboard]
[
-
]
CODE:
showmessage('post_reply_succeed', "viewthread.php?tid=$tid&pid=$pid&page=".(@ceil(($thread['replies'] + 2) / $ppp))."&extra=$extra#pid$pid");
在上面加上
[Copy to clipboard]
[
-
]
CODE:
require DISCUZ_ROOT.'./include/cache.func.php';
updatecache('newreply');
updatecache('newtopic');
4. 修改 include/editpost.inc.php
找到及刪除
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
找
[Copy to clipboard]
[
-
]
CODE:
$discuz_action = 13;
在下面加上
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
找
[Copy to clipboard]
[
-
]
CODE:
$db->query("DELETE FROM {$tablepre}polls WHERE tid='$tid'", 'UNBUFFERED');
在下面加上
[Copy to clipboard]
[
-
]
CODE:
updatecache('newtopic');
找
[Copy to clipboard]
[
-
]
CODE:
$db->query("UPDATE {$tablepre}threads SET replies=replies-1, attachment='$thread_attachment', lastposter='$lastpost[author]', lastpost='$lastpost[dateline]' WHERE tid='$tid'", 'UNBUFFERED');
在下面加上
[Copy to clipboard]
[
-
]
CODE:
updatecache('newreply');
updatecache('newtopic');
5. 修改 include/counter.inc.php
找
[Copy to clipboard]
[
-
]
CODE:
if(!$sessionexists) {
if(strpos($visitor['agent'], 'MSIE')) {
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], 'Netscape')) {
$visitor['browser'] = 'Netscape';
} elseif(strpos($visitor['agent'], 'Lynx')) {
$visitor['browser'] = 'Lynx';
} elseif(strpos($visitor['agent'], 'Opera')) {
$visitor['browser'] = 'Opera';
} elseif(strpos($visitor['agent'], 'Konqueror')) {
$visitor['browser'] = 'Konqueror';
} elseif(substr($visitor['agent'], 0, 7) == 'Mozilla') {
$visitor['browser'] = 'Mozilla';
} else {
$visitor['browser'] = 'Other';
}
if(strpos($visitor['agent'], 'Win')) {
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], 'Mac')) {
$visitor['os'] = 'Mac';
} elseif(strpos($visitor['agent'], 'Linux')) {
$visitor['os'] = 'Linux';
} elseif(strpos($visitor['agent'], 'FreeBSD')) {
$visitor['os'] = 'FreeBSD';
} elseif(strpos($visitor['agent'], 'SunOS')) {
$visitor['os'] = 'SunOS';
} elseif(strpos($visitor['agent'], 'OS/2')) {
$visitor['os'] = 'OS/2';
} elseif(strpos($visitor['agent'], 'AIX')) {
$visitor['os'] = 'AIX';
} elseif(preg_match("/(Bot|Crawl|Spider)/i", $visitor['agent'])) {
$visitor['os'] = 'Spiders';
} else {
$visitor['os'] = 'Other';
}
更換為
[Copy to clipboard]
[
-
]
CODE:
if(!$sessionexists || $discuz_uid) {
if(strpos($visitor['agent'], "MSIE 7.0")) {
$visitor_browser = "Internet Explorer 7.0";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "MSIE 6.0")) {
$visitor_browser = "Internet Explorer 6.0";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "MSIE 5.5")) {
$visitor_browser = "Internet Explorer 5.5";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "MSIE 5.0")) {
$visitor_browser = "Internet Explorer 5.0";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "MSIE 4.01")) {
$visitor_browser = "Internet Explorer 4.01";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "Netscape")) {
$visitor_browser = "Netscape";
$visitor['browser'] = 'Netscape';
} elseif(strpos($visitor['agent'], "Lynx")) {
$visitor_browser = "Lynx";
$visitor['browser'] = 'Lynx';
} elseif(strpos($visitor['agent'], "Opera")) {
$visitor_browser = "Opera";
$visitor['browser'] = 'Opera';
} elseif(strpos($visitor['agent'], "Konqueror")) {
$visitor_browser = "Konqueror";
$visitor['browser'] = 'Konqueror';
} elseif(strpos($visitor['agent'], "Firefox")) {
$visitor_browser = "Firefox";
$visitor['browser'] = 'Mozilla';
} elseif(strpos($visitor['agent'], "Mozilla/5.0")) {
$visitor_browser = "Mozilla";
$visitor['browser'] = 'Mozilla';
} else {
$visitor_browser = "其它";
$visitor['browser'] = 'Other';
}
if(strpos($visitor['agent'], "NT 5.1")) {
if(strpos($visitor['agent'], "SV1")){
$visitor_os = "Windows XP SP2";
$visitor['os'] = 'Windows';
}else{
$visitor_os = "Windows XP";
$visitor['os'] = 'Windows';
}
}elseif(strpos($visitor['agent'], "NT 6.0")) {
$visitor_os = "Win Vista";
$visitor['os'] = 'Windows';
}elseif(strpos($visitor['agent'], "NT 5.2")) {
$visitor_os = "Windows Server 2003";
$visitor['os'] = 'Windows';
}elseif(strpos($visitor['agent'], "NT 5")) {
$visitor_os = "Windows 2000";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "4.9")) {
$visitor_os = "Windows ME";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "NT 4")) {
$visitor_os = "Windows NT 4.0";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "98")) {
$visitor_os = "Windows 98";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "95")) {
$visitor_os = "Windows 95";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "Mac")) {
$visitor_os = "Mac";
$visitor['os'] = 'Mac';
} elseif(strpos($visitor['agent'], "Linux")) {
$visitor_os = "Linux";
$visitor['os'] = 'Linux';
} elseif(strpos($visitor['agent'], "Unix")) {
$visitor_os = "Unix";
$visitor['os'] = 'Other';
} elseif(strpos($visitor['agent'], "FreeBSD")) {
$visitor_os = "FreeBSD";
$visitor['os'] = 'FreeBSD';
} elseif(strpos($visitor['agent'], "SunOS")) {
$visitor_os = "SunOS";
$visitor['os'] = 'SunOS';
} elseif(strpos($visitor['agent'], "OS/2")) {
$visitor_os = "OS/2";
$visitor['os'] = 'OS/2';
}elseif(strpos($visitor['agent'], "AIX")) {
$visitor_os = "AIX";
$visitor['os'] = 'AIX';
} elseif(preg_match("/(Bot|Crawl|Spider)/i", $visitor['agent'])) {
$visitor_os = "Spiders";
$visitor['os'] = 'Spiders';
} else {
$visitor_os = "其他";
$visitor['os'] = 'Other';
}
6. 修改 topicadmin.php
找到及刪除
(共三處)
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
找
(是第一段約第 15 行那句)
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/misc.func.php';
在下面加上
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
找
[Copy to clipboard]
[
-
]
CODE:
showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), $resultarray['redirect']);
在上面加上
[Copy to clipboard]
[
-
]
CODE:
updatecache('newreply');
updatecache('newtopic');
7. 修改 logging.php
找
[Copy to clipboard]
[
-
]
CODE:
$sessionexists = 0;
在下面加上
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
updatecache('todayvisit');
8. 修改 index.php
找
[Copy to clipboard]
[
-
]
CODE:
$catlist = $forumlist = $sublist = array();
在上面加上
[Copy to clipboard]
[
-
]
CODE:
//-----------hack AL8 Info
if(!$statstatus && $discuz_uid){
require_once DISCUZ_ROOT.'./include/counter.inc.php';
}
require_once DISCUZ_ROOT.'./include/misc.func.php';
$mem_home = convertip($onlineip, $datadir = "./");
require_once DISCUZ_ROOT.'./forumdata/cache/cache_todayvisit.php';
$todayvisit=$_DCACHE['todayvisit']['0']['COUNT(*)'] ;
@include './forumdata/cache/cache_newtopic.php';
@include './forumdata/cache/cache_newreply.php';
//-----------hack AL8 Info End
找
[Copy to clipboard]
[
-
]
CODE:
'forumlinks', 'birthdays', 'supe_updateusers'
在後面插入
[Copy to clipboard]
[
-
]
CODE:
, 'foruminfo'
9. 修改 register.php
找
[Copy to clipboard]
[
-
]
CODE:
$styleid = $styleid ? $styleid : $_DCACHE['settings']['styleid'];
在下面加上
[Copy to clipboard]
[
-
]
CODE:
$datecut = time() - (3600 * 24);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE regdate>='$datecut'");
$todaynewmems = $db->result($query, 0);
找
[Copy to clipboard]
[
-
]
CODE:
updatesettings();
在上面加上
[Copy to clipboard]
[
-
]
CODE:
$_DCACHE['settings']['todaynewmems'] = $todaynewmems;
10. 修改 discuz 模板
找到及刪除
[Copy to clipboard]
[
-
]
CODE:
<div class="popupmenu_popup" id="creditlist_menu" style="display: none">
<table cellpadding="4" cellspacing="0" border="0">
<tr><td title='nohighlight' class="popupmenu_option">
{lang credits}: $credits<br>
<!--{loop $extcredits $id $credit}-->
$credit[title]: $GLOBALS[extcredits.$id] $credit[unit]<br>
<!--{/loop}-->
</td></tr></table></div>
找
[Copy to clipboard]
[
-
]
CODE:
<br>
{lang credits}: <span class="bold smalltxt">$credits</span> <span id="creditlist">{lang credits_detail}<script type="text/javascript">menuregister(false, "creditlist", true)</script></span> / {lang index_status}:
<!--{if $validdays}-->
<a href="member.php?action=groupexpiry"><span class="bold">$grouptitle</span>($validdays)</a>
<!--{else}-->
<span class="bold">$grouptitle</span><!--{/if}-->
<!--{if $allowinvisible && $discuz_uid}-->{lang online_status}:
<!--{if !empty($invisible)}-->
<a href="member.php?action=switchstatus" title="{lang login_switch_normal_mode}">{lang login_invisible_mode}</a>
<!--{else}-->
<a href="member.php?action=switchstatus" title="{lang login_switch_invisible_mode}">{lang login_normal_mode}</a>
<!--{/if}-->
<!--{/if}--><br>
{lang your_lastvisit} <span class="smalltxt">$lastvisittime</span><br>
</div>
<div class="right" style="line-height: 18px;">
<a href="search.php?srchfrom=$newthreads&searchsubmit=yes">{lang show_newthreads}</a> |
<!--{if $discuz_uid}-->
<!--{if $allowuseblog}-->
<a href="blog.php?uid=$discuz_uid" target="_blank">{lang blog}</a> |
<!--{/if}-->
<!--{/if}-->
<a href="digest.php">{lang digest}</a> |
<a href="member.php?action=markread">{lang mark_read}</a>
<!--{if $rssstatus}--><a href="rss.php?auth=$rssauth" target="_blank"><img src="images/common/xml.gif" border="0" class="absmiddle" alt="{lang rss_subscribe_all}" /></a><!--{/if}-->
<br>
{lang total} <span class="smalltxt">$threads</span> {lang index_threads} / <span class="smalltxt">$posts</span> {lang index_posts} / {lang index_today} <span class="smalltxt">$todayposts</span> {lang index_posts}<br>
{lang total} <span class="smalltxt">$totalmembers</span> {lang index_members} / {lang welcome_newmember} <a href="viewpro.php?username=$memberenc"><span class="bold">$lastmember</span></a>
</div>
</div><br>
<!--{if empty($gid)}-->
<!--{if !empty($announcements)}-->
<div id="announcement" style="clear: both; width: {TABLEWIDTH}">$announcements</div>
<script type="text/javascript">announcement();</script>
<!--{/if}-->
更換為
[Copy to clipboard]
[
-
]
CODE:
</div>
<div class="right" style="line-height: 18px;">
<!--{if !empty($stylejumpstatus)}-->
<select onchange="if(this.options[this.selectedIndex].value != '') {
<!--{if $rewritestatus && in_array(CURSCRIPT, array('forumdisplay', 'viewthread', 'viewpro'))}-->
<!--{echo "var thisurl = '".substr($_SERVER[SCRIPT_FILENAME], strrpos($_SERVER[SCRIPT_FILENAME], '/')+1).'?'.$_SERVER[QUERY_STRING]."'";}-->
<!--{else}-->
var thisurl = document.URL.replace(/[&?]styleid=.+?&sid=.+?$/i, '');
<!--{/if}-->
window.location=(thisurl.replace(/\#.+$/, '')+(thisurl.match(/\?/) ? '&' : '?')+'styleid='+this.options[this.selectedIndex].value+'&sid=$sid') }">
<option value="">{lang style}</option>
<option value="">----------</option>
<!--{loop $stylejump $id $name}-->
<option value="$id">$name</option>
<!--{/loop}-->
</select>
<!--{/if}-->
<!--{if $rssstatus}--> <a href="rss.php?auth=$rssauth" target="_blank"><img src="images/common/xml.gif" border="0" class="absmiddle" alt="{lang rss_subscribe_all}" /></a><!--{/if}-->
</div>
</div>
<!--{if empty($gid)}-->
{template foruminfo}<br>
<!--{/if}-->
<!--{if empty($gid)}-->
10. 下載附件 foruminfo.rar 及解壓為 foruminfo.htm, 並執行
a. 根據自身討論區對下一段作出調整
QUOTE:
來自 $mem_home 的訪客, 現{lang register}成為會員即獲贈現金 100 點, 用作參予本討論區的活動之用。
b. 上載至 templates/default 目錄下
c. 如果修改時漏了 "更新緩存"步驟, 可在 forumdata/cache 目錄下加回一個空白的 cache_todayvisit.php 檔案便可
~完成~
===========================================================================
简体版
AL8 首鴷|格显示 for Discuz 5.0.0
作 者: alan888
适用版本: Discuz 5.0.0
修改文件: index.php, logging.php, topicadmin.php, include/newthread.inc.php, include/newreply.inc.php, include/editpost.inc.php, include/counter.inc.php, include/cache.func.php, index 模板
加入文件: foruminfo 模板 (附件 1)
演 示:
AL8 Forum
本插件因是按本站的蟡编写, 故这插件不含安全登录及验证登陆, 但有连接到登入麰
所以在下列V作时只N增加数据库查{ 1-2 次:
1. N员注册: 1次 (当天注册人数更新)
2. N员登陆: 1次 (当天到访人数更新)
3. Y新帖: 1次 (最新Y表文章更新)
4. 回帖: 2次 (最新Y表文章及最新回覆文章更新)
5. 管理V作执行: 2次 (最新Y表文章及最新回覆文章更新)
本站曾r尝试使用 Discuz 4 的 JS 调用功能, 但更新不及时而速度也跟本插件相若, 故最后还是使用此插件的办法
注意:
1. 安あ僑‘颿D常繁琐, 对初a者不建议使用;
2. "是日到访N员" 的数据是根据N员执行登入程序后更新, 如N员使用 cookies 登入, 数据N在下次其他N员使用登入程序后才更新;
3. 请子细阅读每藻wけ{序, 尤其修改 cache.func.php 部份
4. 四格显示只提供快速登陆口, 但有安全登录连接
5. 积分政策按恘而z, 超过恘左手ㄡ臚@格N较高, 可增加Y帖及回帖的显示数量平衡, 在 include/cache.func.php 内找 "DESC LIMIT 0,
11
" 将 11 (显示 11 行) 改为修改后的行数
安け{序
1. 修改 include/cache.func.php
修改完成此文件后请即时到后台→更新缓存
找
[Copy to clipboard]
[
-
]
CODE:
'medals' => array('medals')
更换为
[Copy to clipboard]
[
-
]
CODE:
'medals' => array('medals'),
'newtopic' => array('newtopic'),
'newreply' => array('newreply'),
'todayvisit' => array('todayvisit')
再找
[Copy to clipboard]
[
-
]
CODE:
case 'medals':
$table = 'medals';
$cols = 'medalid, name, image';
$conditions = "WHERE available='1'";
break;
在下面加上
(注意先填妥红字部份)
填上不需要显示帖子区域
由于使用快取档型式, 故某些私密区不能判断N员权限来显示Y帖及回帖, 所以要先修改及取代下红字部份 "填上
不
需要显示
帖子区域的 fid 编, 以逗郁@分格, 最后一臚ㄔ峊[上逗" 部份, 例如希望不显示 fid 1,3,5 便填上 "$fids="1,3,5";"
如果希望全部显示者, 请将下峎q的
NOT IN ($fids)
(蓝色字显示部份)蝪, 否则N出现数据错误的显示
QUOTE:
case newtopic:
$table = 'threads t, '.$tablepre.'forums f';
$cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
$fids="
填上
不
需要显示Y新帖区域的 fid 编, 以逗郁@分格, 最后一臚ㄔ峊[上逗
";//例如 "1,2,3";
$conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) ORDER BY t.dateline DESC LIMIT 0, 11";
break;
case newreply:
$table = 'threads t, '.$tablepre.'forums f';
$cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
$fids="
填上
不
需要显示回帖区域的 fid 编, 以逗郁@分格, 最后一臚ㄔ峊[上逗
";//例如 "1,2,3";
$conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 11";
break;
case todayvisit:
$table = 'members';
$cols = "COUNT(*)";
$datecut = time() - (3600 * 24);
$conditions = "WHERE lastactivity>='$datecut' ORDER BY lastvisit DESC";
break;
找
[Copy to clipboard]
[
-
]
CODE:
$GLOBALS['totlamembers'] = $data['totalmembers'] = $db->result($query, 0);
在下面加上
[Copy to clipboard]
[
-
]
CODE:
$datecut = time() - (3600 * 24);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE regdate>='$datecut'");
$GLOBALS['todaynewmems'] = $data['todaynewmems'] = $db->result($query, 0);
找
[Copy to clipboard]
[
-
]
CODE:
case 'forumlinks':
$tightlink_text = $tightlink_logo = '';
上面加上
QUOTE:
case 'newreply':
$hack_cut_str = 26;
$new_reply_threadlist = array();
$rthread = array();
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
while($rthread = $db->fetch_array($query)){
$rthread['forumname'] = $rthread['name'];
$rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
$rthread['subject'] = cutstr($rthread['subject'],46);
$rthread['date']= gmdate('Y-n-j G:i', $rthread['dateline'] + 8 * 3600);
$rthread['lastreplytime']= gmdate('Y-n-j G:i', $rthread['lastpost'] + 8 * 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 = "<a href=\"redirect.php?tid=$rthread[tid]&goto=lastpost#lastpost\" title=\"论: $rthread[forumname]\r\n标题: $rthread[subject]\r\n作者: $rthread[author]\r\nY表时V: $rthread[date]\r\n浏览次数: $rthread[views] 次\r\n回复: $rthread[replies] 次\r\n最后回复: $rthread[lastreplytime]\r\n最后Y表: $rthread[lastposter]\" $rthread[highlight]>$rthread[view_subject]</a><br>";
$data[] = array('content' => $new_reply_threadlist);
}
break;
case 'newtopic':
$hack_cut_str = 26;
$new_post_threadlist = array();
$nthread = array();
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
while($nthread = $db->fetch_array($query)){
$nthread['forumname'] = $nthread['name'];
$nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
$nthread['subject'] = cutstr($nthread['subject'],46);
$nthread['date']= gmdate('Y-n-j G:i', $nthread['dateline'] + 8 * 3600);
$nthread['lastreplytime']= gmdate('Y-n-j G:i', $nthread[lastpost] + 8 * 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[replies] ? "<a href=\"redirect.php?tid=$nthread[tid]&goto=lastpost#lastpost\" title=\"论: $nthread[forumname]\r\n标题: $nthread[subject]\r\n作者: $nthread[author]\r\nY表时V: $nthread[date]\r\n浏览次数: $nthread[views] 次 \r\n回复: $nthread[replies] 次\r\n最后回复: $nthread[lastreplytime]\r\n最后发表: $nthread[lastposter]\" $nthread[highlight] >$nthread[view_subject]</a><br>" : "<a href=\"redirect.php?tid=$nthread[tid]&goto=lastpost#lastpost\" title=\"论: $nthread[forumname]\r\n标题: $nthread[subject]\r\n作者: $nthread[author]\r\n发表时间: $nthread[date]\r\n浏览次数: $nthread[views] 次\r\n回复: 暂时没有回复\" $nthread[highlight] >$nthread[view_subject]</a><br>";
$data[] = array('content' => $new_post_threadlist);
}
break;
2. 修改 include/newthread.inc.php
找
[Copy to clipboard]
[
-
]
CODE:
showmessage('post_newthread_succeed', "viewthread.php?tid=$tid&extra=$extra");
在上面加上
[Copy to clipboard]
[
-
]
CODE:
require DISCUZ_ROOT.'./include/cache.func.php';
updatecache('newtopic');
3. 修改 include/newreply.inc.php
找
[Copy to clipboard]
[
-
]
CODE:
showmessage('post_reply_succeed', "viewthread.php?tid=$tid&pid=$pid&page=".(@ceil(($thread['replies'] + 2) / $ppp))."&extra=$extra#pid$pid");
在上面加上
[Copy to clipboard]
[
-
]
CODE:
require DISCUZ_ROOT.'./include/cache.func.php';
updatecache('newreply');
updatecache('newtopic');
4. 修改 include/editpost.inc.php
找到及蝪
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
找
[Copy to clipboard]
[
-
]
CODE:
$discuz_action = 13;
在下面加上
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
找
[Copy to clipboard]
[
-
]
CODE:
$db->query("DELETE FROM {$tablepre}polls WHERE tid='$tid'", 'UNBUFFERED');
在下面加上
[Copy to clipboard]
[
-
]
CODE:
updatecache('newtopic');
找
[Copy to clipboard]
[
-
]
CODE:
$db->query("UPDATE {$tablepre}threads SET replies=replies-1, attachment='$thread_attachment', lastposter='$lastpost[author]', lastpost='$lastpost[dateline]' WHERE tid='$tid'", 'UNBUFFERED');
在下面加上
[Copy to clipboard]
[
-
]
CODE:
updatecache('newreply');
updatecache('newtopic');
5. 修改 include/counter.inc.php
找
[Copy to clipboard]
[
-
]
CODE:
if(!$sessionexists) {
if(strpos($visitor['agent'], 'MSIE')) {
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], 'Netscape')) {
$visitor['browser'] = 'Netscape';
} elseif(strpos($visitor['agent'], 'Lynx')) {
$visitor['browser'] = 'Lynx';
} elseif(strpos($visitor['agent'], 'Opera')) {
$visitor['browser'] = 'Opera';
} elseif(strpos($visitor['agent'], 'Konqueror')) {
$visitor['browser'] = 'Konqueror';
} elseif(substr($visitor['agent'], 0, 7) == 'Mozilla') {
$visitor['browser'] = 'Mozilla';
} else {
$visitor['browser'] = 'Other';
}
if(strpos($visitor['agent'], 'Win')) {
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], 'Mac')) {
$visitor['os'] = 'Mac';
} elseif(strpos($visitor['agent'], 'Linux')) {
$visitor['os'] = 'Linux';
} elseif(strpos($visitor['agent'], 'FreeBSD')) {
$visitor['os'] = 'FreeBSD';
} elseif(strpos($visitor['agent'], 'SunOS')) {
$visitor['os'] = 'SunOS';
} elseif(strpos($visitor['agent'], 'OS/2')) {
$visitor['os'] = 'OS/2';
} elseif(strpos($visitor['agent'], 'AIX')) {
$visitor['os'] = 'AIX';
} elseif(preg_match("/(Bot|Crawl|Spider)/i", $visitor['agent'])) {
$visitor['os'] = 'Spiders';
} else {
$visitor['os'] = 'Other';
}
更换为
[Copy to clipboard]
[
-
]
CODE:
if(!$sessionexists || $discuz_uid) {
if(strpos($visitor['agent'], "MSIE 7.0")) {
$visitor_browser = "Internet Explorer 7.0";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "MSIE 6.0")) {
$visitor_browser = "Internet Explorer 6.0";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "MSIE 5.5")) {
$visitor_browser = "Internet Explorer 5.5";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "MSIE 5.0")) {
$visitor_browser = "Internet Explorer 5.0";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "MSIE 4.01")) {
$visitor_browser = "Internet Explorer 4.01";
$visitor['browser'] = 'MSIE';
} elseif(strpos($visitor['agent'], "Netscape")) {
$visitor_browser = "Netscape";
$visitor['browser'] = 'Netscape';
} elseif(strpos($visitor['agent'], "Lynx")) {
$visitor_browser = "Lynx";
$visitor['browser'] = 'Lynx';
} elseif(strpos($visitor['agent'], "Opera")) {
$visitor_browser = "Opera";
$visitor['browser'] = 'Opera';
} elseif(strpos($visitor['agent'], "Konqueror")) {
$visitor_browser = "Konqueror";
$visitor['browser'] = 'Konqueror';
} elseif(strpos($visitor['agent'], "Firefox")) {
$visitor_browser = "Firefox";
$visitor['browser'] = 'Mozilla';
} elseif(strpos($visitor['agent'], "Mozilla/5.0")) {
$visitor_browser = "Mozilla";
$visitor['browser'] = 'Mozilla';
} else {
$visitor_browser = "其它";
$visitor['browser'] = 'Other';
}
if(strpos($visitor['agent'], "NT 5.1")) {
if(strpos($visitor['agent'], "SV1")){
$visitor_os = "Windows XP SP2";
$visitor['os'] = 'Windows';
}else{
$visitor_os = "Windows XP";
$visitor['os'] = 'Windows';
}
}elseif(strpos($visitor['agent'], "NT 6.0")) {
$visitor_os = "Win Vista";
$visitor['os'] = 'Windows';
}elseif(strpos($visitor['agent'], "NT 5.2")) {
$visitor_os = "Windows Server 2003";
$visitor['os'] = 'Windows';
}elseif(strpos($visitor['agent'], "NT 5")) {
$visitor_os = "Windows 2000";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "4.9")) {
$visitor_os = "Windows ME";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "NT 4")) {
$visitor_os = "Windows NT 4.0";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "98")) {
$visitor_os = "Windows 98";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "95")) {
$visitor_os = "Windows 95";
$visitor['os'] = 'Windows';
} elseif(strpos($visitor['agent'], "Mac")) {
$visitor_os = "Mac";
$visitor['os'] = 'Mac';
} elseif(strpos($visitor['agent'], "Linux")) {
$visitor_os = "Linux";
$visitor['os'] = 'Linux';
} elseif(strpos($visitor['agent'], "Unix")) {
$visitor_os = "Unix";
$visitor['os'] = 'Other';
} elseif(strpos($visitor['agent'], "FreeBSD")) {
$visitor_os = "FreeBSD";
$visitor['os'] = 'FreeBSD';
} elseif(strpos($visitor['agent'], "SunOS")) {
$visitor_os = "SunOS";
$visitor['os'] = 'SunOS';
} elseif(strpos($visitor['agent'], "OS/2")) {
$visitor_os = "OS/2";
$visitor['os'] = 'OS/2';
}elseif(strpos($visitor['agent'], "AIX")) {
$visitor_os = "AIX";
$visitor['os'] = 'AIX';
} elseif(preg_match("/(Bot|Crawl|Spider)/i", $visitor['agent'])) {
$visitor_os = "Spiders";
$visitor['os'] = 'Spiders';
} else {
$visitor_os = "其他";
$visitor['os'] = 'Other';
}
6. 修改 topicadmin.php
找到及蝪
(共三])
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
找
(是第一段约第 15 行那句)
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/misc.func.php';
在下面加上
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
找
[Copy to clipboard]
[
-
]
CODE:
showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), $resultarray['redirect']);
在上面加上
[Copy to clipboard]
[
-
]
CODE:
updatecache('newreply');
updatecache('newtopic');
7. 修改 logging.php
找
[Copy to clipboard]
[
-
]
CODE:
$sessionexists = 0;
在下面加上
[Copy to clipboard]
[
-
]
CODE:
require_once DISCUZ_ROOT.'./include/cache.func.php';
updatecache('todayvisit');
8. 修改 index.php
找
[Copy to clipboard]
[
-
]
CODE:
$catlist = $forumlist = $sublist = array();
在上面加上
[Copy to clipboard]
[
-
]
CODE:
//-----------hack AL8 Info
if(!$statstatus && $discuz_uid){
require_once DISCUZ_ROOT.'./include/counter.inc.php';
}
require_once DISCUZ_ROOT.'./include/misc.func.php';
$mem_home = convertip($onlineip, $datadir = "./");
require_once DISCUZ_ROOT.'./forumdata/cache/cache_todayvisit.php';
$todayvisit=$_DCACHE['todayvisit']['0']['COUNT(*)'] ;
@include './forumdata/cache/cache_newtopic.php';
@include './forumdata/cache/cache_newreply.php';
//-----------hack AL8 Info End
找
[Copy to clipboard]
[
-
]
CODE:
'forumlinks', 'birthdays', 'supe_updateusers'
在后面插入
[Copy to clipboard]
[
-
]
CODE:
, 'foruminfo'
9. 修改 register.php
找
[Copy to clipboard]
[
-
]
CODE:
$styleid = $styleid ? $styleid : $_DCACHE['settings']['styleid'];
在下面加上
[Copy to clipboard]
[
-
]
CODE:
$datecut = time() - (3600 * 24);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE regdate>='$datecut'");
$todaynewmems = $db->result($query, 0);
找
[Copy to clipboard]
[
-
]
CODE:
updatesettings();
在上面加上
[Copy to clipboard]
[
-
]
CODE:
$_DCACHE['settings']['todaynewmems'] = $todaynewmems;
10. 修改 discuz 模板
找到及蝪
[Copy to clipboard]
[
-
]
CODE:
<div class="popupmenu_popup" id="creditlist_menu" style="display: none">
<table cellpadding="4" cellspacing="0" border="0">
<tr><td title='nohighlight' class="popupmenu_option">
{lang credits}: $credits<br>
<!--{loop $extcredits $id $credit}-->
$credit[title]: $GLOBALS[extcredits.$id] $credit[unit]<br>
<!--{/loop}-->
</td></tr></table></div>
找
[Copy to clipboard]
[
-
]
CODE:
<br>
{lang credits}: <span class="bold smalltxt">$credits</span> <span id="creditlist">{lang credits_detail}<script type="text/javascript">menuregister(false, "creditlist", true)</script></span> / {lang index_status}:
<!--{if $validdays}-->
<a href="member.php?action=groupexpiry"><span class="bold">$grouptitle</span>($validdays)</a>
<!--{else}-->
<span class="bold">$grouptitle</span><!--{/if}-->
<!--{if $allowinvisible && $discuz_uid}-->{lang online_status}:
<!--{if !empty($invisible)}-->
<a href="member.php?action=switchstatus" title="{lang login_switch_normal_mode}">{lang login_invisible_mode}</a>
<!--{else}-->
<a href="member.php?action=switchstatus" title="{lang login_switch_invisible_mode}">{lang login_normal_mode}</a>
<!--{/if}-->
<!--{/if}--><br>
{lang your_lastvisit} <span class="smalltxt">$lastvisittime</span><br>
</div>
<div class="right" style="line-height: 18px;">
<a href="search.php?srchfrom=$newthreads&searchsubmit=yes">{lang show_newthreads}</a> |
<!--{if $discuz_uid}-->
<!--{if $allowuseblog}-->
<a href="blog.php?uid=$discuz_uid" target="_blank">{lang blog}</a> |
<!--{/if}-->
<!--{/if}-->
<a href="digest.php">{lang digest}</a> |
<a href="member.php?action=markread">{lang mark_read}</a>
<!--{if $rssstatus}--><a href="rss.php?auth=$rssauth" target="_blank"><img src="images/common/xml.gif" border="0" class="absmiddle" alt="{lang rss_subscribe_all}" /></a><!--{/if}-->
<br>
{lang total} <span class="smalltxt">$threads</span> {lang index_threads} / <span class="smalltxt">$posts</span> {lang index_posts} / {lang index_today} <span class="smalltxt">$todayposts</span> {lang index_posts}<br>
{lang total} <span class="smalltxt">$totalmembers</span> {lang index_members} / {lang welcome_newmember} <a href="viewpro.php?username=$memberenc"><span class="bold">$lastmember</span></a>
</div>
</div><br>
<!--{if empty($gid)}-->
<!--{if !empty($announcements)}-->
<div id="announcement" style="clear: both; width: {TABLEWIDTH}">$announcements</div>
<script type="text/javascript">announcement();</script>
<!--{/if}-->
更换为
[Copy to clipboard]
[
-
]
CODE:
</div>
<div class="right" style="line-height: 18px;">
<!--{if !empty($stylejumpstatus)}-->
<select onchange="if(this.options[this.selectedIndex].value != '') {
<!--{if $rewritestatus && in_array(CURSCRIPT, array('forumdisplay', 'viewthread', 'viewpro'))}-->
<!--{echo "var thisurl = '".substr($_SERVER[SCRIPT_FILENAME], strrpos($_SERVER[SCRIPT_FILENAME], '/')+1).'?'.$_SERVER[QUERY_STRING]."'";}-->
<!--{else}-->
var thisurl = document.URL.replace(/[&?]styleid=.+?&sid=.+?$/i, '');
<!--{/if}-->
window.location=(thisurl.replace(/\#.+$/, '')+(thisurl.match(/\?/) ? '&' : '?')+'styleid='+this.options[this.selectedIndex].value+'&sid=$sid') }">
<option value="">{lang style}</option>
<option value="">----------</option>
<!--{loop $stylejump $id $name}-->
<option value="$id">$name</option>
<!--{/loop}-->
</select>
<!--{/if}-->
<!--{if $rssstatus}--> <a href="rss.php?auth=$rssauth" target="_blank"><img src="images/common/xml.gif" border="0" class="absmiddle" alt="{lang rss_subscribe_all}" /></a><!--{/if}-->
</div>
</div>
<!--{if empty($gid)}-->
{template foruminfo}<br>
<!--{/if}-->
<!--{if empty($gid)}-->
10. 下载附件 foruminfo.rar 及解压为 foruminfo.htm, 并执行
a. 根据自身讨论区对下一段作出调整
QUOTE:
来自 $mem_home 的访客, 现{lang register}成为N员即获赠现金 100 , 用作諵岩讨论区的活V之用。
b. 上载至 templates/default 目录下
c. 如果修改时漏了 "更新缓存"步骤, 可在 forumdata/cache 目录下加回一蘆聽晡 cache_todayvisit.php 档案便可
~完成~
附件:
您所在的用戶組無法下載或查看附件
AL8 Forum © All rights reserved.
alan888
0000001
頭銜: Administrator
自述: skywalker
帖子: 24007
精華:
195
積分: 579305 點
現金: 78355890 元
存款: 144392954 元
閱讀權限: 120
註冊: 2003-11-13
來自: Hong Kong
狀態: 離線
#2
大
中
小
發表於 2006-10-1 01:36
資料
個人空間
主頁
短消息
加為好友
QUOTE:
安全更新
凡於 2007.01.07 前修改者, 請如下修改
include/newthread.inc.php 及 include/newreply.inc.php
找
[Copy to clipboard]
[
-
]
CODE:
$discuz_root
更換為
[Copy to clipboard]
[
-
]
CODE:
DISCUZ_ROOT
FAQ
QUOTE:
[Copy to clipboard]
[
-
]
CODE:
錯誤顯示
Fatal error: Cannot redeclare arrayeval() (previously declared in /include/cache.func.php:21)
原因
[Copy to clipboard]
[
-
]
CODE:
刪除漏了下一段 或 其他插件又加上與下一段相同的語法
require DISCUZ_ROOT.'./include/cache.func.php';
解決辦法
QUOTE:
先刪除那文件所有類似的上一段的語法, 然後再在 $discuz_action 下面 require xxx 語法下加回
[Copy to clipboard]
[
-
]
CODE:
require DISCUZ_ROOT.'./include/cache.func.php';
QUOTE:
[Copy to clipboard]
[
-
]
CODE:
錯誤
論壇公告不滾動及全部顯示出來
解決辦法
[Copy to clipboard]
[
-
]
CODE:
按一下刷新頁面
QUOTE:
[Copy to clipboard]
[
-
]
CODE:
問題
會員資料有兩行積分
原因
[Copy to clipboard]
[
-
]
CODE:
其中一個是積分策略 (extcredits) 的積分, 而另一個是總積分
QUOTE:
QUOTE:
問題:
如何在 "最新發表文章" 及 "最新回覆文章" 加上 "主題分類
include/cache.func.php
找
[Copy to clipboard]
[
-
]
CODE:
case newtopic:
$table = 'threads t, cdb_forums f';
$cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
$fids="填上不需要顯示發新帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";//例如 "1,2,3";
$conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) ORDER BY t.dateline DESC LIMIT 0, 11";
break;
case newreply:
$table = 'threads t, cdb_forums f';
$cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
$fids="填上不需要顯示回帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";//例如 "1,2,3";
$conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 11";
break;
更換為
[Copy to clipboard]
[
-
]
CODE:
case newtopic:
$table = 'threads t';
$cols = "t.tid, t.typeid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name, tt.name AS idname";
$fids="填上不需要顯示發新帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";//例如 "1,2,3";
$conditions = "LEFT JOIN {$tablepre}threadtypes tt ON (tt.typeid=t.typeid) LEFT JOIN {$tablepre}forums f ON (f.fid=t.fid) WHERE t.fid<>'$fid' AND f.fid NOT IN ($fids) ORDER BY t.dateline DESC LIMIT 0, 11";
break;
case newreply:
$table = 'threads t';
$cols = "t.tid, t.typeid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name, tt.name AS idname";
$fids="填上不需要顯示回帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";//例如 "1,2,3";
$conditions = "LEFT JOIN {$tablepre}threadtypes tt ON (tt.typeid=t.typeid) LEFT JOIN {$tablepre}forums f ON (f.fid=t.fid) WHERE t.fid<>'$fid' AND f.fid NOT IN ($fids) AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 11";
break;
找
[Copy to clipboard]
[
-
]
CODE:
$rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
更換為
[Copy to clipboard]
[
-
]
CODE:
$rthread['view_subject'] = $rthread[idname] ? cutstr( "[$rthread[idname]] $rthread[subject]",$hack_cut_str) : cutstr($rthread['subject'],$hack_cut_str);
找
[Copy to clipboard]
[
-
]
CODE:
$nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
更換為
[Copy to clipboard]
[
-
]
CODE:
$nthread['view_subject'] = $nthread[idname] ? cutstr( "[$nthread[idname]] $nthread[subject]",$hack_cut_str) : cutstr($nthread['subject'],$hack_cut_str);
在下次更新時 (或到後台->更新緩存) 便會顯示
QUOTE:
如何更改最新發表,最新回覆的顯示字數
修改 include/cache.func.php
最新回覆找到修改下紅字部份
QUOTE:
case 'newreply':
$hack_cut_str =
26
;
最新發表找到修改下紅字部份
QUOTE:
case 'newtopic':
$hack_cut_str =
26
;
QUOTE:
本站發放的 Air 及 Leobbs 兩個風格的 discuz 模板應如何修改
QUOTE:
感謝本站會員
zmzmzmzmzm
提供
Air: 本帖的第 112 帖
Leobbs: 本帖的第 113 帖
QUOTE:
因使用了 htm 語法而做成 "最新發表文章" 及 "最新回覆文章" 的顯示不正常解決辦法
修改 cache.func.php
[Copy to clipboard]
[
-
]
CODE:
$rthread['highlight'] = '';
}
下面加
[Copy to clipboard]
[
-
]
CODE:
$rthread[forumname] = preg_replace("/\<font color=([^\[\<]+?)\>/i", '', $rthread[forumname]);
$rthread[forumname] = preg_replace("/\<\/font\>/i", '', $rthread[forumname]);
[Copy to clipboard]
[
-
]
CODE:
$nthread['highlight'] = '';
}
下面加
[Copy to clipboard]
[
-
]
CODE:
$nthread[forumname] = preg_replace("/\<font color=([^\[\<]+?)\>/i", '', $rthread[forumname]);
$nthread[forumname] = preg_replace("/\<\/font\>/i", '', $rthread[forumname]);
AL8 Forum © All rights reserved.
hklcsky
0041970
頭銜: Forum Legend
帖子: 3219
精華:
1
積分: 16830 點
現金: 8866 元
存款: 8888 元
閱讀權限: 70
註冊: 2006-3-19
狀態: 離線
#3
大
中
小
發表於 2006-10-1 01:37
資料
個人空間
主頁
短消息
加為好友
頭位,.
完來我既裝法同你一樣
[
本帖最後由 hklcsky 於 2006-10-1 13:34 編輯
]
<b>創新思維,無限設計;
解答問題,儘力而為。
↑By hklcsky
AL8 Forum © All rights reserved.
piggwest
0019754
頭銜: Conqueror
帖子: 262
精華: 0
積分: 2660 點
現金: 45 元
存款: 0 元
閱讀權限: 20
註冊: 2005-4-24
狀態: 離線
#4
大
中
小
發表於 2006-10-1 01:38
資料
個人空間
短消息
加為好友
3rd~~~~~~~~~
GOGOGOO.com
AL8 Forum © All rights reserved.
KFORUM.
0043885
頭銜: Forum Legend
帖子: 2571
精華: 0
積分: 18000 點
現金: 684 元
存款: 42 元
閱讀權限: 70
註冊: 2006-4-22
狀態: 離線
#5
大
中
小
發表於 2006-10-1 01:40
資料
個人空間
短消息
加為好友
4th..支持啊
AL8 Forum © All rights reserved.
piggwest
0019754
頭銜: Conqueror
帖子: 262
精華: 0
積分: 2660 點
現金: 45 元
存款: 0 元
閱讀權限: 20
註冊: 2005-4-24
狀態: 離線
#6
大
中
小
發表於 2006-10-1 01:46
資料
個人空間
短消息
加為好友
說明寫...填上不需要顯示帖子區域
但..
$fids="填上需要顯示發新帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";//例如 "1,2,3";
???
GOGOGOO.com
AL8 Forum © All rights reserved.
alan888
0000001
頭銜: Administrator
自述: skywalker
帖子: 24007
精華:
195
積分: 579305 點
現金: 78355890 元
存款: 144392954 元
閱讀權限: 120
註冊: 2003-11-13
來自: Hong Kong
狀態: 離線
#7
大
中
小
發表於 2006-10-1 01:49
資料
個人空間
主頁
短消息
加為好友
回覆 #6 piggwest 的帖子
填不顯示就得, 因為之前好多人話要填好多, 所以這版改了
AL8 Forum © All rights reserved.
hklcsky
0041970
頭銜: Forum Legend
帖子: 3219
精華:
1
積分: 16830 點
現金: 8866 元
存款: 8888 元
閱讀權限: 70
註冊: 2006-3-19
狀態: 離線
#8
大
中
小
發表於 2006-10-1 01:50
資料
個人空間
主頁
短消息
加為好友
QUOTE:
原帖由
alan888
於 2006-10-1 01:49 發表。
填不顯示就得, 因為之前好多人話要填好多, 所以這版改了
你小了hide藍色部份
如果刪左
刪埋
$fids="填上需要顯示發新帖區域的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";//例如 "1,2,3";
行唔行到??
仲有
我唔明個
todayvisit.php
點解無啦啦會彈出
<b>創新思維,無限設計;
解答問題,儘力而為。
↑By hklcsky
AL8 Forum © All rights reserved.
Cutthroat
0045173
頭銜: Forum Legend
暱稱: 無知的人
自述: 我不懂 php
帖子: 1837
精華: 0
積分: 8190 點
現金: 2 元
存款: 31557 元
閱讀權限: 70
註冊: 2006-5-17
來自: Taiwan
狀態: 離線
#9
大
中
小
發表於 2006-10-1 01:51
資料
個人空間
主頁
短消息
加為好友
在下面加上 (注意先填妥紅字部份)
填上不需要顯示帖子區域
由於使用快取檔型式, 故某些私密區不能判斷會員權限來顯示發帖及回帖, 所以要先修改及取代下紅字部份 "
填上不需要顯示帖子區域
的 fid 編號, 以逗號作分格, 最後一個不用加上逗號" 部份, 例如希望不顯示 fid 1,3,5 便填上 "$fids="1,3,5";"
如果希望全部顯示者, 請將下兩段的 NOT IN ($fids) (藍色字顯示部份)刪除, 否則會出現數據錯誤的顯示
QUOTE:
case newtopic:
$table = 'threads t, cdb_forums f';
$cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
$fids="
填上需要顯示發新帖區域
的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";//例如 "1,2,3";
$conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) ORDER BY t.dateline DESC LIMIT 0, 11";
break;
case newreply:
$table = 'threads t, cdb_forums f';
$cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
$fids="
填上需要顯示回帖區域
的 fid 編號, 以逗號作分格, 最後一個不用加上逗號";//例如 "1,2,3";
$conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN ($fids) AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 11";
break;
case todayvisit:
$table = 'members';
$cols = "COUNT(*)";
$datecut = time() - (3600 * 24);
$conditions = "WHERE lastactivity>='$datecut' ORDER BY lastvisit DESC";
break;
標題說是填上不需顯示 , 但 Quote 裡又寫 填上需要顯示發新帖區域 , 填上需要顯示回帖區域 , 都弄糊塗了 !
到底是填需要顯示的還是填不需顯示的
AL8 Forum © All rights reserved.
alan888
0000001
頭銜: Administrator
自述: skywalker
帖子: 24007
精華:
195
積分: 579305 點
現金: 78355890 元
存款: 144392954 元
閱讀權限: 120
註冊: 2003-11-13
來自: Hong Kong
狀態: 離線
#10
大
中
小
發表於 2006-10-1 01:51
資料
個人空間
主頁
短消息
加為好友
回覆 #3 hklcsky 的帖子
點彈出來???
AL8 Forum © All rights reserved.
alan888
0000001
頭銜: Administrator
自述: skywalker
帖子: 24007
精華:
195
積分: 579305 點
現金: 78355890 元
存款: 144392954 元
閱讀權限: 120
註冊: 2003-11-13
來自: Hong Kong
狀態: 離線
#11
大
中
小
發表於 2006-10-1 01:53
資料
個人空間
主頁
短消息
加為好友
回覆 #8 hklcsky 的帖子
刪唔刪 $fid 都冇問題, 因為唔 call 佢而已
AL8 Forum © All rights reserved.
Linux0911
0010277
頭銜: Honorary Admin
暱稱: Server ...
自述: 研究生
帖子: 2617
精華: 0
積分: 10130 點
現金: 848 元
存款: 326686 元
閱讀權限: 120
註冊: 2004-10-23
狀態: 離線
#12
大
中
小
發表於 2006-10-1 01:55
資料
個人空間
主頁
短消息
加為好友
先推一下,明晚再測試
仔細閱讀文章的安裝步驟, 一定是漏了某個步驟
註冊日期:2004年10曰23日, 16時19分
http://linux0911.no-ip.info
AL8 Forum © All rights reserved.
hklcsky
0041970
頭銜: Forum Legend
帖子: 3219
精華:
1
積分: 16830 點
現金: 8866 元
存款: 8888 元
閱讀權限: 70
註冊: 2006-3-19
狀態: 離線
#13
大
中
小
發表於 2006-10-1 01:55
資料
個人空間
主頁
短消息
加為好友
QUOTE:
原帖由
alan888
於 2006-10-1 01:51 發表。
點彈出來???
不是 我應該問
你+左個cache
你都冇文件出個今日到訪會員記錄既list 咁..
個todayvisit呢個code有咩用!?
<b>創新思維,無限設計;
解答問題,儘力而為。
↑By hklcsky
AL8 Forum © All rights reserved.
alan888
0000001
頭銜: Administrator
自述: skywalker
帖子: 24007
精華:
195
積分: 579305 點
現金: 78355890 元
存款: 144392954 元
閱讀權限: 120
註冊: 2003-11-13
來自: Hong Kong
狀態: 離線
#14
大
中
小
發表於 2006-10-1 01:57
資料
個人空間
主頁
短消息
加為好友
回覆 #13 hklcsky 的帖子
call 個 todayvisit 人數, 其實可以做多 d 野, 不過又是時間問題
AL8 Forum © All rights reserved.
hklcsky
0041970
頭銜: Forum Legend
帖子: 3219
精華:
1
積分: 16830 點
現金: 8866 元
存款: 8888 元
閱讀權限: 70
註冊: 2006-3-19
狀態: 離線
#15
大
中
小
發表於 2006-10-1 02:02
資料
個人空間
主頁
短消息
加為好友
QUOTE:
原帖由
alan888
於 2006-10-1 01:57 發表。
call 個 todayvisit 人數
你呢個4格原來唔包list嫁
我之前仲以為dz原來包$todayvisit 呢
幾時出
http://www.alan888.com/Discuz/todayvisit.php?action=list&order=lastactivity&desc=desc
呢個
<b>創新思維,無限設計;
解答問題,儘力而為。
↑By hklcsky
AL8 Forum © All rights reserved.
alan888
0000001
頭銜: Administrator
自述: skywalker
帖子: 24007
精華:
195
積分: 579305 點
現金: 78355890 元
存款: 144392954 元
閱讀權限: 120
註冊: 2003-11-13
來自: Hong Kong
狀態: 離線
#16
大
中
小
發表於 2006-10-1 02:04
資料
個人空間
主頁
短消息
加為好友
之前好似都冇
AL8 Forum © All rights reserved.
hklcsky
0041970
頭銜: Forum Legend
帖子: 3219
精華:
1
積分: 16830 點
現金: 8866 元
存款: 8888 元
閱讀權限: 70
註冊: 2006-3-19
狀態: 離線
#17
大
中
小
發表於 2006-10-1 02:09
資料
個人空間
主頁
短消息
加為好友
QUOTE:
原帖由
alan888
於 2006-10-1 02:04 發表。
之前好似都冇
我建議你改返onMouse去返td到...
如果唔係會好怪
<b>創新思維,無限設計;
解答問題,儘力而為。
↑By hklcsky
AL8 Forum © All rights reserved.
別問我是誰
0005547
頭銜: Honorary Admin
帖子: 9332
精華: 0
積分: 126625 點
現金: 648 元
存款: 47195 元
閱讀權限: 120
註冊: 2004-8-15
狀態: 離線
#18
大
中
小
發表於 2006-10-1 02:13
資料
個人空間
短消息
加為好友
QUOTE:
原帖由
hklcsky
於 2006-10-1 02:09 發表。
我建議你改返onMouse去返td到...
如果唔係會好怪
戇翰芊@
呢句英文我識
小莫小於水滴 自成大海汪洋
細莫細於沙粒 自成大地四方
勤檢就是美德 儲蓄可以致富
莫等閒 白了少年頭 空悲切
AL8 Forum © All rights reserved.
hklcsky
0041970
頭銜: Forum Legend
帖子: 3219
精華:
1
積分: 16830 點
現金: 8866 元
存款: 8888 元
閱讀權限: 70
註冊: 2006-3-19
狀態: 離線
#19
大
中
小
發表於 2006-10-1 02:17
資料
個人空間
主頁
短消息
加為好友
QUOTE:
原帖由
別問我是誰
於 2006-10-1 02:13 發表。
戇翰芊@
呢句英文我識
Q33NY
<b>創新思維,無限設計;
解答問題,儘力而為。
↑By hklcsky
AL8 Forum © All rights reserved.
gn01752
0037540
頭銜: Forum Legend
帖子: 1255
精華: 0
積分: 14725 點
現金: 0 元
存款: 0 元
閱讀權限: 70
註冊: 2005-12-25
來自: 昨
狀態: 離線
#20
大
中
小
發表於 2006-10-1 02:32
資料
個人空間
主頁
短消息
加為好友
太感謝了...
1
AL8 Forum © All rights reserved.
434
1/22
1
2
3
4
5
6
7
8
9
10
››
›|
最近訪問的論壇 ...
Discuz 6.0 及 6.1 插件發佈
影音設備
Discuz 6.0 及 6.1 研究及討論
聯繫我們
-
AL8 Forum
- 網頁空間由
I-SERVICES
提供 -
Archiver
-
WAP
界面風格
----------
默認風格
Air
Leobbs
Christmas
清除 Cookies
, 當前時區 GMT+8, 現在時間是 2010-9-3 15:28
Processed in 0.083958 second(s), 9 queries , Gzip enabled
Powered by
Discuz!
5.5.0
© 2001-2007
Comsenz Inc.