SO 1-final
[specialops1.git] / markqueue.php
blobb42df0cd448e1689f1fe006d59be63f0476bac80
1 <?php
2 $require_login = true;
3 $page_name = 'Marked Messages';
4 require 'config.php';
5 $level_restriction = MOD;
6 require 'top.inc.php';
8 $lastmod = mysql_fetch_row (mysql_query ('SELECT `lastmod`, `lastmodat` FROM `misc2`'));
9 echo '<div class="c3">Last Mod: '.userlink ($lastmod[0]).' at '.date2 ($lastmod[1]).'</div>
11 mysql_query ('UPDATE `misc2` SET `lastmod` = \''.$userinfo['userid'].'\', `lastmodat` = \''.time().'\'');
13 function queuedraw ($type, $verb)
15 echo '<div class="c3">'.$verb.' Messages</div>
16 <table>
17 <tr>
18 <th>Mark ID</th>
19 <th>Message ID</th>
20 <th>'.$verb.' By</th>
21 <th>'.$verb.' At</th>
22 <th>'.$verb.' Times</th>
23 <th>User '.$verb.'</th>
24 <th>Board</th>
25 <th>Topic</th>
26 <th>Reason</th>
27 </tr>
29 $result = mysql_query ('SELECT `markid`, `marks`.`msgid`, `by`, `at`, COUNT(*) AS `times`, `postedby`, `mesboard`, `topic`, `reason`
30 FROM `marks`, `msgmeta`
31 WHERE `modat` = 0 AND `marks`.`msgid` = `msgmeta`.`msgid` AND `type` = \''.$type.'\'
32 GROUP BY `marks`.`msgid`
33 ORDER BY `times` DESC
34 LIMIT 30');
35 while ($myrow = mysql_fetch_row ($result))
37 $titles = mysql_fetch_row (mysql_query ('SELECT `boardname`, `topicname` FROM `boards`, `topics` WHERE `boardid` = \''.$myrow[6].'\' AND `topicid` = \''.$myrow[7].'\''));
38 echo '<tr class='.colour().'>
39 <td>'.$myrow[0].'</td>
40 <td><a href="message.php?m='.$myrow[1].urlpath(1).'">'.$myrow[1].'</a></td>
41 <td>'.userlink ($myrow[2]).'</td>
42 <td>'.date2 ($myrow[3]).'</td>
43 <td>'.$myrow[4].'</td>
44 <td>'.userlink ($myrow[5]).'</td>
45 <td><a href="board.php?b='.$myrow[6].'">'.$titles[0].'</a></td>
46 <td><a href="topic.php?b='.$myrow[6].';t='.$myrow[7].'">'.$titles[1].'</a></td>
47 <td>'.$myrow[8].'</td>
48 </tr>
51 echo '</table>';
52 return 1;
54 if (mysql_result (mysql_query ('SELECT COUNT(*) FROM `marks` WHERE `modat` = 0 AND `type` = 2'), 0))
55 $queue = queuedraw ('suggest', 'Suggested');
56 if (mysql_result (mysql_query ('SELECT COUNT(*) FROM `marks` WHERE `modat` = 0 AND `type` = 1'), 0))
57 $queue = queuedraw ('mark', 'Marked');
58 if (!isset ($queue))
59 echo '<div class="alert">Queue is currently empty.</div>';
61 require ('foot.php');