'.$lang_common['Login'].' '.$lang_common['or'].' '.$lang_common['register'].'.'); // Load the index.php language file require 'lang/'.$language.'/'.$language.'_index.php'; $page_title = htmlspecialchars($options['board_title']); require 'header.php'; ?>
 
query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, f.closed FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id'.$extra.' ORDER BY c.position, cid, f.position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); while ($cur_forum = $db->fetch_assoc($result)) { if ($cur_forum['cid'] != $cur_category) // A new category since last iteration? { // ... $cur_category = $cur_forum['cid']; // ... ?> '.htmlspecialchars($cur_forum['forum_name']).''; else $forum_field = ''.htmlspecialchars($cur_forum['forum_name']).''; if ($cur_forum['forum_desc'] != '') $forum_field .= '
'."\n\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'].' '.htmlspecialchars($cur_forum['last_poster']); else $last_post = ' '; if (!$cookie['is_guest'] && $cur_forum['last_post'] > $cookie['last_timeout']) { if ($cur_user['show_img'] != '0') $icon = ''; else $icon = ''; } else $icon = ' '; if ($cur_forum['moderators'] != '') { $mods_array = unserialize($cur_forum['moderators']); $moderators = array(); while (list($mod_username, $mod_id) = @each($mods_array)) { $mod_username = htmlspecialchars($mod_username); $moderators[] = ''.$mod_username.''; } $moderators = implode(', ', $moderators); } else $moderators = ' '; ?> \n\n"; // Show what the current user can and cannot do if (isset($cur_user) && isset($cur_user['status']) && $cur_user['status'] > 0) { $perms = ($cur_user['status'] > 0) ? "{$lang_index['You']} {$lang_index['can']} {$lang_index['post replies']}
{$lang_index['You']} {$lang_index['can']} {$lang_index['post topics']}
{$lang_index['You']} {$lang_index['can']} {$lang_index['edit posts']}
{$lang_index['You']} {$lang_index['can']} {$lang_index['delete posts']}
{$lang_index['You']} {$lang_index['can']} {$lang_index['delete topics']}\n" : ''; } else if (!$cookie['is_guest']) { $perms = $lang_index['You'].' '. (($permissions['users_post'] == '1') ? $lang_index['can'] : $lang_index['cannot']) .' '.$lang_index['post replies'].'
'; $perms .= "\n\t\t\t\t\t\t".$lang_index['You'].' '. (($permissions['users_post_topic'] == '1') ? $lang_index['can'] : $lang_index['cannot']) .' '.$lang_index['post topics'].'
'; $perms .= "\n\t\t\t\t\t\t".$lang_index['You'].' '. (($permissions['users_edit_post'] == '1') ? $lang_index['can'] : $lang_index['cannot']) .' '.$lang_index['edit posts'].'
'; $perms .= "\n\t\t\t\t\t\t".$lang_index['You'].' '. (($permissions['users_del_post'] == '1') ? $lang_index['can'] : $lang_index['cannot']) .' '.$lang_index['delete posts'].'
'; $perms .= "\n\t\t\t\t\t\t".$lang_index['You'].' '. (($permissions['users_del_topic'] == '1') ? $lang_index['can'] : $lang_index['cannot']) .' '.$lang_index['delete topics'].'
'."\n"; } else { $perms = $lang_index['You'].' '. (($permissions['guests_post'] == '1') ? $lang_index['can'] : $lang_index['cannot']) .' '.$lang_index['post replies'].'
'; $perms .= "\n\t\t\t\t\t\t".$lang_index['You'].' '. (($permissions['guests_post_topic'] == '1') ? $lang_index['can'] : $lang_index['cannot']) .' '.$lang_index['post topics'].'
'; $perms .= "\n\t\t\t\t\t\t".$lang_index['You'].' '.$lang_index['cannot'].' '.$lang_index['edit posts'].'
'.$lang_index['You'].' '.$lang_index['cannot'].' '.$lang_index['delete posts'].'
'.$lang_index['You'].' '.$lang_index['cannot'].' '.$lang_index['delete topics']."\n"; } // Collect some statistics from the database $result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users') or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error()); $stats['totalusers'] = $db->result($result, 0) - 1; // Minus the guest account $result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error()); $stats['lastuser'] = $db->fetch_assoc($result); $result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error()); list($stats['totaltopics'], $stats['totalposts']) = $db->fetch_row($result); ?>
 
 
1) ? $lang_index['registered users'] : $lang_index['registered users']).', '.$stats['totaltopics'].' '.(($stats['totaltopics'] <> 1) ? $lang_index['topics'] : $lang_index['topic']).' '.$lang_index['and'].' '.$stats['totalposts'].' '.(($stats['totalposts'] <> 1) ? $lang_index['posts'] : $lang_index['post']) ?>.
. query('SELECT user_id, ident, logged FROM '.$db->prefix.'online ORDER BY ident'); if (!$result) { throw new Exception('Unable to fetch online list: ' . $db->error()); } while ($cur_user_online = $result->fetch_array(MYSQLI_ASSOC)) { if ($cur_user_online['user_id'] > 0) { $users[] = ''.htmlspecialchars($cur_user_online['ident']).''; } else { $num_guests++; } } $num_users = count($users); echo "\t\t\t\t\t\t".'
'.$lang_index['Currently serving'].' '.$num_users.' '.(($num_users != 1) ? $lang_index['registered users'] : $lang_index['registered user']).' '.$lang_index['and'].' '.$num_guests.' '.(($num_guests != 1) ? $lang_index['guests'] : $lang_index['guest']).'.'; if ($num_users) { echo '

'."\n\t\t\t\t\t\t".implode(', ', $users)."\n"; } else { echo "\n"; } } ?>