aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-07-17 09:05:09 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-07-17 09:05:09 +0000
commitdce2a9b039184a8c5dddf4825cf0b6b3081bc3fd (patch)
tree2dca710c948a835867bdc8293977a8e3a7fc67cb /phpBB
parenta7776919945450eb2c0a37af30b35695f93fae51 (diff)
downloadforums-dce2a9b039184a8c5dddf4825cf0b6b3081bc3fd.tar
forums-dce2a9b039184a8c5dddf4825cf0b6b3081bc3fd.tar.gz
forums-dce2a9b039184a8c5dddf4825cf0b6b3081bc3fd.tar.bz2
forums-dce2a9b039184a8c5dddf4825cf0b6b3081bc3fd.tar.xz
forums-dce2a9b039184a8c5dddf4825cf0b6b3081bc3fd.zip
A small correction to #r9763
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9764 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/acp/acp_icons.php38
-rw-r--r--phpBB/includes/functions_posting.php16
2 files changed, 29 insertions, 25 deletions
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index cd26d46044..e261a6cbf0 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -168,7 +168,7 @@ class acp_icons
}
}
}
-
+
$sql = "SELECT *
FROM $table
ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
@@ -180,7 +180,7 @@ class acp_icons
$order_lists = array('', '');
$add_order_lists = array('', '');
$display_count = 0;
-
+
while ($row = $db->sql_fetchrow($result))
{
if ($action == 'add')
@@ -234,12 +234,12 @@ class acp_icons
$colspan = (($mode == 'smilies') ? '7' : '5');
$colspan += ($icon_id) ? 1 : 0;
$colspan += ($action == 'add') ? 2 : 0;
-
+
$template->assign_vars(array(
'S_EDIT' => true,
'S_SMILIES' => ($mode == 'smilies') ? true : false,
'S_ADD' => ($action == 'add') ? true : false,
-
+
'S_ORDER_LIST_DISPLAY' => $order_list . $order_lists[1],
'S_ORDER_LIST_UNDISPLAY' => $order_list . $order_lists[0],
'S_ORDER_LIST_DISPLAY_COUNT' => $display_count + 1,
@@ -286,10 +286,10 @@ class acp_icons
'S_ADD_CODE' => true,
'S_IMG_OPTIONS' => $smiley_options,
-
+
'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1],
'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0],
-
+
'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
'IMG_PATH' => $img_path,
'PHPBB_ROOT_PATH' => $phpbb_root_path,
@@ -303,7 +303,7 @@ class acp_icons
}
return;
-
+
break;
case 'create':
@@ -311,7 +311,7 @@ class acp_icons
// Get items to create/modify
$images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array();
-
+
// Now really get the items
$image_id = (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array();
$image_order = (isset($_POST['order'])) ? request_var('order', array('' => 0)) : array();
@@ -426,13 +426,13 @@ class acp_icons
$db->sql_query($sql);
$icons_updated++;
}
-
+
}
}
-
+
$cache->destroy('_icons');
$cache->destroy('sql', $table);
-
+
$level = E_USER_NOTICE;
switch ($icons_updated)
{
@@ -440,11 +440,11 @@ class acp_icons
$suc_lang = "{$lang}_NONE";
$level = E_USER_WARNING;
break;
-
+
case 1:
$suc_lang = "{$lang}_ONE";
break;
-
+
default:
$suc_lang = $lang;
}
@@ -835,20 +835,19 @@ class acp_icons
);
$spacer = false;
-
+ $pagination_start = request_var('start', 0);
+
$sql = "SELECT COUNT(*) AS count
FROM $table";
$result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
+ $item_count = (int) $db->sql_fetchfield('count');
$db->sql_freeresult($result);
- $item_count = $row['count'];
$sql = "SELECT *
FROM $table
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))
{
$alt_text = ($mode == 'smilies') ? $row['code'] : '';
@@ -874,7 +873,8 @@ class acp_icons
}
$db->sql_freeresult($result);
$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));
}
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 0c5aeb98d6..7db2875cda 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -24,6 +24,8 @@ function generate_smilies($mode, $forum_id)
global $auth, $db, $user, $config, $template;
global $phpEx, $phpbb_root_path;
+ $start = request_var('start', 0);
+
if ($mode == 'window')
{
if ($forum_id)
@@ -43,12 +45,12 @@ function generate_smilies($mode, $forum_id)
}
page_header($user->lang['SMILIES']);
-
+
$sql = 'SELECT COUNT(smiley_id) AS count
FROM ' . SMILIES_TABLE . '
GROUP BY smiley_url';
$result = $db->sql_query($sql, 3600);
-
+
$smiley_count = 0;
while ($row = $db->sql_fetchrow($result))
{
@@ -59,9 +61,11 @@ function generate_smilies($mode, $forum_id)
$template->set_filenames(array(
'body' => 'posting_smilies.html')
);
+
$template->assign_var('PAGINATION',
generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;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;
@@ -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
FROM ' . SMILIES_TABLE . '
- GROUP BY smiley_url, smiley_width, smiley_height ORDER BY smiley_order';
- $result = $db->sql_query_limit($sql, $config['smilies_per_page'], request_var('start', 0), 3600);
+ GROUP BY smiley_url, smiley_width, smiley_height
+ ORDER BY smiley_order';
+ $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600);
}
else
{
@@ -92,7 +97,6 @@ function generate_smilies($mode, $forum_id)
FROM ' . SMILIES_TABLE . '
WHERE display_on_posting = 1
ORDER BY smiley_order';
-
$result = $db->sql_query($sql, 3600);
}