|
本版本開始需在PHP5或更新的環境才可以運行。
本插件安裝需要有一定php的知識,新手有一定機率造成不明錯誤的情況。安裝前建議先備份一下。
本版本開始需在PHP5或更新的環境才可以運行。
界面走位等問題可能是由於界面風格設計的問題
首先上載文件
7.1&7.2: 找 include/index_classics.inc.php
這部份是變更用來讀取版區列表資料的代碼 , 方法是在上面加入新的代碼 及以If-Else 分開處理兩種不同的顯示模式
- $sql = !empty($accessmasks) ?
- "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.simple, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect, a.allowview FROM {$tablepre}forums f
- LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
- LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
- WHERE f.status='1' ORDER BY f.type, f.displayorder"
- : "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.simple, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect FROM {$tablepre}forums f
- LEFT JOIN {$tablepre}forumfields ff USING(fid)
- WHERE f.status='1' ORDER BY f.type, f.displayorder";
複製代碼
上加
它載入直排的Class文件 及建立物件
以Try-catch方式 確保不會因錯誤而出現PHP上的錯誤
- // StraightDisplay Start
- require_once DISCUZ_ROOT.'./plugins/straightdisplay/straightdisplay.class.php';
- $sd = StraightDisplay::getInstance();
- try{
- if(file_exists('./forumdata/cache/plugin_straightdisplay.php')){ //檢查插件設定檔
- include_once './forumdata/cache/plugin_straightdisplay.php';
- }else{
- throw new StraightDisplayException('找不到插件設定檔,請進行更新緩存或論壇管理中心確保插件已經開啟。');
- }
- $sd->setConfig($_DPLUGIN['straightdisplay']['vars']);
- if(!isset($_DCACHE['settings']['straightdisplayConfig'])){ //檢查版區顯示設定
- throw new StraightDisplayException('找不到版區顯示設定,請進行更新緩存或重新安裝。');
- }
- $sd->setDisplayConfig( unserialize($_DCACHE['settings']['straightdisplayConfig']) ); //套用版區顯示設定
- }catch(StraightDisplayException $e ){
- StraightDisplayException::ExceptionHandler($e); //顯示錯誤訊息
- }
- if($sd->CheckViewType()){
- //目前以直排模式顯示
- $sd->registerPlugin(array('StraightDisplayUserDragPlugin','init'),'BeforeDispatch'); //載入直排的其他插件
- $data = $sd->dispatch(); //讀取所有資料
- list($group_list,$forumlist,$threads,$posts,$todayposts) = $data;
- }else{
- // StraightDisplay End 以下為 本來的顯示模式
複製代碼
找
- 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]);
- }
複製代碼
下加
- } // Add by StraightDisplay
複製代碼
界面顯示方面
找 discuz.htm (每個風格中有discuz.htm的 都要修改) /templates/*/discuz.htm
- <!--{loop $catlist $key $cat}-->
- <!--{if $cat['forumscount']}-->
- <div class="mainbox list">
- <span class="headactions">
複製代碼
上加
- <!--{if empty($gid) && $sd->CheckViewType()}-->
- {template forumlist_straightdisplay}
- <!--{/if}-->
複製代碼
互換功能 顯示位置 (如需要提供 顯示模式的轉換 , 可參考以下代碼 , 一般情形下這部份可以不用理會) (請確保你知道自己在做什麼)
首頁使用 (discuz.htm)
- <!--{if empty($gid) && $sd->CheckViewType()}-->
- <a href="index.php?viewtype=default">變更為普通顯示</a>
- <!--{else}-->
- <a href="index.php?viewtype=straightdisplay">變更為直排顯示</a>
- <!--{/if}-->
複製代碼
其他頁面使用 (包括header.htm 或 footer.htm)
- <!--{eval require_once DISCUZ_ROOT.'./plugins/straightdisplay/straightdisplay.class.php';}-->
- <!--{eval $sd = StraightDisplay::getInstance();}-->
- <!--{if empty($gid) && $sd->CheckViewType()}-->
- <a href="index.php?viewtype=default">變更為普通顯示</a>
- <!--{else}-->
- <a href="index.php?viewtype=straightdisplay">變更為直排顯示</a>
- <!--{/if}-->
複製代碼
7.1 & 7.2 :
到插件管理安裝
- INSERT INTO `cdb_settings` (`variable` ,`value`)VALUES ('straightdisplayConfig', '');
- ALTER TABLE `cdb_memberfields` ADD straightdisplayConfig TEXT;
複製代碼
反安裝:- DELETE FROM `cdb_settings` WHERE `variable` = 'straightdisplayConfig' LIMIT 1;
- ALTER TABLE cdb_memberfields DROP straightdisplayConfig;
複製代碼
歡迎提供演示圖片
請測試一下,好了才正式使用。
新功能 :
修正積了很久的問題
修復 子版的開關
可以變更直排可顯示的行數
加入熱門及新版塊標示
管理頁面Drag and Drop化 , 可設定版區的上下位置
可以隱藏分區
測試中的新功能 :
會員可自定義 頁面版塊位置 (有開關) (不建議開啟)
6.0 : http://www.alan888.com/Discuz/thread-177206-1-1.html
錯誤解決方法:
找不到版區顯示設定,請進行更新緩存或重新安裝。 如無法顯示版區 可試試用測試檔案 檢查 安裝是否正確 ( 不包括人手修改的代碼
http://www.alan888.com/Discuz/vi ... ;page=12#pid1436106
直排風格製作圖片活動教學
找到
\images\forum 目錄下的圖檔
把圖檔改成 gidX.jpg 上傳即可
gidX.jpg X 代表的是板塊圖片
加新帖 NEW
跟熱門 HOT
方法!!
請找到(不需全部一樣。。。只要紅字 )
- <IMG hspace=5 src="images/home/bullet_blue.gif" align=absMiddle vspace=11><a href="forumdisplay.php?fid=$forum[fid]" title="今日帖數:$forum[todayposts] {LF}主題數目:$forum[threads] {LF}帖子數目:$forum[posts]" class=orangelink>$forum[name]</a>
複製代碼
有紅色字的那行 在這行下面 添加
- <!--{if $forum[todayposts] >= 10}-->
- <img src="images/home/hot.gif" alt="總共帖數:$forum[todayposts]">
- <!--{elseif $forum[todayposts] >0 && $forum[todayposts] <10}-->
- <span class="todayposts"><img src="images/home/new.gif" alt="此版今日有$forum[todayposts]帖" width="21" height="9" border="0"></span>
- <!--{/if}-->
複製代碼
這樣就可以了
紅色 熱門的判斷 > 10 大表 如果當日文章大於10 顯示熱門 hot
紫色 是有無新帖的判斷 如果 文章有0篇以上 >0 而且 少於 10篇 就顯示 new (如果大於10篇就是顯示 hot 如果想要兩個都顯示 就去掉&& $forum[todayposts] <10)
下面是以寬度 190px 做的,字元大小是 1.1em
|
本帖子中包含更多資源
您需要 登錄 才可以下載或查看,沒有帳號?註冊
x
|