diff -r e3d7322305bf -r 5e1f1e916419 punbb/index.php --- a/punbb/index.php Sun Sep 02 11:00:57 2007 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,213 +0,0 @@ -query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$pun_db->prefix.'categories AS c INNER JOIN '.$pun_db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$pun_db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $pun_db->error()); - -$cur_category = 0; -$cat_count = 0; -while ($cur_forum = $pun_db->fetch_assoc($result)) -{ - $moderators = ''; - - if ($cur_forum['cid'] != $cur_category) // A new category since last iteration? - { - if ($cur_category != 0) - echo "\t\t\t".''."\n\t\t\t".''."\n\t\t".''."\n\t".''."\n".''."\n\n"; - - ++$cat_count; - -?> -
-

-
-
- - - - - - - - - - - $pun_user['last_visit']) - { - $item_status = 'inew'; - $icon_text = $lang_common['New icon']; - $icon_type = 'icon inew'; - } - - // Is this a redirect forum? - if ($cur_forum['redirect_url'] != '') - { - $forum_field = '

'.pun_htmlspecialchars($cur_forum['forum_name']).'

'; - $num_topics = $num_posts = ' '; - $item_status = 'iredirect'; - $icon_text = $lang_common['Redirect icon']; - $icon_type = 'icon'; - } - else - { - $forum_field = '

'.pun_htmlspecialchars($cur_forum['forum_name']).'

'; - $num_topics = $cur_forum['num_topics']; - $num_posts = $cur_forum['num_posts']; - } - - if ($cur_forum['forum_desc'] != '') - $forum_field .= "\n\t\t\t\t\t\t\t\t".$cur_forum['forum_desc']; - - - // If there is a last_post/last_poster. - if ($cur_forum['last_post'] != '') - $last_post = ''.format_time($cur_forum['last_post']).''.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).''; - else - $last_post = ' '; - - if ($cur_forum['moderators'] != '') - { - $mods_array = unserialize($cur_forum['moderators']); - $moderators = array(); - - while (list($mod_username, $mod_id) = @each($mods_array)) - $moderators[] = ''.pun_htmlspecialchars($mod_username).''; - - $moderators = "\t\t\t\t\t\t\t\t".'

('.$lang_common['Moderated by'].' '.implode(', ', $moderators).')

'."\n"; - } - -?> - > - - - - - - 0) - echo "\t\t\t".''."\n\t\t\t".'
-
-
-
- -
-
-
'."\n\t\t".'
'."\n\t".'
'."\n".'
'."\n\n"; -else - echo '

'.$lang_index['Empty board'].'

'; - - -// Collect some statistics from the database -$result = $pun_db->query('SELECT COUNT(id)-1 FROM '.$pun_db->prefix.'users') or error('Unable to fetch total user count', __FILE__, __LINE__, $pun_db->error()); -$stats['total_users'] = $pun_db->result($result); - -$result = $pun_db->query('SELECT u.id, eu.username FROM '.$pun_db->prefix.'users AS u LEFT JOIN '.table_prefix.'users AS eu ON ( eu.user_id = u.id ) ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $pun_db->error()); -$stats['last_user'] = $pun_db->fetch_assoc($result); - -$result = $pun_db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$pun_db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $pun_db->error()); -list($stats['total_topics'], $stats['total_posts']) = $pun_db->fetch_row($result); - -?> -
-

-
-
-
-
-
'. $stats['total_users'] ?>
-
'.$stats['total_topics'] ?>
-
'.$stats['total_posts'] ?>
-
-
-
-
:
-query('SELECT user_id, ident FROM '.$pun_db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $pun_db->error()); - - while ($pun_user_online = $pun_db->fetch_assoc($result)) - { - if ($pun_user_online['user_id'] > 1) - $users[] = "\n\t\t\t\t".'
'.pun_htmlspecialchars($pun_user_online['ident']).''; - else - ++$num_guests; - } - - $num_users = count($users); - echo "\t\t\t\t".'
'. $lang_index['Users online'].': '.$num_users.'
'."\n\t\t\t\t".'
'.$lang_index['Guests online'].': '.$num_guests.'
'."\n\t\t\t".'
'."\n"; - - - if ($num_users > 0) - echo "\t\t\t".'
'."\n\t\t\t\t".'
'.$lang_index['Online'].': 
'."\t\t\t\t".implode(', ', $users).''."\n\t\t\t".'
'."\n"; - else - echo "\t\t\t".'
'."\n"; - -} -else - echo "\t\t".''."\n\t\t\t".'
'."\n"; - - -?> -
-
-
-