列印

約束條款 for dz6.0

約束條款 for dz6.0

from: http://www.alan888.com/Discuz/viewthread.php?tid=124824

僅做些修改對應 dz6.0
本身功能無任何變更

演示:http://www.28wish.net/forumdisplay.php?fid=325

原作: zslunlun
各版塊進入約束系統功能:

1. 管理員可以隨意設置版塊進入的約束條款內容

2. 管理員可以控制論壇內約束的開啟和關閉

3. 管理員可以獨立設置論壇條款內容

4. 會員進入對應論壇必須首先同意條款,否則將無法進入該論壇

5. 使用 cookies 記錄,不增加資料庫負擔
複製內容到剪貼簿
代碼:
ALTER TABLE `cdb_forumfields` ADD `article` text NOT NULL;
開啟 ./admin/forums.inc.php
複製內容到剪貼簿
代碼:
showsetting('forums_edit_rules', 'rulesnew', $forum['rules'], 'textarea');
下方加入
複製內容到剪貼簿
代碼:
//約束條款 - START
showsetting('forums_edit_perm_article', 'articlenew', $forum['article'], 'textarea');
//約束條款 - END
找到
複製內容到剪貼簿
代碼:
password='$passwordnew',
後面加入
複製內容到剪貼簿
代碼:
article='$articlenew',
開啟 forumdisplay.php

找到
複製內容到剪貼簿
代碼:
if($forum['password']) {
        if($action == 'pwverify') {
                if($pw != $forum['password']) {
                        showmessage('forum_passwd_incorrect', NULL, 'HALTED');
                } else {
                        dsetcookie('fidpw'.$fid, $pw);
                        showmessage('forum_passwd_correct', "forumdisplay.php?fid=$fid");
                }
        } elseif($forum['password'] != $_DCOOKIE['fidpw'.$fid]) {
                include template('forumdisplay_passwd');
                exit();
        }
}
下方加入
複製內容到剪貼簿
代碼:
//約束條款 - START
if($forum['article'] && $action == 'aleverify') {
        if($ale != '1') {
                showmessage('不同意無法進入,請返回', NULL, 'HALTED');
        } else {
                dsetcookie('fidale'.$fid, $ale);
                showmessage('你可以進入了', "forumdisplay.php?fid=$fid");
        }
}

if(!empty($forum['article']) && '1' != $_DCOOKIE['fidale'.$fid]) {
        include template('forumdisplay_article');
        exit();
}
//約束條款 - END
打開模版目錄下的 admincp.lang.php

找到
複製內容到剪貼簿
代碼:
'forums_edit_rules' => '本論壇規則:',
        'forums_edit_rules_comment' => '顯示於主題列表頁的當前論壇規則,支援 HTML 代碼,留空為不顯示',
下方加入
複製內容到剪貼簿
代碼:
//約束條款 - START
        'forums_edit_perm_article' => '本論壇約束條款:',
        'forums_edit_perm_article_comment' => '顯示論壇約束條款,同意後才可進入,支援 HTML 代碼,留空為不顯示',
//約束條款 - END
將附件內的檔案傳到模版目錄下即可完成

如想跳過你可以進入了這頁請修改

打開 forumdisplay.php

複製內容到剪貼簿
代碼:
showmessage('你可以進入了', "forumdisplay.php?fid=$fid");
改成
複製內容到剪貼簿
代碼:
header("Location: forumdisplay.php?fid=$fid");
附件: 您所在的用戶組無法下載或查看附件
Hack 安裝錯誤, 80% 來自粗心, 請專心安裝
Linux0911 打造您的個性論壇

本人現在忙於研究所, 沒多的時間管論壇, 有問題別發 pm 給我, 謝謝~
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

請問版大 第一項的
代碼:
ALTER TABLE `cdb_forumfields` ADD `article` text NOT NULL;

是要怎樣用? 我是新手 請你告訴我 感激不盡!
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

引用:
原帖由 aiotianxin 於 2008-5-21 06:43 PM 發表
請問版大 第一項的
代碼:
ALTER TABLE `cdb_forumfields` ADD `article` text NOT NULL;

是要怎樣用? 我是新手 請你告訴我 感激不盡!
引用:
後台-->系統工具-->數據庫升級-->

Discuz! 數據庫升級 - 請將數據庫升級語句粘貼在下面-->提交
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

出現這個問題...如果解決?
Parse error: syntax error, unexpected ';' in /home/hei/domains/sunlight.hk.vg/public_html/forumdisplay.php on line 65
我的FORUM forumdisplay.php


[ 本帖最後由 allin 於 2008-6-8 12:30 PM 編輯 ]
附件: 您所在的用戶組無法下載或查看附件
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

我也是出現同樣問題
Parse error: parse error in c:\appserv\www\k9\forumdisplay.php on line 65
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

回覆 5# jojo2004 的帖子

跟我一樣

Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

我重複安裝好幾次都出現錯誤訊息
好煩哦!

Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

此編碼為BIG5唷~~

如果是UTF-8的話~~

修改後存檔時請轉一下UTF-8唷~~

不然很容易有錯誤唷~~
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

終於幫大家找到問題了~~
我測試好了~~

我是FOR 6.1版的
複製內容到剪貼簿
代碼:
//約束條款 - START
if($forum['article'] && $action == 'aleverify') {
.................
//約束條款 - END
修正成

if($forum['article'] && $action == 'aleverify') {

就可以使用了~~^_^

[ 本帖最後由 mychu 於 2008-6-30 03:39 PM 編輯 ]
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP



論壇聲明
  • 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
    如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
    請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!
最佳瀏覽解析度:不低於 1024 (最佳 1280 以上).(支援 IE 7, Mozilla Firefox, Safari, Chrome)
The Best Surfing Resolution: No Lower than 1024 (Best: above 1280).(IE 7, Mozilla Firefox, Safari, Chrome Supported)