diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2003-10-22 20:41:00 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2003-10-22 20:41:00 +0000 |
commit | 6114414650e8dca9420776d5eef9c3db59596581 (patch) | |
tree | 7ddf47c3b679c068d407c13eea1ffbaf539bd263 | |
parent | 76e1ee162fa98e59c1b44aa3fc646b26ff4677bf (diff) | |
download | forums-6114414650e8dca9420776d5eef9c3db59596581.tar forums-6114414650e8dca9420776d5eef9c3db59596581.tar.gz forums-6114414650e8dca9420776d5eef9c3db59596581.tar.bz2 forums-6114414650e8dca9420776d5eef9c3db59596581.tar.xz forums-6114414650e8dca9420776d5eef9c3db59596581.zip |
oops... not realised the config name change locally. :/
added logging of bump action
git-svn-id: file:///svn/phpbb/trunk@4625 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/posting.php | 16 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 7 |
2 files changed, 11 insertions, 12 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 6ac334850c..b39f265507 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -51,7 +51,7 @@ $current_time = time(); // Was cancel pressed? If so then redirect to the appropriate page -if ($cancel || time() - $lastclick < 2) +if ($cancel || $current_time - $lastclick < 2) { $redirect = ($post_id) ? "viewtopic.$phpEx$SID&p=$post_id#$post_id" : (($topic_id) ? "viewtopic.$phpEx$SID&t=$topic_id" : (($forum_id) ? "viewforum.$phpEx$SID&f=$forum_id" : "index.$phpEx$SID")); redirect($redirect); @@ -266,7 +266,7 @@ if (($forum_status == ITEM_LOCKED || $topic_status == ITEM_LOCKED) && !$auth->ac } // Can we edit this post? -if (($mode == 'edit' || $mode == 'delete') && !$auth->acl_get('m_edit', $forum_id) && $config['edit_time'] && $post_time < time() - $config['edit_time']) +if (($mode == 'edit' || $mode == 'delete') && !$auth->acl_get('m_edit', $forum_id) && $config['edit_time'] && $post_time < $current_time - $config['edit_time']) { trigger_error('CANNOT_EDIT_TIME'); } @@ -383,10 +383,10 @@ if ($mode == 'bump' && !$auth->acl_get('f_bump', $forum_id)) 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_time_range'], $match); + 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 > time()) + if ($topic_last_post_time + $bump_time > $current_time) { trigger_error('BUMP_ERROR'); } @@ -414,6 +414,8 @@ else if ($mode == 'bump') markread('post', $forum_id, $topic_id, $current_time); + add_log('mod', $forum_id, $topic_id, 'LOGM_BUMP'); + 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'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="viewtopic.' . $phpEx . $SID . "&f=$forum_id&t=$topic_id&p=$topic_last_post_id#$topic_last_post_id\">", '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID .'&f=' . $forum_id . '">', '</a>'); @@ -446,7 +448,7 @@ if (($save || isset($_POST['draft_save'])) && $user->data['user_id'] != ANONYMOU $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'user_id' => $user->data['user_id'], 'topic_id' => $topic_id, - 'save_time' => time(), + 'save_time' => $current_time, 'title' => $subject, 'post_subject' => $subject, 'post_message' => $message)); @@ -539,8 +541,6 @@ if ($submit || $preview || $refresh) } - $current_time = time(); - // If replying/quoting and last post id has changed // give user option to continue submit or return to post // notify and show user the post made between his request and the final submit @@ -974,7 +974,7 @@ $forum_data = array( generate_forum_nav($forum_data); $s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $topic_last_post_id . '" />' : ''; -$s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . time() . '" />'; +$s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . $current_time . '" />'; $s_hidden_fields .= (isset($check_value)) ? '<input type="hidden" name="status_switch" value="' . $check_value . '" />' : ''; $form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || @ini_get('file_uploads') == '0' || !$config['allow_attachments'] || !$auth->acl_get('f_attach', $forum_id)) ? '' : 'enctype="multipart/form-data"'; diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index d8c4eb4ec0..4a145b514e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -447,10 +447,9 @@ if (sizeof($censors)) } // Bump topic allowed? -$bump_type = (string) preg_replace('#^[0-9]+([m|h|d])$#', '\1', $config['bump_time_range']); -$bump_time = (int) preg_replace('#^([0-9]+)[m|h|d]$#', '\1', $config['bump_time_range']); -$bump_time = ($bump_type == 'm') ? $bump_time*60 : (($bump_type == 'h') ? $bump_time*3600 : $bump_time*86400); -unset($bump_type); +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); +unset($match); // Send vars to template $template->assign_vars(array( |