日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

網上99%都是不完善和殘缺的 或者各種不兼容,有的論壇還復制別人的DZ3.2版本的偽靜態方法說是支持3.4版本的,全是讓人浪費時間。

A、主題分類偽靜態設置方法:

準備好修改的模板文件:forumdisplay.htm和forumdisplay_list.htm

這兩個文件都在 templatedefaultforum 的目錄下(有修改過discuz模板,以你的主題文件路徑為準,如/template/主題模板文件夾/forum)。

我們要先修改主題分類的:打開forumdisplay.htm的源代碼:

默認主題一般在415行,當然如你的主題有修改過discuz模板,以你的主題文件路徑為準

1.修改forumdisplay.htm文件中

<li><a href="forum.php?mod=forumdisplay&fid=$_G[fid]&filter=typeid&typeid=$id$forumdisplayadd[typeid]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}">

修改為:

<li><a href="forumtype-$_G[fid]-$id-$page.html{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}">

2.接下來再打開forumdisplay_list.htm的源代碼:默認主題一般在162行,如你的主題有修改過模板,以你的主題文件為準找到:

<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread[highlight]{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else} onclick="atarget(this)"{/if} class="s xst">$thread[subject]</a>

修改為:

<a href="forum.php?mod=viewthread&tid=$thread[tid]{if $_G['gp_archiveid']}&archiveid={$_G['gp_archiveid']}{/if}"$thread[highlight]{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else} onclick="atarget(this)"{/if} class="s xst">$thread[subject]</a>

3.主題類別前綴【只顯示文字】,2個地方需要修改

i、打開sourcemoduleforumforum_forumdisplay.php,查找

forum.php?mod=forumdisplay&fid='.$_G['fid'].'&filter=typeid&typeid='.$thread['typeid'].'

替換為:

forumtype-'.$_G['fid'].'-'.$thread['typeid'].'-1.html

ii、打開模板目錄viewthread.htm,查找

forum.php?mod=forumdisplay&fid=$_G[fid]&filter=typeid&typeid=$_G[forum_thread][typeid]

替換為:

forumtype-$_G[fid]-{$_G[forum_thread][typeid]}-1.html

最后我們要把主題分類的偽靜態規則添加到相應文件中,規則如下

(因為環境問題,只測試了.htaccess,其它請自行測試):

.htaccess 偽靜態規則 請在RewriteRule ^forum-(w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1下面增加:

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forumtype-(w+)-(w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&filter=typeid&typeid=$2&page=$3&%1

注意:增加的規則不能放最后,特別是不能 不能 不能放在插件規則RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_-]+).html$ plugin.php?id=$1 :$2&%1之后,不然訪問分類偽靜態會出現“插件不存在或刪除”的錯誤。

httpd.ini 偽靜態規則

RewriteRule ^(.*)/forumtype-(w+)-(w+)-([0-9]+).html(?(.*))*$ $1/forum.php?mod=forumdisplay&fid=$2&filter=typeid&typeid=$3&page=$4&$5

web.config 偽靜態規則

<rule name="forum_forumtype">
<match url="^(.*/)*forumtype-(w+)-(w+)-([0-9]+).html?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/forum.php?mod=forumdisplay&fid={R:2}&filter=typeid&typeid={R:3}&page={R:4}&{R:5}" />
</rule>

B、分類信息列表內的帖子設置偽靜態方法:

打開 forum/forumdisplay_list.htm 模板,將

<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread[highlight]{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else}{/if} class="s xst">$thread[subject]</a>

替換為:

<a href="forum.php?mod=viewthread&tid=$thread[tid]"{$thread[highlight]} {if $thread['isgroup'] == 1 || $thread['forumstick']}target="_blank"{else}onclick="atarget(this)"{/if} class="s xst">$thread[subject]</a>

修改后,當選中分類時,列表中的帖子鏈接將為偽靜態,但帖子的分頁鏈接仍是動態,還需進行以下修改。

打開 source/module/forum/forum_forumdisplay.php 文件,將

<a href="forum.php?mod=viewthread&tid=$realtid&".(!empty($multipate_archive) ? "$multipate_archive&" : '')."extra=$extra&page=$i">

替換為:

<a href="thread-$realtid-$i-1.html">

<a href="forum.php?mod=viewthread&tid=$realtid&".(!empty($multipate_archive) ? "$multipate_archive&" : '')."extra=$extra&page=$thread[pages]">

替換為:

<a href="thread-$realtid-$thread[pages]-1.html">

這樣,Discuz! X3.4 主題分類和分類信息帖子鏈接都會為偽靜態,有興趣的站長趕緊試試?。J模板測試有效)!

分享到:
標簽:分類信息 可用 方法 設置 靜態
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定