summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-03-16 07:02:20 +0000
committerDries Buytaert <dries@buytaert.net>2003-03-16 07:02:20 +0000
commit170b674a0953ce95e06f7a8442eb0f1097e7ee72 (patch)
tree11778666b2fc94cceaa947aea21a71bde0195380 /modules/taxonomy/taxonomy.module
parent6dc1cf59ba2ca58f0b4200d820a23dc5f35ec1fb (diff)
downloadbrdo-170b674a0953ce95e06f7a8442eb0f1097e7ee72.tar.gz
brdo-170b674a0953ce95e06f7a8442eb0f1097e7ee72.tar.bz2
- All LIMIT queries must go through the pager or through db_query_range().
The syntax for db_query_range() was enhanced so it matches db_query(). So you may pass extra arguments of the SQL statement which are checked via check_query() and then substituted into the SQL statement. After these optional arguments, you always pass $from and $count parameters which define your range. Most often, the $from is 0 and the count is the max number of records you want returned. Patch by Moshe. - The pager_query() function for PEAR was enhanced so that it adds proper GROUP BY statement counting the number of records to be paged. Patch by James Arthur. - MSSQL database scheme by Moshe.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index a6374b929..2737844ba 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -268,7 +268,6 @@ function taxonomy_overview() {
$vocabularies = taxonomy_get_vocabularies();
foreach ($vocabularies as $vocabulary) {
$links = array();
-
$rows[] = array($vocabulary->name, array("data" => $vocabulary->types, "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/editvocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/addterm/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid"));
$tree = taxonomy_get_tree($vocabulary->vid);
@@ -644,7 +643,7 @@ function taxonomy_select_nodes($taxonomy, $pager = 1) {
global $user;
if ($taxonomy->operator == "or") {
- $sql = "SELECT DISTINCT(n.nid), n.title, n.type, n.created, n.changed, n.uid, u.name FROM node n LEFT JOIN term_node r ON n.nid = r.nid LEFT JOIN users u ON n.uid = u.uid WHERE tid IN ($taxonomy->str_tids) AND n.status = '1' ORDER BY static DESC, created DESC";
+ $sql = "SELECT DISTINCT(n.nid), n.title, n.type, n.created, n.changed, n.uid, n.static, n.created, u.name FROM node n LEFT JOIN term_node r ON n.nid = r.nid LEFT JOIN users u ON n.uid = u.uid WHERE tid IN ($taxonomy->str_tids) AND n.status = '1' ORDER BY static DESC, created DESC";
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM node n LEFT JOIN term_node r ON n.nid = r.nid LEFT JOIN users u ON n.uid = u.uid WHERE tid IN ($taxonomy->str_tids) AND n.status = '1'";
}
else {
@@ -659,7 +658,7 @@ function taxonomy_select_nodes($taxonomy, $pager = 1) {
$result = pager_query($sql, variable_get("default_nodes_main", 10) , 0, $sql_count);
}
else {
- $result = db_query($sql ." LIMIT 15");
+ $result = db_query_range($sql, 0, 15);
}
return $result;