diff options
-rw-r--r-- | build/build.xml | 2 | ||||
-rw-r--r-- | phpBB/docs/events.md | 48 | ||||
-rw-r--r-- | phpBB/includes/functions_content.php | 66 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 26 | ||||
-rw-r--r-- | phpBB/phpbb/notification/method/messenger_base.php | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/memberlist_view.html | 6 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/memberlist_view.html | 6 |
8 files changed, 159 insertions, 9 deletions
diff --git a/build/build.xml b/build/build.xml index 1827fe8ab3..7d9def981a 100644 --- a/build/build.xml +++ b/build/build.xml @@ -3,7 +3,7 @@ <project name="phpBB" description="The phpBB forum software" default="all" basedir="../"> <!-- a few settings for the build --> <property name="newversion" value="3.1.9-dev" /> - <property name="newversion" value="3.1.8" /> + <property name="prevversion" value="3.1.8" /> <property name="olderversions" value="3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1" /> <!-- no configuration should be needed beyond this point --> diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 04c531c5a3..fced20ecfe 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -991,6 +991,22 @@ memberlist_view_contact_before * Since: 3.1.0-b2 * Purpose: Add content before the user contact part of any user profile +memberlist_view_contact_custom_fields_after +=== +* Locations: + + styles/prosilver/template/memberlist_view.html + + styles/subsilver2/template/memberlist_view.html +* Since: 3.1.9-RC1 +* Purpose: Add content after the user contact related custom fields + +memberlist_view_contact_custom_fields_before +=== +* Locations: + + styles/prosilver/template/memberlist_view.html + + styles/subsilver2/template/memberlist_view.html +* Since: 3.1.9-RC1 +* Purpose: Add content before the user contact related custom fields + memberlist_view_content_append === * Locations: @@ -1007,6 +1023,22 @@ memberlist_view_content_prepend * Since: 3.1.0-b3 * Purpose: Add custom content to the user profile view before the main content +memberlist_view_non_contact_custom_fields_after +=== +* Locations: + + styles/prosilver/template/memberlist_view.html + + styles/subsilver2/template/memberlist_view.html +* Since: 3.1.9-RC1 +* Purpose: Add content after the user not contact related custom fields + +memberlist_view_non_contact_custom_fields_before +=== +* Locations: + + styles/prosilver/template/memberlist_view.html + + styles/subsilver2/template/memberlist_view.html +* Since: 3.1.9-RC1 +* Purpose: Add content before the user not contact related custom fields + memberlist_view_rank_after === * Locations: @@ -1065,6 +1097,22 @@ memberlist_view_user_statistics_before * Since: 3.1.0-a1 * Purpose: Add entries before the user statistics part of any user profile +memberlist_view_zebra_after +=== +* Locations: + + styles/prosilver/template/memberlist_view.html + + styles/subsilver2/template/memberlist_view.html +* Since: 3.1.9-RC1 +* Purpose: Add content after the user friends/foes links + +memberlist_view_zebra_before +=== +* Locations: + + styles/prosilver/template/memberlist_view.html + + styles/subsilver2/template/memberlist_view.html +* Since: 3.1.9-RC1 +* Purpose: Add content before the user friends/foes links + navbar_header_logged_out_content === * Locations: diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 6f861b8607..36d7dfc03c 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -47,7 +47,7 @@ if (!defined('IN_PHPBB')) */ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, &$sort_dir, &$s_limit_days, &$s_sort_key, &$s_sort_dir, &$u_sort_param, $def_st = false, $def_sk = false, $def_sd = false) { - global $user; + global $user, $phpbb_dispatcher; $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); @@ -106,6 +106,42 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, $u_sort_param .= ($selected !== $sort_ary['default']) ? ((strlen($u_sort_param)) ? '&' : '') . "{$name}={$selected}" : ''; } + /** + * Run code before generated sort selects are returned + * + * @event core.gen_sort_selects_after + * @var int limit_days Days limit + * @var array sort_by_text Sort by text options + * @var int sort_days Sort by days flag + * @var string sort_key Sort key + * @var string sort_dir Sort dir + * @var string s_limit_days String of days limit + * @var string s_sort_key String of sort key + * @var string s_sort_dir String of sort dir + * @var string u_sort_param Sort URL params + * @var bool def_st Default sort days + * @var bool def_sk Default sort key + * @var bool def_sd Default sort dir + * @var array sorts Sorts + * @since 3.1.9-RC1 + */ + $vars = array( + 'limit_days', + 'sort_by_text', + 'sort_days', + 'sort_key', + 'sort_dir', + 's_limit_days', + 's_sort_key', + 's_sort_dir', + 'u_sort_param', + 'def_st', + 'def_sk', + 'def_sd', + 'sorts', + ); + extract($phpbb_dispatcher->trigger_event('core.gen_sort_selects_after', compact($vars))); + return; } @@ -392,7 +428,7 @@ function phpbb_clean_search_string($search_string) */ function decode_message(&$message, $bbcode_uid = '') { - global $config; + global $config, $phpbb_dispatcher; if ($bbcode_uid) { @@ -405,12 +441,38 @@ function decode_message(&$message, $bbcode_uid = '') $replace = array("\n"); } + /** + * Use this event to modify the message before it is decoded + * + * @event core.decode_message_before + * @var string message_text The message content + * @var string bbcode_uid The message BBCode UID + * @since 3.1.9-RC1 + */ + $message_text = $message; + $vars = array('message_text', 'bbcode_uid'); + extract($phpbb_dispatcher->trigger_event('core.decode_message_before', compact($vars))); + $message = $message_text; + $message = str_replace($match, $replace, $message); $match = get_preg_expression('bbcode_htm'); $replace = array('\1', '\1', '\2', '\1', '', ''); $message = preg_replace($match, $replace, $message); + + /** + * Use this event to modify the message after it is decoded + * + * @event core.decode_message_after + * @var string message_text The message content + * @var string bbcode_uid The message BBCode UID + * @since 3.1.9-RC1 + */ + $message_text = $message; + $vars = array('message_text', 'bbcode_uid'); + extract($phpbb_dispatcher->trigger_event('core.decode_message_after', compact($vars))); + $message = $message_text; } /** diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index aaecd9de0c..0525cfc29e 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -210,10 +210,12 @@ class messenger /** * Set email template to use */ - function template($template_file, $template_lang = '', $template_path = '') + function template($template_file, $template_lang = '', $template_path = '', $template_dir_prefix = '') { global $config, $phpbb_root_path, $phpEx, $user, $phpbb_extension_manager; + $template_dir_prefix = (!$template_dir_prefix || $template_dir_prefix[0] === '/') ? $template_dir_prefix : '/' . $template_dir_prefix; + $this->setup_template(); if (!trim($template_file)) @@ -232,7 +234,7 @@ class messenger if ($template_path) { $template_paths = array( - $template_path, + $template_path . $template_dir_prefix, ); } else @@ -241,7 +243,7 @@ class messenger $template_path .= $template_lang . '/email'; $template_paths = array( - $template_path, + $template_path . $template_dir_prefix, ); // we can only specify default language fallback when the path is not a custom one for which we @@ -251,14 +253,14 @@ class messenger $fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/'; $fallback_template_path .= basename($config['default_lang']) . '/email'; - $template_paths[] = $fallback_template_path; + $template_paths[] = $fallback_template_path . $template_dir_prefix; } } $this->set_template_paths(array( array( 'name' => $template_lang . '_email', - 'ext_path' => 'language/' . $template_lang . '/email' + 'ext_path' => 'language/' . $template_lang . '/email' . $template_dir_prefix, ), ), $template_paths); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 75d77285a0..fae8e659bb 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1129,6 +1129,32 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $db->sql_freeresult($result); } + /** + * Event to modify the posts list for topic reviews + * + * @event core.topic_review_modify_post_list + * @var array attachments Array with the post attachments data + * @var int cur_post_id Post offset ID + * @var int forum_id The topic's forum ID + * @var string mode The topic review mode + * @var array post_list Array with the post IDs + * @var array rowset Array with the posts data + * @var bool show_quote_button Flag indicating if the quote button should be displayed + * @var int topic_id The topic ID that is being reviewed + * @since 3.1.9-RC1 + */ + $vars = array( + 'attachments', + 'cur_post_id', + 'forum_id', + 'mode', + 'post_list', + 'rowset', + 'show_quote_button', + 'topic_id', + ); + extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_post_list', compact($vars))); + for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) { // A non-existing rowset only happens if there was no user present for the entered poster_id diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php index c3aee088f9..5ae96282c4 100644 --- a/phpBB/phpbb/notification/method/messenger_base.php +++ b/phpBB/phpbb/notification/method/messenger_base.php @@ -74,7 +74,7 @@ abstract class messenger_base extends \phpbb\notification\method\base continue; } - $messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']); + $messenger->template($notification->get_email_template(), $user['user_lang'], '', $template_dir_prefix); $messenger->set_addresses($user); diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index 8ecca49a60..a7439bc759 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -36,11 +36,14 @@ <!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}{L_COLON}</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF --> <!-- IF AGE !== '' --><dt>{L_AGE}{L_COLON}</dt> <dd>{AGE}</dd><!-- ENDIF --> <!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}{L_COLON}</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF --> + <!-- EVENT memberlist_view_non_contact_custom_fields_before --> <!-- BEGIN custom_fields --> <!-- IF not custom_fields.S_PROFILE_CONTACT --> <dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd> <!-- ENDIF --> <!-- END custom_fields --> + <!-- EVENT memberlist_view_non_contact_custom_fields_after --> + <!-- EVENT memberlist_view_zebra_before --> <!-- IF S_USER_LOGGED_IN and S_ZEBRA --> <!-- IF U_REMOVE_FRIEND --> <dt> </dt> <dd class="zebra"><a href="{U_REMOVE_FRIEND}" data-ajax="zebra"><strong>{L_REMOVE_FRIEND}</strong></a></dd> @@ -55,6 +58,7 @@ <!-- ENDIF --> <!-- ENDIF --> <!-- ENDIF --> + <!-- EVENT memberlist_view_zebra_after --> </dl> </div> @@ -71,6 +75,7 @@ <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}{L_COLON}</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER}</a></dd><!-- ENDIF --> <!-- IF U_PM --><dt>{L_PM}{L_COLON}</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF --> <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}{L_COLON}</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 750, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}{L_COLON}</dt> <dd>{USER_JABBER}</dd><!-- ENDIF --> + <!-- EVENT memberlist_view_contact_custom_fields_before --> <!-- BEGIN custom_fields --> <!-- IF custom_fields.S_PROFILE_CONTACT --> <dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt> @@ -81,6 +86,7 @@ <!-- ENDIF --> <!-- ENDIF --> <!-- END custom_fields --> + <!-- EVENT memberlist_view_contact_custom_fields_after --> <!-- IF S_PROFILE_FIELD1 --> <!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> <dt>{PROFILE_FIELD1_NAME}{L_COLON}</dt> <dd>{PROFILE_FIELD1_VALUE}</dd> diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html index 24e96c412c..731d2c8bca 100644 --- a/phpBB/styles/subsilver2/template/memberlist_view.html +++ b/phpBB/styles/subsilver2/template/memberlist_view.html @@ -53,6 +53,7 @@ <td class="genmed" align="center">[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</td> </tr> <!-- ENDIF --> + <!-- EVENT memberlist_view_zebra_before --> <!-- IF S_USER_LOGGED_IN and S_ZEBRA --> <tr> <td class="genmed" align="center">[ @@ -66,6 +67,7 @@ ]</td> </tr> <!-- ENDIF --> + <!-- EVENT memberlist_view_zebra_after --> </table> </td> <td class="row1"> @@ -129,6 +131,7 @@ <td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false" class="imageset">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td> </tr> <!-- ENDIF --> + <!-- EVENT memberlist_view_contact_custom_fields_before --> <!-- BEGIN custom_fields --> <!-- IF custom_fields.S_PROFILE_CONTACT --> <tr> @@ -141,6 +144,7 @@ </tr> <!-- ENDIF --> <!-- END custom_fields --> + <!-- EVENT memberlist_view_contact_custom_fields_after --> </table> </td> <td class="row1"> @@ -162,6 +166,7 @@ <td><b class="genmed">{PROFILE_FIELD1_VALUE}</b></td> </tr> <!-- ENDIF --> + <!-- EVENT memberlist_view_non_contact_custom_fields_before --> <!-- BEGIN custom_fields --> <!-- IF not custom_fields.S_PROFILE_CONTACT --> <tr> @@ -170,6 +175,7 @@ </tr> <!-- ENDIF --> <!-- END custom_fields --> + <!-- EVENT memberlist_view_non_contact_custom_fields_after --> </table> </td> </tr> |