mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
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
This commit is contained in:
parent
72c44126e6
commit
f684613815
1 changed files with 16 additions and 6 deletions
|
@ -268,7 +268,7 @@ if ($forum_data['forum_postable'])
|
||||||
FROM (' . TOPICS_TABLE . ' t
|
FROM (' . TOPICS_TABLE . ' t
|
||||||
LEFT JOIN ' . LASTREAD_TABLE . ' lr ON lr.topic_id = t.topic_id
|
LEFT JOIN ' . LASTREAD_TABLE . ' lr ON lr.topic_id = t.topic_id
|
||||||
AND lr.user_id = ' . $user->data['user_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 . "
|
AND t.topic_type = " . POST_ANNOUNCE . "
|
||||||
ORDER BY $sort_order_sql
|
ORDER BY $sort_order_sql
|
||||||
LIMIT " . $config['topics_per_page'];
|
LIMIT " . $config['topics_per_page'];
|
||||||
|
@ -332,7 +332,7 @@ if ($forum_data['forum_postable'])
|
||||||
// Okay, lets dump out the page ...
|
// Okay, lets dump out the page ...
|
||||||
if ($total_topics)
|
if ($total_topics)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = $s_type_switch = 0;
|
||||||
foreach ($row_ary as $row)
|
foreach ($row_ary as $row)
|
||||||
{
|
{
|
||||||
$topic_id = $row['topic_id'];
|
$topic_id = $row['topic_id'];
|
||||||
|
@ -384,6 +384,7 @@ if ($forum_data['forum_postable'])
|
||||||
}
|
}
|
||||||
|
|
||||||
$unread_topic = true;
|
$unread_topic = true;
|
||||||
|
|
||||||
if ($user->data['user_id'] != ANONYMOUS &&
|
if ($user->data['user_id'] != ANONYMOUS &&
|
||||||
($row['topic_last_post_time'] <= $row['lastread_time'] ||
|
($row['topic_last_post_time'] <= $row['lastread_time'] ||
|
||||||
$row['topic_last_post_time'] < (time() - $config['lastread']))
|
$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']);
|
$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
|
// Send vars to template
|
||||||
$template->assign_block_vars('topicrow', array(
|
$template->assign_block_vars('topicrow', array(
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
|
@ -479,13 +486,16 @@ if ($forum_data['forum_postable'])
|
||||||
'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="" />' : '',
|
'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_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_TOPIC_TYPE' => $row['topic_type'],
|
||||||
'S_USER_POSTED' => ($row['lastread_type'] == LASTREAD_POSTED) ? true : false,
|
'S_USER_POSTED' => ($row['lastread_type'] == LASTREAD_POSTED) ? true : false,
|
||||||
|
|
||||||
'U_VIEW_TOPIC' => $view_topic_url)
|
'U_VIEW_TOPIC' => $view_topic_url)
|
||||||
);
|
);
|
||||||
|
|
||||||
++$i;
|
|
||||||
|
$s_type_switch = ($row['topic_type'] == POST_ANNOUNCE) ? 1 : 0;
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue