1 <?php
if (!$_GET['board'])
3 echo "Invalid boardID.";
6 include ("config.php");
7 function clancheck($bdnum, $username)
9 $sql = "SELECT * FROM users WHERE username='$username'";
10 $result = mysql_query($sql);
11 $myrow = mysql_fetch_array($result);
12 $clan2 = $myrow["faction"];
13 $sql = "SELECT * FROM boards WHERE boardid='$bdnum'";
14 $result = mysql_query($sql);
15 $myrow = mysql_fetch_array($result);
16 if ($clan2 == $myrow["clan"])
24 function check($board)
26 $sql = "SELECT * FROM boards WHERE boardid='$board'";
27 $result = mysql_query($sql);
28 if (!mysql_num_rows($result))
36 function check2($board)
38 $sql = "SELECT * FROM boards WHERE boardid='$board'";
39 $result = mysql_query($sql);
40 $myrow = mysql_fetch_array($result);
41 return $myrow["boardlevel"];
43 function getlevel($username)
45 $sql = "SELECT * FROM users WHERE username='$username'";
46 $result = mysql_query($sql);
47 $myrow = mysql_fetch_array($result);
48 return $myrow["level"];
54 echo "You cannot view this page.";
59 if (isset($_POST['submit']))
61 $topictitle = trim($_POST['topictitle']);
62 $message = trim($_POST['message']);
66 <table cellpadding
="2" cellspacing
="2" border
="0" width
="100%">
69 <td valign
="Top" bgcolor
=<?php
echo $systemnotcolor ?
> >
70 <div align
="Center">Please enter a title
for your topic
.<br
>
75 <td valign
="Top" bgcolor
=<?php
echo $titlecolor ?
> >
76 <div align
="Center"><b
><font color
="#ffffff">Your Topic Title
</font
></b
><br
>
82 <table cellpadding
="0" cellspacing
="0" border
="0" width
="100%">
85 <td valign
="Top" width
="10%">
86 <form method
="Post" action
="post.php?board=<?php echo $_GET['board'] ?> ">
87 <font color
=black
>Topic Title
:<br
>
89 <td valign
="Top"><input type
="text" size
="60" maxlength
="80" name
="topictitle"><br
>
97 <td valign
="Top" bgcolor
=".$titlecolor.">
98 <div align
="Center"><font color
="#ffffff"><b
>Your Message
<br
>
104 <table cellpadding
="0" cellspacing
="0" border
="0" width
="100%">
107 <td valign
="Top" width
="10%"><font color
=black
>Message
:<br
>
109 <td valign
="Top"><br
>
110 <textarea cols
="60" rows
="20" name
="message" wrap
="virtual"></textarea
></td
>
119 <select name
=previewornot
>
120 <option value
=preview selected
>Preview
</option
>
121 <option value
=post
>Post
</option
>
123 <input type
="submit" value
="Post Message" name
="submit"><input type
="reset" value
="Reset" name
="reset"></form
><br
>
130 $message = ereg_replace(" ", "", $message);
131 $message = ereg_replace("<i></i>", "", $message);
132 $message = ereg_replace("<b></b>", "", $message);
135 echo "Please enter your message.<br><br>\n";
137 <table cellpadding
="2" cellspacing
="2" border
="0" width
="100%">
140 <td valign
="Top" bgcolor
=<?php
echo $systemnotcolor ?
> >
141 <div align
="Center">Please enter your message
<br
>
146 <td valign
="Top" bgcolor
=<?php
echo $titlecolor ?
> >
147 <div align
="Center"><b
><font color
="#ffffff">Your Topic Title
</font
></b
><br
>
153 <table cellpadding
="0" cellspacing
="0" border
="0" width
="100%">
156 <td valign
="Top" width
="10%">
157 <form method
="Post" action
="post.php?board=<?php echo $_GET['board'] ?> ">
158 <font color
=black
>Topic Title
:<br
>
160 <td valign
="Top"><input type
="text" size
="60" maxlength
="80" name
="topictitle"><br
>
168 <td valign
="Top" bgcolor
=<?php
echo $titlecolor ?
> >
169 <div align
="Center"><font color
="#ffffff"><b
>Your Message
<br
>
175 <table cellpadding
="0" cellspacing
="0" border
="0" width
="100%">
178 <td valign
="Top" width
="10%"><font color
=black
>Message
:<br
>
180 <td valign
="Top"><br
>
181 <textarea cols
="60" rows
="20" name
="message" wrap
="virtual"></textarea
></td
>
190 <select name
=previewornot
>
191 <option value
=preview selected
>Preview
</option
>
192 <option value
=post
>Post
</option
>
194 <input type
="submit" value
="Post Message" name
="submit"><input type
="reset" value
="Reset" name
="reset"></form
><br
>
201 if (strcmp($_POST['previewornot'], "preview") == 0)
203 $message = ereg_replace("\n", "<br>", $message);
204 $message = stripslashes($message);
205 $topictitle = stripslashes($topictitle);
206 echo "<font color=black><b>Topic Title:</b> ".$topictitle;
207 echo "<table width=100%><tr><td bgcolor="
209 ."><font face=arial><b>From: </b> | <b>Posted:</b> | ";
210 echo "</td></tr><tr><td bgcolor="
212 ."><font face=arial>"
214 ."</font></td></tr></table>\n";
218 ereg_replace("<br>", "\n", $message);
220 <form method
=post action
=post
.php?board
=<?php
echo $_GET['board'] ?
> &topic
=<?php
echo $topic ?
> >
221 <input type
=hidden name
=previewornot value
=post
>
222 <input type
=hidden name
=message value
="<?php echo htmlspecialchars($message) ?> ">
223 <input type
=hidden name
=topictitle value
="<?php echo htmlspecialchars($topictitle) ?> ">
224 <input type
=submit name
=submit value
="Post this Message"></form
><br
>
225 <table cellpadding
="2" cellspacing
="2" border
="0" width
="100%">
228 <td valign
="Top" bgcolor
=<?php
echo $titlecolor ?
> >
229 <div align
="Center"><b
><font color
="#ffffff">Your Topic Title
</font
></b
><br
>
235 <table cellpadding
="0" cellspacing
="0" border
="0" width
="100%">
238 <td valign
="Top" width
="10%">
239 <form method
="Post" action
="post.php?board=<?php echo $_GET['board'] ?> ">
240 <font color
=black
>Topic Title
:<br
>
242 <td valign
="Top"><input type
="text" size
="60" maxlength
="80" name
="topictitle" value
="<?php echo $topictitle ?> "><br
>
250 <td valign
="Top" bgcolor
=<?php
echo $titlecolor ?
> >
251 <div align
="Center"><font color
="#ffffff"><b
>Your Message
<br
>
257 <table cellpadding
="0" cellspacing
="0" border
="0" width
="100%">
260 <td valign
="Top" width
="10%"><font color
=black
>Message
:<br
>
262 <td valign
="Top"><br
>
263 <textarea cols
="60" rows
="20" name
="message" wrap
="virtual"><?php
echo $message ?
> </textarea
></td
>
272 <select name
=previewornot
>
273 <option value
=preview
>Preview
</option
>
274 <option value
=post selected
>Post
</option
>
276 <input type
="submit" value
="Post Message" name
="submit"><input type
="reset" value
="Reset" name
="reset"></form
><br
>
283 if (strcmp($_POST['previewornot'], "post") == 0)
285 $toptit = addslashes($topictitle);
286 $bodbod = addslashes($message);
287 $uselevel = getlevel($uname);
288 $boardcheck = check($_GET['board']);
289 if ($boardcheck == 0)
291 echo "<font color=black>Invalid board.";
294 $boardlevel = check2($_GET['board']);
295 if ($boardlevel > $uselevel)
297 echo "<font color=black>You cannot post here.";
300 $sql = "SELECT * FROM boards WHERE boardid='{$_GET['board']}'";
301 $result = mysql_query($sql);
302 $myrow = mysql_fetch_array($result);
303 $clanvalue = $myrow["clan"];
304 $clan = clancheck($_GET['board'], $uname);
305 if ($clanvalue != 0 AND $uselevel != 60)
309 echo "<font color=black>You cannot view this board.";
314 $toptit = htmlspecialchars($toptit);
316 $bodbod = htmlspecialchars($bodbod);
317 $bodbod = ereg_replace("\n", "<br>", $bodbod);
318 $bodbod = ereg_replace("<i>", "<i>", $bodbod);
319 $bodbod = ereg_replace("</i>", "</i>", $bodbod);
320 $bodbod = ereg_replace("<b>", "<b>", $bodbod);
321 $bodbod = ereg_replace("<B>", "<b>", $bodbod);
322 $bodbod = ereg_replace("</B>", "</b>", $bodbod);
323 $bodbod = ereg_replace("<I>", "<i>", $bodbod);
324 $bodbod = ereg_replace("</I>", "</i>", $bodbod);
325 $bodbod = ereg_replace("</b>", "</b>", $bodbod);
326 $sql = "SELECT * FROM users WHERE username='$uname'";
327 $result = mysql_query($sql);
328 $myrow = mysql_fetch_array($result);
329 $usename = $myrow["username"];
330 /* if ($myrow["level"]==15)
332 if ($myrow["poststoday"]<50)
334 if ($myrow["topicstoday"]<5)
336 $postst=$myrow["poststoday"]+1;
337 $topicst=$myrow["topicstoday"]+1;
338 $sql="UPDATE users SET poststoday='$postst' WHERE username='$uname'";
339 $result=mysql_query($sql);
340 $sql="UPDATE users SET topicstoday='$topicst' WHERE username='$uname'";
341 $result=mysql_query($sql);
343 if ($myrow["level"]==15)
345 if ($myrow["poststoday"]==50)
347 echo "You have posted 50 messages already.";
350 if ($myrow["level"]==15)
352 if ($myrow["topicstoday"]==5)
354 echo "You have posted 5 topics today already.";
358 "SELECT * FROM topics WHERE topicname='$toptit' AND boardnum='{$_GET['board']}'";
359 $result = mysql_query($sql);
360 if (mysql_num_rows($result) >= 1)
362 echo "<font color=black>A topic with this title has already been posted.";
366 $datedate = date("n/j/Y H:i");
368 "INSERT INTO topics (topicname,boardnum,topicby,timesec,active,postdate) VALUES ('$toptit','{$_GET['board']}','$usename','$posttime','1','$datedate')";
369 $result = mysql_query($sql);
370 $topicid = mysql_insert_id($db);
371 $datedate = date("n/j/Y h:i:s A");
373 "INSERT INTO messages (topic,messby,messsec,messbody,mesboard,theorder,postdate) VALUES ('$topicid','$usename','$posttime','$bodbod','{$_GET['board']}','1','$datedate')";
374 $result = mysql_query($sql);
375 $datedate = date("n/j/y H:i:s");
377 "UPDATE users SET lastactivity='$datedate' WHERE username='$uname'";
378 $result = mysql_query($sql);
379 echo "<font color=black>Your message has been posted. Go to your <a href=messagelist.php?board="
383 ."><font color=blue>message</font></a>.\n";
390 <table cellpadding
="2" cellspacing
="2" border
="0" width
="100%">
393 <td valign
="Top" bgcolor
=<?php
echo $titlecolor ?
> >
394 <div align
="Center"><b
><font color
="#ffffff">Your Topic Title
</font
></b
><br
>
400 <table cellpadding
="0" cellspacing
="0" border
="0" width
="100%">
403 <td valign
="Top" width
="10%">
404 <form method
="Post" action
="post.php?board=<?php echo $_GET['board'] ?> ">
405 <font color
=black
>Topic Title
:<br
>
407 <td valign
="Top"><input type
="text" size
="60" maxlength
="80" name
="topictitle"><br
>
415 <td valign
="Top" bgcolor
=<?php
echo $titlecolor ?
> >
416 <div align
="Center"><font color
="#ffffff"><b
>Your Message
<br
>
422 <table cellpadding
="0" cellspacing
="0" border
="0" width
="100%">
425 <td valign
="Top" width
="10%"><font color
=black
>Message
:<br
>
427 <td valign
="Top"><br
>
428 <textarea cols
="60" rows
="20" name
="message" wrap
="virtual"></textarea
></td
>
437 <select name
=previewornot
>
438 <option value
=preview
>Preview
</option
>
439 <option value
=post selected
>Post
</option
>
441 <input type
="submit" value
="Post Message" name
="submit"><input type
="reset" value
="Reset" name
="reset"></form
><br
>
446 <br
><font color
=black
>Enabled tags
. <
;b
>
;<
;/b
>
; <
;i
>
;<
;/i
>
;