aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2004-02-05 14:42:12 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2004-02-05 14:42:12 +0000
commit2a0bcbb592b1488af819f8e4cfabe5c6ed6cc08a (patch)
treef56265dbeb131b2c337a2fff4aba2f24de1c24dc /phpBB/includes/functions_display.php
parent9e58a16cf56aeee0511b70f7ca7a1486b97e57b9 (diff)
downloadforums-2a0bcbb592b1488af819f8e4cfabe5c6ed6cc08a.tar
forums-2a0bcbb592b1488af819f8e4cfabe5c6ed6cc08a.tar.gz
forums-2a0bcbb592b1488af819f8e4cfabe5c6ed6cc08a.tar.bz2
forums-2a0bcbb592b1488af819f8e4cfabe5c6ed6cc08a.tar.xz
forums-2a0bcbb592b1488af819f8e4cfabe5c6ed6cc08a.zip
Return information for display of active topics in subfora ... little kludgy? but seems to work
git-svn-id: file:///svn/phpbb/trunk@4801 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 7275e26525..f66ec0d74f 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -18,7 +18,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
// Get posted/get info
$mark_read = request_var('mark', '');
- $forum_id_ary = array();
+ $forum_id_ary = $active_forum_ary = $forum_rows = $subforums = $forum_moderators = $mark_forums = array();
$visible_forums = 0;
if (!$root_data)
@@ -31,6 +31,9 @@ function display_forums($root_data = '', $display_moderators = TRUE)
$sql_where = ' WHERE left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id'];
}
+ // Display list of active topics for this category?
+ $show_active = ($root_data['forum_flags'] & 16) ? true : false;
+
if ($config['load_db_lastread'] && $user->data['user_id'] != ANONYMOUS)
{
switch (SQL_LAYER)
@@ -59,8 +62,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
$result = $db->sql_query($sql);
$branch_root_id = $root_data['forum_id'];
- $forum_rows = $subforums = $forum_moderators = $mark_forums = array();
- $forum_ids = array($root_data['forum_id']);
+ $forum_ids = array($root_data['forum_id']);
while ($row = $db->sql_fetchrow($result))
{
@@ -98,6 +100,15 @@ function display_forums($root_data = '', $display_moderators = TRUE)
continue;
}
+ // Display active topics from this forum?
+ if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & 16))
+ {
+ $active_forum_ary['forum_id'][] = $forum_id;
+ $active_forum_ary['enable_icons'][] = $row['enable_icons'];
+ $active_forum_ary['forum_topics'] += $row['forum_topics'];
+ $active_forum_ary['forum_posts'] += $row['forum_posts'];
+ }
+
if ($row['parent_id'] == $root_data['forum_id'] || $row['parent_id'] == $branch_root_id)
{
// Direct child
@@ -126,11 +137,11 @@ function display_forums($root_data = '', $display_moderators = TRUE)
$forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time'];
$forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id'];
$forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name'];
- $forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id'];
+ $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id;
}
else
{
- $forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id'];
+ $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id;
}
}
@@ -315,6 +326,8 @@ function display_forums($root_data = '', $display_moderators = TRUE)
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'])
);
+
+ return $active_forum_ary;
}
// Display Attachments