aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-02-26 17:16:05 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-02-26 17:16:05 +0000
commitf6846138151148c59ef6c82c064cfc93553ae34a (patch)
tree1b9936be3b6db0fb2c84801f616738859c83a29d
parent72c44126e6d74b1e14c451e19f1f0bd09e90bab6 (diff)
downloadforums-f6846138151148c59ef6c82c064cfc93553ae34a.tar
forums-f6846138151148c59ef6c82c064cfc93553ae34a.tar.gz
forums-f6846138151148c59ef6c82c064cfc93553ae34a.tar.bz2
forums-f6846138151148c59ef6c82c064cfc93553ae34a.tar.xz
forums-f6846138151148c59ef6c82c064cfc93553ae34a.zip
Allow style designer the option of seperating off announcements to make them more prominent ... note some changes in here also relate to potential solutions for global announcements, viewtopic has not been commited yet
git-svn-id: file:///svn/phpbb/trunk@3547 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/viewforum.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 99d95ec966..22a5438b74 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -268,7 +268,7 @@ if ($forum_data['forum_postable'])
FROM (' . TOPICS_TABLE . ' t
LEFT JOIN ' . LASTREAD_TABLE . ' lr ON lr.topic_id = t.topic_id
AND lr.user_id = ' . $user->data['user_id'] . ")
- WHERE t.forum_id = $forum_id
+ WHERE t.forum_id IN ($forum_id, 0)
AND t.topic_type = " . POST_ANNOUNCE . "
ORDER BY $sort_order_sql
LIMIT " . $config['topics_per_page'];
@@ -332,7 +332,7 @@ if ($forum_data['forum_postable'])
// Okay, lets dump out the page ...
if ($total_topics)
{
- $i = 0;
+ $i = $s_type_switch = 0;
foreach ($row_ary as $row)
{
$topic_id = $row['topic_id'];
@@ -384,6 +384,7 @@ if ($forum_data['forum_postable'])
}
$unread_topic = true;
+
if ($user->data['user_id'] != ANONYMOUS &&
($row['topic_last_post_time'] <= $row['lastread_time'] ||
$row['topic_last_post_time'] < (time() - $config['lastread']))
@@ -459,6 +460,12 @@ if ($forum_data['forum_postable'])
$last_post_time = $user->format_date($row['topic_last_post_time']);
+ // This will allow the style designer to output a different header
+ // or even seperate the list of announcements from sticky and normal
+ // topics
+ $s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE) ? 1 : 0;
+
+
// Send vars to template
$template->assign_block_vars('topicrow', array(
'FORUM_ID' => $forum_id,
@@ -478,14 +485,17 @@ if ($forum_data['forum_postable'])
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
- 'S_ROW_COUNT' => $i,
- 'S_TOPIC_TYPE' => $row['topic_type'],
- 'S_USER_POSTED' => ($row['lastread_type'] == LASTREAD_POSTED) ? true : false,
+ 'S_ROW_COUNT' => $i,
+ 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test,
+ 'S_TOPIC_TYPE' => $row['topic_type'],
+ 'S_USER_POSTED' => ($row['lastread_type'] == LASTREAD_POSTED) ? true : false,
'U_VIEW_TOPIC' => $view_topic_url)
);
- ++$i;
+
+ $s_type_switch = ($row['topic_type'] == POST_ANNOUNCE) ? 1 : 0;
+ $i++;
}
}