diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 35 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_bbcodes.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewmessage.php | 30 |
4 files changed, 68 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 3cfe5de293..2480f1f025 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -922,6 +922,9 @@ class acp_attachments case 'orphan': + /* @var $pagination \phpbb\pagination */ + $pagination = $this->phpbb_container->get('pagination'); + if ($submit) { $delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array(); @@ -1064,13 +1067,29 @@ class acp_attachments 'S_ORPHAN' => true) ); + $attachments_per_page = (int) $config['topics_per_page']; + + // Get total number or orphans older than 3 hours + $sql = 'SELECT COUNT(attach_id) as num_files, SUM(filesize) as total_size + FROM ' . ATTACHMENTS_TABLE . ' + WHERE is_orphan = 1 + AND filetime < ' . (time() - 3*60*60); + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $num_files = (int) $row['num_files']; + $total_size = (int) $row['total_size']; + $this->db->sql_freeresult($result); + + $start = $request->variable('start', 0); + $start = $pagination->validate_start($start, $attachments_per_page, $num_files); + // Just get the files with is_orphan set and older than 3 hours $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' WHERE is_orphan = 1 AND filetime < ' . (time() - 3*60*60) . ' ORDER BY filetime DESC'; - $result = $db->sql_query($sql); + $result = $db->sql_query_limit($sql, $attachments_per_page, $start); while ($row = $db->sql_fetchrow($result)) { @@ -1086,6 +1105,20 @@ class acp_attachments } $db->sql_freeresult($result); + $pagination->generate_template_pagination( + $this->u_action, + 'pagination', + 'start', + $num_files, + $attachments_per_page, + $start + ); + + $template->assign_vars(array( + 'TOTAL_FILES' => $num_files, + 'TOTAL_SIZE' => get_formatted_filesize($total_size), + )); + break; case 'manage': diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index f958ae93c7..18d574081a 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -553,10 +553,10 @@ class acp_bbcodes } // Lowercase tags - $bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+=?).*/i', '$1', $bbcode_match); - $bbcode_search = preg_replace('/.*?\[([a-z0-9_-]+)=?.*/i', '$1', $bbcode_match); + $bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+).*/i', '$1', $bbcode_match); + $bbcode_search = preg_replace('/.*?\[([a-z0-9_-]+).*/i', '$1', $bbcode_match); - if (!preg_match('/^[a-zA-Z0-9_-]+=?$/', $bbcode_tag)) + if (!preg_match('/^[a-zA-Z0-9_-]+$/', $bbcode_tag)) { global $user; trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 32bee14eef..171a73a8de 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -537,7 +537,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod // Create last post link information, if appropriate if ($row['forum_last_post_id']) { - if ($row['forum_password_last_post'] === '' && $auth->acl_get('f_read', $row['forum_id_last_post'])) + if ($row['forum_password_last_post'] === '' && $auth->acl_gets('f_read', 'f_list_topics', $row['forum_id_last_post'])) { $last_post_subject = censor_text($row['forum_last_post_subject']); $last_post_subject_truncated = truncate_string($last_post_subject, 30, 255, false, $user->lang['ELLIPSIS']); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 48d14a133c..cf767a7cce 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -267,6 +267,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) * @var array user_info User data of the sender * @since 3.1.0-a1 * @changed 3.1.6-RC1 Added user_info into event + * @changed 3.2.2-RC1 Deprecated + * @deprecated 4.0.0 Event name is misspelled and is replaced with new event with correct name */ $vars = array( 'id', @@ -281,6 +283,34 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) ); extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars))); + /** + * Modify pm and sender data before it is assigned to the template + * + * @event core.ucp_pm_view_message + * @var mixed id Active module category (can be int or string) + * @var string mode Active module + * @var int folder_id ID of the folder the message is in + * @var int msg_id ID of the private message + * @var array folder Array with data of user's message folders + * @var array message_row Array with message data + * @var array cp_row Array with senders custom profile field data + * @var array msg_data Template array with message data + * @var array user_info User data of the sender + * @since 3.2.2-RC1 + */ + $vars = array( + 'id', + 'mode', + 'folder_id', + 'msg_id', + 'folder', + 'message_row', + 'cp_row', + 'msg_data', + 'user_info', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_message', compact($vars))); + $template->assign_vars($msg_data); $contact_fields = array( |