aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/index.php55
-rw-r--r--phpBB/viewonline.php11
2 files changed, 18 insertions, 48 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index 220530b370..3ac1e34175 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -38,6 +38,9 @@ if ($mark_read == 'forums')
trigger_error($message);
}
+include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+display_forums();
+
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
@@ -45,54 +48,15 @@ $total_users = $config['num_users'];
$newest_user = $config['newest_username'];
$newest_uid = $config['newest_user_id'];
-if ($total_users == 0)
-{
- $l_total_user_s = $user->lang['REGISTERED_USERS_ZERO_TOTAL'];
-}
-else if ($total_users == 1)
-{
- $l_total_user_s = $user->lang['REGISTERED_USER_TOTAL'];
-}
-else
-{
- $l_total_user_s = $user->lang['REGISTERED_USERS_TOTAL'];
-}
-
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
-display_forums();
-
-if ($total_posts == 0)
-{
- $l_total_post_s = $user->lang['POSTED_ARTICLES_ZERO_TOTAL'];
-}
-else if ($total_posts == 1)
-{
- $l_total_post_s = $user->lang['POSTED_ARTICLE_TOTAL'];
-}
-else
-{
- $l_total_post_s = $user->lang['POSTED_ARTICLES_TOTAL'];
-}
-
-if ($total_topics == 0)
-{
- $l_total_topic_s = $user->lang['POSTED_TOPICS_ZERO_TOTAL'];
-}
-else if ($total_topics == 1)
-{
- $l_total_topic_s = $user->lang['POSTED_TOPIC_TOTAL'];
-}
-else
-{
- $l_total_topic_s = $user->lang['POSTED_TOPICS_TOTAL'];
-}
-
+$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
+$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
+$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
// Grab group details for legend display
$sql = 'SELECT group_name, group_colour, group_type
FROM ' . GROUPS_TABLE . "
WHERE group_colour <> ''
- AND group_type <> " . GROUP_HIDDEN;
+ AND group_type NOT IN (" . GROUP_HIDDEN . ', ' . GROUP_SPECIAL . ')';
$result = $db->sql_query($sql);
$legend = '';
@@ -128,8 +92,9 @@ if ($config['load_birthdays'])
// Assign index specific vars
$template->assign_vars(array(
- 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
- 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
+ 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
+ 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
+ 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "<a href=\"memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=$newest_uid \">", $newest_user, '</a>'),
'LEGEND' => $legend,
'BIRTHDAY_LIST' => $birthday_list,
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 028c1b0171..0f363fcf70 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -100,8 +100,9 @@ while ($row = $db->sql_fetchrow($result))
if ($view_online)
{
- preg_match('#([a-z]+)#', $row['session_page'], $on_page);
-
+ preg_match('#^([a-z]+)#i', $row['session_page'], $on_page);
+// echo $row['session_page'];
+// print_r($on_page);
switch ($on_page[1])
{
case 'index':
@@ -172,6 +173,10 @@ while ($row = $db->sql_fetchrow($result))
$location_url = "memberlist.$phpEx$SID";
break;
+ case 'ucp':
+ $location = $user->lang['VIEWING_UCP'];
+ $location_url = '';
+
default:
$location = $user->lang['INDEX'];
$location_url = "index.$phpEx$SID";
@@ -229,7 +234,7 @@ unset($vars_online);
$sql = 'SELECT group_name, group_colour, group_type
FROM ' . GROUPS_TABLE . "
WHERE group_colour <> ''
- AND group_type <> " . GROUP_HIDDEN;
+ AND group_type NOT IN (" . GROUP_HIDDEN . ', ' . GROUP_SPECIAL . ')';
$result = $db->sql_query($sql);
$legend = '';