A small correction to #r9763

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9764 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2009-07-17 09:05:09 +00:00
parent a777691994
commit dce2a9b039
2 changed files with 29 additions and 25 deletions

View file

@ -835,20 +835,19 @@ class acp_icons
); );
$spacer = false; $spacer = false;
$pagination_start = request_var('start', 0);
$sql = "SELECT COUNT(*) AS count $sql = "SELECT COUNT(*) AS count
FROM $table"; FROM $table";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result); $item_count = (int) $db->sql_fetchfield('count');
$db->sql_freeresult($result); $db->sql_freeresult($result);
$item_count = $row['count'];
$sql = "SELECT * $sql = "SELECT *
FROM $table FROM $table
ORDER BY {$fields}_order ASC"; ORDER BY {$fields}_order ASC";
$result = $db->sql_query_limit($sql, $config['smilies_per_page'], request_var('start', 0)); $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $pagination_start);
$pagination_start = request_var('start', 0);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$alt_text = ($mode == 'smilies') ? $row['code'] : ''; $alt_text = ($mode == 'smilies') ? $row['code'] : '';
@ -874,6 +873,7 @@ class acp_icons
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$template->assign_var('PAGINATION', generate_pagination( $template->assign_var('PAGINATION', generate_pagination(
$this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)); $this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true));
} }
} }

View file

@ -24,6 +24,8 @@ function generate_smilies($mode, $forum_id)
global $auth, $db, $user, $config, $template; global $auth, $db, $user, $config, $template;
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
$start = request_var('start', 0);
if ($mode == 'window') if ($mode == 'window')
{ {
if ($forum_id) if ($forum_id)
@ -59,9 +61,11 @@ function generate_smilies($mode, $forum_id)
$template->set_filenames(array( $template->set_filenames(array(
'body' => 'posting_smilies.html') 'body' => 'posting_smilies.html')
); );
$template->assign_var('PAGINATION', $template->assign_var('PAGINATION',
generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id), generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id),
$smiley_count, $config['smilies_per_page'], request_var('start', 0), true)); $smiley_count, $config['smilies_per_page'], $start, true)
);
} }
$display_link = false; $display_link = false;
@ -83,8 +87,9 @@ function generate_smilies($mode, $forum_id)
{ {
$sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height $sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height
FROM ' . SMILIES_TABLE . ' FROM ' . SMILIES_TABLE . '
GROUP BY smiley_url, smiley_width, smiley_height ORDER BY smiley_order'; GROUP BY smiley_url, smiley_width, smiley_height
$result = $db->sql_query_limit($sql, $config['smilies_per_page'], request_var('start', 0), 3600); ORDER BY smiley_order';
$result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600);
} }
else else
{ {
@ -92,7 +97,6 @@ function generate_smilies($mode, $forum_id)
FROM ' . SMILIES_TABLE . ' FROM ' . SMILIES_TABLE . '
WHERE display_on_posting = 1 WHERE display_on_posting = 1
ORDER BY smiley_order'; ORDER BY smiley_order';
$result = $db->sql_query($sql, 3600); $result = $db->sql_query($sql, 3600);
} }