summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-07-12 10:36:56 +0000
committerDries Buytaert <dries@buytaert.net>2003-07-12 10:36:56 +0000
commitd5cdbcd6444e9d36db64c1f80a70611f779ede94 (patch)
treebf481009c128f4fddff8f2b2b84f2d86f1df0e54
parent337b3c9de997f4fcb27467e3d80d0f43fda7783e (diff)
downloadbrdo-d5cdbcd6444e9d36db64c1f80a70611f779ede94.tar.gz
brdo-d5cdbcd6444e9d36db64c1f80a70611f779ede94.tar.bz2
- Bugfix: fixed username not being fetched with the title module. Fixes bug
#1852. (Going to backport this to the DRUPAL-4-2-0 branch.)
-rw-r--r--modules/title.module4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/title.module b/modules/title.module
index e846f9750..2126ca83d 100644
--- a/modules/title.module
+++ b/modules/title.module
@@ -11,10 +11,12 @@ function title_page() {
$title = urldecode(arg(1));
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid WHERE n.title = '%s' AND n.status = 1 ORDER BY created DESC", $title);
+
if (db_num_rows($result) == 0) {
// No node with exact title found, try substring.
- $result = db_query("SELECT n.* FROM {node} n WHERE n.title LIKE '%". check_query($title). "%' AND n.status = 1 ORDER BY created DESC");
+ $result = db_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid WHERE n.title LIKE '%". check_query($title). "%' AND n.status = 1 ORDER BY created DESC");
}
+
if (db_num_rows($result) == 0 && module_exist("search")) {
// still no matches ... return a full text search
search_view($title);