diff options
author | kasimi <mail@kasimi.net> | 2019-10-17 12:54:42 +0200 |
---|---|---|
committer | kasimi <mail@kasimi.net> | 2019-10-17 12:54:42 +0200 |
commit | 84e0f5a2ebf8477a70c185c6496a02f0e2ed8918 (patch) | |
tree | f10e65e03f316416ad6613b5b814fb684113623a /phpBB/includes/functions_posting.php | |
parent | c75c13e5554652927a8aa57bd3b9f3902f57b429 (diff) | |
download | forums-84e0f5a2ebf8477a70c185c6496a02f0e2ed8918.tar forums-84e0f5a2ebf8477a70c185c6496a02f0e2ed8918.tar.gz forums-84e0f5a2ebf8477a70c185c6496a02f0e2ed8918.tar.bz2 forums-84e0f5a2ebf8477a70c185c6496a02f0e2ed8918.tar.xz forums-84e0f5a2ebf8477a70c185c6496a02f0e2ed8918.zip |
[ticket/16183] Add core.generate_smilies_count_sql_before
PHPBB3-16183
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r-- | phpBB/includes/functions_posting.php | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 2cce77e092..0fb4ef2c49 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -52,9 +52,28 @@ function generate_smilies($mode, $forum_id) page_header($user->lang['SMILIES']); - $sql = 'SELECT COUNT(smiley_id) AS item_count - FROM ' . SMILIES_TABLE . ' - GROUP BY smiley_url'; + $sql_ary = [ + 'SELECT' => 'COUNT(s.smiley_id) AS item_count', + 'FROM' => [ + SMILIES_TABLE => 's', + ], + 'GROUP_BY' => 's.smiley_url', + ]; + + /** + * Modify SQL query that fetches the total number of smilies in window mode + * + * @event core.generate_smilies_count_sql_before + * @var int forum_id Forum where smilies are generated + * @var array sql_ary Array with the SQL query + * @since 3.2.9-RC1 + */ + $vars = [ + 'forum_id', + 'sql_ary', + ]; + extract($phpbb_dispatcher->trigger_event('core.generate_smilies_count_sql_before', compact($vars))); + $result = $db->sql_query($sql, 3600); $smiley_count = 0; |