Author: nickvergessen Date: Mon Aug 31 15:57:04 2009 New Revision: 10080 Log: fix r10076 for #48615 - Ability to specify amount of time user is able to delete his last post in topic. Authorised by: AcydBurn Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html branches/phpBB-3_0_0/phpBB/includes/acp/acp_board.php branches/phpBB-3_0_0/phpBB/install/database_update.php branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql branches/phpBB-3_0_0/phpBB/language/en/acp/board.php branches/phpBB-3_0_0/phpBB/posting.php branches/phpBB-3_0_0/phpBB/viewtopic.php Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original) --- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Mon Aug 31 15:57:04 2009 *************** *** 201,207 **** <li>[Fix] Sort private messages by message time and not message id. (Bug #50015)</li> <li>[Fix] Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)</li> <li>[Fix] Only show "Add friend" and "Add foe" links if the specific module is enabled. (Bug #50475)</li> - <li>[Fix] Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)</li> <li>[Fix] Correctly display list items in forum description in prosilver and administration. (Bug #48055 - Patch by leviatan21)</li> <li>[Fix] Fix handling of bookmarks and subscriptions on "split topcis", "merge topics" and "merge posts". (Bug #50035)</li> <li>[Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).</li> --- 201,206 ---- *************** *** 234,239 **** --- 233,239 ---- <li>[Change] Require user to be registered and logged in to search for unread posts if topic read tracking is disabled for guests (Bug #49525)</li> <li>[Change] Allow three-digit hex notation in Color BBcode. (Bug #39965 - Patch by m0rpha)</li> <li>[Change] Simplified login_box() and redirection after login. S_LOGIN_ACTION can now be used on every page. (Bug #50285)</li> + <li>[Change] Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)</li> <li>[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)</li> <li>[Feature] Backported 3.2 captcha plugins. <ul> *************** *** 289,294 **** --- 289,295 ---- <li>[Feature] Ability to define constant PHPBB_USE_BOARD_URL_PATH to use board url for images/avatars/ranks/imageset...</li> <li>[Feature] Added function to generate Email hash. (Bug #49195)</li> <li>[Feature] Style authors are now able to define the default submit button used for form submission on ENTER keypress on forms using more than one. Prosilver uses this for the posting page(s) and registration screen.</li> + <li>[Feature] Ability to specify amount of time user is able to delete his last post in topic.</li> </ul> <a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3> Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_board.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/acp/acp_board.php (original) --- branches/phpBB-3_0_0/phpBB/includes/acp/acp_board.php Mon Aug 31 15:57:04 2009 *************** *** 177,182 **** --- 177,183 ---- 'legend2' => 'POSTING', 'bump_type' => false, 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'delete_time' => array('lang' => 'DELETE_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), Modified: branches/phpBB-3_0_0/phpBB/install/database_update.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/database_update.php (original) --- branches/phpBB-3_0_0/phpBB/install/database_update.php Mon Aug 31 15:57:04 2009 *************** *** 1498,1503 **** --- 1498,1508 ---- _sql($sql, $errored, $error_ary); } + if (!isset($config['delete_time'])) + { + set_config('delete_time', $config['edit_time']); + } + $no_updates = false; break; } Modified: branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql (original) --- branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql Mon Aug 31 15:57:04 2009 *************** *** 90,95 **** --- 90,96 ---- INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0'); + INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail'); Modified: branches/phpBB-3_0_0/phpBB/language/en/acp/board.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/language/en/acp/board.php (original) --- branches/phpBB-3_0_0/phpBB/language/en/acp/board.php Mon Aug 31 15:57:04 2009 *************** *** 152,157 **** --- 152,159 ---- 'BUMP_INTERVAL_EXPLAIN' => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic.', 'CHAR_LIMIT' => 'Maximum characters per post/message', 'CHAR_LIMIT_EXPLAIN' => 'The number of characters allowed within a post/private message. Set to 0 for unlimited characters.', + 'DELETE_TIME' => 'Limit deleting time', + 'DELETE_TIME_EXPLAIN' => 'Limits the time available to delete a new post. Setting the value to 0 disables this behaviour.', 'DISPLAY_LAST_EDITED' => 'Display last edited time information', 'DISPLAY_LAST_EDITED_EXPLAIN' => 'Choose if the last edited by information to be displayed on posts.', 'EDIT_TIME' => 'Limit editing time', Modified: branches/phpBB-3_0_0/phpBB/posting.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/posting.php (original) --- branches/phpBB-3_0_0/phpBB/posting.php Mon Aug 31 15:57:04 2009 *************** *** 1433,1439 **** 'S_EDIT_REASON' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, ! 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked']) || $auth->acl_get('m_delete', $forum_id))) ? true : false, 'S_BBCODE_ALLOWED' => $bbcode_status, 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', 'S_SMILIES_ALLOWED' => $smilies_status, --- 1433,1439 ---- 'S_EDIT_REASON' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, ! 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false, 'S_BBCODE_ALLOWED' => $bbcode_status, 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', 'S_SMILIES_ALLOWED' => $smilies_status, *************** *** 1545,1551 **** global $phpbb_root_path, $phpEx; // If moderator removing post or user itself removing post, present a confirmation screen ! if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'])) { $s_hidden_fields = build_hidden_fields(array( 'p' => $post_id, --- 1545,1551 ---- global $phpbb_root_path, $phpEx; // If moderator removing post or user itself removing post, present a confirmation screen ! if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']))) { $s_hidden_fields = build_hidden_fields(array( 'p' => $post_id, Modified: branches/phpBB-3_0_0/phpBB/viewtopic.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/viewtopic.php (original) --- branches/phpBB-3_0_0/phpBB/viewtopic.php Mon Aug 31 15:57:04 2009 *************** *** 1476,1482 **** $user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ! // we do not want to allowe removal of the last post if a moderator locked it! !$row['post_edit_locked'] ))); --- 1476,1483 ---- $user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ! ($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']) && ! // we do not want to allow removal of the last post if a moderator locked it! !$row['post_edit_locked'] ))); |