AL8 Forum
   登錄註冊幫助


標題: 【插件】發貼時可加入指定會員才可看第1版
 ywndaniel
 0000200
Rank: 1

頭銜: Newbie

帖子: 33

精華: 6

積分: 4565 點

現金: 621 元

存款: 38531 元

閱讀權限: 10

註冊: 2004-1-24

狀態: 離線
 
發表於 2004-7-4 23:33  資料  個人空間  短消息  加為好友 
【插件】發貼時可加入指定會員才可看第1版

HACK名稱: 發貼時可加入指定會員才可看第1版
修改文件: viewthread.php, include/newthread.php, include/editpostphp,
修改模板: post_newthread, post_editpost, forumdisplay

後台升級
ALTER TABLE `cdb_threads` ADD `actmember` varchar( 15 ) NOT NULL;
ALTER TABLE `cdb_posts` ADD `actmember` varchar( 15 ) NOT NULL

打開viewthread.php
找到
$query = $db->query("SELECT * FROM $table_threads WHERE tid='$tid'");
if(!$thread = $db->fetch_array($query)) {
        showmessage('thread_nonexistence');
}

在下面加入
//指定會員開始
$querypost = $db->query("SELECT p.*, m.username FROM $table_posts p LEFT JOIN $table_members m ON m.username=p.author WHERE p.tid='$tid'");
while($post = $db->fetch_array($querypost)) {
if($post['actmember']!='' && !$isadmin && $discuz_user!=$post['author'] && $discuz_user!=$post['actmember'])
        {
        showmessage('八卦,人地都唔係寫比你o既。');//隨意修改不是指定會員進入的信息
        }
}
//指定會員結束

打開include/newthread.php
找到
if(!$isadmin && !$issupermod && !$ismoderator && $forum['lastpost']) {
                $lastpost = explode("\t", $forum['lastpost']);
                if(($timestamp - $floodctrl) <= $lastpost[1] && $username == $lastpost[2]) {
                        showmessage('post_flood_ctrl');
                }
        }

在下面加入
        //指定會員開始
        if($actmember!='')
        {
        $touser = $actmember;
        $touser = addslashes(htmlspecialchars($touser));

        $query = $db->query("SELECT uid,username FROM $table_members WHERE username='$actmember'");
        if (!$db->num_rows($query)) {
                showmessage("該用戶不存在!不能發貼,請返回。");
        }
        }
        //指定會員結束

找到
        $db->query("INSERT INTO $table_threads (fid, creditsrequire, icon, author, subject, dateline, lastpost, lastposter, topped, digest, closed, pollopts, attachment)
                VALUES ('$fid', '$viewperm', '$posticon', '$username', '$subject', '$timestamp', '$timestamp', '$username', '$topped', '$digest', '$closed', '$pollopts', '$attach_type')");
        $tid = $db->insert_id();
        $db->query("INSERT INTO $table_posts  (fid, tid, aid, icon, author, subject, dateline, message, useip, usesig, bbcodeoff, smileyoff, parseurloff)
                VALUES ('$fid', '$tid', '$aid', '$posticon', '$username', '$subject', '$timestamp', '$message', '$onlineip', '$usesig', '$bbcodeoff', '$smileyoff', '$parseurloff')");
        $pid = $db->insert_id();

改為
        //指定會員開始
        $db->query("INSERT INTO $table_threads (fid, creditsrequire, icon, author, subject, dateline, lastpost, lastposter, topped, digest, closed, pollopts, attachment, actmember)
                VALUES ('$fid', '$viewperm', '$posticon', '$username', '$subject', '$timestamp', '$timestamp', '$username', '$topped', '$digest', '$closed', '$pollopts', '$attach_type', '$actmember')");
        $tid = $db->insert_id();
        $db->query("INSERT INTO $table_posts  (fid, tid, aid, icon, author, subject, dateline, message, useip, usesig, bbcodeoff, smileyoff, parseurloff, actmember)
                VALUES ('$fid', '$tid', '$aid', '$posticon', '$username', '$subject', '$timestamp', '$message', '$onlineip', '$usesig', '$bbcodeoff', '$smileyoff', '$parseurloff', '$actmember')");
        //指定會員結束
        $pid = $db->insert_id();

打開include/editpost.php
找到
$query = $db->query("SELECT author, dateline FROM $table_posts WHERE pid='$pid' AND tid='$tid' AND fid='$fid'");
$orig = $db->fetch_array($query);
$orig[author] = addslashes($orig['author']);

改為
//指定會員開始
$query = $db->query("SELECT author, dateline, actmember FROM $table_posts WHERE pid='$pid' AND tid='$tid' AND fid='$fid'");
$orig = $db->fetch_array($query);
$orig[author] = addslashes($orig['author']);
$orig[actmember] = addslashes($orig['actmember']);
//指定會員結束

找到
        $postinfo['subject'] = str_replace('"', "&quot;", $postinfo['subject']);
        $postinfo['message'] = dhtmlspecialchars($postinfo['message']);
        $postinfo['message'] = preg_replace("/\n{2}\[ Last edited by .+? on .+? at .+? \]$/s", '', $postinfo['message']);

在下面加入
        //指定會員開始
        $postinfo['actmember'] = dhtmlspecialchars($postinfo['actmember']);
        //指定會員結束

找到
        if(!$delete) {

                if(strlen($subject) > 100) {
                        showmessage('post_subject_toolang');
                }

在下面加入
                //指定會員開始
                if($actmember!='')
                {
                $touser = $actmember;
                $touser = addslashes(htmlspecialchars($touser));

                $query = $db->query("SELECT uid,username FROM $table_members WHERE username='$actmember'");
                if (!$db->num_rows($query)) {
                        showmessage("該用戶不存在!不能發貼,請返回。");
                }
                }
                //指定會員結束




 AL8 Forum © All rights reserved.
頂部
 ywndaniel
 0000200
Rank: 1

頭銜: Newbie

帖子: 33

精華: 6

積分: 4565 點

現金: 621 元

存款: 38531 元

閱讀權限: 10

註冊: 2004-1-24

狀態: 離線
 
發表於 2004-7-4 23:34  資料  個人空間  短消息  加為好友 
找到
                                if($tempfetch[topped]==0 or !$isadmin){
                                if(!$isadmin){
                                $subject = dhtmlspecialchars($subject);

在下面加入
                                //指定會員開始
                                $actmember = dhtmlspecialchars($actmember);
                                //指定會員結束

找到
$db->unbuffered_query("UPDATE $table_threads SET icon='$posticon', subject='$subject' $polloptsadd WHERE tid='$tid'");

改為
$db->unbuffered_query("UPDATE $table_threads SET icon='$posticon', actmember='$actmember', subject='$subject' $polloptsadd WHERE tid='$tid'");

找到
                        $db->query("UPDATE $table_posts SET aid='$aid', message='$message', usesig='$usesig', bbcodeoff='$bbcodeoff', parseurloff='$parseurloff',
                                smileyoff='$smileyoff', icon='$posticon', subject='$subject' WHERE pid='$pid'");
                        $db->unbuffered_query("UPDATE $table_threads SET attachment='$attach_type'$viewpermadd WHERE tid='$tid'");
                } else {
                        $db->query("UPDATE $table_posts SET message='$message', usesig='$usesig', bbcodeoff='$bbcodeoff', parseurloff='$parseurloff',
                                smileyoff='$smileyoff', icon='$posticon', subject='$subject' WHERE pid='$pid'");

改為
                        //指定會員開始
                        $db->query("UPDATE $table_posts SET aid='$aid', message='$message', usesig='$usesig', bbcodeoff='$bbcodeoff', parseurloff='$parseurloff',
                                smileyoff='$smileyoff', icon='$posticon', subject='$subject', actmember='$actmember' WHERE pid='$pid'");
                        $db->unbuffered_query("UPDATE $table_threads SET attachment='$attach_type'$viewpermadd WHERE tid='$tid'");
                } else {
                        $db->query("UPDATE $table_posts SET message='$message', usesig='$usesig', bbcodeoff='$bbcodeoff', parseurloff='$parseurloff',
                                smileyoff='$smileyoff', icon='$posticon', subject='$subject', actmember='$actmember' WHERE pid='$pid'");
                        //指定會員結束

打開post_editpost模版
找到
<tr>
<td bgcolor="{ALTBG1}" width="20%">{lang subject}:</td>
<td bgcolor="{ALTBG2}">
<input type="text" name="subject" size="45" value="$postinfo[subject]" tabindex="3">
<input type="hidden" name="origsubject" value="$postinfo[subject]">
</td></tr>

在下面加入
<!--{if $allowsetviewperm && $isfirstpost}-->
<tr>
<td bgcolor="{ALTBG1}" width="20%">發貼給指定會員:</td>
<td bgcolor="{ALTBG2}">
<input type="text" name="actmember" size="45" value="$postinfo[actmember]" tabindex="3">
<input type="hidden" name="origactmember" value="$postinfo[actmember]">
</td></tr>
<!--{/if}-->

打開post_newthread模版
找到
<td bgcolor="{ALTBG1}" width="20%">{lang subject}:</td>
<td bgcolor="{ALTBG2}">
<input type="text" name="subject" size="45" value="$subject" tabindex="3"></td>
</tr>

在下面加入
<tr>
<td bgcolor="{ALTBG1}" width="20%">發貼給指定會員:</td>
<td bgcolor="{ALTBG2}">
<input type="text" name="actmember" size="45" value="$actmember" tabindex="3"></td>
</tr>

打開forumdisplay模版
找到
<a href="viewthread.php?fpage=$page&tid=$thread[tid]">$thread[subject]

在更換為
                <!--{if !$thread['actmember']}-->
                <a href="viewthread.php?fpage=$page&tid=$thread[tid]">$thread[subject]
                <!--{else}-->
                <a href="viewthread.php?fpage=$page&tid=$thread[tid]">$thread[subject] <font color=red>給指定會員: $thread[actmember]</font>
                <!--{/if}-->


[ Last edited by Poka on 2004-11-16 at 16:53 ]




 AL8 Forum © All rights reserved.
頂部
 RINGOYAU
 0000081
Rank: 4Rank: 4Rank: 4Rank: 4

頭銜: Lord

帖子: 387

精華: 7

積分: 29620 點

現金: 923 元

存款: 37634 元

閱讀權限: 25

註冊: 2004-1-9

狀態: 離線
 
發表於 2004-7-4 23:35  資料  個人空間  短消息  加為好友 
Thanks a lot~~




 AL8 Forum © All rights reserved.
頂部
 jimmychim
 0000456
Rank: 2Rank: 2

頭銜: Member

帖子: 74

精華: 0

積分: 610 點

現金: 245 元

存款: 2267 元

閱讀權限: 15

註冊: 2004-2-19

狀態: 離線
 
發表於 2004-7-9 21:19  資料  個人空間  主頁 短消息  加為好友 
這個是什麼東東




 AL8 Forum © All rights reserved.
頂部
 ericericeric
 0000657
Rank: 2Rank: 2

頭銜: Member

帖子: 81

精華: 1

積分: 3150 點

現金: 22 元

存款: 1600 元

閱讀權限: 15

註冊: 2004-3-7

狀態: 離線
 
發表於 2004-7-10 16:25  資料  個人空間  短消息  加為好友 
不太明白???
可否解釋一次???




 AL8 Forum © All rights reserved.
頂部
 tonypak1985
 0000790
Rank: 3Rank: 3Rank: 3
點擊查看 tonypak1985 的詳細資料

頭銜: Conqueror

帖子: 108

精華: 2

積分: 3890 點

現金: 669 元

存款: 0 元

閱讀權限: 20

註冊: 2004-3-15

來自: hk

狀態: 離線
 
發表於 2004-7-12 10:50  資料  個人空間  短消息  加為好友  Yahoo!
板主睇唔睇到架???




 AL8 Forum © All rights reserved.
頂部
 Qoo橙汁
 0003489
Rank: 1

頭銜: Newbie

帖子: 46

精華: 0

積分: 995 點

現金: 138 元

存款: 0 元

閱讀權限: 10

註冊: 2004-6-27

狀態: 離線
 
發表於 2004-8-4 16:05  資料  個人空間  短消息  加為好友 
thx @@




 AL8 Forum © All rights reserved.
頂部
 魔戒王
 0008926
Rank: 1

頭銜: Newbie

帖子: 20

精華: 0

積分: 290 點

現金: 0 元

存款: 0 元

閱讀權限: 10

註冊: 2004-10-2

狀態: 離線
 
發表於 2004-10-4 16:50  資料  個人空間  短消息  加為好友 
好贵。。。。。。。。。。
不过我需要哩个功能。买佐先。。




 AL8 Forum © All rights reserved.
頂部
 glio
 0009742
Rank: 3Rank: 3Rank: 3
點擊查看 glio 的詳細資料

頭銜: Conqueror

帖子: 264

精華: 1

積分: 5145 點

現金: 13 元

存款: 18061 元

閱讀權限: 20

註冊: 2004-10-13

狀態: 離線
 
發表於 2004-10-14 21:55  資料  個人空間  短消息  加為好友 
咁貴﹗




 AL8 Forum © All rights reserved.
頂部
 Kira26
 0009871
Rank: 1

頭銜: Newbie

帖子: 11

精華: 0

積分: 100 點

現金: 0 元

存款: 0 元

閱讀權限: 10

註冊: 2004-10-16

狀態: 離線
 
發表於 2004-10-16 21:02  資料  個人空間  短消息  加為好友 
no  $$$$$$$$$$$$$$$$




 AL8 Forum © All rights reserved.
頂部
 arhin
 0010286
Rank: 1

頭銜: Newbie

帖子: 24

精華: 0

積分: 600 點

現金: 39 元

存款: 0 元

閱讀權限: 10

註冊: 2004-10-23

狀態: 離線
 
發表於 2004-10-28 22:34  資料  個人空間  短消息  加為好友 
好呀~~~真係多謝你




 AL8 Forum © All rights reserved.
頂部
 wacisunny
 0006606
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 104

精華: 0

積分: 2200 點

現金: 100 元

存款: 670 元

閱讀權限: 20

註冊: 2004-9-1

狀態: 離線
 
發表於 2004-10-30 21:11  資料  個人空間  短消息  加為好友 
不明白是什麼意思ㄟ

可不可以說清楚一些

第一版是哪一版




 AL8 Forum © All rights reserved.
頂部
 ny9111111
 0010350
Rank: 1

頭銜: Newbie

帖子: 29

精華: 0

積分: 110 點

現金: 26 元

存款: 173 元

閱讀權限: 10

註冊: 2004-10-24

狀態: 離線
 
發表於 2004-11-7 11:27  資料  個人空間  短消息  加為好友 
THX~~~~~~~~~~~~~




 AL8 Forum © All rights reserved.
頂部
 helren
 0010872
Rank: 3Rank: 3Rank: 3
點擊查看 helren 的詳細資料

頭銜: Conqueror

帖子: 236

精華: 0

積分: 4000 點

現金: 0 元

存款: 1355 元

閱讀權限: 20

註冊: 2004-11-2

來自: hong kong

狀態: 離線
 
發表於 2004-11-7 12:43  資料  個人空間  主頁 短消息  加為好友  添加 helren 為MSN好友 通過MSN和 helren 交談 ICQ 狀態
好貴啊!!~




 AL8 Forum © All rights reserved.
頂部
 東方不敗
 0012761
Rank: 1

頭銜: Newbie

帖子: 21

精華: 0

積分: 209 點

現金: 300 元

存款: 0 元

閱讀權限: 10

註冊: 2004-12-8

狀態: 離線
 
發表於 2004-12-12 02:11  資料  個人空間  短消息  加為好友 
謝謝啦




 AL8 Forum © All rights reserved.
頂部
 kofkyo
 0012232
Rank: 3Rank: 3Rank: 3
點擊查看 kofkyo 的詳細資料

頭銜: Conqueror

帖子: 126

精華: 0

積分: 2430 點

現金: 0 元

存款: 23 元

閱讀權限: 20

註冊: 2004-11-27

狀態: 離線
 
發表於 2004-12-20 13:50  資料  個人空間  短消息  加為好友 
就是la~




 AL8 Forum © All rights reserved.
頂部
 蛇
 0013403
Rank: 2Rank: 2

頭銜: Member

帖子: 60

精華: 0

積分: 1265 點

現金: 0 元

存款: 372 元

閱讀權限: 15

註冊: 2004-12-19

狀態: 離線
 
發表於 2004-12-29 09:06  資料  個人空間  短消息  加為好友 
好貴....




 AL8 Forum © All rights reserved.
頂部
 loveyoyo
 0014292
Rank: 2Rank: 2
點擊查看 loveyoyo 的詳細資料

頭銜: Member

帖子: 62

精華: 0

積分: 1230 點

現金: 50 元

存款: 0 元

閱讀權限: 15

註冊: 2005-1-3

狀態: 離線
 
發表於 2005-1-24 00:09  資料  個人空間  短消息  加為好友 
在這裡看到最貴的價格,希望內容很豐富∼




作業系統:Microsoft IIS 5.0
PHP:5.0.2
mySQL:3.23.57
Discuz!:2.5
 AL8 Forum © All rights reserved.
頂部
 feng04
 0014200
Rank: 2Rank: 2
點擊查看 feng04 的詳細資料

頭銜: Member

帖子: 52

精華: 0