diff options
author | Jmz <jmztaylor@gmail.com> | 2016-11-02 17:03:50 -0500 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-11-20 12:56:11 +0100 |
commit | 6bbc18fa40cda5d46ae7ab750b06db2eed1a4d1c (patch) | |
tree | 85f05e253b0eac0ccc52702c251ec67fb28bcca0 /phpBB | |
parent | 16c3b40b4ea2a16e3ed7d7c5fcaa1fadd1d3c734 (diff) | |
download | forums-6bbc18fa40cda5d46ae7ab750b06db2eed1a4d1c.tar forums-6bbc18fa40cda5d46ae7ab750b06db2eed1a4d1c.tar.gz forums-6bbc18fa40cda5d46ae7ab750b06db2eed1a4d1c.tar.bz2 forums-6bbc18fa40cda5d46ae7ab750b06db2eed1a4d1c.tar.xz forums-6bbc18fa40cda5d46ae7ab750b06db2eed1a4d1c.zip |
[ticket/14850] Add core.smiley_text_root_path
Allows changing root_path of smilies to use CDN for example
PHPBB3-14850
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_content.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 8e60804d6e..8858d1a307 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -980,7 +980,7 @@ function bbcode_nl2br($text) */ function smiley_text($text, $force_option = false) { - global $config, $user, $phpbb_path_helper; + global $config, $user, $phpbb_path_helper, $phpbb_dispatcher; if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies')) { @@ -989,6 +989,16 @@ function smiley_text($text, $force_option = false) else { $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path(); + + /** + * Event to override the root_path for smilies + * + * @event core.smiley_text_root_path + * @var string root_path root_path for smilies + * @since 3.1.11-RC1 + */ + $vars = array('root_path'); + extract($phpbb_dispatcher->trigger_event('core.smiley_text_root_path', compact($vars))); return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' . $root_path . $config['smilies_path'] . '/\2 />', $text); } } |