1 <?php
include ("config.php");
2 function auth($userid, $password)
4 $sql = "SELECT username FROM users WHERE username='$userid' AND userpass='$password'";
5 $result = mysql_query($sql);
6 if (!mysql_num_rows($result))
10 $query_data = mysql_fetch_row($result);
11 return $query_data[0];
14 function bname($boardnum)
16 $sql = "SELECT * FROM boards WHERE boardid='$boardnum'";
17 $result = mysql_query($sql);
18 $myrow = mysql_fetch_array($result);
19 return $myrow["boardname"];
21 function tname($topicnum)
23 $sql = "SELECT * FROM topics WHERE topicid='$topicnum'";
24 $result = mysql_query($sql);
25 $myrow = mysql_fetch_array($result);
26 return $myrow["topicname"];
28 function tpost($topicn)
30 $sql = "SELECT * FROM messages WHERE topic='$topicn' AND messby='$uname'";
31 $result = mysql_query($sql);
32 return mysql_num_rows($result);
34 $username = auth($uname, $pword);
37 echo "You are not <a href=login.php>Logged In</a>.";
45 echo "Invalid userID.";
48 $sql = "SELECT * FROM users WHERE username='$uname'";
49 $result = mysql_query($sql);
50 $myrow = mysql_fetch_array($result);
51 if ($myrow["level"] <= 49)
53 echo "You cannot be here.";
56 include ("colors.inc");
58 echo "<table width=100%><tr align=center><td bgcolor=".$titlecolor."><font face=arial><b><a href=user.php>".$myrow["username"]." (".$myrow["level"].")</b></a> | <b><a href=index.php>Board List</b></a>";
61 echo " | <b><a href=topiclist.php?board=".$board.">Topic List</b></a>";
65 echo " | <b><a href=messagelist.php?board=".$board."&topic=".$topic.">Message List</b></a>";
67 echo " | <b><a href=logout.php>Log Out</b></a></td></tr></table>";
68 $sql = "SELECT * FROM users WHERE userid='$user'";
69 $result = mysql_query($sql);
70 $myrow = mysql_fetch_array($result);
71 $usename22 = $myrow["username"];
72 $sql = "SELECT * FROM messages WHERE messby='$usename22' ORDER BY messageid DESC LIMIT ".$pages.",50";
73 $result = mysql_query($sql);
74 while ($myrow = mysql_fetch_array($result))
76 $topicname = tname($myrow["topic"]);
77 $topicname = stripslashes($topicname);
78 $bodbod = stripslashes($myrow["messbody"]);
79 echo "<table width=100% cellpadding=0 cellspacing=2 border=0><tr><td bgcolor=".$secondcolor."><font face=arial><b>Board:</b> ".$myrow["mesboard"]." | <b>Topic: </b><a href=messagelist.php?board=".$myrow["mesboard"]."&topic=".$myrow["topic"].">".$topicname."</a> | <b>From:</b> ".$myrow["messby"];
80 if ($myrow["auraed"] == 1)
82 echo "<img src=take.gif>";
84 if ($myrow["auraed"] == 2)
86 echo "<img src=add.gif>";
88 echo " </td></tr><tr><td bgcolor=".$firstcolor."><font face=arial>".$bodbod."</td></tr></table>";
92 echo "<table width=100%><tr align=center><Td bgcolor=".$titlecolor.">";
95 echo "<a href=viewposts.php?page=".$nextpage.">Next Page</a> | ";
97 echo "<a href=viewposts.php?page=".$prevpage.">Previous Page</a></tr></td></table>";