3 * Board List layout similar to old Special Ops 1 one
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://../COPYING
9 require_once 'iface.Boardlist.php';
11 class Boardlist_SO1
implements Boardlist
20 $boards = $DB->query('SELECT `group_name`, `boardid`, `board_name` AS `name`, `caption`, `view_restrict`
21 FROM `boards` LEFT JOIN `board-groups` USING(`groupid`)
23 ORDER BY `groupid` ASC, `boardid` ASC', MYSQLI_USE_RESULT
);
25 // Really bad multidimensional array hack
26 while ( $tmp = $boards->fetch_assoc() ) {
27 $groups[array_shift($tmp)][array_shift($tmp)] = $tmp;
32 <col
/><col
class="num"/><col
class="num"/><col
/>
35 <th scope
="col">Board
</th
>
36 <th scope
="col">Posts
</th
>
37 <th scope
="col">Topics
</th
>
38 <th scope
="col">Last Post
</th
>
42 foreach ( $groups as $groupname => $boards ) {
43 echo '<tbody class="boardgroup">',"\n",
44 '<tr><th scope="rowgroup" colspan="4">',$groupname,"</th></tr>\n";
46 foreach ( $boards as $boardid => $board ) {
47 $DB->query('SET @boardid = '.$boardid);
49 list($postcount, $lastpost) = $DB->query('SELECT COUNT(*), MAX(`messageid`) FROM `messages` WHERE `topicid` IN
50 (SELECT `topicid` FROM `topics` WHERE `boardid` = @boardid)')->fetch_row();
51 list($topiccount) = $DB->query('SELECT COUNT(*) FROM `topics` WHERE `boardid` = @boardid')->fetch_row();
54 $postinfo = $DB->query('SELECT `messages`.`userid`, `alias`, `mtime`, `topics`.`topicid`, `topic_title`
56 LEFT JOIN `topics` USING(`topicid`)
57 LEFT JOIN `users` ON `messages`.`userid` = `users`.`userid`
58 WHERE `messageid` = '.$lastpost)->fetch_assoc();
63 echo '<tr class="content">',"\n",
64 ' <td><a href="topiclist?',$boardid,'">',$board['name'],"</a><br/>\n",
65 ' <small style="margin-left:1em">',$board['caption'],"</small></td>\n",
66 ' <td>',$postcount,"</td>\n",
67 ' <td>',$topiccount,"</td>\n";
72 " <strong>From:</strong> %s\n".
73 " <strong>at</strong> %s<br/>\n".
74 ' <strong>in topic:</strong> %s</small></td>'."\n".
76 $user->namelink($postinfo['userid'],
78 $user->fdate($postinfo['mtime']),
79 $user->has_priv('viewboard', $board['view_restrict'])
80 ?
'<a class="topic" href="messagelist?'.$postinfo['topicid'].'">'.$postinfo['topic_title'].'</a>'
81 : $postinfo['topic_title']
84 echo "\t<td>N/A</td>\n</tr>\n";