webroot/query.php

- Search event name and description for the text string from the viewer.
  (Based on a patch by Michelle Argus)
- Adjust local time to UTC when doing date based search


git-svn-id: http://forge.opensimulator.org/svn/ossearch/trunk@173 109abde3-1f22-4c10-b5d7-b6b0135cd00c
This commit is contained in:
kcozens
2011-11-17 03:44:15 +00:00
parent 3bd3b6f1db
commit db93807e4e
+10 -2
View File
@@ -303,9 +303,10 @@ function dir_events_query($method_name, $params, $app_data)
$day = $pieces[0];
$category = $pieces[1];
$search_text= $pieces[2];
//Setting a variable for NOW
$now = time();
//Get todays date/time and adjust it to UTC
$now = time() - date_offset_get();
$terms = array();
@@ -341,6 +342,13 @@ function dir_events_query($method_name, $params, $app_data)
$terms[] = $type[0];
}
if ($search_text != "")
{
$search_text = mysql_real_escape_string($search_text);
$terms[] = "(name LIKE '%$search_text%' OR " .
"description LIKE '%$search_text%')";
}
if (count($terms) > 1)
$where = " WHERE " . join_terms(" AND ", $terms, False);
else