4 $boardinfo = mysql_fetch_row(mysql_query('SELECT `name`, `view_level`, `topic_level` FROM `boards`
5 WHERE `board` = '.intval($_GET['b'])));
8 list($page_name, $level_restriction, $topic_level) = $boardinfo;
10 require 'top.inc.php';
12 if ( empty($boardinfo) )
13 printf('Invalid Board ID.') && footer();
15 $page = isset ($_GET['p']) ?
intval($_GET['p']) : 1;
16 $pages = ($page - 1) * $userinfo['topics_page'];
17 $topic_count = $pages;
19 list($number_of_items) = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `topics` WHERE `board` = '.intval($_GET['b'])));
21 if ( $number_of_items > $userinfo['topics_page'] ) {
23 $pagelist = '<div class="c3">Page '.$page." | \n";
24 while ( $count < $number_of_items / $userinfo['topics_page'] ) {
38 $pagelist .= '<a href="?p='.$count.URL_APPEND
.'"'.( $rel ?
' rel="'.$rel.'"' : '' ).'>'.$stuff{0}.$count.$stuff{1}."</a>\n";
40 $pagelist .= "</div>\n";
58 $topic_list = mysql_query('SELECT `topics`.`topic`, `title`, `topics`.`visible`, `topics`.`user`,
59 UNIX_TIMESTAMP(`time`) AS `time`, COUNT(`message`) AS `msgs`
60 FROM `topics` LEFT JOIN `messages` USING(`topic`)
61 WHERE `board` = '.intval($_GET['b']).
62 ( $userinfo['level'] >= MOD ?
'' : ' AND `topics`.`visible` >= 0 AND `messages`.`visible` >= 0' ).'
63 GROUP BY `topics`.`topic`
65 LIMIT '.$pages.', '.$userinfo['topics_page']);
70 while ( $topic = mysql_fetch_assoc($topic_list) ) {
71 $newposts = ($topic['time'] > time() - 3600) ?
true : false;
73 echo '<tr class=',colour(),'>
74 <td><a href="viewtopic?t=',$topic['topic'],'"',( $n < 5 ?
' accesskey="'.$a{$n++
}.'"' : '' ),'>',
75 $topic['title'],'</a></td>
76 <td>',userlink($topic['user']),'</td>
77 <td>',$topic['msgs'],'</td>
78 <td',( $newposts ?
' class="newposts">' : '>' ),date2($topic['time']),"</td>\n",