0.8.1a
[gfh.git] / modme.php
blobd1f32753a72e4ae5984a72e00b6dbe76423bb890
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))
7 return 0;
8 else
10 $query_data = mysql_fetch_row($result);
11 return $query_data[0];
14 function getuser($mess)
16 $sql = "SELECT * FROM messages WHERE messageid='$mess'";
17 $result = mysql_query($sql);
18 $myrow = mysql_fetch_array($result);
19 return $myrow["messby"];
21 function getuser2($username)
23 $sql = "SELECT * FROM users WHERE username='$username'";
24 $result = mysql_query($sql);
25 $myrow = mysql_fetch_array($result);
26 return $myrow["username"];
28 function getboard($board)
30 $sql = "SELECT * FROM boards WHERE boardid='$board'";
31 $result = mysql_query($sql);
32 $myrow = mysql_fetch_array($result);
33 return $myrow["boardname"];
35 function gettopic($topic)
37 $sql = "SELECT * FROM topics WHERE topicid='$topic'";
38 $result = mysql_query($sql);
39 $myrow = mysql_fetch_array($result);
40 return $myrow["topicname"];
42 function getreason($reason, $markid)
44 if ($reason == 1)
45 return "Stupid.";
46 if ($reason == 2)
47 return "Annoying.";
48 if ($reason == 3)
49 return "Bad Language.";
50 if ($reason == 5)
51 return "Illegal.";
52 if ($reason == 4)
54 $sql = "SELECT * FROM marked WHERE markid='$markid'";
55 $result = mysql_query($sql);
56 $myrow = mysql_fetch_array($result);
57 return $myrow["reason2"];
60 $username = auth($uname, $pword);
61 if (!$username)
63 echo "You are not <a href=login.php>Logged In</a>.";
65 $sql = "SELECT * FROM users WHERE username='$uname'";
66 $result = mysql_query($sql);
67 $myrow = mysql_fetch_array($result);
68 if (!$myrow["level"] >= 50)
70 echo "You cannot view this page.";
71 exit;
73 if ($myrow["level"] >= 50)
75 include ("colors.inc");
76 include ("top.inc");
77 echo "<center><font color=black>Last Mod: ";
78 readfile("/var/www/html/boards/lastmod1.txt");
79 echo "</center></font><br><br>";
80 $numrow = getuser2($uname);
81 $fp = fopen("/var/www/html/boards/lastmod1.txt", "w");
82 fwrite($fp, $numrow);
83 fclose($fp);
84 echo "<table width=100%><tr align=center><td bgcolor=".$titlecolor."><font face=arial><b>Multiply Marked Messages</b></td></tr></table>";
85 echo "<table width=100% cellpadding=0 cellspacing=2 border=0><tr><td bgcolor=".$secondcolor."><font face=arial><b>MessageID</font></td><td bgcolor=".$secondcolor."><b><font face=arial>Marked Times</font></td><td bgcolor=".$secondcolor."><b><font face=arial>User Marked</font></td><td bgcolor=".$secondcolor."><b><font face=arial>Board</font></td><td bgcolor=".$secondcolor."><b><font face=arial>Topic</font></td><td bgcolor=".$secondcolor."><b><font face=arial>Reason</font></td></tr>";
86 $sql = "SELECT * FROM marked WHERE active='1' AND markedtimes>='2'";
87 $result = mysql_query($sql);
88 while ($myrow = mysql_fetch_array($result))
90 $reason = getreason($myrow["reason"], $myrow["markid"]);
91 $topic = gettopic($myrow["topic"]);
92 $board = getboard($myrow["board"]);
93 $who = getuser($myrow["message"]);
94 echo "<tr><td bgcolor=".$firstcolor."><font face=arial><a href=dosum.php?message=".$myrow["message"]."&topic=".$myrow["topic"]."&board=".$myrow["board"]."&marked=".$myrow["markid"].">".$myrow["markid"]."</a></td><td bgcolor=".$firstcolor."><font face=arial>".$myrow["markedtimes"]."</td><td bgcolor=".$firstcolor."><font face=arial>".$who."</td><td bgcolor=".$firstcolor."><font face=arial>".$board."</td><td bgcolor=".$firstcolor."><font face=arial><a href=messagelist.php?board=".$myrow["board"]."&topic=".$myrow["topic"].">".$topic."</td><td bgcolor=".$firstcolor."><font face=arial>".$reason."</td></tr>";
96 echo "</table>";
97 echo "<table width=100%><tr align=center><td bgcolor=".$titlecolor."><font face=arial><b>Singly Marked Messages</b></td></tr></table>";
98 echo "<table width=100% cellpadding=0 cellspacing=2 border=0><tr><td bgcolor=".$secondcolor."><font face=arial><b>MessageID</font></td><td bgcolor=".$secondcolor."><b><font face=arial>Marked By</font></td><td bgcolor=".$secondcolor."><b><font face=arial>User Marked</font></td><td bgcolor=".$secondcolor."><b><font face=arial>Board</font></td><td bgcolor=".$secondcolor."><b><font face=arial>Topic</font></td><td bgcolor=".$secondcolor."><b><font face=arial>Reason</font></td></tr>";
99 $sql = "SELECT * FROM marked WHERE active='1' AND markedtimes='1' ORDER BY markid ASC";
100 $result = mysql_query($sql);
101 while ($myrow = mysql_fetch_array($result))
103 $reason = getreason($myrow["reason"], $myrow["markid"]);
104 $topic = gettopic($myrow["topic"]);
105 $board = getboard($myrow["board"]);
106 $who = getuser($myrow["message"]);
107 echo "<tr><td bgcolor=".$firstcolor."><font face=arial><a href=dosum.php?message=".$myrow["message"]."&topic=".$myrow["topic"]."&board=".$myrow["board"]."&marked=".$myrow["markid"].">".$myrow["markid"]."</a></td><td bgcolor=".$firstcolor."><font face=arial>".$myrow["markwho"]."</td><td bgcolor=".$firstcolor."><font face=arial>".$who."</td><td bgcolor=".$firstcolor."><font face=arial>".$board."</td><td bgcolor=".$firstcolor."><font face=arial><a href=messagelist.php?board=".$myrow["board"]."&topic=".$myrow["topic"].">".$topic."</td><td bgcolor=".$firstcolor."><font face=arial>".$reason."</td></tr>";
109 echo "</table>";
110 echo "<center><table><tr align=center><td><a href=topiclist.php?board=1><font color=blue>Return to CE</font></a></td></tr></table>";