summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-05-21 21:32:54 +0000
committerDries Buytaert <dries@buytaert.net>2005-05-21 21:32:54 +0000
commit2b1664bc668b9928bc99f082f9b9abaed867512f (patch)
treef017f8753fbbe77f3f8075b551ba6df56625a211 /modules/taxonomy/taxonomy.module
parenta7bced320e74066cac904be6b2bc8922a3a8af0b (diff)
downloadbrdo-2b1664bc668b9928bc99f082f9b9abaed867512f.tar.gz
brdo-2b1664bc668b9928bc99f082f9b9abaed867512f.tar.bz2
- Patch #16452 by chx: made it possible to rewrite some taxonomy queries.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index abca53066..44586cf6b 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -741,7 +741,7 @@ function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
if (!isset($children[$vid])) {
$children[$vid] = array();
- $result = db_query('SELECT t.*, parent FROM {term_data} t, {term_hierarchy} h WHERE t.tid = h.tid AND t.vid = %d ORDER BY weight, name', $vid);
+ $result = db_query(db_rewrite_sql('SELECT t.tid, t.*, parent FROM {term_data} t, {term_hierarchy} h WHERE t.tid = h.tid AND t.vid = %d ORDER BY weight, name', 't', 'tid'), $vid);
while ($term = db_fetch_object($result)) {
$children[$vid][$term->parent][] = $term->tid;
$parents[$vid][$term->tid][] = $term->parent;
@@ -1052,10 +1052,11 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
$rss_tids = urlencode($str_tids);
if ($tids) {
- // Build title:
- $result = db_query('SELECT name FROM {term_data} WHERE tid IN (%s)', implode(',', $tids));
+ $result = db_query(db_rewrite_sql('SELECT t.tid, t.name FROM {term_data} t WHERE t.tid IN (%s)', 't', 'tid'), implode(',', $tids));
+ $tids = array(); // we rebuild the $tids-array so it only contains terms the user has access to.
$names = array();
while ($term = db_fetch_object($result)) {
+ $tids[] = $term->tid;
$names[] = $term->name;
}