mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 14:48:53 +00:00
[ticket/16183] Add core.generate_smilies_count_sql_before
PHPBB3-16183
This commit is contained in:
parent
c75c13e555
commit
84e0f5a2eb
1 changed files with 22 additions and 3 deletions
|
@ -52,9 +52,28 @@ function generate_smilies($mode, $forum_id)
|
||||||
|
|
||||||
page_header($user->lang['SMILIES']);
|
page_header($user->lang['SMILIES']);
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(smiley_id) AS item_count
|
$sql_ary = [
|
||||||
FROM ' . SMILIES_TABLE . '
|
'SELECT' => 'COUNT(s.smiley_id) AS item_count',
|
||||||
GROUP BY smiley_url';
|
'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);
|
$result = $db->sql_query($sql, 3600);
|
||||||
|
|
||||||
$smiley_count = 0;
|
$smiley_count = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue