TShopping

 找回密碼
 註冊
搜索
查看: 5810|回復: 11

[教學] 論壇版塊直排系統 v1.1 For Dz 7.1 (加修改include版本)

  [複製鏈接]
發表於 2009-10-31 18:36:28 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
注意:本插件作者為NTF,本人只係轉換到能讓大家於7.1使用。
如果不想Dz7.1原本個index 可以修改Dz7.1  inclde/index_classics.inc.php  在#2
轉換修改Dz7.1 BY:TCheung

/**
@name Forum Board Straight Display Style System - Control Panel
@version 1.1
@author ntf
@license Attribution-No Derivative Works 3.0 Hong Kong http://creativecommons.org/licenses/by-nd/3.0/hk/
*/



演示:http://www.tshopping.com.tw

1.

SQL升級: 全新安裝適用
  1. ALTER TABLE `cdb_forums` ADD `straightdisplay` SMALLINT( 1 ) NOT NULL DEFAULT '0';
複製代碼
由於Dz7.1 個index.php 已經與Dz7.0 完全不同  所以大家需要上傳新index.php



2.
打開 templates/discuz.htm
  1. <!--{loop $catlist $key $cat}-->
  2.         <!--{if $cat['forumscount']}-->
  3.                 <div class="mainbox list">
  4.                         <span class="headactions">
  5.                                 <!--{if $cat['moderators']}-->{lang forum_category_modedby}: $cat[moderators]<!--{/if}-->
  6.                                 <img id="category_$cat[fid]_img" src="{IMGDIR}/$cat[collapseimg]" title="{lang spread}" alt="{lang spread}"  />
  7.                         </span>
  8.                         <h3><a href="$indexname?gid=$cat[fid]">$cat[name]</a></h3>
  9.                         <table id="category_$cat[fid]" summary="category$cat[fid]" cellspacing="0" cellpadding="0" style="$collapse['category_'.$cat[fid]]">
  10.                         <!--{if !$cat['forumcolumns']}-->
  11.                                 <!--{loop $cat[forums] $forumid}-->
  12.                                         <!--{eval $forum=$forumlist[$forumid];}-->
  13.                                         <tbody id="forum$forum[fid]">
  14.                                                 <tr>
  15.                                                         <th$forum[folder]>
  16.                                                                 $forum[icon]
  17.                                                                 <div class="left">
  18.                                                                 <h2><a href="forumdisplay.php?fid=$forum[fid]" {if $forum[redirect]}target="_blank"{/if}>$forum[name]</a><!--{if $forum[todayposts] && !$forum['redirect']}--><em> ({lang index_today}: <strong>$forum[todayposts]</strong></em><!--{/if}--></h2>
  19.                                                                 <!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->
  20.                                                                 <!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
  21.                                                                 <!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><p>{lang forum_moderators}: $forum[moderators]</p><!--{else}--><span class="dropmenu" id="mod$forum[fid]" >{lang forum_moderators}</span><ul class="popupmenu_popup headermenu_popup" id="mod$forum[fid]_menu" style="display: none">$forum[moderators]</ul><!--{/if}--><!--{/if}-->
  22.                                                                 </div>
  23.                                                         </th>
  24.                                                         <td class="forumnums">
  25.                                                                 <!--{if $forum['redirect']}-->N/A<!--{else}--><em>$forum[threads]</em> / $forum[posts]<!--{/if}-->
  26.                                                         </td>
  27.                                                         <td class="forumlast">
  28.                                                         <!--{if $forum['permission'] == 1}-->
  29.                                                                 {lang private_forum}
  30.                                                         <!--{else}-->
  31.                                                                 <!--{if $forum['redirect']}-->
  32.                                                                         <a href="forumdisplay.php?fid=$forum[fid]">{lang url_link}</a>
  33.                                                                 <!--{elseif is_array($forum['lastpost'])}-->
  34.                                                                         <p><a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($forum[lastpost][subject], 30)}</a></p>
  35.                                                                         <cite><!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[lastpost][dateline]</cite>
  36.                                                                 <!--{else}-->
  37.                                                                         {lang never}
  38.                                                                 <!--{/if}-->
  39.                                                         <!--{/if}-->
  40.                                                         </td>
  41.                                                 </tr>
  42.                                         </tbody>
  43.                                 <!--{/loop}-->
  44.                         <!--{else}-->
  45.                                 <tr class="narrowlist">
  46.                                 <!--{loop $cat['forums'] $forumid}-->
  47.                                         <!--{eval $forum=$forumlist[$forumid];}-->
  48.                                         <!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
  49.                                                 </tr></tbody>
  50.                                                 <!--{if $forum['orderid'] < $cat['forumscount']}-->
  51.                                                         <tbody><tr>
  52.                                                 <!--{/if}-->
  53.                                         <!--{/if}-->
  54.                                         <th width="$cat[forumcolwidth]"{$forum[folder]}>
  55.                                                 <h2><a href="forumdisplay.php?fid=$forum[fid]" {if $forum[redirect]}target="_blank"{/if}>$forum[name]</a><!--{if $forum[todayposts]}--><em> ({lang index_today}: <strong>$forum[todayposts]</strong></em><!--{/if}--></h2>
  56.                                                 <!--{if !$forum[redirect]}-->
  57.                                                         <p>{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts]</p>
  58.                                                         <!--{if $forum['permission'] == 1}-->
  59.                                                                 <p>{lang private_forum}
  60.                                                         <!--{else}-->
  61.                                                                 <p>{lang forum_lastpost}:
  62.                                                                         <!--{if is_array($forum['lastpost'])}-->
  63.                                                                                 <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost" title="{echo cutstr($forum[lastpost][subject], 30)} {lang forum_lastpost_by} {if $forum['lastpost']['author']}$forum['lastpost']['authorusername']{else}{lang anonymous}{/if}  ">$forum[lastpost][dateline]</a>
  64.                                                                         <!--{else}-->
  65.                                                                                 {lang never}
  66.                                                                         <!--{/if}-->
  67.                                                                 </p>
  68.                                                         <!--{/if}-->
  69.                                                 <!--{else}-->
  70.                                                         <p>{lang url_link}</p>
  71.                                                 <!--{/if}-->
  72.                                         </th>
  73.                                 <!--{/loop}-->
  74.                                 $cat['endrows']
  75.                         <!--{/if}-->
  76.                         </table>
  77.                 </div>
  78.                 <!--{if $admode && !empty($advlist['intercat']) && ($advlist['intercat'][$key] = array_merge(($advlist['intercat'][0] ? $advlist['intercat'][0] : array()), ($advlist['intercat'][$key] ? $advlist['intercat'][$key] : array())))}--><div class="ad_column" id="ad_intercat_$key"><!--{echo $advitems[$advlist['intercat'][$key][array_rand($advlist['intercat'][$key])]]}--></div><!--{else}--><div id="ad_intercat_$key"></div><!--{/if}-->
  79.         <!--{/if}-->
  80. <!--{/loop}-->
複製代碼
修改為:
  1. <!--{if $gid || $showforumlist == 'default'}-->
  2. {template forumlist_default}
  3. <!--{elseif empty($gid) && $showforumlist == 'straightdisplay'}-->
  4. {template forumlist_straightdisplay}
  5. <!--{/if}-->
複製代碼
換功能 顯示位置: (如需要)
  1. <!--{if $gid || $showforumlist == 'default'}-->
  2. <a href="index.php?showforumlist=straightdisplay">變更為直排顯示</a>
  3. <!--{elseif empty($gid) && $showforumlist == 'straightdisplay'}-->
  4. <a href="index.php?showforumlist=default">變更為普通顯示</a>
  5. <!--{/if}-->
複製代碼
3.上傳附件

4.後台導入數據 discuz_plugin_straightdisplay.rar (717 Bytes)
注要: 安裝時,如果為非BIG5,請把本導入數據先轉碼



4.請變更/新增版塊後 到 管理系統straightdisplay.php 直接按 [提交] 更新   即係(你的網站網址.straightdisplay.php)

5.後台更新緩存

 

臉書網友討論

本帖子中包含更多資源

您需要 登錄 才可以下載或查看,沒有帳號?註冊

x
發表於 2010-1-19 10:56:42 | 顯示全部樓層
感謝大大分享!!

版主招募中

發表於 2010-1-19 11:11:23 | 顯示全部樓層
謝謝指教分享!!


發表於 2010-8-8 16:43:30 | 顯示全部樓層
回復 1# woff

請問7.2 可以使用嗎?貴站目前是使用這個嗎?


 樓主| 發表於 2010-8-8 22:45:51 | 顯示全部樓層
7.2版本的要測試看看才知道了

不過你可試試看

不行再幫你測試看看


發表於 2010-8-8 23:55:28 | 顯示全部樓層
本帖最後由 xgameover 於 2010-8-8 23:59 編輯

我的是7.2的
請問
1.
SQL升級: 全新安裝適用
那個代碼是做什麼的呢?看不懂

大大,貴站的直排風格好漂亮哦!是自己改的嗎?裝了這個就是和貴站一模一樣的直排嗎?


 樓主| 發表於 2010-8-9 00:14:51 | 顯示全部樓層
是自己改的 裝了就會一樣

但是那個主題的圖不會一樣

要自己用圖片修改軟體修改

代碼是 程式碼
PHP MYSQL HTML CSS程式碼
要花點時間學是真的
不過按表操課保證成功就是了


發表於 2010-8-9 09:15:34 | 顯示全部樓層
大大您好,我是 http://twdudu.com 的管理員
我是使用7.2的discuz

其它的地方我都知道怎麼改,唯獨下面這張圖,要怎麼改呢?看不懂


 樓主| 發表於 2010-8-9 10:42:47 | 顯示全部樓層
後台 數據庫 升級 把代碼貼入就可以了


發表於 2010-8-9 10:44:39 | 顯示全部樓層
本帖最後由 xgameover 於 2010-8-9 10:54 編輯

回復 9# woff

這要動用到數據庫呀!若是後悔了不想裝了怎麼恢復?

我發現貴站的論壇有沒改好的地方
使用firefox瀏覽貴站的論壇,會出錯誤,安全提示、及登入邊框失效、以及無法刪除文章和使用代碼模式編輯文章

http://www.alan888.com/Discuz/vi ... p;highlight=firefox
用了上面這個網址後,就可以修改好了。


*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-3-19 22:02 , Processed in 0.103454 second(s), 20 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表