summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Stjerneman2010-03-05 18:45:32 +0000
committerEmil Stjerneman2010-03-05 18:45:32 +0000
commit1b15725340cf6f01d1e27e62efa6e16eb564bee8 (patch)
tree7496be2235363b7fb79f3b7b4f910d7ae3fcdbe7
parent56998c1b17df592a9143e55accc7e1be37222c8c (diff)
by anon: Added "db_rewrite_sql" to node and taxonomy plugin6.x-1.1
-rw-r--r--CHANGELOG.txt3
-rw-r--r--plugins/linkit_node/linkit_node.module2
-rw-r--r--plugins/linkit_taxonomy/linkit_taxonomy.module2
3 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index b7e4860..9c1b567 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,8 +2,9 @@
Linkit x.x-x.x, xxxx-xx-xx
------------------------------
-Linkit 6.x-1.1, xxxx-xx-xx
+Linkit 6.x-1.1, 2010-03-05
------------------------------
+by anon: Added "db_rewrite_sql" to node and taxonomy plugin
by anon: Removed "linkit_tinymce.css" (it wasnt used anymore)
by anon: Fixed permissions bug
- (create all links) didnt work
diff --git a/plugins/linkit_node/linkit_node.module b/plugins/linkit_node/linkit_node.module
index 423fd65..5ccd165 100644
--- a/plugins/linkit_node/linkit_node.module
+++ b/plugins/linkit_node/linkit_node.module
@@ -14,7 +14,7 @@ function linkit_node_linkit_load_plugins($string) {
$matches = array();
// Get nodes
- $result = db_query_range("SELECT title, nid FROM {node} WHERE LOWER(title) LIKE LOWER('%%%s%%')", $string, 0, 10);
+ $result = db_query_range(db_rewrite_sql("SELECT n.title, n.nid FROM {node} n WHERE LOWER(n.title) LIKE LOWER('%%%s%%') AND n.status = 1"), $string, 0, 10);
while ($node = db_fetch_object($result)) {
$matches['node'][linkit_autolist_val($node->title, 'internal:node/' . $node->nid)] = linkit_autolist_list($node->title, 'Node');
}
diff --git a/plugins/linkit_taxonomy/linkit_taxonomy.module b/plugins/linkit_taxonomy/linkit_taxonomy.module
index 5a580fb..0dda990 100644
--- a/plugins/linkit_taxonomy/linkit_taxonomy.module
+++ b/plugins/linkit_taxonomy/linkit_taxonomy.module
@@ -14,7 +14,7 @@ function linkit_taxonomy_linkit_load_plugins($string) {
$matches = array();
// Get terms
- $result = db_query_range("SELECT name, tid FROM {term_data} WHERE LOWER(name) LIKE LOWER('%%%s%%')", $string, 0, 10);
+ $result = db_query_range(db_rewrite_sql("SELECT t.name, t.tid FROM {term_data} t WHERE LOWER(t.name) LIKE LOWER('%%%s%%')", 't', 'tid'), $string, 0, 10);
while ($term = db_fetch_object($result)) {
$matches['taxonomy'][linkit_autolist_val($term->name, 'internal:taxonomy/term/' . $term->tid)] = linkit_autolist_list($term->name, 'Taxonomy');
}