diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-01 19:05:03 +0000 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-01 19:05:03 +0000 |
| commit | 1f3ccdbb990204d5238c78f0990496011ccb9902 (patch) | |
| tree | 8a21f2838d82300ebdae61afdd2fabdabc119962 /central/trunk/instadisc.php | |
| parent | edc9d436c4e4f9fa3cb00256652190359a4ddc20 (diff) | |
| download | instadisc-1f3ccdbb990204d5238c78f0990496011ccb9902.tar.gz instadisc-1f3ccdbb990204d5238c78f0990496011ccb9902.tar.bz2 instadisc-1f3ccdbb990204d5238c78f0990496011ccb9902.zip | |
Central: Added sendDatabase functions
Completed the instaDisc_sendDatabase() library function and the InstaDisc.sendDatabase() XML-RPC function.
Diffstat (limited to 'central/trunk/instadisc.php')
| -rw-r--r-- | central/trunk/instadisc.php | 22 |
1 files changed, 22 insertions, 0 deletions
| diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index d32d2d7..9920e51 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php | |||
| @@ -37,6 +37,28 @@ function instaDisc_sendUpdateNotice($softwareVersion) | |||
| 37 | 37 | ||
| 38 | function instaDisc_sendDatabase($cserver) | 38 | function instaDisc_sendDatabase($cserver) |
| 39 | { | 39 | { |
| 40 | $getdb = "SELECT * FROM centralServers"; | ||
| 41 | $getdb2 = mysql_query($getdb); | ||
| 42 | $i=0; | ||
| 43 | while ($getdb3[$i] = mysql_fetch_array($getdb2)) | ||
| 44 | { | ||
| 45 | $db[$getdb3[$i]['url']] = $getdb3[$i]['key']; | ||
| 46 | $i++; | ||
| 47 | } | ||
| 48 | |||
| 49 | $cserver2 = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; | ||
| 50 | $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_escape_string($cserver2) . "\""; | ||
| 51 | $getuk2 = mysql_query($getuk); | ||
| 52 | $getuk3 = mysql_fetch_array($getuk2); | ||
| 53 | |||
| 54 | $verID = rand(1,65536); | ||
| 55 | |||
| 56 | $client = new xmlrpc_client($cserver); | ||
| 57 | $msg = new xmlrpcmsg("InstaDisc.sendDatabase", array( new xmlrpcval($cserver2, 'string'), | ||
| 58 | new xmlrpcval(md5($cserver2 + ":" + $getuk3['key'] + ":" + $verID), 'string'), | ||
| 59 | new xmlrpcval($verID, 'int'), | ||
| 60 | new xmlrpcval($db, 'array'))); | ||
| 61 | $client->send($msg); | ||
| 40 | } | 62 | } |
| 41 | 63 | ||
| 42 | function instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics) | 64 | function instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics) |
