diff options
author | nomind60s <nomind60s@users.noreply.github.com> | 2017-03-20 23:06:34 -0600 |
---|---|---|
committer | nomind60s <nomind60s@users.noreply.github.com> | 2017-03-20 23:06:34 -0600 |
commit | 7609ba71e98071cf5549de9d9baea253609ecd00 (patch) | |
tree | fbfc3711fe43d958819dc098cb3f6800452597e7 /phpBB | |
parent | 927220c87372c41abd0d8f4ff30937e7e4befceb (diff) | |
download | forums-7609ba71e98071cf5549de9d9baea253609ecd00.tar forums-7609ba71e98071cf5549de9d9baea253609ecd00.tar.gz forums-7609ba71e98071cf5549de9d9baea253609ecd00.tar.bz2 forums-7609ba71e98071cf5549de9d9baea253609ecd00.tar.xz forums-7609ba71e98071cf5549de9d9baea253609ecd00.zip |
[ticket/15137] Global announcements can stick for a non-zero number of days
To be consistent with Sticky and Announcements topic types, Global
announcements can now stick for a non-zero number of days, i.e. they are
no longer never ending.
Before this change, if the topic type was Global and a non-zero number of
days where set to stick topic, the number was silently ignored and a Global
announcement was always never ending.
PHPBB3-15137
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_posting.php | 4 | ||||
-rw-r--r-- | phpBB/language/en/posting.php | 2 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index ba367e5eeb..e782414f62 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1814,7 +1814,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), 'topic_first_poster_colour' => $user->data['user_colour'], 'topic_type' => $topic_type, - 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, + 'topic_time_limit' => ($topic_type != POST_NORMAL) ? ($data['topic_time_limit'] * 86400) : 0, 'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0, 'topic_status' => (isset($data['topic_status'])) ? $data['topic_status'] : ITEM_UNLOCKED, ); @@ -1909,7 +1909,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_title' => $subject, 'topic_first_poster_name' => $username, 'topic_type' => $topic_type, - 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, + 'topic_time_limit' => ($topic_type != POST_NORMAL) ? ($data['topic_time_limit'] * 86400) : 0, 'poll_title' => (isset($poll['poll_options'])) ? $poll['poll_title'] : '', 'poll_start' => (isset($poll['poll_options'])) ? $poll_start : 0, 'poll_max_options' => (isset($poll['poll_options'])) ? $poll['poll_max_options'] : 1, diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index ef52f59753..2b2fdb7d22 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -241,7 +241,7 @@ $lang = array_merge($lang, array( 'SMILIES_ARE_ON' => 'Smilies are <em>ON</em>', 'STICKY_ANNOUNCE_TIME_LIMIT'=> 'Sticky/Announcement time limit', 'STICK_TOPIC_FOR' => 'Stick topic for', - 'STICK_TOPIC_FOR_EXPLAIN' => 'Enter 0 for a never ending Sticky/Announcement. Please note that this number is relative to the date of the post.', + 'STICK_TOPIC_FOR_EXPLAIN' => 'Enter 0 for a never ending Sticky/Announcement/Global. Please note that this number is relative to the date of the post.', 'STYLES_TIP' => 'Tip: Styles can be applied quickly to selected text.', 'TOO_FEW_CHARS' => 'Your message contains too few characters.', diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 378e2d8f97..e9cb2dd383 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -321,8 +321,8 @@ if ($post_id) $topic_id = (int) $topic_data['topic_id']; $topic_replies = $phpbb_content_visibility->get_count('topic_posts', $topic_data, $forum_id) - 1; -// Check sticky/announcement time limit -if (($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == POST_ANNOUNCE) && $topic_data['topic_time_limit'] && ($topic_data['topic_time'] + $topic_data['topic_time_limit']) < time()) +// Check sticky/announcement/global time limit +if (($topic_data['topic_type'] != POST_NORMAL) && $topic_data['topic_time_limit'] && ($topic_data['topic_time'] + $topic_data['topic_time_limit']) < time()) { $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_type = ' . POST_NORMAL . ', topic_time_limit = 0 |