From d000f93b1c6b930874f3b02d04c3965b54e784d5 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 6 Aug 2008 12:48:15 +0000 Subject: Central: Changed semantics' type Previously, semantics was an array, but apparently XML-RPC only allows arrays of xmlrpcvals, so it was changed to a serialized array (string). --- central/trunk/instadisc.php | 8 +++++++- central/trunk/xmlrpc.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index 5da1d54..421f058 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php @@ -70,6 +70,12 @@ function instaDisc_sendItem($username, $id) $out .= 'Title: ' . $getitem3['title'] . "\r\n"; $out .= 'Author: ' . $getitem3['author'] . "\r\n"; $out .= 'URL: ' . $getitem3['url'] . "\r\n"; + + foreach (deserialize($getitem3['semantics']) as $name => $value) + { + $out .= $name . ': ' . $value . "\r\n"; + } + $out .= "\r\n\r\n"; fwrite($fp, $out); @@ -128,7 +134,7 @@ function instaDisc_addItem($username, $subscription, $title, $author, $url, $sem $setuser = "UPDATE users SET nextItemID = nextItemID+1 WHERE username = \"" . mysql_real_escape_string($username) . "\""; $setuser2 = mysql_query($setuser); - $insitem = "INSERT INTO inbox (username, itemID, subscription, title, author, url, semantics) VALUES (\"" . mysql_real_escape_string($username) . "\", " . $itemID . ", \"" . mysql_real_escape_string($subscription) . "\", \"" . mysql_real_escape_string($title) . "\", \"" . mysql_real_escape_string($author) . "\", \"" . mysql_real_escape_string($url) . "\", \"" . mysql_real_escape_string(serialize($semantics)) . "\")"; + $insitem = "INSERT INTO inbox (username, itemID, subscription, title, author, url, semantics) VALUES (\"" . mysql_real_escape_string($username) . "\", " . $itemID . ", \"" . mysql_real_escape_string($subscription) . "\", \"" . mysql_real_escape_string($title) . "\", \"" . mysql_real_escape_string($author) . "\", \"" . mysql_real_escape_string($url) . "\", \"" . mysql_real_escape_string($semantics) . "\")"; $insitem2 = mysql_query($insitem); instaDisc_sendItem($username, $itemID); diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 3ffd1e1..5373f80 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php @@ -102,7 +102,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription new xmlrpcval($title, 'string'), new xmlrpcval($author, 'string'), new xmlrpcval($url, 'string'), - new xmlrpcval($semantics, 'array'), + new xmlrpcval($semantics, 'string'), new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'), new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int'))); $client->send($msg); -- cgit 1.4.1