Discuz!X Nginx 的偽靜態(Rewrite)規則

Discuz!X是康盛創想(Comsenz)推出的一個以社區為基礎的專業建站平臺,讓論壇(BBS)、個人空間(SNS)、門戶(Portal)、群組(Group)、應用開放平臺(Open Platform)充分融合于一體,幫助網站實現一站式服務。

江陰論壇就是建立在Discuz!X的一個江陰本地論壇。

把下面代碼存為discuzx.conf,然后在域名配置文件(jyrj.net.conf)中嵌入(include discuzx.conf)就行了。

1
2
3
4
5
6
7
8
9
10
11
12
13
location / {
    rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
    rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
    rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
    rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
    rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
    rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
    rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
    rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last;
    if (!-e $request_filename) {
        return 404;
    }
}

Discuz調用jQuery沖突的解決辦法

將jquery.js在common.js之后載入,在調用jQuery的函數前使用一下代碼:

1
jQuery.noConflict();

之后便可以使用jQuery()來代替jQuery原來的$()函數,而$()函數則是原來Discuz的$()函數。

例:

1
2
3
4
5
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery("div p").hide();
</script>

Discuz版塊設置只有版主和發貼人能回復

修改post.php 這個文件,在59行處

1
2
3
if($thread['readperm'] && $thread['readperm'] > $readaccess && !$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
   showmessage('thread_nopermission', NULL, 'NOPERM');
  }

的下面添加下面代碼即可。

1
2
3
4
5
  //只有版主和發貼人自己能回復
  if(($forum['fid']==42) && ($thread['authorid']!=$discuz_uid) && !$forum['ismoderator']  )
  {
           showmessage('只有版主和發貼人才能回復', NULL, 'NOPERM');
  }

新模板《 羽落凡塵》

模版信息:

A、模版名稱:羽落凡塵(沿用原作者的名字)
B、模版適用 X-Space 2.0.1
C、模版適用的分辨率:800*600或者以上
D、適用的瀏覽器環境:IE6,Firefox,IE7的沒測試過,沒有裝ie7,有的朋友可以幫忙測試一下噢。
E、如果各位在使用的過程中還有什么問題可以直接給我留言呀。

演示圖片
xspace.jpg

下載
angel.txt

第一次做X-SPACE模板,問題可能比較多。

X-SPACE模板不知道在哪加原作者版權。