diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-05-13 20:31:37 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-05-13 20:31:37 +0000 |
| commit | e22f7fc7c0632a612adc82f447cecb2889dfec76 (patch) | |
| tree | 7efa36bd8540df9971f9b66f7b6b35f2e7654231 | |
| parent | 10450b3f9c5a154bdd5a4351a13193952d034702 (diff) | |
| download | forums-e22f7fc7c0632a612adc82f447cecb2889dfec76.tar forums-e22f7fc7c0632a612adc82f447cecb2889dfec76.tar.gz forums-e22f7fc7c0632a612adc82f447cecb2889dfec76.tar.bz2 forums-e22f7fc7c0632a612adc82f447cecb2889dfec76.tar.xz forums-e22f7fc7c0632a612adc82f447cecb2889dfec76.zip | |
Fixed display of forums - all pages should now work fine
git-svn-id: file:///svn/phpbb/trunk@290 89ea8834-ac86-4346-8a33-228a782c2dd0
| -rw-r--r-- | phpBB/viewonline.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 6b8f488414..1ecd1cfeb2 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -62,11 +62,17 @@ if(!$forums_result) { error_die(SQL_QUERY, "Couldn't obtain user/online forums information.", __LINE__, __FILE__); } -$forumsrow = $db->sql_fetchrowset($forums_result); +else +{ + while($forumsrow = $db->sql_fetchrow($forums_result)) + { + $forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name']; + } +} -if(!$onlinerow || !$forumsrow) +if(!$onlinerow || !$forum_data) { - error_die(SQL_QUERY, "Couldn't fetchrow", __LINE__, __FILE__); + error_die(SQL_QUERY, "Couldn't fetchrow.", __LINE__, __FILE__); } $template->assign_vars(array( @@ -117,7 +123,7 @@ if($online_count) $guest_users++; } - if($onlinerow[$i]['session_page'] < 0) + if($onlinerow[$i]['session_page'] < 1) { switch($onlinerow[$i]['session_page']) { @@ -164,15 +170,8 @@ if($online_count) } else { - for($j = 0; $j < count($forumsrow); $j++) - { - if($onlinerow[$i]['session_page'] == $forumsrow[$j]['forum_id']) - { - $location_url = append_sid("viewforum.".$phpEx."?".POST_FORUM_URL."=".$forumsrow[$j]['forum_id']); - $location = $forumsrow[$j]['forum_name']; - break; - } - } + $location_url = append_sid("viewforum.".$phpEx."?".POST_FORUM_URL."=".$onlinerow[$i]['session_page']); + $location = $forum_data[$onlinerow[$i]['session_page']]; } // |
