From be96f198642944da86e8c43b0eab5e7cd0dacdea Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 1 Aug 2008 18:15:38 +0000 Subject: Central: Added library skeleton Added the library method signatures for XML-RPC used functions to the library, and also implemented a instaDisc_sendUpdateNotice() and instaDisc_addItem(). Refs #3. --- central/trunk/instadisc.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'central/trunk/instadisc.php') diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index f8f33e5..f4fcd1e 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php @@ -19,4 +19,42 @@ function instaDisc_checkVerification($username, $verification, $verificationID, return false; } +function instaDisc_sendItem($username, $id) +{ +} + +function instaDisc_sendUpdateNotice($softwareVersion) +{ + $username = getConfig('owner'); + $subscription = 'http://' . $_SERVER['HTTP_HOST']; + $title = 'Update your software to ' . $software; + $author = 'Hatkirby'; + $url = 'http://fourisland.com/projects/instadisc/wiki/CentralSoftwareUpdate'; + $semantics = array(); + + instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics); +} + +function instaDisc_sendDatabase($cserver) +{ +} + +function instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics) +{ + $getuser = "SELECT * FROM users WHERE username = \"" . $username . "\""; + $getuser2 = mysql_query($getuser); + $getuser3 = mysql_fetch_array($getuser2); + if ($getuser3['username'] == $username) + { + $itemID = $getuser3['nextItemID']; + $setuser = "UPDATE users SET nextItemID = nextItemID+1 WHERE username = \"" . $username . "\""; + $setuser2 = mysql_query($setuser); + + $insitem = "INSERT INTO inbox (username, itemID, subscription, title, author, url, semantics) VALUES (\"" . $username . "\", " . $itemID . ", \"" . $subscription . "\", \"" . $title . "\", \"" . $author . "\", \"" . $url . "\", \"" . serialize($semantics) . "\")"; + $insitem2 = mysql_query($insitem); + + instaDisc_sendItem($username, $itemID); + } +} + ?> -- cgit 1.4.1