Changes made to the query.php file and added PicksReply with Dictonary

git-svn-id: http://forge.opensimulator.org/svn/osprofile/trunk@15 19860011-0018-435d-96ae-4a7b0aaa3128
This commit is contained in:
fly-man-
2008-12-27 20:23:41 +00:00
parent 97dcbab01a
commit 85048a4727
2 changed files with 82 additions and 2 deletions
@@ -230,7 +230,17 @@ namespace OpenSimProfile.Modules.OpenProfile
ArrayList dataArray = (ArrayList)result["data"];
// remoteClient.SendAvatarPicksReply();
Dictionary<UUID, string> picks = new Dictionary<UUID, string>();
foreach (Object o in dataArray)
{
Hashtable d = (Hashtable)o;
picks[new UUID(d["pickid"].ToString())] = d["name"].ToString();
}
remoteClient.SendAvatarPicksReply(remoteClient.AgentId,
picks);
}
public void HandleAvatarNotesRequest(Object sender, string method, List<String> args)
+71 -1
View File
@@ -71,7 +71,7 @@ function avatarpicksrequest($method_name, $params, $app_data)
{
$data[] = array(
"pickID" => $row["PickID"],
"pickName" => $row["Name"]);
"name" => $row["Name"]);
}
$response_xml = xmlrpc_encode(array(
@@ -113,6 +113,76 @@ function avatarnotesrequest($method_name, $params, $app_data)
print $response_xml;
}
xmlrpc_server_register_method($xmlrpc_server, "classifiedclickthrough",
"classifiedclickthrough");
function classifiedclickthrough($method_name, $params, $app_data)
{
$req = $params[0];
$uuid = $req['uuid'];
$targetuuid = $req['avatar_id'];
$result = mysql_query("select * from usernotes where ".
"userUUID = '". mysql_escape_string($uuid) ."' AND ".
"TargetID = '". mysql_escape_string($targetuuid) ."'");
while (($row = mysql_fetch_assoc($result)))
{
$data[] = array(
"targetID" => $row["TargetID"],
"notes" => $row["Notes"]);
}
$response_xml = xmlrpc_encode(array(
'success' => True,
'errorMessage' => "",
'data' => $data
));
print $response_xml;
}
xmlrpc_server_register_method($xmlrpc_server, "pickinforequest",
"pickinforequest");
function pickinforequest($method_name, $params, $app_data)
{
$req = $params[0];
$uuid = $req['avatar_id'];
$pick = $req['pick_id'];
$result = mysql_query("select * from userpicks where ".
"CreatorID = '". mysql_escape_string($uuid) ."' AND ".
"PickID = '". mysql_escape_string($pick) ."'");
while (($row = mysql_fetch_assoc($result)))
{
$data[] = array(
"pickuuid" => $row["PickID"],
"creatoruuid" => $row["CreatorID"],
"toppick" => $row["TopPick"],
"parceluuid" => $row["ParcelID"],
"name" => $row["Name"],
"description" => $row["Desc"],
"snapshotuuid" => $row["SnapshotID"],
"user" => $row["User"],
"originalname" => $row["OriginalName"],
"posglobal" => $row["PosGlobal"],
"sortorder"=> $row["SortOrder"],
"enabled" => $row["Enabled"]);
}
$response_xml = xmlrpc_encode(array(
'success' => True,
'errorMessage' => "",
'data' => $data
));
print $response_xml;
}
#
# Process the request
#