about summary refs log tree commit diff stats
path: root/central/trunk
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-08-01 20:15:26 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-08-01 20:15:26 +0000
commit4f91c5bec482bc8e01ebc9d2eba4454e8aa9201f (patch)
treeac22438bae557da29050551ff972c6a30aad94c2 /central/trunk
parent1f3ccdbb990204d5238c78f0990496011ccb9902 (diff)
downloadinstadisc-4f91c5bec482bc8e01ebc9d2eba4454e8aa9201f.tar.gz
instadisc-4f91c5bec482bc8e01ebc9d2eba4454e8aa9201f.tar.bz2
instadisc-4f91c5bec482bc8e01ebc9d2eba4454e8aa9201f.zip
Central: Completed instaDisc_sendItem() function
Closes #3
Diffstat (limited to 'central/trunk')
-rw-r--r--central/trunk/instadisc.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index 9920e51..66032ec 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php
@@ -21,6 +21,33 @@ function instaDisc_checkVerification($username, $verification, $verificationID,
21 21
22function instaDisc_sendItem($username, $id) 22function instaDisc_sendItem($username, $id)
23{ 23{
24 $getitem = "SELECT * FROM inbox WHERE username = \"" . mysql_escape_string($username) . "\" AND itemID = " . $id;
25 $getitem2 = mysql_query($getitem);
26 $getitem3 = mysql_fetch_array($getitem2);
27 if ($getitem3['username'] == $username)
28 {
29 $getuser = "SELECT * FROM users WHERE username = \"" . mysql_escape_string($username) . "\"";
30 $getuser2 = mysql_query($getuser);
31 $getuser3 = mysql_fetch_array($getuser2);
32
33 $fp = fsockopen($getuser3['ip'], 4444, $errno, $errstr);
34 if ($fp)
35 {
36 $verID = rand(1,65536);
37
38 $out = 'ID: ' . $id . '\r\n';
39 $out .= 'Verification: ' . md5($username . ':' . $getuser3['password'] . ':' . $verID) . '\r\n';
40 $out .= 'Verification-ID: ' . $verID . '\r\n';
41 $out .= 'Subscription: ' . $getitem3['subscription'] . '\r\n';
42 $out .= 'Title: ' . $getitem3['title'] . '\r\n';
43 $out .= 'Author: ' . $getitem3['author'] . '\r\n';
44 $out .= 'URL: ' . $getitem3['url'] . '\r\n';
45 $out .= '\r\n\r\n';
46
47 fwrite($fp, $out);
48 fclose($fp);
49 }
50 }
24} 51}
25 52
26function instaDisc_sendUpdateNotice($softwareVersion) 53function instaDisc_sendUpdateNotice($softwareVersion)