mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Announcements always stay in listing using previous x feature
git-svn-id: file:///svn/phpbb/trunk@568 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ec65620f23
commit
6032080761
1 changed files with 23 additions and 18 deletions
|
@ -59,15 +59,15 @@ if(isset($forum_id))
|
||||||
$sql = "SELECT forum_name, forum_topics, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_votecreate, auth_vote, prune_enable, prune_next
|
$sql = "SELECT forum_name, forum_topics, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_votecreate, auth_vote, prune_enable, prune_next
|
||||||
FROM " . FORUMS_TABLE . "
|
FROM " . FORUMS_TABLE . "
|
||||||
WHERE forum_id = $forum_id";
|
WHERE forum_id = $forum_id";
|
||||||
|
if(!$result = $db->sql_query($sql))
|
||||||
|
{
|
||||||
|
message_die(GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message_die(GENERAL_MESSAGE, "You have reached this page in error, please go back and try again");
|
message_die(GENERAL_MESSAGE, "You have reached this page in error, please go back and try again");
|
||||||
}
|
}
|
||||||
if(!$result = $db->sql_query($sql))
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the query doesn't return any rows this
|
// If the query doesn't return any rows this
|
||||||
|
@ -124,7 +124,7 @@ if(empty($HTTP_POST_VARS['postdays']))
|
||||||
$sql = "SELECT u.username, u.user_id
|
$sql = "SELECT u.username, u.user_id
|
||||||
FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa
|
FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa
|
||||||
WHERE aa.forum_id = $forum_id
|
WHERE aa.forum_id = $forum_id
|
||||||
AND aa.auth_mod = 1
|
AND aa.auth_mod = " . TRUE . "
|
||||||
AND ug.group_id = aa.group_id
|
AND ug.group_id = aa.group_id
|
||||||
AND u.user_id = ug.user_id";
|
AND u.user_id = ug.user_id";
|
||||||
if(!$result_mods = $db->sql_query($sql))
|
if(!$result_mods = $db->sql_query($sql))
|
||||||
|
@ -166,7 +166,8 @@ if(!empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays']))
|
||||||
$sql = "SELECT COUNT(*) AS forum_topics
|
$sql = "SELECT COUNT(*) AS forum_topics
|
||||||
FROM " . TOPICS_TABLE . "
|
FROM " . TOPICS_TABLE . "
|
||||||
WHERE forum_id = $forum_id
|
WHERE forum_id = $forum_id
|
||||||
AND topic_time > $min_post_time";
|
AND topic_time > $min_post_time
|
||||||
|
OR topic_type = " . POST_ANNOUNCE;
|
||||||
|
|
||||||
if(!$result = $db->sql_query($sql))
|
if(!$result = $db->sql_query($sql))
|
||||||
{
|
{
|
||||||
|
@ -174,7 +175,7 @@ if(!empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays']))
|
||||||
}
|
}
|
||||||
$topics_count = $db->sql_fetchfield("forum_topics", -1, $result);
|
$topics_count = $db->sql_fetchfield("forum_topics", -1, $result);
|
||||||
|
|
||||||
$limit_posts_time = "AND t.topic_time > $min_post_time ";
|
$limit_posts_time = "AND ( t.topic_time > $min_post_time OR t.topic_type = " . POST_ANNOUNCE . " ) ";
|
||||||
|
|
||||||
if(!empty($HTTP_POST_VARS['postdays']))
|
if(!empty($HTTP_POST_VARS['postdays']))
|
||||||
{
|
{
|
||||||
|
@ -220,12 +221,13 @@ $total_topics = $db->sql_numrows($t_result);
|
||||||
// Post URL generation for
|
// Post URL generation for
|
||||||
// templating vars
|
// templating vars
|
||||||
//
|
//
|
||||||
$post_new_topic_url = append_sid("posting.".$phpEx."?mode=newtopic&".POST_FORUM_URL."=$forum_id");
|
$post_new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id");
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
"L_DISPLAY_TOPICS" => $lang['Display_topics'],
|
"L_DISPLAY_TOPICS" => $lang['Display_topics'],
|
||||||
"U_POST_NEW_TOPIC" => $post_new_topic_url,
|
"U_POST_NEW_TOPIC" => $post_new_topic_url,
|
||||||
"S_SELECT_POST_DAYS" => $select_post_days,
|
"S_SELECT_POST_DAYS" => $select_post_days,
|
||||||
"S_POST_DAYS_ACTION" => append_sid("viewforum.$phpEx?".POST_FORUM_URL."=".$forum_id."&start=$start")));
|
"S_POST_DAYS_ACTION" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&start=$start"))
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Dump out the page header and
|
// Dump out the page header and
|
||||||
|
@ -237,12 +239,14 @@ $template->set_filenames(array(
|
||||||
"body" => "viewforum_body.tpl",
|
"body" => "viewforum_body.tpl",
|
||||||
"jumpbox" => "jumpbox.tpl")
|
"jumpbox" => "jumpbox.tpl")
|
||||||
);
|
);
|
||||||
|
|
||||||
$jumpbox = make_jumpbox();
|
$jumpbox = make_jumpbox();
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
"JUMPBOX_LIST" => $jumpbox,
|
"JUMPBOX_LIST" => $jumpbox,
|
||||||
"SELECT_NAME" => POST_FORUM_URL)
|
"SELECT_NAME" => POST_FORUM_URL)
|
||||||
);
|
);
|
||||||
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
|
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
"FORUM_ID" => $forum_id,
|
"FORUM_ID" => $forum_id,
|
||||||
"FORUM_NAME" => $forum_name,
|
"FORUM_NAME" => $forum_name,
|
||||||
|
@ -323,6 +327,7 @@ if($total_topics)
|
||||||
if($replies > $board_config['posts_per_page'])
|
if($replies > $board_config['posts_per_page'])
|
||||||
{
|
{
|
||||||
$goto_page = " (<img src=\"" . $images['posticon'] . "\">" . $lang['Goto_page'] . ": ";
|
$goto_page = " (<img src=\"" . $images['posticon'] . "\">" . $lang['Goto_page'] . ": ";
|
||||||
|
|
||||||
$times = 1;
|
$times = 1;
|
||||||
for($i = 0; $i < ($replies + 1); $i += $board_config['posts_per_page'])
|
for($i = 0; $i < ($replies + 1); $i += $board_config['posts_per_page'])
|
||||||
{
|
{
|
||||||
|
@ -412,7 +417,7 @@ if($total_topics)
|
||||||
$s_auth_can .= "You " . (($is_auth['auth_delete']) ? "<b>can</b>" : "<b>cannot</b>") . " delete your posts in this forum<br>";
|
$s_auth_can .= "You " . (($is_auth['auth_delete']) ? "<b>can</b>" : "<b>cannot</b>") . " delete your posts in this forum<br>";
|
||||||
if($is_auth['auth_mod'] || $userdata['user_level'] == ADMIN)
|
if($is_auth['auth_mod'] || $userdata['user_level'] == ADMIN)
|
||||||
{
|
{
|
||||||
$s_auth_can .= "You <b>can</b> <a href=\"" . append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">moderate this forum</a><br>";
|
$s_auth_can .= "You <b>can</b> <a href=\"" . append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">moderate this forum</a><br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
|
Loading…
Add table
Reference in a new issue