Adds popular places

git-svn-id: http://forge.opensimulator.org/svn/ossearch/trunk@35 109abde3-1f22-4c10-b5d7-b6b0135cd00c
This commit is contained in:
melanie
2008-10-11 07:30:40 +00:00
parent 95b67b99b2
commit 8197aaed14
+22 -1
View File
@@ -36,7 +36,7 @@ function dir_places_query($method_name, $params, $app_data)
{
$response_xml = xmlrpc_encode(array(
'success' => False,
'errorMessage' => "Invalid serach terms"
'errorMessage' => "Invalid search terms"
));
print $response_xml;
@@ -93,7 +93,28 @@ function dir_popular_query($method_name, $params, $app_data)
$flags = $req['flags'];
$terms = array();
if ($flags & 0x1000)
$terms[] = "has_picture = 1";
if ($flags & 0x0800)
$terms[] = "mature = 0";
if (count($terms) > 0)
$where = " where " . join(" and ", $terms);
$result = mysql_query("select * from popularplaces" . $where;
$data = array();
while (($row = mysql_fetch_assoc($result)))
{
$data[] = array(
"parcel_id" => $row["infoUUID"],
"name" => $row["name"],
"dwell" => $row["dwell"]
);
}
$response_xml = xmlrpc_encode(array(
'success' => True,