[ Index ] |
|
Code source de Drupal 5.3 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
Poids: | 422 lignes (14 kb) |
Inclus ou requis: | 1 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
pager_query($query, $limit = 10, $element = 0, $count_query = NULL) X-Ref |
Perform a paged database query. Use this function when doing select queries you wish to be able to page. The pager uses LIMIT-based queries to fetch only the records required to render a certain page. However, it has to learn the total number of records returned by the query to compute the number of pages (the number of records / records per page). This is done by inserting "COUNT(*)" in the original query. For example, the query "SELECT nid, type FROM node WHERE status = '1' ORDER BY sticky DESC, created DESC" would be rewritten to read "SELECT COUNT(*) FROM node WHERE status = '1' ORDER BY sticky DESC, created DESC". Rewriting the query is accomplished using a regular expression. Unfortunately, the rewrite rule does not always work as intended for queries that already have a "COUNT(*)" or a "GROUP BY" clause, and possibly for other complex queries. In those cases, you can optionally pass a query that will be used to count the records. For example, if you want to page the query "SELECT COUNT(*), TYPE FROM node GROUP BY TYPE", pager_query() would invoke the incorrect query "SELECT COUNT(*) FROM node GROUP BY TYPE". So instead, you should pass "SELECT COUNT(DISTINCT(TYPE)) FROM node" as the optional $count_query parameter. param: $query param: $limit param: $element param: $count_query param: ... return: |
pager_get_querystring() X-Ref |
Compose a query string to append to pager requests. return: |
theme_pager($tags = array() X-Ref |
Format a query pager. Menu callbacks that display paged query results should call theme('pager') to retrieve a pager control so that users can view other results. param: $tags param: $limit param: $element param: $parameters return: |
theme_pager_first($text, $limit, $element = 0, $parameters = array() X-Ref |
Format a "first page" link. param: $text param: $limit param: $element param: $parameters return: |
theme_pager_previous($text, $limit, $element = 0, $interval = 1, $parameters = array() X-Ref |
Format a "previous page" link. param: $text param: $limit param: $element param: $interval param: $parameters return: |
theme_pager_next($text, $limit, $element = 0, $interval = 1, $parameters = array() X-Ref |
Format a "next page" link. param: $text param: $limit param: $element param: $interval param: $parameters return: |
theme_pager_last($text, $limit, $element = 0, $parameters = array() X-Ref |
Format a "last page" link. param: $text param: $limit param: $element param: $parameters return: |
theme_pager_list($limit, $element = 0, $quantity = 5, $text = '', $parameters = array() X-Ref |
Format a list of nearby pages with additional query results. param: $limit param: $element param: $quantity param: $text param: $parameters return: |
theme_pager_link($text, $page_new, $element, $parameters = array() X-Ref |
Format a link to a specific query result page. param: $page_new param: $element param: $parameters param: $attributes return: |
pager_load_array($value, $element, $old_array) X-Ref |
Helper function Copies $old_array to $new_array and sets $new_array[$element] = $value Fills in $new_array[0 .. $element - 1] = 0 |
Généré le : Fri Nov 30 16:20:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |