diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index dac19939ba..70d6f014f0 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1113,6 +1113,37 @@ function login_forum_box(&$forum_data)
page_footer();
}
+// Bump Topic Check - used by posting and viewtopic (do not want another included file)
+function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_poster, $last_topic_poster)
+{
+ global $config, $auth, $user;
+
+ // Check permission and make sure the last post was not already bumped
+ if (!$auth->acl_get('f_bump', $forum_id) || $topic_bumped)
+ {
+ return false;
+ }
+
+ // Check bump time range, is the user really allowed to bump the topic at this time?
+ preg_match('#^([0-9]+)(m|h|d)$#', $config['bump_interval'], $match);
+ $bump_time = ($match[2] == 'm') ? $match[1] * 60 : (($match[2] == 'h') ? $match[1] * 3600 : $match[1] * 86400);
+
+ // Check bump time
+ if ($last_post_time + $bump_time > time())
+ {
+ return false;
+ }
+
+ // Check bumper, only topic poster and last poster are allowed to bump
+ if ($topic_poster != $user->data['user_id'] && $last_topic_poster != $user->data['user_id'])
+ {
+ return false;
+ }
+
+ // A bump time of 0 will completely disable the bump feature... not intended but might be useful.
+ return $bump_time;
+}
+
// Error and message handler, call with trigger_error if reqd
function msg_handler($errno, $msg_text, $errfile, $errline)
{
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 78c46bafd0..9eac5d44ce 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -70,6 +70,27 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl =
return $forum_list;
}
+// Generate size select form
+function size_select($select_name, $size_compare)
+{
+ global $user;
+
+ $size_types_text = array($user->lang['BYTES'], $user->lang['KB'], $user->lang['MB']);
+ $size_types = array('b', 'kb', 'mb');
+
+ $select_field = '';
+
+ return ($select_field);
+}
+
// Obtain authed forums list
function get_forum_list($acl_list = 'f_list', $id_only = TRUE, $postable_only = FALSE, $no_cache = FALSE)
{
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 677bdc08bd..6468a15508 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -523,7 +523,6 @@ function create_thumbnail($source, $new_file, $mimetype)
return TRUE;
}
-
//
// TODO
//
diff --git a/phpBB/posting.php b/phpBB/posting.php
index aede56df5a..f4d001f4f3 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -373,23 +373,9 @@ $img_status = ($auth->acl_get('f_img', $forum_id)) ? TRUE : FALSE;
$flash_status = ($auth->acl_get('f_flash', $forum_id)) ? TRUE : FALSE;
$quote_status = ($config['allow_quote'] && $auth->acl_get('f_quote', $forum_id)) ? TRUE : FALSE;
-
// Bump Topic
-if ($mode == 'bump' && !$auth->acl_get('f_bump', $forum_id))
+if ($mode == 'bump' && ($bump_time = bump_topic_allowed($forum_id, $topic_bumped, $topic_last_post_time, $topic_poster, $topic_last_poster_id)))
{
- trigger_error('USER_CANNOT_BUMP');
-}
-else if ($mode == 'bump')
-{
- // Check bump time range, is the user really allowed to bump the topic at this time?
- preg_match('#^([0-9]+)(m|h|d)$#', $config['bump_interval'], $match);
- $bump_time = ($match[2] == 'm') ? $match[1] * 60 : (($match[2] == 'h') ? $match[1] * 3600 : $match[1] * 86400);
-
- if ($topic_last_post_time + $bump_time > $current_time)
- {
- trigger_error('BUMP_ERROR');
- }
-
$db->sql_transaction();
$db->sql_query('UPDATE ' . POSTS_TABLE . "
@@ -398,7 +384,9 @@ else if ($mode == 'bump')
AND topic_id = $topic_id");
$db->sql_query('UPDATE ' . TOPICS_TABLE . "
- SET topic_last_post_time = $current_time
+ SET topic_last_post_time = $current_time,
+ topic_bumped = 1,
+ topic_bumper = " . $user->data['user_id'] . "
WHERE topic_id = $topic_id");
$db->sql_query('UPDATE ' . FORUMS_TABLE . '
@@ -413,13 +401,17 @@ else if ($mode == 'bump')
markread('post', $forum_id, $topic_id, $current_time);
- add_log('mod', $forum_id, $topic_id, sprintf('LOGM_BUMP', $topic_title));
+ add_log('mod', $forum_id, $topic_id, sprintf($user->lang['LOGM_BUMP'], $topic_title));
meta_refresh(3, "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&p=$topic_last_post_id#$topic_last_post_id");
$message = $user->lang['TOPIC_BUMPED'] . '
' . sprintf($user->lang['VIEW_MESSAGE'], '", '') . '
' . sprintf($user->lang['RETURN_FORUM'], '', '');
trigger_error($message);
}
+else if ($mode == 'bump')
+{
+ trigger_error('BUMP_ERROR');
+}
// Save Draft
@@ -1571,7 +1563,7 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $data)
{
$sql_data['forum'] .= ($sql_data['forum'] != '') ? ', ' . implode(', ', $update) : implode(', ', $update);
}
- $sql_data['topic'] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
+ $sql_data['topic'] = 'topic_bumped = 0, topic_bumper = 0, topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
$update = update_last_post_information('topic', $topic_id);
if (sizeof($update))
{
@@ -1764,6 +1756,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
case 'reply':
$sql_data['topic']['stat'][] = 'topic_replies_real = topic_replies_real + 1' . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? ', topic_replies = topic_replies + 1' : '');
+ $sql_data['topic']['stat'][] = 'topic_bumped = 0, topic_bumper = 0';
$sql_data['user']['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : '');
$sql_data['forum']['stat'][] = 'forum_posts = forum_posts + 1'; //(!$auth->acl_get('f_moderate', $data['forum_id'])) ? 'forum_posts = forum_posts + 1' : '';
break;
@@ -1789,7 +1782,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
break;
}
-// $db->sql_transaction();
+ $db->sql_transaction();
// Submit new topic
if ($post_mode == 'post')
@@ -1991,7 +1984,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
}
-// $db->sql_transaction('commit');
+ $db->sql_transaction('commit');
if ($post_mode == 'post' || $post_mode == 'reply' || $post_mode == 'edit_last_post')
{
diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html
index 59ae0078d8..51fce73f93 100644
--- a/phpBB/styles/subSilver/template/posting_body.html
+++ b/phpBB/styles/subSilver/template/posting_body.html
@@ -38,6 +38,7 @@ function checkForm()
return true;
}
}
+
//-->
diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html
index 10fc0ccf8e..3711a88d66 100644
--- a/phpBB/styles/subSilver/template/viewtopic_body.html
+++ b/phpBB/styles/subSilver/template/viewtopic_body.html
@@ -162,6 +162,7 @@
{L_DOWNLOAD_NOTICE}
_________________
{postrow.SIGNATURE}
{postrow.EDITED_MESSAGE}
+ {postrow.BUMPED_MESSAGE}