3 * Special Ops 2 board list layout
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://../COPYING
9 require_once 'iface.Boardlist.php';
11 class Boardlist_SO2
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`)
22 ORDER BY `groupid` ASC, `boardid` ASC', MYSQLI_USE_RESULT
);
24 // See class.boardlist_so1
25 while ( $tmp = $boards->fetch_assoc() ) {
26 $groups[array_shift($tmp)][array_shift($tmp)] = $tmp;
29 // Nothing wrong with a bit of outdenting ?>
31 <col
/><col
/><col
/><col
/>
34 <th scope
="col">Board
</th
>
35 <th scope
="col">Posts
</th
>
36 <th scope
="col">Topics
</th
>
37 <th scope
="col">Last Post
</th
>
41 foreach ( $groups as $groupname => $boards ) {
42 echo '<tbody class="boardgroup">',"\n",
43 '<tr><th scope="rowgroup" colspan="4">',$groupname,"</th></tr>\n";
45 foreach ( $boards as $boardid => $board ) {
46 $DB->query('SET @boardid = '.$boardid);
48 list($postcount, $lastpost) = $DB->query('SELECT COUNT(*), MAX(`mtime`) FROM `messages` WHERE `topicid` IN
49 (SELECT `topicid` FROM `topics` WHERE `boardid` = @boardid)')->fetch_row();
50 list($topiccount) = $DB->query('SELECT COUNT(*) AS `c` FROM `topics` WHERE `boardid` = @boardid')->fetch_row();
53 '<tr class="content">',"\n",
55 $user->has_priv('viewboard', $board['view_restrict']) ?
56 '<a href="topiclist?'.$boardid.'">'.$board['name'].'</a>' : $board['name']
58 ' <small style="margin-left:1em">',$board['caption'],"</small></td>\n",
59 ' <td>',$postcount,"</td>\n",
60 ' <td>',$topiccount,"</td>\n",
61 ' <td>',$user->fdate($lastpost),"</td>\n",