Hacks4wbb by HFW™ (https://pommes.forenoase.de//index.php)
- WBB Bereich (https://pommes.forenoase.de//board.php?boardid=20)
--- wbb 2 (https://pommes.forenoase.de//board.php?boardid=393)
------ WBB 2.2 Forum (https://pommes.forenoase.de//board.php?boardid=251)
---------- Hilfe & Suche wbb2.2 (https://pommes.forenoase.de//board.php?boardid=401)
----------- WBB 2.2 Hacksuche (https://pommes.forenoase.de//board.php?boardid=253)
------------ Suche Hack Beitragszahl erhaltungs hack (https://pommes.forenoase.de//thread.php?threadid=24220)


Geschrieben von Darkwarrior am 01.10.2005 um 11:25:

  Beitragszahl erhaltungs hack

Hallo!

Ich suche einen ganz bestimmten Hack für ein Wbb 2.2 Board.
Die Funktion des Hacks:
Beiträge von Usern werden einzeln gelöscht (oder auch ganze Themen können gelöscht werden), jedoch werden die Postingszahlen beibehalten.

Hat jemand solch einen Hack auf lager?

Liebe Grüße

Dark



Geschrieben von alfie am 01.10.2005 um 11:42:

 

Guckst du hier

MfG

alfie



Geschrieben von Darkwarrior am 01.10.2005 um 12:26:

 

Sorry aber das klappt nicht, was die auf dem yourwbb angegeben haben.



Geschrieben von alfie am 01.10.2005 um 13:07:

 

Was klappt nicht?

alfie



Geschrieben von Darkwarrior am 01.10.2005 um 18:23:

 

./acp/lib/mod_functions.php

Diese Zeile finde ich bei mir in der php Datei einfach nicht. Und der Vorschlag, der weiter unten gemacht wurde, der klappt auch nicht unglücklich ;-(



Geschrieben von alfie am 02.10.2005 um 12:10:

 

Häng die Datei mal an!

alfie



Geschrieben von Darkwarrior am 02.10.2005 um 20:28:

 

Danke erstmal für die Hilfe!!!! :-D


Hier wäre die Datei:

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
<?php
/** delete a thread **/
function deletethread($threadid) {
    global $db$n$thread$board$boardid;
    
    /** delete thread **/
    $db->query("DELETE FROM bb".$n."_threads WHERE threadid = '$threadid'");
    $db->unbuffered_query("DELETE FROM bb".$n."_threads WHERE pollid = '$threadid' AND closed=3"1);
    if ($thread['important'] == 2$db->unbuffered_query("DELETE FROM bb".$n."_announcements WHERE threadid = '$threadid'"1);
    
    /** delete subscriptions **/
    $db->query("DELETE FROM bb".$n."_subscribethreads WHERE threadid = '$threadid'"); 
    
    /** delete poll **/ 
    if ($thread['pollid']) {
        $db->query("DELETE FROM bb".$n."_polls WHERE pollid = '$thread[pollid]'");
        $pollvotes " OR (id = '$thread[pollid]' AND votemode=1)";
        $db->query("DELETE FROM bb".$n."_polloptions WHERE pollid = '$thread[pollid]'");
    }
    else $pollvotes '';
    
    /** delete ratings **/
    $db->query("DELETE FROM bb".$n."_votes WHERE (id = '$threadid' AND votemode=2)$pollvotes");
    
    /** delete attachments **/
    if ($thread['attachments']) {
        $result $db->query("SELECT attachmentid FROM bb".$n."_posts WHERE threadid='$threadid' AND attachmentid>0");
        while ($row $db->fetch_array($result)) $attachmentids .= ",".$row['attachmentid'];
        $result $db->query("SELECT attachmentid, attachmentextension FROM bb".$n."_attachments WHERE attachmentid IN (0$attachmentids)");
        while ($row $db->fetch_array($result)) @unlink("attachments/attachment-".$row['attachmentid'].".".$row['attachmentextension']);
        $db->query("DELETE FROM bb".$n."_attachments WHERE attachmentid IN (0$attachmentids)");
    }
    
    /** delete userpost **/
    if ($board['countuserposts'] == 1) { 
        $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$threadid' AND visible=1 AND userid>0 GROUP BY userid");
        while ($row $db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts-'$row[posts]' WHERE userid='$row[userid]'");
    }
    
    /** delete posts **/
    $db->query("DELETE FROM bb".$n."_posts WHERE threadid = '$threadid'");
    $thread['replycount'] += 1;
    
    /* update global threadcount & postcount */
    if ($thread['visible'] == 1$db->unbuffered_query("UPDATE bb".$n."_stats SET threadcount=threadcount-1, postcount=postcount-'".$thread['replycount']."'"1);
    
    /* update boardcount */
    if ($thread['visible'] == 1$db->query("UPDATE bb".$n."_boards SET threadcount=threadcount-1, postcount=postcount-'".$thread['replycount']."' WHERE boardid IN ($boardid,$board[parentlist])");
    if ($board['lastthreadid'] == $threadidupdateBoardInfo("$boardid,$board[parentlist]"0$threadid);
}


/** delete an amount of posts **/
function deleteposts($postids$threadid$postcount) {
    global $db$n$thread$board$boardid;
    
    $result $db->query("SELECT postid, parentpostid FROM bb".$n."_posts WHERE postid IN ($postids) ORDER BY posttime DESC");
    while ($row $db->fetch_array($result)) $db->query("UPDATE bb".$n."_posts SET parentpostid='$row[parentpostid]' WHERE threadid = '".$threadid."' AND parentpostid='$row[postid]'");
    
    /** delete userpost **/
    if ($board['countuserposts'] == 1) {
        $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE postid IN ($postids) AND visible=1 AND userid>0 GROUP BY userid");
        while ($row $db->fetch_array($result)) $db->unbuffered_query("UPDATE bb".$n."_users SET userposts=userposts-'$row[posts]' WHERE userid='$row[userid]'"1);
    }
    
    /** delete attachments **/
    $attachmentcount 0;
    if ($thread['attachments']) {
        $result $db->query("SELECT attachmentid FROM bb".$n."_posts WHERE postid IN ($postids) AND attachmentid>0");
        while ($row $db->fetch_array($result)) {
            $attachmentids .= ",".$row['attachmentid'];
            $attachmentcount++;
        }
        $result $db->query("SELECT attachmentid, attachmentextension FROM bb".$n."_attachments WHERE attachmentid IN (0$attachmentids)");
        while ($row $db->fetch_array($result)) @unlink("attachments/attachment-".$row['attachmentid'].".".$row['attachmentextension']);
        $db->unbuffered_query("DELETE FROM bb".$n."_attachments WHERE attachmentid IN (0$attachmentids)"1);
    }
    
    $db->query("DELETE FROM bb".$n."_posts WHERE postid IN ($postids)");
    
    /* update global postcount */
    $db->unbuffered_query("UPDATE bb".$n."_stats SET postcount=postcount-'".$postcount."'"1); 
    
    /* update board & thread count */
    $db->query("UPDATE bb".$n."_boards SET postcount=postcount-'$postcount' WHERE boardid IN ($boardid,$board[parentlist])");
    $result $db->query_first("SELECT userid, username, posttime FROM bb".$n."_posts WHERE threadid='$threadid' ORDER BY posttime DESC"1);
    $db->query("UPDATE bb".$n."_threads SET replycount=replycount-'$postcount', lastposttime='$result[posttime]', lastposterid='$result[userid]', lastposter='".addslashes($result['username'])."'".(($attachmentcount != 0) ? (", attachments=attachments-'$attachmentcount'") : (""))." WHERE threadid='$threadid'");
    
    updateBoardInfo("$boardid,$board[parentlist]"$thread['lastposttime']);
}


/** move a thread **/
function movethread($threadid$mode$newboardid) {
    global $board$thread$db$n$newboard$default_prefix;    
    
    $boardid $board['boardid'];
    if (!is_array($newboard)) $newboard $db->query_first("SELECT * FROM bb".$n."_boards WHERE boardid = '$newboardid'");
    
    if ($mode == "onlymove" || $mode == "movewithredirect") {
        if ($thread['important'] == 2) {
            list($announcements) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_announcements WHERE threadid='$threadid'");    
            if ($announcements 1$db->query("INSERT IGNORE INTO bb".$n."_announcements (boardid,threadid) VALUES ('$newboardid','$threadid')");
            else $db->query("UPDATE bb".$n."_announcements SET boardid='$newboardid' WHERE threadid='$threadid' AND boardid='$boardid'");
        }
        
        // verify prefix
        $prefix $thread['prefix'];
        if ($thread['prefix'] != '') {
            // get allowed prefixes in newboard
            if ($newboard['prefixuse'] == 1$ch_prefix $default_prefix;
            if ($newboard['prefixuse'] == 2$ch_prefix $default_prefix."\n".$newboard['prefix'];
            if ($newboard['prefixuse'] == 3$ch_prefix $newboard['prefix'];
            else $ch_prefix "";
            $ch_prefix preg_replace("/\s*\n\s*/""\n"wbb_trim($ch_prefix));
            $ch_prefix explode("\n"$ch_prefix);
            
            // thread's prefix is not allowed in new board -> delete prefix
            if (!in_array($thread['prefix'], $ch_prefix)) {
                $prefix='';    
            }
        }
        
        $db->query("DELETE FROM bb".$n."_threads WHERE boardid='$newboardid' AND pollid='$threadid' AND closed='3'"); 
        $db->query("UPDATE bb".$n."_threads SET boardid='$newboardid'".(($thread['prefix']!=$prefix) ? ",prefix='".addslashes($prefix)."'" "")." WHERE threadid='$threadid'");
        if ($mode=="movewithredirect"$db->query("INSERT INTO bb".$n."_threads (boardid,prefix,topic,iconid,starttime,starterid,starter,lastposttime,lastposterid,lastposter,replycount,views,closed,voted,votepoints,pollid,visible) VALUES ('$boardid','".addslashes($prefix)."','".addslashes($thread['topic'])."','$thread[iconid]','$thread[starttime]','$thread[starterid]','".addslashes($thread['starter'])."','$thread[lastposttime]','$thread[lastposterid]','".addslashes($thread['lastposter'])."','$thread[replycount]','$thread[views]','3','$thread[voted]','$thread[votepoints]','$threadid','$thread[visible]')");
        
        $thread['replycount']+=1;
        $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount-1, postcount=postcount-'$thread[replycount]' WHERE boardid IN ($boardid,$board[parentlist])");
        $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount+1, postcount=postcount+'$thread[replycount]' WHERE boardid IN ($newboardid,$newboard[parentlist])");
        
        if ($board['lastthreadid']==$threadidupdateBoardInfo("$boardid,$board[parentlist]",0,$threadid);
        if ($newboard['lastposttime']<=$thread['lastposttime']) updateBoardInfo("$newboardid,$newboard[parentlist]",$thread['lastposttime']);
        
        if ($board['countuserposts']==&& $newboard['countuserposts']==0) {
            $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$threadid' AND visible = 1 AND userid>0 GROUP BY userid");
            while ($row=$db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts-'$row[posts]' WHERE userid='$row[userid]'");
        }
        if ($board['countuserposts']==&& $newboard['countuserposts']==1) {
            $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$threadid' AND visible = 1 AND userid>0 GROUP BY userid");
            while ($row=$db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts+'$row[posts]' WHERE userid='$row[userid]'");
        }
    }
    if ($mode == "copy") {
        $db->query("INSERT INTO bb".$n."_threads (boardid,topic,iconid,starttime,starterid,starter,lastposttime,lastposterid,lastposter,replycount,views,closed,voted,votepoints,attachments,pollid,important,visible)
        VALUES ('$newboardid','".addslashes($thread[topic])."','$thread[iconid]','$thread[starttime]','$thread[starterid]','".addslashes($thread[starter])."','$thread[lastposttime]','$thread[lastposterid]','".addslashes($thread[lastposter])."','$thread[replycount]','$thread[views]','$thread[closed]','$thread[voted]','$thread[votepoints]','$thread[attachments]','$thread[pollid]','$thread[important]','$thread[visible]')");
        $newthreadid $db->insert_id();
        // copy poll (ignore votes)
        if ($thread['pollid'] != 0) {
            $poll $db->query_first("SELECT * FROM bb".$n."_polls WHERE pollid='$thread[pollid]'");
            $db->query("INSERT INTO bb".$n."_polls (threadid, question, starttime, choicecount, timeout) ".
            "VALUES ('$newthreadid', '".addslashes($poll['question'])."', '$poll[starttime]', '$poll[choicecount]', '$poll[timeout]')");
            $newpollid $db->insert_id();
            $db->query("UPDATE bb".$n."_threads SET pollid = '$newpollid' WHERE threadid = '$newthreadid'");
            
            $insert_str '';
            $result $db->query("SELECT * FROM bb".$n."_polloptions WHERE pollid = '$thread[pollid]'");
            while ($row $db->fetch_array($result)) {
                $insert_str .= ",('$newpollid', '".addslashes($row['polloption'])."', '$row[votes]', '$row[showorder]')";
            }
            if ($insert_str != ''$db->query("INSERT INTO bb".$n."_polloptions (pollid, polloption, votes, showorder) VALUES ".wbb_substr($insert_str1));
        }
        
        $result $db->query("SELECT * FROM bb".$n."_announcements WHERE threadid='$threadid'");
        if ($db->num_rows($result)) {
            while ($row=$db->fetch_array($result)) $db->query("INSERT INTO bb".$n."_announcements (boardid,threadid) VALUES ('$row[boardid]','$newthreadid')");
            $db->query("INSERT IGNORE INTO bb".$n."_announcements (boardid,threadid) VALUES ('$newboardid','$newthreadid')");
        }
        
        $attachmentPostIDs = array();
        $newPostIDs = array();
        $oldPostIDs = array();
        $result $db->query("SELECT * FROM bb".$n."_posts WHERE threadid='$threadid'");
        while ($row $db->fetch_array($result)) {
            $db->query("INSERT INTO bb".$n."_posts (parentpostid,threadid,userid,username,iconid,posttopic,posttime,message,attachmentid,edittime,editorid,editor,editcount,allowsmilies,allowhtml,allowbbcode,allowimages,showsignature,ipaddress,visible,reindex)
            VALUES ('".((isset($newPostIDs[$row['parentpostid']]) && $newPostIDs[$row['parentpostid']]) ? ($newPostIDs[$row['parentpostid']]) : ($row['parentpostid']))."','$newthreadid','$row[userid]','".addslashes($row[username])."','$row[iconid]','".addslashes($row[posttopic])."','$row[posttime]','".addslashes($row[message])."','$row[attachmentid]','$row[edittime]','$row[editorid]','".addslashes($row[editor])."','$row[editcount]','$row[allowsmilies]','$row[allowhtml]','$row[allowbbcode]','$row[allowimages]','$row[showsignature]','$row[ipaddress]','$row[visible]','1')");
            $newPostIDs[$row['postid']] = $db->insert_id();
            if (!isset($newPostIDs[$row['parentpostid']]) && !$newPostIDs[$row['parentpostid']]) {
                $oldPostIDs[$row['postid']] = $newPostIDs[$row['postid']];
                $oldPostIDs[$newPostIDs[$row['postid']]] = $row['parentpostid'];
            }
            if ($row['attachmentid']) {
                $attachmentPostIDs[$row['postid']] = $newPostIDs[$row['postid']];
            }
        }

        // rebuild threaded view
        if (count($oldPostIDs)) {
            foreach ($oldPostIDs as $newPostID => $oldparentpostID) {
                $db->unbuffered_query("UPDATE bb".$n."_posts SET parentpostid = '".intval($newPostIDs[$oldparentpostID])."' WHERE postid = '".$newPostID."'"1);
            }
        }

        // copy attachments
        if (count($attachmentPostIDs) > 0) {
            $result $db->query("SELECT * FROM bb".$n."_attachments WHERE postid IN (".implode(','array_keys($attachmentPostIDs)).")");
            while ($row $db->fetch_array($result)) {
                $db->query("INSERT INTO bb".$n."_attachments (postid, attachmentname, attachmentextension, attachmentsize, counter) ".
                "VALUES ('".$attachmentPostIDs[$row['postid']]."', '".addslashes($row['attachmentname'])."', '".addslashes($row['attachmentextension'])."', '$row[attachmentsize]', '$row[counter]')");
                $newattachmentid $db->insert_id();
                @copy('attachments/attachment-'.$row['attachmentid'].'.'.$row['attachmentextension'], 'attachments/attachment-'.$newattachmentid.'.'.$row['attachmentextension']);
                @chmod('attachments/attachment-'.$newattachmentid.'.'.$row['attachmentextension'], 0777);
                $db->query("UPDATE bb".$n."_posts SET attachmentid = '$newattachmentid' WHERE postid = '".$attachmentPostIDs[$row['postid']]."'");
            }
        }

        
        $thread['replycount']+=1;
        $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount+1, postcount=postcount+'$thread[replycount]' WHERE boardid IN ($newboardid,$newboard[parentlist])");
        
        if ($newboard['lastposttime']<=$thread['lastposttime']) updateBoardInfo("$newboardid,$newboard[parentlist]",$thread['lastposttime']);
        
        if ($newboard['countuserposts']==1) {
            $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$newthreadid' AND visible = 1 AND userid>0 GROUP BY userid");
            while ($row=$db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts+'$row[posts]' WHERE userid='$row[userid]'");
        }
        
        /* update global threadcount & postcount */
        $db->unbuffered_query("UPDATE bb".$n."_stats SET threadcount=threadcount+1, postcount=postcount+'".$thread['replycount']."'"1);
    }    
}
?>



Geschrieben von alfie am 03.10.2005 um 12:40:

 

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:

<?php
/** delete a thread **/
function deletethread($threadid) {
    global $db$n$thread$board$boardid;
    
    /** delete thread **/
    $db->query("DELETE FROM bb".$n."_threads WHERE threadid = '$threadid'");
    $db->unbuffered_query("DELETE FROM bb".$n."_threads WHERE pollid = '$threadid' AND closed=3"1);
    if ($thread['important'] == 2$db->unbuffered_query("DELETE FROM bb".$n."_announcements WHERE threadid = '$threadid'"1);
    
    /** delete subscriptions **/
    $db->query("DELETE FROM bb".$n."_subscribethreads WHERE threadid = '$threadid'"); 
    
    /** delete poll **/ 
    if ($thread['pollid']) {
        $db->query("DELETE FROM bb".$n."_polls WHERE pollid = '$thread[pollid]'");
        $pollvotes " OR (id = '$thread[pollid]' AND votemode=1)";
        $db->query("DELETE FROM bb".$n."_polloptions WHERE pollid = '$thread[pollid]'");
    }
    else $pollvotes '';
    
    /** delete ratings **/
    $db->query("DELETE FROM bb".$n."_votes WHERE (id = '$threadid' AND votemode=2)$pollvotes");
    
    /** delete attachments **/
    if ($thread['attachments']) {
        $result $db->query("SELECT attachmentid FROM bb".$n."_posts WHERE threadid='$threadid' AND attachmentid>0");
        while ($row $db->fetch_array($result)) $attachmentids .= ",".$row['attachmentid'];
        $result $db->query("SELECT attachmentid, attachmentextension FROM bb".$n."_attachments WHERE attachmentid IN (0$attachmentids)");
        while ($row $db->fetch_array($result)) @unlink("attachments/attachment-".$row['attachmentid'].".".$row['attachmentextension']);
        $db->query("DELETE FROM bb".$n."_attachments WHERE attachmentid IN (0$attachmentids)");
    }
    
    /** delete userpost **/
    if ($board['countuserposts'] == 1) { 
        $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$threadid' AND visible=1 AND userid>0 GROUP BY userid");
        //while ($row = $db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts-'$row[posts]' WHERE userid='$row[userid]'");
    }
    
    /** delete posts **/
    $db->query("DELETE FROM bb".$n."_posts WHERE threadid = '$threadid'");
    $thread['replycount'] += 1;
    
    /* update global threadcount & postcount */
    if ($thread['visible'] == 1$db->unbuffered_query("UPDATE bb".$n."_stats SET threadcount=threadcount-1, postcount=postcount-'".$thread['replycount']."'"1);
    
    /* update boardcount */
    if ($thread['visible'] == 1$db->query("UPDATE bb".$n."_boards SET threadcount=threadcount-1, postcount=postcount-'".$thread['replycount']."' WHERE boardid IN ($boardid,$board[parentlist])");
    if ($board['lastthreadid'] == $threadidupdateBoardInfo("$boardid,$board[parentlist]"0$threadid);
}


/** delete an amount of posts **/
function deleteposts($postids$threadid$postcount) {
    global $db$n$thread$board$boardid;
    
    $result $db->query("SELECT postid, parentpostid FROM bb".$n."_posts WHERE postid IN ($postids) ORDER BY posttime DESC");
    while ($row $db->fetch_array($result)) $db->query("UPDATE bb".$n."_posts SET parentpostid='$row[parentpostid]' WHERE threadid = '".$threadid."' AND parentpostid='$row[postid]'");
    
    /** delete userpost **/
    if ($board['countuserposts'] == 1) {
        $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE postid IN ($postids) AND visible=1 AND userid>0 GROUP BY userid");
        //while ($row = $db->fetch_array($result)) $db->unbuffered_query("UPDATE bb".$n."_users SET userposts=userposts-'$row[posts]' WHERE userid='$row[userid]'", 1);
    }
    
    /** delete attachments **/
    $attachmentcount 0;
    if ($thread['attachments']) {
        $result $db->query("SELECT attachmentid FROM bb".$n."_posts WHERE postid IN ($postids) AND attachmentid>0");
        while ($row $db->fetch_array($result)) {
            $attachmentids .= ",".$row['attachmentid'];
            $attachmentcount++;
        }
        $result $db->query("SELECT attachmentid, attachmentextension FROM bb".$n."_attachments WHERE attachmentid IN (0$attachmentids)");
        while ($row $db->fetch_array($result)) @unlink("attachments/attachment-".$row['attachmentid'].".".$row['attachmentextension']);
        $db->unbuffered_query("DELETE FROM bb".$n."_attachments WHERE attachmentid IN (0$attachmentids)"1);
    }
    
    $db->query("DELETE FROM bb".$n."_posts WHERE postid IN ($postids)");
    
    /* update global postcount */
    $db->unbuffered_query("UPDATE bb".$n."_stats SET postcount=postcount-'".$postcount."'"1); 
    
    /* update board & thread count */
    $db->query("UPDATE bb".$n."_boards SET postcount=postcount-'$postcount' WHERE boardid IN ($boardid,$board[parentlist])");
    $result $db->query_first("SELECT userid, username, posttime FROM bb".$n."_posts WHERE threadid='$threadid' ORDER BY posttime DESC"1);
    $db->query("UPDATE bb".$n."_threads SET replycount=replycount-'$postcount', lastposttime='$result[posttime]', lastposterid='$result[userid]', lastposter='".addslashes($result['username'])."'".(($attachmentcount != 0) ? (", attachments=attachments-'$attachmentcount'") : (""))." WHERE threadid='$threadid'");
    
    updateBoardInfo("$boardid,$board[parentlist]"$thread['lastposttime']);
}


/** move a thread **/
function movethread($threadid$mode$newboardid) {
    global $board$thread$db$n$newboard$default_prefix;    
    
    $boardid $board['boardid'];
    if (!is_array($newboard)) $newboard $db->query_first("SELECT * FROM bb".$n."_boards WHERE boardid = '$newboardid'");
    
    if ($mode == "onlymove" || $mode == "movewithredirect") {
        if ($thread['important'] == 2) {
            list($announcements) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_announcements WHERE threadid='$threadid'");    
            if ($announcements 1$db->query("INSERT IGNORE INTO bb".$n."_announcements (boardid,threadid) VALUES ('$newboardid','$threadid')");
            else $db->query("UPDATE bb".$n."_announcements SET boardid='$newboardid' WHERE threadid='$threadid' AND boardid='$boardid'");
        }
        
        // verify prefix
        $prefix $thread['prefix'];
        if ($thread['prefix'] != '') {
            // get allowed prefixes in newboard
            if ($newboard['prefixuse'] == 1$ch_prefix $default_prefix;
            if ($newboard['prefixuse'] == 2$ch_prefix $default_prefix."\n".$newboard['prefix'];
            if ($newboard['prefixuse'] == 3$ch_prefix $newboard['prefix'];
            else $ch_prefix "";
            $ch_prefix preg_replace("/\s*\n\s*/""\n"wbb_trim($ch_prefix));
            $ch_prefix explode("\n"$ch_prefix);
            
            // thread's prefix is not allowed in new board -> delete prefix
            if (!in_array($thread['prefix'], $ch_prefix)) {
                $prefix='';    
            }
        }
        
        $db->query("DELETE FROM bb".$n."_threads WHERE boardid='$newboardid' AND pollid='$threadid' AND closed='3'"); 
        $db->query("UPDATE bb".$n."_threads SET boardid='$newboardid'".(($thread['prefix']!=$prefix) ? ",prefix='".addslashes($prefix)."'" "")." WHERE threadid='$threadid'");
        if ($mode=="movewithredirect"$db->query("INSERT INTO bb".$n."_threads (boardid,prefix,topic,iconid,starttime,starterid,starter,lastposttime,lastposterid,lastposter,replycount,views,closed,voted,votepoints,pollid,visible) VALUES ('$boardid','".addslashes($prefix)."','".addslashes($thread['topic'])."','$thread[iconid]','$thread[starttime]','$thread[starterid]','".addslashes($thread['starter'])."','$thread[lastposttime]','$thread[lastposterid]','".addslashes($thread['lastposter'])."','$thread[replycount]','$thread[views]','3','$thread[voted]','$thread[votepoints]','$threadid','$thread[visible]')");
        
        $thread['replycount']+=1;
        $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount-1, postcount=postcount-'$thread[replycount]' WHERE boardid IN ($boardid,$board[parentlist])");
        $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount+1, postcount=postcount+'$thread[replycount]' WHERE boardid IN ($newboardid,$newboard[parentlist])");
        
        if ($board['lastthreadid']==$threadidupdateBoardInfo("$boardid,$board[parentlist]",0,$threadid);
        if ($newboard['lastposttime']<=$thread['lastposttime']) updateBoardInfo("$newboardid,$newboard[parentlist]",$thread['lastposttime']);
        
        if ($board['countuserposts']==&& $newboard['countuserposts']==0) {
            $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$threadid' AND visible = 1 AND userid>0 GROUP BY userid");
            //while ($row=$db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts-'$row[posts]' WHERE userid='$row[userid]'");
        }
        if ($board['countuserposts']==&& $newboard['countuserposts']==1) {
            $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$threadid' AND visible = 1 AND userid>0 GROUP BY userid");
            while ($row=$db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts+'$row[posts]' WHERE userid='$row[userid]'");
        }
    }
    if ($mode == "copy") {
        $db->query("INSERT INTO bb".$n."_threads (boardid,topic,iconid,starttime,starterid,starter,lastposttime,lastposterid,lastposter,replycount,views,closed,voted,votepoints,attachments,pollid,important,visible)
        VALUES ('$newboardid','".addslashes($thread[topic])."','$thread[iconid]','$thread[starttime]','$thread[starterid]','".addslashes($thread[starter])."','$thread[lastposttime]','$thread[lastposterid]','".addslashes($thread[lastposter])."','$thread[replycount]','$thread[views]','$thread[closed]','$thread[voted]','$thread[votepoints]','$thread[attachments]','$thread[pollid]','$thread[important]','$thread[visible]')");
        $newthreadid $db->insert_id();
        // copy poll (ignore votes)
        if ($thread['pollid'] != 0) {
            $poll $db->query_first("SELECT * FROM bb".$n."_polls WHERE pollid='$thread[pollid]'");
            $db->query("INSERT INTO bb".$n."_polls (threadid, question, starttime, choicecount, timeout) ".
            "VALUES ('$newthreadid', '".addslashes($poll['question'])."', '$poll[starttime]', '$poll[choicecount]', '$poll[timeout]')");
            $newpollid $db->insert_id();
            $db->query("UPDATE bb".$n."_threads SET pollid = '$newpollid' WHERE threadid = '$newthreadid'");
            
            $insert_str '';
            $result $db->query("SELECT * FROM bb".$n."_polloptions WHERE pollid = '$thread[pollid]'");
            while ($row $db->fetch_array($result)) {
                $insert_str .= ",('$newpollid', '".addslashes($row['polloption'])."', '$row[votes]', '$row[showorder]')";
            }
            if ($insert_str != ''$db->query("INSERT INTO bb".$n."_polloptions (pollid, polloption, votes, showorder) VALUES ".wbb_substr($insert_str1));
        }
        
        $result $db->query("SELECT * FROM bb".$n."_announcements WHERE threadid='$threadid'");
        if ($db->num_rows($result)) {
            while ($row=$db->fetch_array($result)) $db->query("INSERT INTO bb".$n."_announcements (boardid,threadid) VALUES ('$row[boardid]','$newthreadid')");
            $db->query("INSERT IGNORE INTO bb".$n."_announcements (boardid,threadid) VALUES ('$newboardid','$newthreadid')");
        }
        
        $attachmentPostIDs = array();
        $newPostIDs = array();
        $oldPostIDs = array();
        $result $db->query("SELECT * FROM bb".$n."_posts WHERE threadid='$threadid'");
        while ($row $db->fetch_array($result)) {
            $db->query("INSERT INTO bb".$n."_posts (parentpostid,threadid,userid,username,iconid,posttopic,posttime,message,attachmentid,edittime,editorid,editor,editcount,allowsmilies,allowhtml,allowbbcode,allowimages,showsignature,ipaddress,visible,reindex)
            VALUES ('".((isset($newPostIDs[$row['parentpostid']]) && $newPostIDs[$row['parentpostid']]) ? ($newPostIDs[$row['parentpostid']]) : ($row['parentpostid']))."','$newthreadid','$row[userid]','".addslashes($row[username])."','$row[iconid]','".addslashes($row[posttopic])."','$row[posttime]','".addslashes($row[message])."','$row[attachmentid]','$row[edittime]','$row[editorid]','".addslashes($row[editor])."','$row[editcount]','$row[allowsmilies]','$row[allowhtml]','$row[allowbbcode]','$row[allowimages]','$row[showsignature]','$row[ipaddress]','$row[visible]','1')");
            $newPostIDs[$row['postid']] = $db->insert_id();
            if (!isset($newPostIDs[$row['parentpostid']]) && !$newPostIDs[$row['parentpostid']]) {
                $oldPostIDs[$row['postid']] = $newPostIDs[$row['postid']];
                $oldPostIDs[$newPostIDs[$row['postid']]] = $row['parentpostid'];
            }
            if ($row['attachmentid']) {
                $attachmentPostIDs[$row['postid']] = $newPostIDs[$row['postid']];
            }
        }

        // rebuild threaded view
        if (count($oldPostIDs)) {
            foreach ($oldPostIDs as $newPostID => $oldparentpostID) {
                $db->unbuffered_query("UPDATE bb".$n."_posts SET parentpostid = '".intval($newPostIDs[$oldparentpostID])."' WHERE postid = '".$newPostID."'"1);
            }
        }

        // copy attachments
        if (count($attachmentPostIDs) > 0) {
            $result $db->query("SELECT * FROM bb".$n."_attachments WHERE postid IN (".implode(','array_keys($attachmentPostIDs)).")");
            while ($row $db->fetch_array($result)) {
                $db->query("INSERT INTO bb".$n."_attachments (postid, attachmentname, attachmentextension, attachmentsize, counter) ".
                "VALUES ('".$attachmentPostIDs[$row['postid']]."', '".addslashes($row['attachmentname'])."', '".addslashes($row['attachmentextension'])."', '$row[attachmentsize]', '$row[counter]')");
                $newattachmentid $db->insert_id();
                @copy('attachments/attachment-'.$row['attachmentid'].'.'.$row['attachmentextension'], 'attachments/attachment-'.$newattachmentid.'.'.$row['attachmentextension']);
                @chmod('attachments/attachment-'.$newattachmentid.'.'.$row['attachmentextension'], 0777);
                $db->query("UPDATE bb".$n."_posts SET attachmentid = '$newattachmentid' WHERE postid = '".$attachmentPostIDs[$row['postid']]."'");
            }
        }

        
        $thread['replycount']+=1;
        $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount+1, postcount=postcount+'$thread[replycount]' WHERE boardid IN ($newboardid,$newboard[parentlist])");
        
        if ($newboard['lastposttime']<=$thread['lastposttime']) updateBoardInfo("$newboardid,$newboard[parentlist]",$thread['lastposttime']);
        
        if ($newboard['countuserposts']==1) {
            $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$newthreadid' AND visible = 1 AND userid>0 GROUP BY userid");
            while ($row=$db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts+'$row[posts]' WHERE userid='$row[userid]'");
        }
        
        /* update global threadcount & postcount */
        $db->unbuffered_query("UPDATE bb".$n."_stats SET threadcount=threadcount+1, postcount=postcount+'".$thread['replycount']."'"1);
    }    
}
?>


MfG

alfie



Geschrieben von Darkwarrior am 03.10.2005 um 17:54:

 

Dann kommt folgende Fehlermeldung:

Zitat:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /www/htdocs/solaron/forum/modcp.php on line 2

Parse error: parse error, unexpected T_STRING in /www/htdocs/solaron/forum/modcp.php on line 2


;-(

Laut der Fehlermeldung scheints dann wohl nicht an der anderen Datei zu liegen, sondern an der modcp.php

Und meine bearbeitete Modcp.php Datei sieht so aus:

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
525:
526:
527:
528:
529:
530:
531:
532:
533:
534:
535:
536:
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
573:
574:
575:
576:
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}
\viewkind4\uc1\pard\lang1031\f0\fs20 <?php\par
$filename 'modcp.php';\par
\par
require('./global.php');\par
require('./acp/lib/mod_functions.php');\par
$lang->load('MODCP');\par
\par
$m_is_mod 0;\par
$isuser 0;\par
if (isset($threadid)) \{\par
\tab if ($wbbuserdata['m_is_supermod'] == || $board['moderatorid']) $m_is_mod 1;\par
\tab if ($wbbuserdata['userid'] && $wbbuserdata['userid'] == $thread['starterid'] && (checkpermissions('can_close_own_topic') == || checkpermissions('can_del_own_topic') == || checkpermissions('can_edit_own_topic') == || checkpermissions('can_move_own_topic') == 1)) $isuser 1;\par
\}\par
\par
if (isset($_REQUEST['action'])) $action $_REQUEST['action'];\par
else $action '';\par
if ($action == '' || $action == -1error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array("adminmail" => $adminmail)));\par
\par
\par
\par
\par
\par
/** delete posts **/\par
if ($action == 'post_del') \{\par
\tab if (!checkmodpermissions('m_can_post_del')) access_error();\par
\tab if (isset($_POST['send'])) \{\par
\tab\tab if (is_array($_POST['postids']) && count($_POST['postids'])) $postids implode(','$_POST['postids']);\par
\tab\tab else $postids '';\par
\tab\tab if (!$postids) \{\par
\tab\tab\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab\tab exit();\tab\par
\tab\tab\}\par
\tab\tab list($postcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_posts WHERE threadid='$threadid' AND postid IN ($postids)");\par
\tab\tab if ($postcount == $thread['replycount'] + 1) \{\par
\tab\tab\tab deletethread($threadid);\par
\tab\tab\tab header("Location: board.php?boardid=$boardid$SID_ARG_2ND_UN);\par
\tab\tab\tab exit();\par
\tab\tab\}\tab\par
\tab\tab else \{\par
\tab\tab\tab deleteposts($postids$threadid$postcount);\par
\tab\tab\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab\tab exit();\tab\par
\tab\tab\}\par
\tab\}\par
\tab\par
\tab list($postcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_posts WHERE threadid='$threadid'");\par
\tab if ($wbbuserdata['umaxposts']) $postsperpage $wbbuserdata['umaxposts'];\par
\tab elseif ($board['postsperpage']) $postsperpage $board['postsperpage'];\par
\tab else $postsperpage $default_postsperpage;\par
\tab $postorder $board['postorder'];\par
\tab\par
\tab if (isset($_GET['page'])) \{\par
\tab\tab $page intval($_GET['page']);\par
\tab\tab if ($page == 0$page 1;\par
\tab\}\par
\tab else $page 1;\par
\tab $pages ceil($postcount $postsperpage);\par
\tab if ($pages 1$pagelink makepagelink("modcp.php?action=post_del&amp;threadid=$threadid".$SID_ARG_2ND$page$pages$showpagelinks 1);\par
\tab $navbar getNavbar($board['parentlist']);\par
\tab eval("\\$navbar .= \\"".$tpl->get("navbar_board")."\\";");\par
\tab\par
\tab $postbit '';\par
\tab $count 0;\par
\tab $result $db->query("SELECT postid, username, posttime, message FROM bb".$n."_posts WHERE threadid='$threadid' ORDER BY posttime ".(($postorder) ? ("DESC") : ("ASC")), $postsperpage$postsperpage * ($page 1));\tab\par
\tab while ($row $db->fetch_array($result)) \{\par
\tab\tab $tdclass getone($count'tableb''tablea');\par
\tab\tab\par
\tab\tab $postdate formatdate($wbbuserdata['dateformat'], $row['posttime']);\par
\tab\tab $posttime formatdate($wbbuserdata['timeformat'], $row['posttime']);\par
\tab\tab if (wbb_strlen($row['message']) > 100$row['message'] = wbb_substr($row['message'], 0100).'...';\par
\tab\tab $row['message'] = htmlconverter($row['message']);\par
\tab\tab $row['username'] = htmlconverter($row['username']);\par
\tab\tab $LANG_MODCP_BY $lang->get("LANG_MODCP_BY", array('$username' => $row['username'], '$postdate' => $postdate'$posttime' => $posttime));\par
\tab\tab eval("\\$postbit .= \\"".$tpl->get("modcp_postbit")."\\";");\par
\tab\tab $count++;\par
\tab\}\tab\par
\tab\par
\tab $thread['topic'] = htmlconverter(textwrap($thread['topic']));\par
\tab eval("\\$tpl->output(\\"".$tpl->get("modcp_post_del")."\\");");\par
\}\par
\par
\par
\par
\par
/** divide/seperate thread **/\par
if ($action == 'thread_cut') \{\par
\tab if (!checkmodpermissions('m_can_thread_cut')) access_error();\par
\tab if (isset($_POST['send'])) \{\par
\tab\tab if (is_array($_POST['postids']) && count($_POST['postids'])) $postids implode(','$_POST['postids']);\par
\tab\tab $newboardid intval($_POST['newboardid']);\par
\tab\tab if (!$postids) \{\par
\tab\tab\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab\tab exit();\tab\par
\tab\tab\}\par
\tab\tab list($postcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_posts WHERE threadid='$threadid' AND postid IN ($postids)");\par
\tab\tab if ($postcount == $thread['replycount'] + 1error($lang->get("LANG_MODCP_ERROR_CANTCUT"));\par
\tab\tab else \{\par
\tab\tab\tab $topic wbb_trim($_POST['topic']);\par
\tab\tab\tab if (!$topic || $newboardid == -1error($lang->get("LANG_GLOBAL_ERROR1"));\par
\tab\tab\tab $newboard getBoardAccessData($newboardid);\par
\tab\tab\tab if (!$newboard['boardid']) error($lang->get("LANG_GLOBAL_ERROR1"));\par
\tab\tab\tab if (!checkpermissions("can_enter_board"$newboard) || $newboard['isboard'] == 0access_error();\par
\tab\tab\tab\par
\tab\tab\tab $firstpost $db->query_first("SELECT userid, username, posttime FROM bb".$n."_posts WHERE postid IN ($postids) ORDER BY posttime ASC"1);\par
\tab\tab\tab $lastpost $db->query_first("SELECT userid, username, posttime FROM bb".$n."_posts WHERE postid IN ($postids) ORDER BY posttime DESC"1);\par
\tab\tab\tab\par
\tab\tab\tab $db->query("INSERT INTO bb".$n."_threads (boardid,topic,starttime,starterid,starter,lastposttime,lastposterid,lastposter,replycount,visible) VALUES ('$newboardid','".addslashes($topic)."','$firstpost[posttime]','$firstpost[userid]','".addslashes($firstpost['username'])."','$lastpost[posttime]','$lastpost[userid]','".addslashes($lastpost['username'])."','".($postcount 1)."',1)");\par
\tab\tab\tab $newthreadid $db->insert_id();\par
\tab\tab\tab\par
\tab\tab\tab $db->query("UPDATE bb".$n."_posts SET threadid='$newthreadid' WHERE postid IN ($postids)");\par
\tab\tab\tab $db->query("UPDATE bb".$n."_postcache SET threadid='$newthreadid' WHERE postid IN ($postids)");\par
\tab\tab\tab $db->unbuffered_query("UPDATE bb".$n."_posts SET parentpostid=0 WHERE threadid='$threadid' AND postid IN ($postids) AND parentpostid NOT IN ($postids)"1);\par
\tab\tab\tab $db->unbuffered_query("UPDATE bb".$n."_posts SET parentpostid=0 WHERE threadid='$threadid' AND postid NOT IN ($postids) AND parentpostid IN ($postids)"1);\par
\tab\tab\tab\par
\tab\tab\tab $result $db->query_first("SELECT userid, username, posttime FROM bb".$n."_posts WHERE threadid='$threadid' ORDER BY posttime DESC"1);\par
\tab\tab\tab $db->query("UPDATE bb".$n."_threads SET replycount=replycount-'$postcount', lastposttime='$result[posttime]', lastposterid='$result[userid]', lastposter='".addslashes($result['username'])."'".(($post['attachmentid']) ? (", attachments=attachments-1") : (""))." WHERE threadid='$threadid'");\par
\tab\tab\tab\par
\tab\tab\tab $db->query("UPDATE bb".$n."_boards SET postcount=postcount-'$postcount' WHERE boardid IN ($boardid,$board[parentlist])");\par
\tab\tab\tab $db->query("UPDATE bb".$n."_boards SET postcount=postcount+'$postcount', threadcount=threadcount+1 WHERE boardid IN ($newboardid,$newboard[parentlist])");\par
\tab\tab\tab\par
\tab\tab\tab if ($board['lastthreadid'] == $threadidupdateBoardInfo("$boardid,$board[parentlist]"0$threadid);\par
\tab\tab\tab if ($newboard['lastposttime'] <= $lastpost['posttime']) updateBoardInfo("$newboardid,$newboard[parentlist]"$lastpost['posttime']);\par
\tab\tab\tab\par
\tab\tab\tab if ($board['countuserposts'] == && $newboard['countuserposts'] == 0) \{\par
\tab\tab\tab\tab $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE postid IN ($postids) AND visible = 1 AND userid>0 GROUP BY userid");\par
\tab\tab\tab\tab  // while ($row = $db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts-'$row[posts]' WHERE userid='$row[userid]'");  $row[userid]'");  $row[userid]'");\par
\tab\tab\tab\}\par
\tab\tab\tab if ($board['countuserposts'] == && $newboard['countuserposts'] == 1) \{\par
\tab\tab\tab\tab $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE postid IN ($postids) AND visible = 1 AND userid>0 GROUP BY userid");\par
\tab\tab\tab\tab while ($row $db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts+'$row[posts]' WHERE userid='$row[userid]'");\par
\tab\tab\tab\}\par
\tab\tab\tab\par
\tab\tab\tab /* update global threadcount */\par
\tab\tab\tab $db->unbuffered_query("UPDATE bb".$n."_stats SET threadcount=threadcount+1"1);\par
\tab\tab\tab\par
\tab\tab\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab\tab exit();\tab\par
\tab\tab\}\tab\par
\tab\}\par
\tab\par
\tab list($postcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_posts WHERE threadid='$threadid'");\par
\tab if ($wbbuserdata['umaxposts']) $postsperpage $wbbuserdata['umaxposts'];\par
\tab elseif ($board['postsperpage']) $postsperpage $board['postsperpage'];\par
\tab else $postsperpage $default_postsperpage;\par
\tab $postorder $board['postorder'];\par
\tab\par
\tab if (isset($_GET['page'])) \{\par
\tab\tab $page intval($_GET['page']);\par
\tab\tab if ($page == 0$page 1;\par
\tab\}\par
\tab else $page 1;\par
\tab $pages ceil($postcount $postsperpage);\par
\tab if ($pages 1$pagelink makepagelink("modcp.php?action=thread_cut&amp;threadid=$threadid".$SID_ARG_2ND$page$pages$showpagelinks 1);\par
\tab $navbar getNavbar($board['parentlist']);\par
\tab eval("\\$navbar .= \\"".$tpl->get("navbar_board")."\\";");\par
\tab\par
\tab $postbit '';\par
\tab $count 0;\par
\tab $result $db->query("SELECT postid, username, posttime, message FROM bb".$n."_posts WHERE threadid='$threadid' ORDER BY posttime ".(($postorder) ? ("DESC") : ("ASC")), $postsperpage$postsperpage * ($page 1));\tab\par
\tab while ($row $db->fetch_array($result)) \{\par
\tab\tab $tdclass getone($count'tableb''tablea');\par
\tab\tab\par
\tab\tab $postdate formatdate($wbbuserdata['dateformat'], $row['posttime']);\par
\tab\tab $posttime formatdate($wbbuserdata['timeformat'], $row['posttime']);\par
\tab\tab if (wbb_strlen($row['message']) > 100$row['message'] = wbb_substr($row['message'], 0100).'...';\par
\tab\tab $row['message'] = htmlconverter($row['message']);\par
\tab\tab $row['username'] = htmlconverter($row['username']);\par
\tab\tab $LANG_MODCP_BY $lang->get("LANG_MODCP_BY", array('$username' => $row['username'], '$postdate' => $postdate'$posttime' => $posttime));\par
\tab\tab eval("\\$postbit .= \\"".$tpl->get("modcp_postbit2")."\\";");\par
\tab\tab $count++;\par
\tab\}\par
\tab\par
\tab $result $db->query("SELECT boardid, parentid, boardorder, title, invisible, isboard FROM bb".$n."_boards ORDER by parentid ASC, boardorder ASC");\par
\tab while ($row $db->fetch_array($result)) $boardcache[$row['parentid']][$row['boardorder']][$row['boardid']] = $row;\par
\tab\par
\tab $permissioncache getPermissions();\par
\tab $board_options makeboardselect(010"%s *");\par
\tab\par
\tab $thread['topic'] = htmlconverter(textwrap($thread['topic']));\par
\tab eval("\\$tpl->output(\\"".$tpl->get("modcp_thread_cut")."\\");");\par
\}\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
/** close/open thread **/\par
if ($action == 'thread_close') \{\par
\tab if (!isset($threadid)) error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array("adminmail" => $adminmail)));\par
\tab\par
\tab if (!checkmodpermissions('m_can_thread_close') && (!$isuser || checkpermissions('can_close_own_topic') == 0)) access_error();\par
\tab $db->query("UPDATE bb".$n."_threads SET closed=1-'$thread[closed]' WHERE threadid='$threadid'");\par
\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab exit();\par
\}\par
\par
\par
\par
\par
\par
\par
\par
\par
/** top/untop thread **/\par
if ($action == 'thread_top') \{\par
\tab if (!isset($threadid)) error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array("adminmail" => $adminmail)));\par
\tab\par
\tab if (!checkmodpermissions('m_can_thread_top')) access_error();\par
\tab if ($thread['important'] == 2) \{\par
\tab\tab $db->query("DELETE FROM bb".$n."_announcements WHERE threadid='$threadid'");\par
\tab\tab $thread['important'] = 1;\par
\tab\}\par
\tab $db->query("UPDATE bb".$n."_threads SET important=1-'$thread[important]' WHERE threadid='$threadid'");\par
\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab exit();\par
\}\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
/** delete thread **/\par
if ($action == 'thread_del') \{\par
\tab if (!isset($threadid)) error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array("adminmail" => $adminmail)));\par
\tab\par
\tab if (!checkmodpermissions('m_can_thread_del') && (!$isuser || checkpermissions('can_del_own_topic') == 0)) access_error();\par
\tab if (isset($_POST['send'])) \{\par
\tab\tab deletethread($threadid);\par
\tab\tab header("Location: board.php?boardid=$boardid".$SID_ARG_2ND_UN);\par
\tab\tab exit();\par
\tab\}\par
\tab else \{\par
\tab\tab $navbar getNavbar($board['parentlist']);\par
\tab\tab eval("\\$navbar .= \\"".$tpl->get("navbar_board")."\\";");\par
\tab\tab\par
\tab\tab $thread['topic'] = htmlconverter(textwrap($thread['topic']));\par
\tab\tab eval("\\$tpl->output(\\"".$tpl->get("modcp_thread_del")."\\");");\par
\tab\}\par
\}\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
/** move thread **/\par
if ($action == 'thread_move') \{\par
\tab if (!checkmodpermissions('m_can_thread_move') && (!$isuser || checkpermissions('can_move_own_topic') == 0)) access_error();\par
\tab if (isset($_POST['send'])) \{\par
\tab\tab $newboardid intval($_POST['newboardid']);\par
\tab\tab $mode $_POST['mode'];\par
\tab\tab if (!$newboardid || $newboardid == -|| $newboardid == $boardiderror($lang->get("LANG_MODCP_ERROR_CANTMOVE"));\par
\tab\tab $newboard getBoardAccessData($newboardid);\par
\tab\tab if (!checkpermissions('can_enter_board'$newboard) || $newboard['isboard'] == 0error($lang->get("LANG_MODCP_ERROR_CANTMOVE"));\par
\tab\tab\par
\tab\tab movethread($threadid$mode$newboardid);\par
\tab\tab\par
\tab\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab exit();\par
\tab\}\par
\tab else \{\par
\tab\tab $navbar getNavbar($board['parentlist']);\par
\tab\tab eval("\\$navbar .= \\"".$tpl->get("navbar_board")."\\";");\par
\tab\tab\par
\tab\tab $result $db->query("SELECT boardid, parentid, boardorder, title, invisible, isboard FROM bb".$n."_boards ORDER by parentid ASC, boardorder ASC");\par
\tab\tab while ($row $db->fetch_array($result)) $boardcache[$row['parentid']][$row['boardorder']][$row['boardid']] = $row;\par
\tab\tab\par
\tab\tab $permissioncache getPermissions();\par
\tab\tab $newboard_options makeboardselect(010"%s *");\par
\tab\tab\par
\tab\tab $thread['topic'] = htmlconverter(textwrap($thread['topic']));\par
\tab\tab eval("\\$tpl->output(\\"".$tpl->get("modcp_thread_move")."\\");");\par
\tab\}\par
\}\par
\par
\par
\par
\par
\par
\par
\par
/** merge thread **/\par
if ($action == 'thread_merge') \{\par
\tab if (!isset($threadid)) error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array("adminmail" => $adminmail)));\par
\tab\par
\tab if (!checkmodpermissions('m_can_thread_merge')) access_error();\par
\tab if (isset($_POST['send'])) \{\par
\tab\tab $merge_threadid 0;\par
\tab\tab $merge_postid 0;\par
\tab\tab $mergeurl $_POST['mergeurl'];\par
\tab\tab list ($script$query) = split ('[?]'$mergeurl);\par
\tab\tab $values explode('&'$query);\par
\tab\tab while (list($key$val) = each($values)) \{\par
\tab\tab\tab list ($varname$value) = explode('='$val);\par
\tab\tab\tab if ($varname == 'threadid') \{\par
\tab\tab\tab\tab $merge_threadid intval($value);\par
\tab\tab\tab\tab break;\par
\tab\tab\tab\}\par
\tab\tab\tab if ($varname == 'postid') \{\par
\tab\tab\tab\tab $merge_postid intval($value);\par
\tab\tab\tab\tab break;\par
\tab\tab\tab\}\par
\tab\tab\} \par
\tab\tab\par
\tab\tab if ((!$merge_postid && !$merge_threadid) || $merge_threadid == $threadiderror($lang->get("LANG_MODCP_ERROR_CANTMERGE"));\par
\tab\tab\par
\tab\tab if ($merge_postid$merge_thread $db->query_first("SELECT t.* FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND p.postid='$merge_postid'");\par
\tab\tab if ($merge_threadid$merge_thread $db->query_first("SELECT * FROM bb".$n."_threads WHERE threadid='$merge_threadid'");\par
\tab\tab\par
\tab\tab if (!$merge_thread['threadid']) error($lang->get("LANG_MODCP_ERROR_CANTMERGE"));\par
\tab\tab\par
\tab\tab if ($merge_thread['lastposttime'] > $thread['lastposttime']) $db->query("UPDATE bb".$n."_threads SET replycount=replycount+'".($merge_thread['replycount'] + 1)."', lastposttime='$merge_thread[lastposttime]', lastposterid='$merge_thread[lastposterid]', lastposter='".addslashes($merge_thread['lastposter'])."' WHERE threadid='$threadid'");\par
\tab\tab else $db->query("UPDATE bb".$n."_threads SET replycount=replycount+'".($merge_thread['replycount'] + 1)."' WHERE threadid='$threadid'");\par
\tab\tab\par
\tab\tab $db->query("DELETE FROM bb".$n."_threads WHERE threadid = '$merge_threadid'");\par
\tab\tab $db->query("DELETE FROM bb".$n."_threads WHERE pollid = '$merge_threadid' AND closed=3");\par
\tab\tab if ($merge_thread['important'] == 2$db->unbuffered_query("DELETE FROM bb".$n."_announcements WHERE threadid = '$merge_threadid'"1);\par
\tab\tab $db->query("DELETE FROM bb".$n."_subscribethreads WHERE threadid = '$merge_threadid'");\par
\tab\tab if ($thread['pollid']) \{\par
\tab\tab\tab $db->query("DELETE FROM bb".$n."_polls WHERE pollid = '$merge_thread[pollid]'");\par
\tab\tab\tab $pollvotes " OR (id = '$merge_thread[pollid]' AND votemode=1)";\par
\tab\tab\tab $db->query("DELETE FROM bb".$n."_polloptions WHERE pollid = '$merge_thread[pollid]'");\par
\tab\tab\}\par
\tab\tab else $pollvotes '';\par
\tab\tab $db->query("DELETE FROM bb".$n."_votes WHERE (id = '$merge_threadid' AND votemode=2)$pollvotes");\par
\tab\tab\par
\tab\tab if ($merge_thread['boardid'] == $boardid) \{\par
\tab\tab\tab $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount-1 WHERE boardid IN ($boardid,$board[parentlist])");\par
\tab\tab\tab if ($board['lastthreadid'] == $merge_threadid$db->query("UPDATE bb".$n."_boards SET lastthreadid='$threadid' WHERE boardid IN ($boardid,$board[parentlist]) AND lastthreadid='$merge_threadid'");\par
\tab\tab\tab $db->query("UPDATE bb".$n."_posts SET threadid='$threadid', parentpostid=0 WHERE threadid='$merge_threadid'");\par
\tab\tab\tab $db->query("UPDATE bb".$n."_postcache SET threadid='$threadid' WHERE threadid='$merge_threadid'");\par
\tab\tab\}\par
\tab\tab else \{\par
\tab\tab\tab $oldboard $db->query_first("SELECT * FROM bb".$n."_boards WHERE boardid='$merge_thread[boardid]'");\par
\tab\tab\tab $merge_thread['replycount'] += 1;\par
\tab\tab\tab $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount-1, postcount=postcount-'$merge_thread[replycount]' WHERE boardid IN ($oldboard[boardid],$oldboard[parentlist])");\par
\tab\tab\tab $db->query("UPDATE bb".$n."_boards SET threadcount=threadcount+1, postcount=postcount+'$merge_thread[replycount]' WHERE boardid IN ($boardid,$board[parentlist])");\par
\tab\tab\tab\par
\tab\tab\tab if ($oldboard['countuserposts'] == && $board['countuserposts'] == 0) \{\par
\tab\tab\tab\tab $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$merge_threadid' AND visible = 1 AND userid>0 GROUP BY userid");\par
\tab\tab\tab\tab  // while ($row = $db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts-'$row[posts]' WHERE userid='$row[userid]'");  $row[userid]'");\par
\tab\tab\tab\}\par
\tab\tab\tab if ($oldboard['countuserposts'] == && $board['countuserposts'] == 1) \{\par
\tab\tab\tab\tab $result $db->query("SELECT COUNT(postid) AS posts, userid FROM bb".$n."_posts WHERE threadid='$merge_threadid' AND visible = 1 AND userid>0 GROUP BY userid");\par
\tab\tab\tab\tab while ($row $db->fetch_array($result)) $db->query("UPDATE bb".$n."_users SET userposts=userposts+'$row[posts]' WHERE userid='$row[userid]'");\par
\tab\tab\tab\}\par
\tab\tab\tab\par
\tab\tab\tab $db->query("UPDATE bb".$n."_posts SET threadid='$threadid' WHERE threadid='$merge_threadid'");\par
\tab\tab\tab $db->query("UPDATE bb".$n."_postcache SET threadid='$threadid' WHERE threadid='$merge_threadid'");\par
\tab\tab\tab\par
\tab\tab\tab if ($oldboard['lastthreadid'] == $merge_threadidupdateBoardInfo("$oldboard[boardid],$oldboard[parentlist]"0$merge_threadid);\par
\tab\tab\tab if ($board['lastposttime'] <= $merge_thread['lastposttime']) updateBoardInfo("$boardid,$board[parentlist]"$merge_thread['lastposttime']);\par
\tab\tab\}\par
\tab\tab\par
\tab\tab /* update global threadcount */\par
\tab\tab $db->unbuffered_query("UPDATE bb".$n."_stats SET threadcount=threadcount-1"1);\par
\tab\tab\par
\tab\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab exit();\par
\tab\}\par
\tab\par
\tab $navbar getNavbar($board['parentlist']);\par
\tab eval("\\$navbar .= \\"".$tpl->get("navbar_board")."\\";");\par
\tab\par
\tab $thread['topic'] = htmlconverter(textwrap($thread['topic']));\par
\tab\par
\tab $lang->items['LANG_MODCP_THREAD_MERGE_INFO1'] = $lang->get("LANG_MODCP_THREAD_MERGE_INFO1", array('$topic' => $thread['topic']));\par
\tab eval("\\$tpl->output(\\"".$tpl->get("modcp_thread_merge")."\\");"); \par
\}\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
/** edit thread **/\par
if ($action == 'thread_edit') \{\par
\tab if (!isset($threadid)) error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array("adminmail" => $adminmail)));\par
\tab\par
\tab if (!checkmodpermissions('m_can_thread_edit') && (!$isuser || checkpermissions('can_edit_own_topic') == 0)) access_error();\par
\tab if (isset($_POST['send'])) \{\par
\tab\tab $topic wbb_trim($_POST['topic']);\par
\tab\tab\par
\tab\tab if (isset($_POST['iconid']) && checkpermissions("can_use_post_icons") == 1$iconid intval($_POST['iconid']);\par
\tab\tab else $iconid 0;\par
\tab\tab\par
\tab\tab if ($dostopshooting == 1$topic stopShooting($topic);\par
\tab\tab if (!$topicerror($lang->get("LANG_GLOBAL_ERROR1"));\par
\tab\tab if ($m_is_mod == 1$important intval($_POST['important']);\par
\tab\tab else $important $thread['important'];\par
\tab\tab if ($important == && $thread['important'] != 2$db->unbuffered_query("INSERT IGNORE INTO bb".$n."_announcements (boardid,threadid) VALUES ($boardid,$threadid)");  \par
\tab\tab if ($important != && $thread['important'] == 2$db->unbuffered_query("DELETE FROM bb".$n."_announcements WHERE threadid = '$threadid'"1);  \par
\tab\tab\par
\tab\tab // remove redirect(s)\par
\tab\tab if ($m_is_mod == && isset($_POST['rm_redirect']) && $_POST['rm_redirect'] == 1$db->unbuffered_query("DELETE FROM bb".$n."_threads WHERE pollid='$threadid' AND closed=3"1);\par
\tab\tab\par
\tab\tab // verify prefix\par
\tab\tab unset($prefix);\par
\tab\tab if (isset($_POST['prefix']) && $board['prefixuse'] > && checkpermissions('can_use_prefix')) \{\par
\tab\tab\tab if ($board['prefixuse'] == 1$ch_prefix $default_prefix;\par
\tab\tab\tab if ($board['prefixuse'] == 2$ch_prefix $default_prefix."\\n".$board['prefix'];\par
\tab\tab\tab if ($board['prefixuse'] == 3$ch_prefix $board['prefix'];\par
\tab\tab\tab $ch_prefix preg_replace("/\\s*\\n\\s*/""\\n"wbb_trim($ch_prefix));\par
\tab\tab\tab $ch_prefix explode("\\n"$ch_prefix);\par
\tab\tab\tab if (in_array($_POST['prefix'], $ch_prefix)) $prefix $_POST['prefix'];\par
\tab\tab\tab else $prefix '';\par
\tab\tab\}\par
\tab\tab\par
\tab\tab $db->unbuffered_query("UPDATE bb".$n."_threads SET topic='".addslashes($topic)."',topicdescription='".addslashes($topicdescription)."', iconid='$iconid', ".((checkmodpermissions("m_can_thread_close") || ($isuser && $wbbuserdata['can_close_own_topic'] == 1)) ? ("closed='".intval($_POST['closed'])."',") : (""))."important='$important'".((isset($prefix)) ? (", prefix='".addslashes($prefix)."'") : (""))." WHERE threadid='$threadid'"1);\par
\tab\tab $db->unbuffered_query("UPDATE bb".$n."_posts SET posttopic='".addslashes($topic)."', iconid='$iconid' WHERE threadid='$threadid' AND posttime = '$thread[starttime]'"1);\par
\tab\tab\par
\tab\tab if (isset($_POST['submitbutton']) || (!isset($_POST['announce']) || !$_POST['announce'])) header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab else header("Location: modcp.php?action=announce&threadid=$threadid".$SID_ARG_2ND_UN);\par
\tab\tab exit();\par
\tab\}\par
\tab\par
\tab $lang->load('POSTINGS');\par
\tab if (checkpermissions("can_use_post_icons") == 1$newthread_icons getIcons($thread['iconid']);\par
\tab if ($thread['closed'] == 1$checked " checked=\\"checked\\"";\par
\tab\par
\tab $navbar getNavbar($board['parentlist']);\par
\tab eval("\\$navbar .= \\"".$tpl->get("navbar_board")."\\";");\par
\tab\par
\tab if ($m_is_mod == 1) \{\par
\tab\tab $imp_checked[$thread['important']] = " checked=\\"checked\\"";\par
\tab\tab eval("\\$change_important = \\"".$tpl->get("modcp_thread_edit_important")."\\";");\par
\tab\tab\par
\tab\tab list($redirectlink) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_threads WHERE pollid='$threadid' AND closed=3");\par
\tab\tab if ($redirectlink 0) eval("\\$remove_redirect = \\"".$tpl->get("modcp_thread_remove_redirect")."\\";");\par
\tab\}\par
\tab\par
\tab if ($board['prefixuse'] > && checkpermissions('can_use_prefix')) \{\par
\tab\tab if ($board['prefixuse'] == 1$ch_prefix $default_prefix;\par
\tab\tab if ($board['prefixuse'] == 2$ch_prefix $default_prefix."\\n".$board['prefix'];\par
\tab\tab if ($board['prefixuse'] == 3$ch_prefix $board['prefix'];\par
\tab\tab\par
\tab\tab $ch_prefix preg_replace("/\\s*\\n\\s*/""\\n"wbb_trim($ch_prefix));\par
\tab\tab $ch_prefix explode("\\n"$ch_prefix);\tab\par
\tab\tab sort($ch_prefix);\par
\tab\tab\par
\tab\tab $thread['prefix'] = htmlconverter($thread['prefix']);\par
\tab\tab $prefix_options '';\par
\tab\tab for ($i 0$i count($ch_prefix); $i++) \{\par
\tab\tab\tab $ch_prefix[$i] = htmlconverter($ch_prefix[$i]);\par
\tab\tab\tab $prefix_options .= makeoption($ch_prefix[$i], $ch_prefix[$i], $thread['prefix'], 1);\tab\par
\tab\tab\}\tab\par
\tab\tab if ($prefix_options != '') eval("\\$select_prefix = \\"".$tpl->get("newthread_prefix")."\\";");\par
\tab\}\par
\tab\par
\tab $thread['topic'] = htmlconverter($thread['topic']);\par
\tab eval("\\$tpl->output(\\"".$tpl->get("modcp_thread_edit")."\\");");\par
\}\par
\par
\par
\par
\par
\par
\par
\par
\par
/** announce **/\par
if ($action == 'announce') \{\par
\tab if (!isset($threadid) || $thread['important'] != 2error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array("adminmail" => $adminmail)));\par
\tab if (!checkmodpermissions('m_can_announce')) access_error();\par
\tab\par
\tab\par
\tab if (isset($_POST['send'])) \{\par
\tab\tab $db->query("DELETE FROM bb".$n."_announcements WHERE boardid<>'$boardid' AND threadid='$threadid'");\par
\tab\tab $boardids $_POST['boardids'];\par
\tab\tab if (count($boardids)) \{\par
\tab\tab\tab $boardids implode("','$threadid'),('"$boardids);\par
\tab\tab\tab $db->query("INSERT IGNORE INTO bb".$n."_announcements (boardid,threadid) VALUES ('$boardids','$threadid')");\par
\tab\tab\}\par
\tab\tab\par
\tab\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab exit(); \tab\par
\tab\}\tab\par
\tab\par
\tab $result $db->query("SELECT boardid, parentid, boardorder, title, invisible FROM bb".$n."_boards ORDER by parentid ASC, boardorder ASC");\par
\tab while ($row $db->fetch_array($result)) $boardcache[$row['parentid']][$row['boardorder']][$row['boardid']] = $row;\par
\tab\par
\tab $permissioncache getPermissions();\par
\tab\par
\tab $boardids = array();\par
\tab $result $db->query("SELECT boardid FROM bb".$n."_announcements WHERE threadid='$threadid'");\par
\tab while ($row $db->fetch_array($result)) $boardids[] = $row['boardid'];\par
\tab\par
\tab $board_options makeboardselect(01$boardids);\tab\par
\tab\par
\tab $navbar getNavbar($board['parentlist']);\par
\tab eval("\\$navbar .= \\"".$tpl->get("navbar_board")."\\";");\par
\tab\par
\tab $thread['topic'] = htmlconverter(textwrap($thread['topic']));\par
\tab eval("\\$tpl->output(\\"".$tpl->get("modcp_announce")."\\");");\tab\par
\}\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
\par
/** add poll **/\par
if ($action == 'polladd') \{\par
\tab if (!isset($threadid)) error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array("adminmail" => $adminmail)));\par
\tab\par
\tab if (!checkmodpermissions('m_can_add_poll')) access_error();\par
\tab\par
\tab $pollinfo $db->query_first("SELECT pollid FROM bb".$n."_polls WHERE threadid='$threadid'");\par
\tab\par
\tab if ($pollinfo['pollid'] > || $thread['closed'] == || !checkpermissions('can_post_poll')) access_error();\par
\tab\par
\tab if ($_POST['send']) \{\par
\tab\tab if (isset($_POST['polloptions'])) $options explode("\\n"$_POST['polloptions']);\par
\tab\tab else $options = array();\par
\tab\tab if (isset($_POST['question'])) $question wbb_trim($_POST['question']);\par
\tab\tab else $question '';\par
\tab\tab\par
\tab\tab if (!$question || !count($options)) error($lang->get("LANG_GLOBAL_ERROR1"));\par
\tab\tab else \{\par
\tab\tab\tab $db->query("INSERT INTO bb".$n."_polls (threadid,question,starttime,choicecount,timeout) VALUES ('".intval($threadid)."' ,'".addslashes($question)."','".time()."','".intval($_POST['choicecount'])."','".intval($_POST['timeout'])."')");\par
\tab\tab\tab $pollid $db->insert_id();\par
\tab\tab\tab\par
\tab\tab\tab $count 1;\par
\tab\tab\tab $polloptions_insert "";\par
\tab\tab\tab for ($i 0$i count($options); $i++) \{\par
\tab\tab\tab\tab $options[$i] = wbb_trim($options[$i]);\par
\tab\tab\tab\tab if (!$options[$i]) continue;\par
\tab\tab\tab\tab $polloptions_insert .= ",('$pollid','".addslashes($options[$i])."','$count')";\par
\tab\tab\tab\tab $count++;\par
\tab\tab\tab\}\par
\tab\tab\tab if ($polloptions_insert$db->query("INSERT INTO bb".$n."_polloptions (pollid,polloption,showorder) VALUES ".wbb_substr($polloptions_insert1));\par
\tab\tab\tab\par
\tab\tab\tab $db->unbuffered_query("UPDATE bb".$n."_threads SET pollid='$pollid' WHERE threadid='$threadid'");\par
\tab\tab\tab header("Location: thread.php?threadid=$threadid$SID_ARG_2ND_UN);\par
\tab\tab\tab exit();\par
\tab\tab\}\par
\tab\}\par
\tab else \{\par
\tab\tab $lang->load('POLL');\par
\tab\tab\par
\tab\tab $navbar getNavbar($board['parentlist']);\par
\tab\tab eval("\\$navbar .= \\"".$tpl->get("navbar_board")."\\";");\par
\tab\tab\par
\tab\tab $thread['topic'] = htmlconverter(textwrap($thread['topic']));\par
\tab\tab eval("\\$tpl->output(\\"".$tpl->get("polladd")."\\");");\par
\tab\}\par
\}\par
?>\par
}
 



Geschrieben von alfie am 03.10.2005 um 18:37:

 

Was ist das denn, in Zeile 1 und 2 vor <?php ??
Das ist nicht original, hat da eigentlich nichts zu suchen!
Nimm das mal raus, dann ist auch der Fehler weg, würde ich sagen!


alfie



Geschrieben von Darkwarrior am 03.10.2005 um 20:40:

 

Hmmm also wo das herkommt, weis ich leider auch nicht .... :-(

Danke auch nochmal, das du dir so viel Mühe gibst mir zu helfen. :-]

Nur leider hat das auch nichts gebracht. Nun hab ich ne ellenlange Fehlermeldung gehabt. Naja also musses ja an der "modcp.php" Datei gelegen haben, denke ich. ?-(

Soll ich die "Lange Fehlermeldung" mal hier hinposten? Wenns helfen sollte?! Verrückt



Geschrieben von Günny am 03.10.2005 um 21:21:

 

wo hast du denn die modcp her???

wo kommen denn die ganzen par und tabtabtab her?

also du solltest mal dringend die originale modcp.php hochladen und dann falls du änderungen hattest diese nochmal neu eintragen...so wie die jetzt ist wird die nie im leben funktionieren



Geschrieben von XundY am 04.10.2005 um 06:06:

 

Bevor du weiter an den dateien änderst solltest du dir erstmal nen gescheiten php-editor zulegen mit deinem texteditor wird das nix der versaut die ganze Syntax

mfg



Geschrieben von alfie am 04.10.2005 um 15:58:

 

Ich denke mal er hat einen Editor, der die Steuerzeichen anzeigt, wenn man sie nicht gezielt ausblendet! Das wäre ja nicht sooooo schlimm!
Die ersten Zeilen sind aber auf jeden Fall falsch!

MfG

alfie



Geschrieben von Darkwarrior am 05.10.2005 um 19:49:

 

Naja trotzdem Danke erst einmal für die viele Hilfe!


Scheint auf jeden Fall so, als wenn ich dem Täter auf der Spur wäre... vielleicht wirds ja noch was. :-(


Forensoftware: Burning Board 2.3.6, entwickelt von WoltLab GmbH