diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-01 18:15:38 +0000 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-01 18:15:38 +0000 |
| commit | be96f198642944da86e8c43b0eab5e7cd0dacdea (patch) | |
| tree | 88349d0329ed72eb1f224848d81f6fe4079f544d /central/trunk/instadisc.php | |
| parent | dfa87010beb0f598f45234e55185afc924cd4b12 (diff) | |
| download | instadisc-be96f198642944da86e8c43b0eab5e7cd0dacdea.tar.gz instadisc-be96f198642944da86e8c43b0eab5e7cd0dacdea.tar.bz2 instadisc-be96f198642944da86e8c43b0eab5e7cd0dacdea.zip | |
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.
Diffstat (limited to 'central/trunk/instadisc.php')
| -rw-r--r-- | central/trunk/instadisc.php | 38 |
1 files changed, 38 insertions, 0 deletions
| 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, | |||
| 19 | return false; | 19 | return false; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | function instaDisc_sendItem($username, $id) | ||
| 23 | { | ||
| 24 | } | ||
| 25 | |||
| 26 | function instaDisc_sendUpdateNotice($softwareVersion) | ||
| 27 | { | ||
| 28 | $username = getConfig('owner'); | ||
| 29 | $subscription = 'http://' . $_SERVER['HTTP_HOST']; | ||
| 30 | $title = 'Update your software to ' . $software; | ||
| 31 | $author = 'Hatkirby'; | ||
| 32 | $url = 'http://fourisland.com/projects/instadisc/wiki/CentralSoftwareUpdate'; | ||
| 33 | $semantics = array(); | ||
| 34 | |||
| 35 | instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics); | ||
| 36 | } | ||
| 37 | |||
| 38 | function instaDisc_sendDatabase($cserver) | ||
| 39 | { | ||
| 40 | } | ||
| 41 | |||
| 42 | function instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics) | ||
| 43 | { | ||
| 44 | $getuser = "SELECT * FROM users WHERE username = \"" . $username . "\""; | ||
| 45 | $getuser2 = mysql_query($getuser); | ||
| 46 | $getuser3 = mysql_fetch_array($getuser2); | ||
| 47 | if ($getuser3['username'] == $username) | ||
| 48 | { | ||
| 49 | $itemID = $getuser3['nextItemID']; | ||
| 50 | $setuser = "UPDATE users SET nextItemID = nextItemID+1 WHERE username = \"" . $username . "\""; | ||
| 51 | $setuser2 = mysql_query($setuser); | ||
| 52 | |||
| 53 | $insitem = "INSERT INTO inbox (username, itemID, subscription, title, author, url, semantics) VALUES (\"" . $username . "\", " . $itemID . ", \"" . $subscription . "\", \"" . $title . "\", \"" . $author . "\", \"" . $url . "\", \"" . serialize($semantics) . "\")"; | ||
| 54 | $insitem2 = mysql_query($insitem); | ||
| 55 | |||
| 56 | instaDisc_sendItem($username, $itemID); | ||
| 57 | } | ||
| 58 | } | ||
| 59 | |||
| 22 | ?> | 60 | ?> |
