- Bugfix: fixed username not being fetched with the title module. Fixes bug

#1852.

  (Going to backport this to the DRUPAL-4-2-0 branch.)
4.3.x
Dries Buytaert 2003-07-12 10:36:56 +00:00
parent 337b3c9de9
commit d5cdbcd644
1 changed files with 3 additions and 1 deletions

View File

@ -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);