aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-11-20 12:57:31 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-11-20 12:57:31 +0100
commit20771271ca201f8729eecab5052da8a6423dab02 (patch)
treea7518c361cc3a363ba0cf2e6bb5649cfef9792a5 /phpBB/includes
parent8f19d16b2a9bb9b080c56df7b743d505cffc60b2 (diff)
parent6d58c4a4b5d9361a3bec8359b0bce9e9dd4eddf3 (diff)
downloadforums-20771271ca201f8729eecab5052da8a6423dab02.tar
forums-20771271ca201f8729eecab5052da8a6423dab02.tar.gz
forums-20771271ca201f8729eecab5052da8a6423dab02.tar.bz2
forums-20771271ca201f8729eecab5052da8a6423dab02.tar.xz
forums-20771271ca201f8729eecab5052da8a6423dab02.zip
Merge branch '3.1.x' into 3.2.x
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_content.php12
-rw-r--r--phpBB/includes/functions_posting.php9
2 files changed, 20 insertions, 1 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index e36eb8119b..9ec965a6a1 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -1035,7 +1035,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'))
{
@@ -1044,6 +1044,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);
}
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 3a2004396c..551165c558 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -120,6 +120,15 @@ function generate_smilies($mode, $forum_id)
foreach ($smilies as $row)
{
+ /**
+ * Modify smiley root path before populating smiley list
+ *
+ * @event core.generate_smilies_before
+ * @var string root_path root_path for smilies
+ * @since 3.1.11-RC1
+ */
+ $vars = array('root_path');
+ extract($phpbb_dispatcher->trigger_event('core.generate_smilies_before', compact($vars)));
$template->assign_block_vars('smiley', array(
'SMILEY_CODE' => $row['code'],
'A_SMILEY_CODE' => addslashes($row['code']),