1 <?php
include ("config.php");
3 function bname($boardnum)
5 $sql = "SELECT * FROM boards WHERE boardid='$boardnum'";
6 $result = mysql_query($sql);
7 $myrow = mysql_fetch_array($result);
8 return $myrow["boardname"];
10 function tname($topicnum)
12 $sql = "SELECT * FROM topics WHERE topicid='$topicnum'";
13 $result = mysql_query($sql);
14 $myrow = mysql_fetch_array($result);
15 return $myrow["topicname"];
17 function tpost($topicn)
19 $sql = "SELECT * FROM messages WHERE topic='$topicn' AND messby='$uname'";
20 $result = mysql_query($sql);
21 return mysql_num_rows($result);
26 echo "You are not <a href=login.php>Logged In</a>.";
29 if (!isset($_GET['page']))
31 $pages = $_GET['page'] * 50;
32 $sql = "SELECT * FROM users WHERE username='$uname'";
33 $result = mysql_query($sql);
34 $myrow = mysql_fetch_array($result);
35 echo "<table width=100%><tr align=center><td bgcolor=".$titlecolor."><font face=arial color=white><b><a href=user.php>".$myrow["username"]." (".$myrow["level"].")</b></a> | <b><a href=index.php>Board List</b></a>";
36 if (isset($_GET['board']))
38 echo " | <b><a href=topiclist.php?board=".$_GET['board'].">Topic List</b></a>";
40 if (isset($_GET['topic']))
42 echo " | <b><a href=messagelist.php?board=".$_GET['board']."&topic=".$_GET['topic'].">Message List</b></a>";
44 echo " | <b><a href=logout.php>Log Out</b></a></td></tr></table>";
45 $sql = "SELECT * FROM messages WHERE messby='$uname' ORDER BY messageid DESC LIMIT ".$pages.",50";
46 $result = mysql_query($sql);
47 while ($myrow = mysql_fetch_array($result))
49 $topicname = tname($myrow["topic"]);
50 $topicname = stripslashes($topicname);
51 $bodbod = stripslashes($myrow["messbody"]);
52 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"];
53 if ($myrow["auraed"] == 1)
55 echo "<img src=take.gif>";
57 if ($myrow["auraed"] == 2)
59 echo "<img src=add.gif>";
61 echo "</td></tr><tr><td bgcolor=".$firstcolor."><font face=arial>".$bodbod."</td></tr></table>";
63 $nextpage = $_GET['page'] -1;
64 $prevpage = $_GET['page'] +
1;
65 echo "<table width=100%><tr align=center><Td bgcolor=".$titlecolor.">";
66 if ($_GET['page'] != 0)
68 echo "<a href=viewposts.php?page=".$nextpage.">Next Page</a> | ";
70 echo "<a href=viewposts.php?page=".$prevpage.">Previous Page</a></tr></td></table>";