3 include ("config.php");
6 echo "Invalid boardID.";
11 Echo "Invalid topicID.";
14 function clancheck($bdnum, $username)
16 $sql = "SELECT * FROM users WHERE username='$username'";
17 $result = mysql_query($sql);
18 $myrow = mysql_fetch_array($result);
19 $clan2 = $myrow["faction"];
20 $sql = "SELECT * FROM boards WHERE boardid='$bdnum'";
21 $result = mysql_query($sql);
22 $myrow = mysql_fetch_array($result);
23 if ($clan2 == $myrow["clan"])
31 function checkl($topicid)
33 $sql = "SELECT * FROM topics WHERE topicid='$topicid'";
34 $result = mysql_query($sql);
35 $myrow = mysql_fetch_array($result);
36 if ($myrow["active"] == 0)
38 if ($myrow["active"] == 1)
41 function check2($board)
43 $sql = "SELECT * FROM boards WHERE boardid='$board'";
44 $result = mysql_query($sql);
45 $myrow = mysql_fetch_array($result);
46 return $myrow["boardlevel"];
48 function check3($board, $topic)
50 $sql = "SELECT * FROM messages WHERE topic='$topic' AND mesboard='$board'";
51 $result = mysql_query($sql);
52 if (!mysql_num_rows($result))
62 $sql = "SELECT * FROM suggest WHERE active=1";
63 $result = mysql_query($sql);
64 $suggests = mysql_num_rows($result);
69 $sql = "SELECT * FROM marked WHERE active=1";
70 $result = mysql_query($sql);
71 $marks = mysql_num_rows($result);
74 function getlevel($username)
76 $sql = "SELECT * FROM users WHERE username='$username'";
77 $result = mysql_query($sql);
78 $myrow = mysql_fetch_array($result);
79 return $myrow["level"];
81 function useid($usename)
83 $sql = "SELECT * FROM users WHERE username='$usename'";
84 $result = mysql_query($sql);
85 $myrow = mysql_fetch_array($result);
86 return $myrow["userid"];
88 function useid2($usename)
90 $sql = "SELECT * FROM users WHERE username='$usename'";
91 $result = mysql_query($sql);
92 $myrow = mysql_fetch_array($result);
93 return $myrow["username"];
96 $sql = "SELECT * FROM users WHERE username='$uname'";
97 $result = mysql_query($sql);
98 $myrow = mysql_fetch_array($result);
99 $userlevel = $myrow["level"];
100 $sql = "SELECT * FROM boards WHERE boardid='{$_GET['board']}'";
101 $result = mysql_query($sql);
102 $myrow = mysql_fetch_array($result);
103 $boardname = $myrow["boardname"];
104 $clanvalue = $myrow["clan"];
107 echo "<font color=black>You cannot view this board.</font>";
112 $clan = clancheck($_GET['board'], $uname);
113 if ($clanvalue != 0 AND $userlevel != 60)
117 echo "<font color=black>You cannot view this board.</font>";
121 $sql = "SELECT * FROM topics WHERE topicid='{$_GET['topic']}'";
122 $result = mysql_query($sql);
123 $myrow = mysql_fetch_array($result);
124 $topicname = $myrow["topicname"];
125 $topicname = stripslashes($topicname);
126 $sql = "SELECT * FROM users WHERE username='$uname'";
127 $result = mysql_query($sql);
128 $myrow = mysql_fetch_array($result);
129 echo "<font size=6 face=arial color=black><b><center>".stripslashes($boardname)."</b><br></font><font size=3 face=arial color=black>".$topicname."</center></font>\n";
130 echo "<table width=100%><tr align=center bgcolor=".$titlecolor."><td><font face=arial size=3><b><a href=user.php?board=".$_GET['board']."&topic=".$_GET['topic'].">".$myrow["username"]." (".$myrow["level"].")</a>: <a href=index.php>Board List</a> | <a href=topiclist.php?board=".$_GET['board'].">Topic List</a> | <a href=postmes.php?board=".$_GET['board']."&topic=".$_GET['topic'].">Post a new message</a> | <a href=logout.php>Log Out</a></b> | <b><a href=faq.php>FAQ</a></b></td>\n</tr></font>\n";
131 if ($userlevel >= 50)
135 echo "<tr><td bgcolor=".$titlecolor."><b><font face=arial>Marks:</b> <a href=modme.php>".$marks."</a> | <b>Suggests:</b> <a href=helpme.php>".$sugs."</a> | <a href=modresources.php>Moderator Resources</a></td></tr></font>\n";
138 $talive = checkl($_GET['topic']);
141 echo "<font color=black>This topic has been deleted.</font>";
144 echo "<table width=100% cellpadding=0 cellspacing=2 border=0>";
145 if (empty($_GET['page']))
150 $page = $_GET['page'] -1;
153 $sql = "SELECT * FROM messages WHERE topic='{$_GET['topic']}' ORDER BY theorder ASC LIMIT ".$pages.",50";
154 $result = mysql_query($sql);
155 $boardlevel = check2($_GET['board']);
156 $uselevel = getlevel($uname);
157 if ($boardlevel > $uselevel)
159 echo "<font color=black>You cannot view this.</font>";
162 while ($myrow = mysql_fetch_array($result))
164 $alive = check3($_GET['board'], $_GET['topic']);
167 echo "<font color=black>Invalid link.</font>";
170 $mes = stripslashes($myrow["messbody"]);
171 $userid = useid($myrow["messby"]);
172 echo "<tr><td bgcolor=".$secondcolor."><font face=arial><b>From: </b><a href=whois.php?user=".$userid."&board=".$_GET['board']."&topic=".$_GET['topic'].">".$myrow["messby"]."</a> | <b>Posted:</b> ".$myrow["postdate"]." | ";
173 $useename = useid2($uname);
174 if ($myrow["messby"] == $useename)
176 echo "<a href=delmessage.php?board=".$_GET['board']."&topic=".$_GET['topic']."&message=".$myrow["messageid"].">Delete</a> this message.";
179 echo "<a href=modnotice.php?board=".$_GET['board']."&topic=".$_GET['topic']."&message=".$myrow["messageid"].">Mark</a> for moderation</font>";
181 echo " <font face=arial>| <font face=arial><a href=suggestcook.php?board=".$_GET['board']."&topic=".$_GET['topic']."&message=".$myrow["messageid"].">Suggest</a> this person for aura.";
182 if ($myrow["auraed"] == 1)
184 echo "<img src=take.gif>";
186 if ($myrow["auraed"] == 2)
188 echo "<img src=add.gif>";
190 echo "</td></tr><tr><td bgcolor=".$firstcolor."><font face=arial>".$mes."</font></td></tr>\n";
193 $sql = "SELECT * FROM messages WHERE topic='{$_GET['topic']}'";
194 $result = mysql_query($sql);
195 if (mysql_num_rows($result) > 50)
197 $previouspage = $page +
2;
199 $numberoftopics = mysql_num_rows($result);
200 $numberoftopics = $numberoftopics / 50;
202 echo "<table width=100% cellpadding=0 cellspacing=2 border=0>\n<tr align=center>\n<td bgcolor=".$titlecolor."><b>Pages: ";
203 while ($count < $numberoftopics)
206 echo "<a href=messagelist.php?board=".$_GET['board']."&topic=".$_GET['topic']."&page=".$count.">".$count."</a> ";
208 echo "</td></tr><tr><td bgcolor=".$titlecolor.">";
210 echo "\n<center><a href=messagelist.php?board=".$_GET['board']."&topic=".$_GET['topic']."&page=".$nextpage.">Previous Page</a> | ";
211 echo "<center><a href=messagelist.php?board=".$_GET['board']."&topic=".$_GET['topic']."&page=".$previouspage.">Next Page</a>\n</td>\n</tr>\n</table>";
213 echo "\n<center><font size=1 color=black>The fine print: I Neo (Chuck Sakoda) cannot be held responsible for any content the user's post";
216 echo "You cannot view this board.";