 |
 |
ntf
0043014
頭銜: Moderator

自述: ntf

帖子: 3713

精華:
0

積分: 6403 點

現金: 0 元

存款: 38423 元

閱讀權限: 100

註冊: 2006-4-7

狀態: 離線

|
|
 |
|
 |
|
|
|
社區直排顯示v1.06 for discuz! 6.0.0 [已有1.07更新]
Plug-in Name: HKCZ - 論壇版塊直排顯示系統
Designed for Discuz!6.0 TC
Designed by ntf
Type: Discuz! Hack 本版本更新:
修正style 1 dz6.0上使用的問題
1.下載 《Discuz! 社區直排顯示 管理平台》 及上載檔案
文件下載: 《Discuz! 社區直排顯示 管理平台》v1.0.6
3.升級數據庫 ALTER TABLE `cdb_forums` ADD `straightdisplay` SMALLINT( 1 ) NOT NULL DEFAULT '0'; 4.修改內容
index.php
找 $threads = $posts = $todayposts = 0;
下加 $showforumlist=empty($showforumlist) ? $_DCOOKIE[showforumlist] : $showforumlist;
if(!$_DCOOKIE[showforumlist] or ($_DCOOKIE[showforumlist]!=$showforumlist)){
$sdsetcookie =!empty($showforumlist) ? $showforumlist : 'straightdisplay'; //沒有選擇的顯示方式 straightdisplay為直排 default為本來的顯示
dsetcookie('showforumlist',$sdsetcookie,$timestamp+3600000);
}
//社區直排顯示 Cache
if(!$showforumlist){
$showforumlist='straightdisplay'; //沒有選擇的顯示方式 straightdisplay為直排 default為本來的顯示
}
if($showforumlist=='straightdisplay'){
require_once DISCUZ_ROOT.'./sdlist.php';
}else{
//社區直排顯示 Cache
找 if(isset($catlist[0]) && $catlist[0]['forumscount']) {
$catlist[0]['fid'] = 0;
$catlist[0]['type'] = 'group';
$catlist[0]['name'] = $bbname;
$catlist[0]['collapseimg'] = 'collapsed_no.gif';
} else {
unset($catlist[0]);
} 下加 //社區直排顯示 Cache
}
//社區直排顯示 Cache
變更顯示位置 請放入 discuz.htm (或你的home內)
<!--{if $gid || $showforumlist == 'default'}-->
<a href="{$PHP_SELF}?showforumlist=straightdisplay">變更為直排顯示</a>
<!--{elseif empty($gid) && $showforumlist == 'straightdisplay'}-->
<a href="{$PHP_SELF}?showforumlist=default">變更為普通顯示</a>
<!--{/if}-->
顯示直排位置:如果不懂修改可在discuz.htm找
找 <!--{loop $catlist $key $cat}-->
<!--{if $cat['forumscount']}-->
<div class="mainbox forumlist">
<span class="headactions">
<!--{if $cat['moderators']}-->{lang forum_category_modedby}: $cat[moderators]<!--{/if}-->
<img id="category_$cat[fid]_img" src="{IMGDIR}/$cat[collapseimg]" title="{lang spread}" alt="{lang spread}" onclick="toggle_collapse('category_$cat[fid]');" />
</span>
<h3><a href="$indexname?gid=$cat[fid]">$cat[name]</a></h3>
<table id="category_$cat[fid]" summary="category$cat[fid]" cellspacing="0" cellpadding="0" style="$collapse['category_'.$cat[fid]]">
<!--{if !$cat['forumcolumns']}-->
<thead class="category">
<tr>
<th>{lang forum_name}</th>
<td class="nums">{lang forum_threads}</td>
<td class="nums">{lang forum_posts}</td>
<td class="lastpost">{lang forum_lastpost}</td>
</tr>
</thead>
<!--{loop $cat[forums] $forumid}-->
<!--{eval $forum=$forumlist[$forumid];}-->
<tbody id="forum$forum[fid]">
<tr>
<th$forum[folder]>
$forum[icon]
<h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts]}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>
<!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->
<!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
<!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><p class="moderators">{lang forum_moderators}: $forum[moderators]</p><!--{else}--><span class="dropmenu" id="mod$forum[fid]" onmouseover="showMenu(this.id)">{lang forum_moderators}</span><ul class="moderators popupmenu_popup" id="mod$forum[fid]_menu" style="display: none">$forum[moderators]</ul><!--{/if}--><!--{/if}-->
</th>
<td class="nums">$forum[threads]</td>
<td class="nums">$forum[posts]</td>
<td class="lastpost">
<!--{if $forum['permission'] == 1}-->
{lang private_forum}
<!--{else}-->
<!--{if is_array($forum['lastpost'])}-->
<a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{eval echo cutstr($forum[lastpost][subject], 40)}</a>
<cite>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[lastpost][dateline]</cite>
<!--{else}-->
{lang never}
<!--{/if}-->
<!--{/if}-->
</td>
</tr>
</tbody>
<!--{/loop}-->
<!--{else}-->
<tr>
<!--{loop $cat['forums'] $forumid}-->
<!--{eval $forum=$forumlist[$forumid];}-->
<!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
</tr></tbody>
<!--{if $forum['orderid'] < $cat['forumscount']}-->
<tbody><tr>
<!--{/if}-->
<!--{/if}-->
<th width="$cat[forumcolwidth]"{$forum[folder]}>
<h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts]}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>
<p>{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts]</p>
<p>{lang forum_lastpost}:
<!--{if is_array($forum['lastpost'])}-->
<a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][dateline]</a>
{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
<!--{else}-->
{lang never}
<!--{/if}-->
</p>
</th>
<!--{/loop}-->
$cat['endrows']
<!--{/if}-->
</table>
</div>
<div id="ad_intercat_$key"></div>
<!--{/if}-->
<!--{/loop}--> 改為 <!--{if $gid || $showforumlist == 'default'}-->
{template forumlist_default}
<!--{elseif empty($gid) && $showforumlist == 'straightdisplay'}-->
{template forumlist_straightdisplay}
<!--{/if}-->
找 include/cache.func.php 'medals' => array('medals'), 下加 'straightdisplay' => array('straight_one', 'straight_two', 'straight_three', 'straight_four'), //社區直排顯示 找 case 'faqs':
$table = 'faqs';
$cols = 'id, identifier, keyword';
$conditions = "WHERE identifier!='' AND keyword!=''";
break; 下加 //社區直排顯示
case 'straight_one':
$table = 'forums f';
$cols = 'f.fid, f.type, f.name, f.fup, f.posts, f.threads, f.todayposts, ff.viewperm, a.uid';
$conditions = "LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid LEFT JOIN {$tablepre}access a ON a.fid=f.fid AND a.allowview='1' WHERE f.status>0 AND straightdisplay=1 ORDER BY f.type, f.displayorder";
break;
case 'straight_two':
$table = 'forums f';
$cols = 'f.fid, f.type, f.name, f.fup, f.posts, f.threads, f.todayposts, ff.viewperm, a.uid';
$conditions = "LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid LEFT JOIN {$tablepre}access a ON a.fid=f.fid AND a.allowview='1' WHERE f.status>0 AND straightdisplay=2 ORDER BY f.type, f.displayorder";
break;
case 'straight_three':
$table = 'forums f';
$cols = 'f.fid, f.type, f.name, f.fup, f.posts, f.threads, f.todayposts, ff.viewperm, a.uid';
$conditions = "LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid LEFT JOIN {$tablepre}access a ON a.fid=f.fid AND a.allowview='1' WHERE f.status>0 AND straightdisplay=3 ORDER BY f.type, f.displayorder";
break;
case 'straight_four':
$table = 'forums f';
$cols = 'f.fid, f.type, f.name, f.fup, f.posts, f.threads, f.todayposts, ff.viewperm, a.uid';
$conditions = "LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid LEFT JOIN {$tablepre}access a ON a.fid=f.fid AND a.allowview='1' WHERE f.status>0 AND straightdisplay=4 ORDER BY f.type, f.displayorder";
break;
//社區直排顯示 找 if(empty($table) || empty($cols)) return '';
$query = $db->query("SELECT $cols FROM {$tablepre}$table $conditions");
}
switch($cachename) { 下加 //社區直排顯示
case (in_array($cachename, array('straight_one', 'straight_two', 'straight_three', 'straight_four'))):
while($forum = $db->fetch_array($query)) {
if(!isset($forumlist[$forum['fid']])) {
$forum['name'] = strip_tags($forum['name']);
if($forum['uid']) {
$forum['users'] = "\t$forum[uid]\t";
}
unset($forum['uid']);
if($forum['fup']) {
$forumlist[$forum['fup']]['count']++;
}
$forumlist[$forum['fid']] = $forum;
} elseif($forum['uid']) {
if(!$forumlist[$forum['fid']]['users']) {
$forumlist[$forum['fid']]['users'] = "\t";
}
$forumlist[$forum['fid']]['users'] .= "$forum[uid]\t";
}
}
if(!empty($forumlist)) {
foreach($forumlist as $fid1 => $forum1) {
if(($forum1['type'] == 'group' && $forum1['count'])) {
$data[$fid1]['fid'] = $forum1['fid'];
$data[$fid1]['type'] = $forum1['type'];
$data[$fid1]['name'] = $forum1['name'];
$data[$fid1]['fup'] = $forum1['fup'];
$data[$fid1]['viewperm'] = $forum1['viewperm'];
$data[$fid1]['posts'] = $forum1['posts'];
$data[$fid1]['threads'] = $forum1['threads'];
$data[$fid1]['todayposts'] = $forum1['todayposts'];
foreach($forumlist as $fid2 => $forum2) {
if($forum2['fup'] == $fid1 && $forum2['type'] == 'forum') {
$data[$fid2]['fid'] = $forum2['fid'];
$data[$fid2]['type'] = $forum2['type'];
$data[$fid2]['name'] = $forum2['name'];
$data[$fid2]['fup'] = $forum2['fup'];
$data[$fid2]['viewperm'] = $forum2['viewperm'];
$data[$fid2]['posts'] = $forum2['posts'];
$data[$fid2]['threads'] = $forum2['threads'];
$data[$fid2]['todayposts'] = $forum2['todayposts'];
foreach($forumlist as $fid3 => $forum3) {
if($forum3['fup'] == $fid2 && $forum3['type'] == 'sub') {
$data[$fid3]['fid'] = $forum3['fid'];
$data[$fid3]['type'] = $forum3['type'];
$data[$fid3]['name'] = $forum3['name'];
$data[$fid3]['fup'] = $forum3['fup'];
$data[$fid3]['viewperm'] = $forum3['viewperm'];
$data[$fid3]['posts'] = $forum3['posts'];
$data[$fid3]['threads'] = $forum3['threads'];
$data[$fid3]['todayposts'] = $forum3['todayposts'];
}
}
}
}
}
}
}
break;
//社區直排顯示 找 admin/forums.inc.php $table_forum_columns = array('fup', 'type', 'name', 'status', 'styleid', 'allowsmilies', 'allowhtml', 'allowbbcode', 'allowimgcode', 'allowanonymous', 'allowshare', 'allowpostspecial', 'alloweditrules', 'allowpaytoauthor', 'alloweditpost', 'modnewposts', 'recyclebin', 'jammer', 'forumcolumns', 'threadcaches', 'disablewatermark', 'autoclose', 'simple'); 改為
//社區直排顯示
$table_forum_columns = array('fup', 'type', 'name', 'status', 'styleid', 'allowsmilies', 'allowhtml', 'allowbbcode', 'allowimgcode', 'allowanonymous', 'allowshare', 'allowpostspecial', 'alloweditrules', 'allowpaytoauthor', 'alloweditpost', 'modnewposts', 'recyclebin', 'jammer', 'forumcolumns', 'threadcaches', 'disablewatermark', 'autoclose', 'simple','straightdisplay');
//社區直排顯示
找 $forumfields['fup'] = $forum ? $fup : 0;
$forumfields['type'] = $forum['type'] == 'forum' ? 'sub' : 'forum';
$forumfields['name'] = $newforum;
$forumfields['status'] = 1; 下加 //社區直排顯示
$forumfields['straightdisplay'] = $forum['straightdisplay'];
//社區直排顯示 找 while($mod = $db->fetch_array($query)) {
if($mod['inherited'] || $forum['inheritedmod']) {
$db->query("REPLACE INTO {$tablepre}moderators (uid, fid, inherited)
VALUES ('$mod[uid]', '$fid', '1')");
}
}
updatecache('forums'); 下加 //社區直排顯示
updatecache('straight_one');
updatecache('straight_two');
updatecache('straight_three');
updatecache('straight_four');
//社區直排顯示 找 $query = $db->query("SELECT fid, type, inheritedmod FROM {$tablepre}forums WHERE fid='$fupnew'"); 改為 //社區直排顯示
$query = $db->query("SELECT fid, type, inheritedmod,straightdisplay FROM {$tablepre}forums WHERE fid='$fupnew'");
//社區直排顯示 找 $fupadd = ", type='".($fup['type'] == 'forum' ? 'sub' : 'forum')."', fup='$fup[fid]'"; 改為 //社區直排顯示
$fupadd = ", type='".($fup['type'] == 'forum' ? 'sub' : 'forum')."', fup='$fup[fid]', straightdisplay='$fup[straightdisplay]'";
//社區直排顯示
找 if($statusnew == 0) {
$db->query("UPDATE {$tablepre}forums SET status='$statusnew' WHERE fup='$fid'", 'UNBUFFERED');
}
updatecache('forums'); 下加 //社區直排顯示
updatecache('straight_one');
updatecache('straight_two');
updatecache('straight_three');
updatecache('straight_four');
//社區直排顯示 5.插件導入數據 YTozOntzOjY6InBsdWdpbiI7YTo5OntzOjk6ImF2YWlsYWJsZSI7aToxO3M6
NzoiYWRtaW5pZCI7aToxO3M6NDoibmFtZSI7czoxMjoiqsCwz6q9scbF46Xc
IjtzOjEwOiJpZGVudGlmaWVyIjtzOjE1OiJzdHJhaWdodGRpc3BsYXkiO3M6
MTE6ImRlc2NyaXB0aW9uIjtzOjA6IiI7czoxMDoiZGF0YXRhYmxlcyI7czow
OiIiO3M6OToiZGlyZWN0b3J5IjtzOjA6IiI7czo5OiJjb3B5cmlnaHQiO3M6
MzA6IiBEaXNjdXqqvbHGxeOl3LresnqlraV4IGJ5IG50ZiI7czo3OiJtb2R1
bGVzIjtzOjE3OToiYToxOntpOjA7YTo2OntzOjQ6Im5hbWUiO3M6MTU6InN0
cmFpZ2h0ZGlzcGxheSI7czo0OiJtZW51IjtzOjE2OiKqwLDPqr2xxrresnql
raV4IjtzOjM6InVybCI7czoxOToic3RyYWlnaHRkaXNwbGF5LnBocCI7czo0
OiJ0eXBlIjtpOjU7czo3OiJhZG1pbmlkIjtpOjE7czoxMjoiZGlzcGxheW9y
ZGVyIjtpOjE7fX0iO31zOjc6InZlcnNpb24iO3M6NToiNS41LjAiO3M6NDoi
dmFycyI7YTo1OntpOjA7YTo3OntzOjEyOiJkaXNwbGF5b3JkZXIiO2k6MTtz
OjU6InRpdGxlIjtzOjE2OiK9177Cr8Gk3qhDpua8xqXYIjtzOjExOiJkZXNj
cmlwdGlvbiI7czowOiIiO3M6ODoidmFyaWFibGUiO3M6ODoiYnJlYWtudW0i
O3M6NDoidHlwZSI7czo2OiJudW1iZXIiO3M6NToidmFsdWUiO2k6NDtzOjU6
ImV4dHJhIjtzOjA6IiI7fWk6MTthOjc6e3M6MTI6ImRpc3BsYXlvcmRlciI7
aTo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YmxlIjtz
OjEzOiJkaXNwbGF5X3RocmVlIjtzOjQ6InR5cGUiO3M6Njoic2VsZWN0Ijtz
OjU6InZhbHVlIjtzOjY6Im9yYW5nZSI7czo1OiJleHRyYSI7czo1NToiYmx1
ZSA9IMLFpuINCmdyZWVuID0guvGm4g0Kb3JhbmdlID0gvu2m4g0KcHVycGxl
ID0gtbWm4iI7fX19
可以 加入 計劃任務 forumlist.inc.php 以進行定時更新
運行系統管理插件 進行設置
設置後請按下面的立即更新 如有問題 請看看本帖的討論
本風格外觀純屬參考, 如有雷同, 實屬巧合. 請用者自行衡量使用後的版權責任,請使用者自行根據貴站進行修改。
v1.05 > v1.051
找 index.php if(!$showforumlist){
$showforumlist='straightdisplay'; //沒有選擇的顯示方式 straightdisplay為直排 default為本來的顯示
} 改為 $showforumlist=empty($showforumlist) ? $_DCOOKIE[showforumlist] : $showforumlist;
if(!$_DCOOKIE[showforumlist] or ($_DCOOKIE[showforumlist]!=$showforumlist)){
$sdsetcookie =!empty($showforumlist) ? $showforumlist : 'straightdisplay'; //沒有選擇的顯示方式 straightdisplay為直排 default為本來的顯示
dsetcookie('showforumlist',$sdsetcookie,$timestamp+3600000);
}
//社區直排顯示 Cache
if(!$showforumlist){
$showforumlist='straightdisplay'; //沒有選擇的顯示方式 straightdisplay為直排 default為本來的顯示
} v1.05.1 -> v1.06 更換系統文件 (管理平台)
v1.05.1 -> v1.06 如果使用 style 1 就更換模板
在這裡謝謝 (唔記得邊位) 制作 xhtml版
style 1 現時子版有bug 建議不要開啟子版下拉
Discuz!6.0 070904以後更新 請查看: http://alan888.com/Discuz/viewth ... p;page=3#pid1044450
[ 本帖最後由 ntf 於 2008-11-30 17:06 編輯 ]
附件: 您所在的用戶組無法下載或查看附件
| |