mirror of
https://github.com/kcozens/OpenSimSearch.git
synced 2026-08-14 08:52:28 +00:00
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:
+10
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user