From 9404dfe2fb809c49ad79558bee12d9e8001c8e15 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 22 Apr 2006 18:54:41 +0000 Subject: - Bug #1210 git-svn-id: file:///svn/phpbb/trunk@5832 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'phpBB/includes/functions_posting.php') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 4202c8bc0b..03f1c962ee 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -56,22 +56,27 @@ function generate_smilies($mode, $forum_id) $db->sql_freeresult($result); } + $last_url = ''; + $sql = 'SELECT * FROM ' . SMILIES_TABLE . (($mode == 'inline') ? ' WHERE display_on_posting = 1 ' : '') . ' - GROUP BY smiley_url ORDER BY smiley_order'; $result = $db->sql_query($sql, 3600); while ($row = $db->sql_fetchrow($result)) { - $template->assign_block_vars('smiley', array( - 'SMILEY_CODE' => $row['code'], - 'SMILEY_IMG' => $phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url'], - 'SMILEY_WIDTH' => $row['smiley_width'], - 'SMILEY_HEIGHT' => $row['smiley_height'], - 'SMILEY_DESC' => $row['emotion']) - ); + if ($row['smiley_url'] !== $last_url) + { + $template->assign_block_vars('smiley', array( + 'SMILEY_CODE' => $row['code'], + 'SMILEY_IMG' => $phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url'], + 'SMILEY_WIDTH' => $row['smiley_width'], + 'SMILEY_HEIGHT' => $row['smiley_height'], + 'SMILEY_DESC' => $row['emotion']) + ); + } + $last_url = $row['smiley_url']; } $db->sql_freeresult($result); -- cgit v1.2.1