diff options
author | Marek A. R <aptx@phpbb.com> | 2009-07-16 17:57:05 +0000 |
---|---|---|
committer | Marek A. R <aptx@phpbb.com> | 2009-07-16 17:57:05 +0000 |
commit | a7776919945450eb2c0a37af30b35695f93fae51 (patch) | |
tree | 5c9e13a93cf8c2f8313136f8a7a2302b521b5f14 | |
parent | 7a5db8b55d163ae4b0b0bd433362dbbe8cbbfdf4 (diff) | |
download | forums-a7776919945450eb2c0a37af30b35695f93fae51.tar forums-a7776919945450eb2c0a37af30b35695f93fae51.tar.gz forums-a7776919945450eb2c0a37af30b35695f93fae51.tar.bz2 forums-a7776919945450eb2c0a37af30b35695f93fae51.tar.xz forums-a7776919945450eb2c0a37af30b35695f93fae51.zip |
- Add pagination for icons and smilies in the ACP and smilies in the smiley popup
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9763 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/adm/style/acp_icons.html | 6 | ||||
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_icons.php | 20 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 36 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 1 | ||||
-rw-r--r-- | phpBB/language/en/acp/board.php | 1 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/posting_smilies.html | 1 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/posting_smilies.html | 3 |
9 files changed, 54 insertions, 16 deletions
diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index 86500ae047..10166fec35 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -243,8 +243,8 @@ <td style="text-align: center;">{items.EMOTION}</td> <!-- ENDIF --> <td style="text-align: right; white-space: nowrap;"> - <!-- IF items.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF --> - <!-- IF items.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF --> + <!-- IF items.S_FIRST_ROW and not PREVIOUS_PAGE -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF --> + <!-- IF items.S_LAST_ROW and not NEXT_PAGE -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF --> <a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}">{ICON_DELETE}</a> </td> </tr> @@ -255,7 +255,7 @@ <!-- END items --> </tbody> </table> - + <div>{PAGINATION}</div> <p class="quick"> <input class="button2" name="add" type="submit" value="{L_ICON_ADD}" /> <input class="button2" type="submit" name="edit" value="{L_ICON_EDIT}" /> </p> diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7676d73607..6ee8b91959 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -176,6 +176,7 @@ <li>[Change] Add confirmation for deactivating styles (Bug #14304 - Patch by leviatan21)</li> <li>[Change] Add confirmation for deactivating language packs (Patch by leviatan21)</li> <li>[Change] Add confirm-box when deleting permissions (Bug #13673 - Patch by nickvergessen)</li> + <li>[Change] Add pagination for icons and smilies in the ACP and smilies in the smiley popup</li> <li>[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)</li> <li>[Feature] Backported 3.2 captcha plugins.</li> <li>[Feature] Introduced new ACM plugins: diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index a4a2572c0f..5966d5a4b2 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -181,6 +181,7 @@ class acp_board 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), + 'smilies_per_page' => array('lang' => 'SMILIES_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true), 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'text:4:4', 'explain' => false), 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true), diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index a88090cb25..cd26d46044 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -173,7 +173,7 @@ class acp_icons FROM $table ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC'); $result = $db->sql_query($sql); - + $data = array(); $after = false; $display = 0; @@ -835,12 +835,20 @@ class acp_icons ); $spacer = false; + + $sql = "SELECT COUNT(*) AS count + FROM $table"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $item_count = $row['count']; $sql = "SELECT * FROM $table ORDER BY {$fields}_order ASC"; - $result = $db->sql_query($sql); + $result = $db->sql_query_limit($sql, $config['smilies_per_page'], request_var('start', 0)); + $pagination_start = request_var('start', 0); while ($row = $db->sql_fetchrow($result)) { $alt_text = ($mode == 'smilies') ? $row['code'] : ''; @@ -855,9 +863,9 @@ class acp_icons 'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '', 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row[$fields . '_id'], 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row[$fields . '_id'], - 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row[$fields . '_id'], - 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row[$fields . '_id']) - ); + 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row[$fields . '_id'] . '&start=' . $pagination_start, + 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row[$fields . '_id'] . '&start=' . $pagination_start, + )); if (!$spacer && !$row['display_on_posting']) { @@ -865,6 +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)); } } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 22fbfe3495..0c5aeb98d6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -43,10 +43,25 @@ 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)) + { + ++$smiley_count; + } + $db->sql_freeresult($result); $template->set_filenames(array( 'body' => 'posting_smilies.html') ); + $template->assign_var('PAGINATION', + 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)); } $display_link = false; @@ -64,13 +79,22 @@ function generate_smilies($mode, $forum_id) $db->sql_freeresult($result); } - $last_url = ''; + if ($mode == 'window') + { + $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); + } + else + { + $sql = 'SELECT * + FROM ' . SMILIES_TABLE . ' + WHERE display_on_posting = 1 + ORDER BY smiley_order'; - $sql = 'SELECT * - FROM ' . SMILIES_TABLE . - (($mode == 'inline') ? ' WHERE display_on_posting = 1 ' : '') . ' - ORDER BY smiley_order'; - $result = $db->sql_query($sql, 3600); + $result = $db->sql_query($sql, 3600); + } $smilies = array(); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 0c5b527c9d..5799abcff7 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -228,6 +228,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length', ' INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc', '{L_CONFIG_SITE_DESC}'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename', '{L_CONFIG_SITENAME}'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_auth_method', 'PLAIN'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_delivery', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', ''); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index f09548661f..b51db0ba57 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -175,6 +175,7 @@ $lang = array_merge($lang, array( 'QUOTE_DEPTH_LIMIT_EXPLAIN' => 'Maximum number of nested quotes in a post. Set to 0 for unlimited depth.', 'SMILIES_LIMIT' => 'Maximum smilies per post', 'SMILIES_LIMIT_EXPLAIN' => 'Maximum number of smilies in a post. Set to 0 for unlimited smilies.', + 'SMILIES_PER_PAGE' => 'Smilies per page', 'TOPICS_PER_PAGE' => 'Topics per page', )); diff --git a/phpBB/styles/prosilver/template/posting_smilies.html b/phpBB/styles/prosilver/template/posting_smilies.html index 1c44fd5f11..fdd0d7ada1 100644 --- a/phpBB/styles/prosilver/template/posting_smilies.html +++ b/phpBB/styles/prosilver/template/posting_smilies.html @@ -17,6 +17,7 @@ <span class="corners-bottom"><span></span></span></div> </div> +<div>{PAGINATION}</div> <a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a> <!-- INCLUDE simple_footer.html -->
\ No newline at end of file diff --git a/phpBB/styles/subsilver2/template/posting_smilies.html b/phpBB/styles/subsilver2/template/posting_smilies.html index 3c57cb132f..2586530e55 100644 --- a/phpBB/styles/subsilver2/template/posting_smilies.html +++ b/phpBB/styles/subsilver2/template/posting_smilies.html @@ -16,11 +16,10 @@ <th>{L_SMILIES}</th> </tr> <tr> - <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td> + <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br />{PAGINATION}<br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td> </tr> </table> </td> </tr> </table> - <!-- INCLUDE simple_footer.html -->
\ No newline at end of file |