webroot/query.php

- Fixed problems in Popular Places query:
  o Use supplied text and query start position when building SQL query
  o Don't include search of 'description' field as it doesn't exist

README
- Corrected format for globalPos data in events table


git-svn-id: http://forge.opensimulator.org/svn/ossearch/trunk@177 109abde3-1f22-4c10-b5d7-b6b0135cd00c
This commit is contained in:
kcozens
2011-11-30 01:41:49 +00:00
parent 369eddcb54
commit 885d6ec687
2 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -288,7 +288,7 @@ field. (It seems silly to require the boolean but this has been left in to
avoid any compatability issues.)
The globalPos field is the location of the event as a global grid coordinate.
The format is "<x, y, z>". where x and y are the grid X and Y positions times
256 plus the x and y value within the region named by the simname field.
The format is "x/y/z". where x and y are the grid X and Y positions (times
256) plus the x and y offset within the region named by the simname field.
The eventflags field is 0 for a PG event, 1 for Mature, and 2 for Adult.
+7 -7
View File
@@ -144,10 +144,11 @@ xmlrpc_server_register_method($xmlrpc_server, "dir_popular_query",
function dir_popular_query($method_name, $params, $app_data)
{
$req = $params[0];
$req = $params[0];
$text = $req['text'];
$flags = $req['flags'];
$text = $req['text'];
$flags = $req['flags'];
$query_start = $req['query_start'];
$terms = array();
@@ -160,8 +161,7 @@ function dir_popular_query($method_name, $params, $app_data)
if ($text != "")
{
$text = mysql_real_escape_string($text);
$terms[] = "(name LIKE '%$text%' OR " .
"description LIKE '%$text%')";
$terms[] = "(name LIKE '%$text%')";
}
if (count($terms) > 0)
@@ -169,8 +169,8 @@ function dir_popular_query($method_name, $params, $app_data)
else
$where = "";
//FIXME: Should there be a limit on the number of results?
$result = mysql_query("SELECT * FROM popularplaces" . $where);
$result = mysql_query("SELECT * FROM popularplaces" . $where .
" LIMIT " . mysql_real_escape_string($query_start) . ",101";
$data = array();
while (($row = mysql_fetch_assoc($result)))