mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
not my day me thinks
git-svn-id: file:///svn/phpbb/trunk@4550 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
508b94ee12
commit
ee056e09f7
1 changed files with 23 additions and 27 deletions
|
@ -39,15 +39,17 @@ function generate_smilies($mode, $forum_id)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$num_smilies = 0;
|
$display_link = FALSE;
|
||||||
if ($mode == 'inline')
|
if ($mode == 'inline')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT COUNT(*) as num_smilies
|
$sql = 'SELECT smile_id
|
||||||
FROM ' . SMILIES_TABLE . '
|
FROM ' . SMILIES_TABLE . '
|
||||||
GROUP BY smile_url';
|
WHERE display_on_posting = 0';
|
||||||
$result = $db->sql_query_limit($sql, 1, 0, 3600);
|
$result = $db->sql_query_limit($sql, 1, 0, 3600);
|
||||||
$row = $db->sql_fetchrow($result);
|
if ($row = $db->sql_fetchrow($result))
|
||||||
$num_smilies = (int) $row['num_smilies'];
|
{
|
||||||
|
$display_link = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
|
@ -57,32 +59,26 @@ function generate_smilies($mode, $forum_id)
|
||||||
ORDER BY smile_order';
|
ORDER BY smile_order';
|
||||||
$result = $db->sql_query($sql, 3600);
|
$result = $db->sql_query($sql, 3600);
|
||||||
|
|
||||||
$smilies = 0;
|
while ($row = $db->sql_fetchrow($result))
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
{
|
||||||
do
|
$template->assign_block_vars('emoticon', array(
|
||||||
{
|
'SMILEY_CODE' => $row['code'],
|
||||||
$template->assign_block_vars('emoticon', array(
|
'SMILEY_IMG' => $config['smilies_path'] . '/' . $row['smile_url'],
|
||||||
'SMILEY_CODE' => $row['code'],
|
'SMILEY_WIDTH' => $row['smile_width'],
|
||||||
'SMILEY_IMG' => $config['smilies_path'] . '/' . $row['smile_url'],
|
'SMILEY_HEIGHT' => $row['smile_height'],
|
||||||
'SMILEY_WIDTH' => $row['smile_width'],
|
'SMILEY_DESC' => $row['emoticon'])
|
||||||
'SMILEY_HEIGHT' => $row['smile_height'],
|
);
|
||||||
'SMILEY_DESC' => $row['emoticon'])
|
|
||||||
);
|
|
||||||
$smilies++;
|
|
||||||
}
|
|
||||||
while ($row = $db->sql_fetchrow($result));
|
|
||||||
|
|
||||||
if ($mode == 'inline' && $num_smilies > $smilies)
|
|
||||||
{
|
|
||||||
$template->assign_vars(array(
|
|
||||||
'S_SHOW_EMOTICON_LINK' => TRUE,
|
|
||||||
'U_MORE_SMILIES' => $phpbb_root_path . "posting.$phpEx$SID&mode=smilies&f=$forum_id")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($mode == 'inline' && $display_link)
|
||||||
|
{
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'S_SHOW_EMOTICON_LINK' => TRUE,
|
||||||
|
'U_MORE_SMILIES' => $phpbb_root_path . "posting.$phpEx$SID&mode=smilies&f=$forum_id")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if ($mode == 'window')
|
if ($mode == 'window')
|
||||||
{
|
{
|
||||||
page_footer();
|
page_footer();
|
||||||
|
|
Loading…
Add table
Reference in a new issue