Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.108 diff -u -p -r1.108 install.php --- install.php 20 Dec 2007 08:26:42 -0000 1.108 +++ install.php 20 Dec 2007 23:51:26 -0000 @@ -129,6 +129,10 @@ function install_main() { // The database is set up, turn to further tasks. install_tasks($profile, $task); + + //set default pager limits + pager_set_limit('long', 50); + pager_set_limit('short', 25); } /** Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.168 diff -u -p -r1.168 locale.inc --- includes/locale.inc 18 Dec 2007 16:27:44 -0000 1.168 +++ includes/locale.inc 20 Dec 2007 23:51:26 -0000 @@ -1958,7 +1958,7 @@ function _locale_translate_seek() { $limit_language = $query['language']; } - $result = pager_query($sql, 50, 0, NULL, $arguments); + $result = pager_query($sql, pager_get_limit(), 0, NULL, $arguments); $groups = module_invoke_all('locale', 'groups'); $header = array(t('Text group'), t('String'), ($limit_language) ? t('Language') : t('Languages'), array('data' => t('Operations'), 'colspan' => '2')); @@ -1982,7 +1982,7 @@ function _locale_translate_seek() { if (count($rows)) { $output .= theme('table', $header, $rows); - if ($pager = theme('pager', NULL, 50)) { + if ($pager = theme('pager', NULL, pager_get_limit())) { $output .= $pager; } } Index: includes/pager.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/pager.inc,v retrieving revision 1.63 diff -u -p -r1.63 pager.inc --- includes/pager.inc 6 Dec 2007 09:58:30 -0000 1.63 +++ includes/pager.inc 20 Dec 2007 23:51:26 -0000 @@ -91,6 +91,47 @@ function pager_get_querystring() { } /** + * Return the limit of given pager type. + * + * @param $pager_type + * Pager type. + * @return + * The number of query results to display per page. + */ +function pager_get_limit($pager_type = 'long') { + $pager_settings = variable_get('pager_settings', array()); + return isset($pager_settings[$pager_type .'_limit']) ? $pager_settings[$pager_type .'_limit'] : 50; +} + +/** + * Set the limit for given pager type. + * + * @param $pager_type + * Pager type. + * @param $limit + * The number of query results to display per page. + */ +function pager_set_limit($pager_type, $limit) { + $pager_settings = variable_get('pager_settings', array()); + $pager_settings[$pager_type .'_limit'] = $limit; + variable_set('pager_settings', $pager_settings); +} + +/** + * Remove the limit of given pager type. + * + * @param $pager_type + * Pager type. + */ +function pager_delete_limit($pager_type) { + $pager_settings = variable_get('pager_settings', array()); + if (isset($pager_settings[$pager_type .'_limit'])) { + unset($pager_settings[$pager_type .'_limit']); + } + variable_set('pager_settings', $pager_settings); +} + +/** * Format a query pager. * * Menu callbacks that display paged query results should call theme('pager') to Index: modules/aggregator/aggregator.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.pages.inc,v retrieving revision 1.11 diff -u -p -r1.11 aggregator.pages.inc --- modules/aggregator/aggregator.pages.inc 18 Dec 2007 21:39:47 -0000 1.11 +++ modules/aggregator/aggregator.pages.inc 20 Dec 2007 23:51:26 -0000 @@ -85,7 +85,7 @@ function aggregator_page_category($arg1, function aggregator_feed_items_load($sql) { $items = array(); if (isset($sql)) { - $result = pager_query($sql, 20); + $result = pager_query($sql, pager_get_limit('short')); while ($item = db_fetch_object($result)) { $result_category = db_query('SELECT c.title, c.cid FROM {aggregator_category_item} ci LEFT JOIN {aggregator_category} c ON ci.cid = c.cid WHERE ci.iid = %d ORDER BY c.title', $item->iid); $item->categories = array(); @@ -237,7 +237,7 @@ function theme_aggregator_categorize_ite * @see aggregator-wrapper.tpl.php */ function template_preprocess_aggregator_wrapper(&$variables) { - $variables['pager'] = theme('pager', NULL, 20, 0); + $variables['pager'] = theme('pager', NULL, pager_get_limit('short'), 0); } /** Index: modules/comment/comment.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.admin.inc,v retrieving revision 1.3 diff -u -p -r1.3 comment.admin.inc --- modules/comment/comment.admin.inc 18 Dec 2007 22:16:55 -0000 1.3 +++ modules/comment/comment.admin.inc 20 Dec 2007 23:51:27 -0000 @@ -57,7 +57,7 @@ function comment_admin_overview($type = array('data' => t('Time'), 'field' => 'timestamp', 'sort' => 'desc'), array('data' => t('Operations')) )); - $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid, n.title as node_title FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid INNER JOIN {node} n ON n.nid = c.nid WHERE c.status = %d'. tablesort_sql($form['header']['#value']), 50, 0, NULL, $status); + $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid, n.title as node_title FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid INNER JOIN {node} n ON n.nid = c.nid WHERE c.status = %d'. tablesort_sql($form['header']['#value']), pager_get_limit(), 0, NULL, $status); // build a table listing the appropriate comments $destination = drupal_get_destination(); @@ -71,7 +71,7 @@ function comment_admin_overview($type = $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/'. $comment->cid, array('query' => $destination))); } $form['comments'] = array('#type' => 'checkboxes', '#options' => isset($comments) ? $comments: array()); - $form['pager'] = array('#value' => theme('pager', NULL, 50, 0)); + $form['pager'] = array('#value' => theme('pager', NULL, pager_get_limit(), 0)); return $form; } Index: modules/dblog/dblog.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v retrieving revision 1.5 diff -u -p -r1.5 dblog.admin.inc --- modules/dblog/dblog.admin.inc 19 Dec 2007 17:45:42 -0000 1.5 +++ modules/dblog/dblog.admin.inc 20 Dec 2007 23:51:27 -0000 @@ -55,10 +55,10 @@ function dblog_overview() { $sql = "SELECT w.wid, w.uid, w.severity, w.type, w.timestamp, w.message, w.variables, w.link, u.name FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid"; $tablesort = tablesort_sql($header); if (!empty($filter['where'])) { - $result = pager_query($sql ." WHERE ". $filter['where'] . $tablesort, 50, 0, NULL, $filter['args']); + $result = pager_query($sql ." WHERE ". $filter['where'] . $tablesort, pager_get_limit(), 0, NULL, $filter['args']); } else { - $result = pager_query($sql . $tablesort, 50); + $result = pager_query($sql . $tablesort, pager_get_limit()); } while ($dblog = db_fetch_object($result)) { @@ -82,7 +82,7 @@ function dblog_overview() { } $output .= theme('table', $header, $rows, array('id' => 'admin-dblog')); - $output .= theme('pager', NULL, 50, 0); + $output .= theme('pager', NULL, pager_get_limit(), 0); return $output; } @@ -98,7 +98,7 @@ function dblog_top($type) { array('data' => t('Message'), 'field' => 'message') ); - $result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables ". tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = '%s'", $type); + $result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables ". tablesort_sql($header), pager_get_limit('short'), 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = '%s'", $type); $rows = array(); while ($dblog = db_fetch_object($result)) { @@ -110,7 +110,7 @@ function dblog_top($type) { } $output = theme('table', $header, $rows); - $output .= theme('pager', NULL, 30, 0); + $output .= theme('pager', NULL, pager_get_limit('short'), 0); return $output; } Index: modules/node/node.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v retrieving revision 1.15 diff -u -p -r1.15 node.admin.inc --- modules/node/node.admin.inc 20 Dec 2007 09:08:35 -0000 1.15 +++ modules/node/node.admin.inc 20 Dec 2007 23:51:27 -0000 @@ -463,7 +463,7 @@ function node_admin_nodes() { $filter = node_build_filter_query(); - $result = pager_query(db_rewrite_sql('SELECT n.*, u.name FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC'), 50, 0, NULL, $filter['args']); + $result = pager_query(db_rewrite_sql('SELECT n.*, u.name FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC'), pager_get_limit(), 0, NULL, $filter['args']); // Enable language column if locale is enabled or if we have any node with language $count = db_result(db_query("SELECT COUNT(*) FROM {node} n WHERE language != ''")); @@ -501,7 +501,7 @@ function node_admin_nodes() { $form['operations'][$node->nid] = array('#value' => l(t('edit'), 'node/'. $node->nid .'/edit', array('query' => $destination))); } $form['nodes'] = array('#type' => 'checkboxes', '#options' => $nodes); - $form['pager'] = array('#value' => theme('pager', NULL, 50, 0)); + $form['pager'] = array('#value' => theme('pager', NULL, pager_get_limit(), 0)); $form['#theme'] = 'node_admin_nodes'; return $form; } Index: modules/path/path.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.admin.inc,v retrieving revision 1.5 diff -u -p -r1.5 path.admin.inc --- modules/path/path.admin.inc 10 Nov 2007 12:08:22 -0000 1.5 +++ modules/path/path.admin.inc 20 Dec 2007 23:51:27 -0000 @@ -36,7 +36,7 @@ function path_admin_overview($keys = NUL $header[2] = array('data' => t('Language'), 'field' => 'language'); } $sql .= tablesort_sql($header); - $result = pager_query($sql, 50, 0 , NULL, $keys); + $result = pager_query($sql, pager_get_limit(), 0 , NULL, $keys); $rows = array(); $destination = drupal_get_destination(); @@ -56,7 +56,7 @@ function path_admin_overview($keys = NUL } $output .= theme('table', $header, $rows); - $output .= theme('pager', NULL, 50, 0); + $output .= theme('pager', NULL, pager_get_limit(), 0); return $output; } Index: modules/poll/poll.install =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.install,v retrieving revision 1.13 diff -u -p -r1.13 poll.install --- modules/poll/poll.install 18 Dec 2007 12:59:21 -0000 1.13 +++ modules/poll/poll.install 20 Dec 2007 23:51:27 -0000 @@ -7,6 +7,8 @@ function poll_install() { // Create tables. drupal_install_schema('poll'); + pager_set_limit('polls', 15); + pager_set_limit('poll_votes', 20); } /** @@ -15,6 +17,8 @@ function poll_install() { function poll_uninstall() { // Remove tables. drupal_uninstall_schema('poll'); + pager_delete_limit('polls'); + pager_delete_limit('poll_votes'); } /** Index: modules/poll/poll.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.pages.inc,v retrieving revision 1.4 diff -u -p -r1.4 poll.pages.inc --- modules/poll/poll.pages.inc 14 Dec 2007 09:50:41 -0000 1.4 +++ modules/poll/poll.pages.inc 20 Dec 2007 23:51:27 -0000 @@ -14,13 +14,13 @@ function poll_page() { $sql = db_rewrite_sql("SELECT n.nid, n.title, p.active, n.created, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid = p.nid INNER JOIN {poll_choices} c ON n.nid = c.nid WHERE n.status = 1 GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC"); // Count all polls for the pager. $count_sql = db_rewrite_sql('SELECT COUNT(*) FROM {node} n INNER JOIN {poll} p ON n.nid = p.nid WHERE n.status = 1'); - $result = pager_query($sql, 15, 0, $count_sql); + $result = pager_query($sql, pager_get_limit('polls'), 0, $count_sql); $output = ''; - $output .= theme("pager", NULL, 15); + $output .= theme("pager", NULL, pager_get_limit('polls')); return $output; } @@ -34,7 +34,7 @@ function poll_votes($node) { $header[] = array('data' => t('Visitor'), 'field' => 'u.name'); $header[] = array('data' => t('Vote'), 'field' => 'pv.chorder'); - $result = pager_query("SELECT pv.chorder, pv.uid, pv.hostname, u.name FROM {poll_votes} pv LEFT JOIN {users} u ON pv.uid = u.uid WHERE pv.nid = %d". tablesort_sql($header), 20, 0, NULL, $node->nid); + $result = pager_query("SELECT pv.chorder, pv.uid, pv.hostname, u.name FROM {poll_votes} pv LEFT JOIN {users} u ON pv.uid = u.uid WHERE pv.nid = %d". tablesort_sql($header), pager_get_limit('poll_votes'), 0, NULL, $node->nid); $rows = array(); while ($vote = db_fetch_object($result)) { $rows[] = array( @@ -42,7 +42,7 @@ function poll_votes($node) { check_plain($node->choice[$vote->chorder]['chtext'])); } $output .= theme('table', $header, $rows); - $output .= theme('pager', NULL, 20, 0); + $output .= theme('pager', NULL, pager_get_limit('poll_votes'), 0); return $output; } Index: modules/profile/profile.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.pages.inc,v retrieving revision 1.2 diff -u -p -r1.2 profile.pages.inc --- modules/profile/profile.pages.inc 8 Dec 2007 14:06:22 -0000 1.2 +++ modules/profile/profile.pages.inc 20 Dec 2007 23:51:27 -0000 @@ -55,7 +55,7 @@ function profile_browse() { } // Extract the affected users: - $result = pager_query("SELECT u.uid, u.access FROM {users} u INNER JOIN {profile_values} v ON u.uid = v.uid WHERE v.fid = %d AND $query AND u.access != 0 AND u.status != 0 ORDER BY u.access DESC", 20, 0, NULL, $arguments); + $result = pager_query("SELECT u.uid, u.access FROM {users} u INNER JOIN {profile_values} v ON u.uid = v.uid WHERE v.fid = %d AND $query AND u.access != 0 AND u.status != 0 ORDER BY u.access DESC", pager_get_limit('short'), 0, NULL, $arguments); $content = ''; while ($account = db_fetch_object($result)) { @@ -64,7 +64,7 @@ function profile_browse() { $content .= theme('profile_listing', $account, $profile); } $output = theme('profile_wrapper', $content); - $output .= theme('pager', NULL, 20); + $output .= theme('pager', NULL, pager_get_limit('short')); if ($field->type == 'selection' || $field->type == 'list' || $field->type == 'textfield') { $title = strtr(check_plain($field->page), array('%value' => theme('placeholder', $value))); @@ -88,7 +88,7 @@ function profile_browse() { } // Extract the affected users: - $result = pager_query('SELECT uid, access FROM {users} WHERE uid > 0 AND status != 0 AND access != 0 ORDER BY access DESC', 20, 0, NULL); + $result = pager_query('SELECT uid, access FROM {users} WHERE uid > 0 AND status != 0 AND access != 0 ORDER BY access DESC', pager_get_limit('short'), 0, NULL); $content = ''; while ($account = db_fetch_object($result)) { @@ -97,7 +97,7 @@ function profile_browse() { $content .= theme('profile_listing', $account, $profile); } $output = theme('profile_wrapper', $content); - $output .= theme('pager', NULL, 20); + $output .= theme('pager', NULL, pager_get_limit('short')); drupal_set_title(t('User list')); return $output; Index: modules/search/search.install =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.install,v retrieving revision 1.12 diff -u -p -r1.12 search.install --- modules/search/search.install 17 Nov 2007 14:01:24 -0000 1.12 +++ modules/search/search.install 20 Dec 2007 23:51:27 -0000 @@ -7,6 +7,8 @@ function search_install() { // Create tables. drupal_install_schema('search'); + + pager_set_limit('search', 10); } /** @@ -16,6 +18,7 @@ function search_uninstall() { // Remove tables. drupal_uninstall_schema('search'); + pager_delete_limit('search'); variable_del('minimum_word_size'); variable_del('overlap_cjk'); variable_del('search_cron_limit'); Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.246 diff -u -p -r1.246 search.module --- modules/search/search.module 19 Dec 2007 17:45:42 -0000 1.246 +++ modules/search/search.module 20 Dec 2007 23:51:27 -0000 @@ -940,7 +940,7 @@ function do_search($keywords, $type, $jo $arguments = array_merge($arguments2, $arguments1, array($query[4])); // Do actual search query - $result = pager_query("$select $sort_parameters", 10, 0, $count_select, $arguments); + $result = pager_query("$select $sort_parameters", pager_get_limit('search'), 0, $count_select, $arguments); $results = array(); while ($item = db_fetch_object($result)) { $results[] = $item; Index: modules/search/search.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.pages.inc,v retrieving revision 1.4 diff -u -p -r1.4 search.pages.inc --- modules/search/search.pages.inc 6 Dec 2007 09:51:01 -0000 1.4 +++ modules/search/search.pages.inc 20 Dec 2007 23:51:27 -0000 @@ -63,7 +63,7 @@ function template_preprocess_search_resu foreach ($variables['results'] as $result) { $variables['search_results'] .= theme('search_result', $result, $variables['type']); } - $variables['pager'] = theme('pager', NULL, 10, 0); + $variables['pager'] = theme('pager', NULL, pager_get_limit('search'), 0); // Provide alternate search results template. $variables['template_files'][] = 'search-results-'. $variables['type']; } Index: modules/statistics/statistics.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.admin.inc,v retrieving revision 1.4 diff -u -p -r1.4 statistics.admin.inc --- modules/statistics/statistics.admin.inc 20 Dec 2007 22:02:08 -0000 1.4 +++ modules/statistics/statistics.admin.inc 20 Dec 2007 23:55:25 -0000 @@ -19,7 +19,7 @@ function statistics_recent_hits() { $sql = 'SELECT a.aid, a.path, a.title, a.uid, u.name, a.timestamp FROM {accesslog} a LEFT JOIN {users} u ON u.uid = a.uid'. tablesort_sql($header); - $result = pager_query($sql, 30); + $result = pager_query($sql, pager_get_limit('short')); $rows = array(); while ($log = db_fetch_object($result)) { $rows[] = array( @@ -34,7 +34,7 @@ function statistics_recent_hits() { } $output = theme('table', $header, $rows); - $output .= theme('pager', NULL, 30, 0); + $output .= theme('pager', NULL, pager_get_limit('short'), 0); return $output; } @@ -53,7 +53,7 @@ function statistics_top_pages() { array('data' => t('Total page generation time'), 'field' => 'total_time') ); $sql .= tablesort_sql($header); - $result = pager_query($sql, 30, 0, $sql_cnt); + $result = pager_query($sql, pager_get_limit('short'), 0, $sql_cnt); $rows = array(); while ($page = db_fetch_object($result)) { @@ -66,7 +66,7 @@ function statistics_top_pages() { drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200))))); $output = theme('table', $header, $rows); - $output .= theme('pager', NULL, 30, 0); + $output .= theme('pager', NULL, pager_get_limit('short'), 0); return $output; } @@ -84,7 +84,7 @@ function statistics_top_visitors() { $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name, a.hostname, SUM(a.timer) AS total, ac.aid FROM {accesslog} a LEFT JOIN {access} ac ON ac.type = 'host' AND LOWER(a.hostname) LIKE (ac.mask) LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.hostname, a.uid, u.name, ac.aid". tablesort_sql($header); $sql_cnt = "SELECT COUNT(DISTINCT(CONCAT(uid, hostname))) FROM {accesslog}"; - $result = pager_query($sql, 30, 0, $sql_cnt); + $result = pager_query($sql, pager_get_limit('short'), 0, $sql_cnt); $rows = array(); while ($account = db_fetch_object($result)) { @@ -99,7 +99,7 @@ function statistics_top_visitors() { drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200))))); $output = theme('table', $header, $rows); - $output .= theme('pager', NULL, 30, 0); + $output .= theme('pager', NULL, pager_get_limit('short'), 0); return $output; } @@ -118,7 +118,7 @@ function statistics_top_referrers() { ); $query .= tablesort_sql($header); - $result = pager_query($query, 30, 0, $query_cnt, $_SERVER['HTTP_HOST']); + $result = pager_query($query, pager_get_limit('short'), 0, $query_cnt, $_SERVER['HTTP_HOST']); $rows = array(); while ($referrer = db_fetch_object($result)) { @@ -130,7 +130,7 @@ function statistics_top_referrers() { } $output = theme('table', $header, $rows); - $output .= theme('pager', NULL, 30, 0); + $output .= theme('pager', NULL, pager_get_limit('short'), 0); return $output; } Index: modules/statistics/statistics.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.pages.inc,v retrieving revision 1.2 diff -u -p -r1.2 statistics.pages.inc --- modules/statistics/statistics.pages.inc 20 Oct 2007 21:57:50 -0000 1.2 +++ modules/statistics/statistics.pages.inc 20 Dec 2007 23:51:27 -0000 @@ -15,7 +15,7 @@ function statistics_node_tracker() { array('data' => t('User'), 'field' => 'u.name'), array('data' => t('Operations'))); - $result = pager_query('SELECT a.aid, a.timestamp, a.url, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE a.path LIKE \'node/%d%%\''. tablesort_sql($header), 30, 0, NULL, $node->nid); + $result = pager_query('SELECT a.aid, a.timestamp, a.url, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE a.path LIKE \'node/%d%%\''. tablesort_sql($header), pager_get_limit('short'), 0, NULL, $node->nid); $rows = array(); while ($log = db_fetch_object($result)) { $rows[] = array( @@ -31,7 +31,7 @@ function statistics_node_tracker() { drupal_set_title(check_plain($node->title)); $output = theme('table', $header, $rows); - $output .= theme('pager', NULL, 30, 0); + $output .= theme('pager', NULL, pager_get_limit('short'), 0); return $output; } else { @@ -47,7 +47,7 @@ function statistics_user_tracker() { array('data' => t('Page'), 'field' => 'path'), array('data' => t('Operations'))); - $result = pager_query('SELECT aid, timestamp, path, title FROM {accesslog} WHERE uid = %d'. tablesort_sql($header), 30, 0, NULL, $account->uid); + $result = pager_query('SELECT aid, timestamp, path, title FROM {accesslog} WHERE uid = %d'. tablesort_sql($header), pager_get_limit('short'), 0, NULL, $account->uid); $rows = array(); while ($log = db_fetch_object($result)) { $rows[] = array( @@ -62,7 +62,7 @@ function statistics_user_tracker() { drupal_set_title(check_plain($account->name)); $output = theme('table', $header, $rows); - $output .= theme('pager', NULL, 30, 0); + $output .= theme('pager', NULL, pager_get_limit('short'), 0); return $output; } else { Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.571 diff -u -p -r1.571 system.module --- modules/system/system.module 20 Dec 2007 23:17:51 -0000 1.571 +++ modules/system/system.module 20 Dec 2007 23:53:13 -0000 @@ -1300,7 +1300,7 @@ function system_actions_manage() { array('data' => $instances_present ? t('Operations') : '', 'colspan' => '2') ); $sql = 'SELECT * FROM {actions}'; - $result = pager_query($sql . tablesort_sql($header), 50); + $result = pager_query($sql . tablesort_sql($header), pager_get_limit()); while ($action = db_fetch_object($result)) { $row[] = array( array('data' => $action->type), @@ -1311,7 +1311,7 @@ function system_actions_manage() { } if ($row) { - $pager = theme('pager', NULL, 50, 0); + $pager = theme('pager', NULL, pager_get_limit(), 0); if (!empty($pager)) { $row[] = array(array('data' => $pager, 'colspan' => '3')); } Index: modules/taxonomy/taxonomy.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v retrieving revision 1.19 diff -u -p -r1.19 taxonomy.admin.inc --- modules/taxonomy/taxonomy.admin.inc 19 Dec 2007 16:17:37 -0000 1.19 +++ modules/taxonomy/taxonomy.admin.inc 20 Dec 2007 23:51:27 -0000 @@ -259,7 +259,7 @@ function taxonomy_overview_terms(&$form_ ); $page = isset($_GET['page']) ? $_GET['page'] : 0; - $page_increment = 10; // Number of terms per page. + $page_increment = pager_get_limit('taxonomy_terms'); // Number of terms per page. $page_entries = 0; // Elements shown on this page. $before_entries = 0; // Elements at the root level before this page. $after_entries = 0; // Elements at the root level after this page. Index: modules/taxonomy/taxonomy.install =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.install,v retrieving revision 1.6 diff -u -p -r1.6 taxonomy.install --- modules/taxonomy/taxonomy.install 18 Dec 2007 12:59:22 -0000 1.6 +++ modules/taxonomy/taxonomy.install 20 Dec 2007 23:51:27 -0000 @@ -2,6 +2,26 @@ // $Id: taxonomy.install,v 1.6 2007/12/18 12:59:22 dries Exp $ /** + * Implementation of hook_install(). + */ +function taxonomy_install() { + // Create tables. + drupal_install_schema('taxonomy'); + + pager_set_limit('taxonomy_terms', 10); +} + +/** + * Implementation of hook_uninstall(). + */ +function taxonomy_uninstall() { + // Remove tables. + drupal_uninstall_schema('taxonomy'); + + pager_delete_limit('taxonomy_terms'); +} + +/** * Implementation of hook_schema(). */ function taxonomy_schema() { Index: modules/tracker/tracker.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.pages.inc,v retrieving revision 1.5 diff -u -p -r1.5 tracker.pages.inc --- modules/tracker/tracker.pages.inc 28 Nov 2007 10:29:20 -0000 1.5 +++ modules/tracker/tracker.pages.inc 20 Dec 2007 23:51:27 -0000 @@ -26,14 +26,14 @@ function tracker_page($account = NULL, $ $sql = db_rewrite_sql($sql); $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d)'; $sql_count = db_rewrite_sql($sql_count); - $result = pager_query($sql, 25, 0, $sql_count, COMMENT_PUBLISHED, $account->uid, $account->uid); + $result = pager_query($sql, pager_get_limit('short'), 0, $sql_count, COMMENT_PUBLISHED, $account->uid, $account->uid); } else { $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 ORDER BY last_updated DESC'; $sql = db_rewrite_sql($sql); $sql_count = 'SELECT COUNT(n.nid) FROM {node} n WHERE n.status = 1'; $sql_count = db_rewrite_sql($sql_count); - $result = pager_query($sql, 25, 0, $sql_count); + $result = pager_query($sql, pager_get_limit('short'), 0, $sql_count); } $rows = array(); Index: modules/user/user.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v retrieving revision 1.11 diff -u -p -r1.11 user.admin.inc --- modules/user/user.admin.inc 24 Nov 2007 20:13:43 -0000 1.11 +++ modules/user/user.admin.inc 20 Dec 2007 23:51:27 -0000 @@ -142,7 +142,7 @@ function user_admin_account() { $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where']; $sql .= tablesort_sql($header); $query_count = 'SELECT COUNT(DISTINCT u.uid) FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where']; - $result = pager_query($sql, 50, 0, $query_count, $filter['args']); + $result = pager_query($sql, pager_get_limit(), 0, $query_count, $filter['args']); $form['options'] = array( '#type' => 'fieldset', @@ -188,7 +188,7 @@ function user_admin_account() { '#type' => 'checkboxes', '#options' => $accounts ); - $form['pager'] = array('#value' => theme('pager', NULL, 50, 0)); + $form['pager'] = array('#value' => theme('pager', NULL, pager_get_limit(), 0)); return $form; } Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.877 diff -u -p -r1.877 user.module --- modules/user/user.module 20 Dec 2007 21:59:17 -0000 1.877 +++ modules/user/user.module 20 Dec 2007 23:52:14 -0000 @@ -551,13 +551,13 @@ function user_search($op = 'search', $ke $keys = preg_replace('!\*+!', '%', $keys); if (user_access('administer users')) { // Administrators can also search in the otherwise private email field. - $result = pager_query("SELECT name, uid, mail FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%') OR LOWER(mail) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys, $keys); + $result = pager_query("SELECT name, uid, mail FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%') OR LOWER(mail) LIKE LOWER('%%%s%%')", pager_get_limit('search'), 0, NULL, $keys, $keys); while ($account = db_fetch_object($result)) { $find[] = array('title' => $account->name .' ('. $account->mail .')', 'link' => url('user/'. $account->uid, array('absolute' => TRUE))); } } else { - $result = pager_query("SELECT name, uid FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys); + $result = pager_query("SELECT name, uid FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", pager_get_limit('search'), 0, NULL, $keys); while ($account = db_fetch_object($result)) { $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid, array('absolute' => TRUE))); }