SO 1-final
[specialops1.git] / topics.inc.php
blob8a0c3a0d2cf2317d4a1f8c26579ebd7f96b6cd2c
1 <?php
2 $page = isset ($_GET['page']) ? $_GET['page'] : 1;
3 $pages = ($page - 1) * $userinfo['tpp'];
4 $topic_count = $pages;
6 $number_of_items = mysql_result (mysql_query ('SELECT COUNT(*) FROM `topics` WHERE '.$list_criteria), 0);
8 $pagelist = null;
9 if ($number_of_items > $userinfo['tpp'])
10 $pagelist = pagelist();
12 echo $pagelist.'
13 <table>
14 <tr><th>Topic Name</th><th>Created By</th><th>Messages</th>'.
15 ($userinfo['viewdisp'] & 1 ? '<th>Views</th>' : '').
16 '<th>Last Post</th>'.
17 ($userinfo['viewdisp'] & 2 ? '<th>Last View</th>' : '').
18 '</tr>
23 $topics = mysql_query ('SELECT `topicid`, `topicname`, `active`, `postedby`, `lastpostsec`, `views`, `viewsec` FROM `topics` WHERE '.$list_criteria.' LIMIT '.$pages.', '.$userinfo['tpp']);
24 while ($myrow = mysql_fetch_row ($topics))
26 echo '<tr class='.colour().'>
27 <td><a href="topic.php?b='.intval ($_GET['b']).';t='.$myrow[0].'">'.$myrow[1].'</a>'.
28 ($myrow[2] == 'closed' ? $cfg['img'][2] : null).
29 ($myrow[2] == 'deleted' ? $cfg['img'][3] : null).'</td>
30 <td>'.userlink ($myrow[3]).'</td>
31 <td>'.mysql_result (mysql_query ('SELECT COUNT(*) FROM `msgmeta` WHERE `topic` = '.$myrow[0]), 0).'</td>'.
32 ($userinfo['viewdisp'] & 1 ? '
33 <td>'.$myrow[5].'</td>' : null).'
34 <td>'.date2 ($myrow[4]).'</td>'.
35 ($userinfo['viewdisp'] & 2 ? '
36 <td>'.date2 ($myrow[6]).'</td>' : null).'
37 </tr>
41 echo '</table>
42 '.$pagelist;