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
|
<?php /* $Id: newtopic.php,v 1.3 2002/12/21 16:59:37 dkreuer Exp $ */ /* ThWboard - PHP/MySQL Bulletin Board System ============================================== (c) 2000, 2001 by Paul Baecher <paul@thewall.de> Felix Gonschorek <funner@thewall.de>
download the latest version: http://www.thwboard.de
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
==============================================
*/
include "./inc/header.inc.php";
// http://www.securiteam.com/securitynews/5FP0C204KE.html $post['posttext'] = $HTTP_POST_VARS['post']['posttext'];
if( $g_user['userid'] == 0 && !$P->has_permission( P_POSTNEW ) ) { message("Hinweis", "Sie müssen registriert sein, um Beiträge erstellen zu können"); }
requires_permission( P_POSTNEW );
if( !isset($Submit) ) { $j = 1; while( list($iconid, $img) = each($topicicon) ) { $newtopicicons .= "<INPUT type=\"radio\" name=\"thread[threadiconid]\" value=\"$iconid\" > <img src=\"templates/".$style['styletemplate']."/images/icon/".$img."_new.gif\"> "; if( $j % 6 == 0 ) { $newtopicicons .= "<br>"; } $j++; } if( $config['smilies'] ) { $smilies_on_off = "AN"; } else { $smilies_on_off = "AUS"; }
if( $config['use_email'] ) { $notifyavailable = ''; } else { $notifyavailable = ' (Derzeit nicht verfügbar)'; } // <input class="tbinput" type="text" name="thread[postguestname]"> if( $g_user['userid'] ) { $replyusername = "$style[stdfont]$g_user[userhtmlname]$style[stdfontend]$style[smallfont] [ <a href=\"logout.php\">Logout</a> ]$style[smallfontend]"; } else { if( $g_user['userid'] == 0 && $P->has_permission( P_POSTNEW ) ) { $replyusername = '<input class="tbinput" name="post[postguestname]" type="text">' . $style['smallfont'] . ' (Minimal ' . $config['min_usernamelength'] . ', maximal ' . $config['max_usernamelength'] . ' Zeichen, keine Sonderzeichen)' . $style['smallfontend']; } else { $replyusername = ''; } } $Tframe= new Template("templates/" . $style['styletemplate'] . "/frame.html"); $Tform= new Template("templates/" . $style['styletemplate'] . "/newtopic.html");
$navpath .= 'Neues Thema erstellen'; eval($Tform->GetTemplate("CONTENT")); eval($Tframe->GetTemplate()); } else { unset($msg); if( strlen($thread['threadtopic']) > $config['subject_maxlength'] ) { $msg .= "Das Subject ist zu lang!<br>"; } if( strlen(preparse_code($thread['threadtopic'])) < $config['subject_minlength'] ) { $msg .= "Das Subject ist zu kurz!<br>"; } $teststring = parse_code(preparse_code($post['posttext']), 1, ($config['imageslevel'] ? 0 : 1), $post['postcode'], $post['postsmilies']); if( strlen(strip_tags($teststring)) < $config['message_minlength'] ) { $msg .= "Der Text ist zu kurz<br>"; } if( strlen(strip_tags($teststring)) > $config['message_maxlength'] ) { $msg .= "Der Text ist zu lang<br>"; }
if( strlen($msg) > 0 ) { $navpath .= 'Neuer Thread'; message("Fehler","Es sind leider folgende Fehler aufgetreten:<br><br><font color='$style[color_err]'>$msg</font>"); } if( !$P->has_permission( P_NOFLOODPROT ) && time() - $config['postdelay'] < $g_user['userlastpost'] ) { $navpath .= 'Neuer Thread'; message("Fehler", "Sie können nur alle $config[postdelay] Sekunden einen neuen Thread erstellen."); }
$time = time();
$post['postemailnotify'] ? $post['postemailnotify'] = 1 : $post['postemailnotify'] = 0; if( !$topicicon[($thread['topiciconid'])] ) { $thread['topiciconid'] = 0; }
if( $P->has_permission( P_POSTNEW ) && ($g_user['userid'] == 0) ) { // check username check_username($post['postguestname']);
// override notify $post['postemailnotify'] = 0;
$g_user['username'] = $config['guestprefix'] . $post['postguestname']; $post['postguestname'] = $config['guestprefix'] . addslashes($post['postguestname']); } else { $post['postguestname'] = ''; } if( $config['uppercase_prot'] ) { $words = explode(' ', $thread['threadtopic']); $newwords = array();
while( list(, $word) = @each($words) ) { if( strlen($word) > 1 ) { $newwords[] = substr($word, 0, 1) . strtolower(substr($word, 1)); } else { $newwords[] = $word; } } $thread['threadtopic'] = implode(' ', $newwords); } // Bannedwords-Protection if( $config["usebwordprot"] == BWORD_TOPIC || $config["usebwordprot"] == BWORD_ALL ) { $thread["threadtopic"] = check_banned($thread["threadtopic"]); } if( $config["usebwordprot"] >= BWORD_POST ) { $post["posttext"] = check_banned($post["posttext"]); }
// Autoclose & delete if ( $config['auto_close'] > 0 ) { thwb_query("UPDATE " . $pref . "thread SET threadclosed = '1' WHERE threadtime < '" . ( time() - ( ( $config['auto_close']+1 ) * 86400 ) ) . "'"); } if ( $config['auto_delete'] > 0 ) { thwb_query("DELETE FROM " . $pref . "thread WHERE threadtime < " . ( time() - ( $config['auto_delete'] * 86400 ) ) . ""); } // die neue nachricht abspeichern in dem topics table thwb_query("INSERT INTO ".$pref."thread (threadtime, threadtopic, threadauthor, boardid, threadlastreplyby, threadiconid, threadcreationtime) VALUES('$time', '".addslashes(preparse_code($thread['threadtopic']))."', '".addslashes($g_user['username'])."', '$board[boardid]', '".addslashes($g_user['username'])."', '".intval($thread['threadiconid'])."', '$time')");
$thread['threadid'] = mysql_insert_id();
// die neue nachricht abspeichern in dem messages table thwb_query("INSERT INTO ".$pref."post (posttime, posttext, userid, threadid, postemailnotify, postip, postsmilies, postcode, postguestname) VALUES('$time', '" . addslashes(preparse_code($post['posttext'])) . "', '$g_user[userid]', '$thread[threadid]', '$post[postemailnotify]', '".addslashes($REMOTE_ADDR)."', '" . ($post['postsmilies'] ? 1 : 0) . "', '" . ($post['postcode'] ? 1 : 0) . "', '" . addslashes($post['postguestname']) . "')");
// Den topics-count-wert des board erhöhen thwb_query("UPDATE ".$pref."board SET boardthreads=boardthreads+1, boardlastpost='$time', boardposts=boardposts+1, boardlastpostby='" . addslashes($g_user['username']) . "', boardthreadtopic='" . addslashes($thread['threadtopic']) . "', boardthreadid=$thread[threadid] WHERE boardid='$board[boardid]'");
if( $g_user['userid'] ) { // Den postings wert des postenden users erhöhen thwb_query("UPDATE ".$pref."user SET userlastpost=$time, userposts=userposts+1 WHERE userid='$g_user[userid]'"); }
header("Location: showtopic.php?threadid=$thread[threadid]"); }
?>
|