diff options
-rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 11 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewmessage.php | 3 | ||||
-rw-r--r-- | phpBB/phpbb/avatar/driver/upload.php | 7 | ||||
-rw-r--r-- | phpBB/phpbb/session.php | 58 | ||||
-rw-r--r-- | phpBB/posting.php | 13 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/common.css | 7 |
6 files changed, 85 insertions, 14 deletions
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 0d1df2b937..7a93f73228 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -559,6 +559,17 @@ function change_poster(&$post_info, $userdata) $post_info = $post_info[$post_id]; + /** + * This event allows you to perform additional tasks after changing a post's poster + * + * @event core.mcp_change_poster_after + * @var array userdata Information on a post's new poster + * @var array post_info Information on the affected post + * @since 3.1.6-RC1 + */ + $vars = array('userdata', 'post_info'); + extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars))); + // Now add log entry add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username); } diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index d81c4ce7fe..d7b9b32dbf 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -265,7 +265,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) * @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.1.0-a1 + * @changed 3.1.6-RC1 Added user_info into event */ $vars = array( 'id', @@ -276,6 +278,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'message_row', 'cp_row', 'msg_data', + 'user_info', ); extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars))); diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index ee36243844..73147a85a0 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -161,6 +161,13 @@ class upload extends \phpbb\avatar\driver\driver return false; } + // Delete current avatar if not overwritten + $ext = substr(strrchr($row['avatar'], '.'), 1); + if ($ext && $ext !== $file->get('extension')) + { + $this->delete($row); + } + return array( 'avatar' => $row['id'] . '_' . time() . '.' . $file->get('extension'), 'avatar_width' => $file->get('width'), diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index bedd581725..a5c8f264e0 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -519,7 +519,7 @@ class session */ function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true) { - global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container; + global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; $this->data = array(); @@ -893,6 +893,19 @@ class session $_SID = ''; } + $session_data = $sql_ary; + /** + * Event to send new session data to extension + * Read-only event + * + * @event core.session_create_after + * @var array session_data Associative array of session keys to be updated + * @since 3.1.6-RC1 + */ + $vars = array('session_data'); + extract($phpbb_dispatcher->trigger_event('core.session_create_after', compact($vars))); + unset($session_data); + return true; } @@ -906,13 +919,30 @@ class session */ function session_kill($new_session = true) { - global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container; + global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '" . $db->sql_escape($this->session_id) . "' AND session_user_id = " . (int) $this->data['user_id']; $db->sql_query($sql); + $user_id = (int) $this->data['user_id']; + $session_id = $this->session_id; + /** + * Event to send session kill information to extension + * Read-only event + * + * @event core.session_kill_after + * @var int user_id user_id of the session user. + * @var string session_id current user's session_id + * @var bool new_session should we create new session for user + * @since 3.1.6-RC1 + */ + $vars = array('user_id', 'session_id', 'new_session'); + extract($phpbb_dispatcher->trigger_event('core.session_kill_after', compact($vars))); + unset($user_id); + unset($session_id); + // Allow connecting logout with external auth method logout $provider_collection = $phpbb_container->get('auth.provider_collection'); $provider = $provider_collection->get_provider(); @@ -980,7 +1010,7 @@ class session */ function session_gc() { - global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container; + global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; $batch_size = 10; @@ -1048,6 +1078,14 @@ class session $db->sql_query($sql); } + /** + * Event to trigger extension on session_gc + * + * @event core.session_gc_after + * @since 3.1.6-RC1 + */ + $phpbb_dispatcher->dispatch('core.session_gc_after'); + return; } @@ -1541,12 +1579,24 @@ class session */ public function update_session($session_data, $session_id = null) { - global $db; + global $db, $phpbb_dispatcher; $session_id = ($session_id) ? $session_id : $this->session_id; $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $session_data) . " WHERE session_id = '" . $db->sql_escape($session_id) . "'"; $db->sql_query($sql); + + /** + * Event to send update session information to extension + * Read-only event + * + * @event core.update_session_after + * @var array session_data Associative array of session keys to be updated + * @var string session_id current user's session_id + * @since 3.1.6-RC1 + */ + $vars = array('session_data', 'session_id'); + extract($phpbb_dispatcher->trigger_event('core.update_session_after', compact($vars))); } } diff --git a/phpBB/posting.php b/phpBB/posting.php index 4f901c1d94..2bd3a1a1d2 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1379,10 +1379,9 @@ if ($submit || $preview || $refresh) * @var string post_author_name Author name for guest posts * @var bool update_message Boolean if the post message was changed * @var bool update_subject Boolean if the post subject was changed - * @var bool submit Whether or not the form has been submitted - * @var array error Any error strings; a non-empty array aborts form submission. * NOTE: Should be actual language strings, NOT language keys. * @since 3.1.0-RC5 + * @changed 3.1.6-RC1 remove submit and error from event Submit and Error are checked previously prior to running event */ $vars = array( 'post_data', @@ -1396,8 +1395,6 @@ if ($submit || $preview || $refresh) 'post_author_name', 'update_message', 'update_subject', - 'submit', - 'error', ); extract($phpbb_dispatcher->trigger_event('core.posting_modify_submit_post_before', compact($vars))); @@ -1421,10 +1418,9 @@ if ($submit || $preview || $refresh) * @var bool update_message Boolean if the post message was changed * @var bool update_subject Boolean if the post subject was changed * @var string redirect_url URL the user is going to be redirected to - * @var bool submit Whether or not the form has been submitted - * @var array error Any error strings; a non-empty array aborts form submission. * NOTE: Should be actual language strings, NOT language keys. * @since 3.1.0-RC5 + * @changed 3.1.6-RC1 remove submit and error from event Submit and Error are checked previously prior to running event */ $vars = array( 'post_data', @@ -1439,8 +1435,6 @@ if ($submit || $preview || $refresh) 'update_message', 'update_subject', 'redirect_url', - 'submit', - 'error', ); extract($phpbb_dispatcher->trigger_event('core.posting_modify_submit_post_after', compact($vars))); @@ -1850,6 +1844,7 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_ * @var int post_id ID of the post * @var int topic_id ID of the topic * @var int forum_id ID of the forum +* @var int draft_id ID of the draft * @var bool submit Whether or not the form has been submitted * @var bool preview Whether or not the post is being previewed * @var bool save Whether or not a draft is being saved @@ -1872,6 +1867,7 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_ * delete, cancel, refresh, error, page_data, message_parser * @change 3.1.2-RC1 Removed 'delete' var as it does not exist * @change 3.1.5-RC1 Added poll variables to the page_data array +* @change 3.1.6-RC1 Added 'draft_id' var */ $vars = array( 'post_data', @@ -1885,6 +1881,7 @@ $vars = array( 'post_id', 'topic_id', 'forum_id', + 'draft_id', 'submit', 'preview', 'save', diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index c126b9e3c2..702960f47c 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -327,6 +327,7 @@ ul.linklist li.responsive-menu { ul.linklist li.responsive-menu a.responsive-menu-link { display: inline-block; margin: 0 5px; + font-size: 1.455em; position: relative; width: 16px; line-height: 1.2em; @@ -1257,12 +1258,14 @@ ul.linklist:after, } #quick-links a.responsive-menu-link:before { - font-size: 1.6em; + font-size: 1.455em; line-height: 16.5px; } .compact #quick-links a.responsive-menu-link { - font-size: 0; + width: 0; + overflow: hidden; + white-space: nowrap; } .compact .icon-notification > a > span, .compact .icon-pm > a > span { |