From fe678d3e0ed345aa5edbc9dd0ae98faa7cc322c0 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 6 Sep 2008 21:42:34 +0000 Subject: Central: Started moving to Series Refs #28 --- central/trunk/includes/instadisc.php | 142 ----------------------------------- 1 file changed, 142 deletions(-) (limited to 'central/trunk/includes/instadisc.php') diff --git a/central/trunk/includes/instadisc.php b/central/trunk/includes/instadisc.php index d00893b..3f3922a 100644 --- a/central/trunk/includes/instadisc.php +++ b/central/trunk/includes/instadisc.php @@ -271,148 +271,6 @@ function instaDisc_getConfig($key) return $getconfig3['value']; } -function instaDisc_listSubscriptions($username) -{ - $getsubs = "SELECT * FROM subscriptions WHERE username = \"" . mysql_real_escape_string($username) . "\" AND owner = \"true\""; - $getsubs2 = mysql_query($getsubs); - $i=0; - while ($getsubs3[$i] = mysql_fetch_array($getsubs2)) - { - $subs[$i] = $getsubs3[$i]['url']; - - $i++; - } - - $subs['size'] = $i; - return $subs; -} - -function instaDisc_addSubscription($username, $url) -{ - $getcode = "SELECT * FROM pending2 WHERE username = \"" . mysql_real_escape_string($username) . "\" AND url = \"" . mysql_real_escape_string($url) . "\""; - $getcode2 = mysql_query($getcode); - $getcode3 = mysql_fetch_array($getcode2); - if ($getcode3['username'] == $username) - { - $c = curl_init(); - curl_setopt($c, CURLOPT_URL, $url); - curl_setopt($c, CURLOPT_HEADER, false); - curl_setopt($c, CURLOPT_RETURNTRANSFER, true); - $page_data = curl_exec($c); - curl_close($c); - - $headers = split("\n", $page_data); - foreach ($headers as $name => $value) - { - $header = split(": ", $value); - $headerMap[$header[0]] = $header[1]; - } - - if (isset($headerMap['Subscription'])) - { - if (isset($headerMap['Title'])) - { - if (isset($headerMap['Category'])) - { - if (isset($headerMap['Key'])) - { - if ($headerMap['Key'] == $getcode3['code']) - { - $inssub = "INSERT INTO subscriptions (username,url,owner,category) VALUES (\"" . mysql_real_escape_string($username) . "\", \"" . mysql_real_escape_string($headerMap['Subscription']) . "\", \"true\", \"" . mysql_real_escape_string($headerMap['Category']) . "\")"; - $inssub2 = mysql_query($inssub); - - $delcode = "DELETE FROM pending2 WHERE username = \"" . mysql_real_escape_string($username) . "\" AND url = \"" . mysql_real_escape_string($url) . "\""; - $delcode2 = mysql_query($delcode); - - return 0; - } else { - return 4; - } - } else { - return 3; - } - } else { - return 3; - } - } else { - return 3; - } - } else { - return 3; - } - } else { - return 2; - } - - return 1; -} - -function instaDisc_listPendingSubscriptions($username) -{ - $getsubs = "SELECT * FROM pending2 WHERE username = \"" . mysql_real_escape_string($username) . "\""; - $getsubs2 = mysql_query($getsubs); - $i=0; - while ($getsubs3[$i] = mysql_fetch_array($getsubs2)) - { - $subs[$i] = array('url' => $getsubs3[$i]['url'], 'code' => $getsubs3[$i]['code']); - - $i++; - } - - $subs['size'] = $i; - return $subs; -} - -function instaDisc_generateSubscriptionActivation($username, $url) -{ - $getuser = "SELECT * FROM users WHERE username = \"" . mysql_real_escape_string($username) . "\""; - $getuser2 = mysql_query($getuser); - $getuser3 = mysql_fetch_array($getuser2); - if ($getuser3['username'] == $username) - { - $key = md5(rand(1,2147483647)); - - $inspending = "INSERT INTO pending2 (username, url, code) VALUES (\"" . mysql_real_escape_string($username) . "\", \"" . mysql_real_escape_string($url) . "\", \"" . mysql_real_escape_string($key) . "\")"; - $inspending2 = mysql_query($inspending); - - return $key; - } - - return false; -} - -function instaDisc_deleteSubscription($username, $url) -{ - $getsub = "SELECT * FROM subscriptions WHERE username = \"" . mysql_real_escape_string($username) . "\" AND url = \"" . mysql_real_escape_string($url) . "\")"; - $getsub2 = mysql_query($getsub); - $getsub3 = mysql_fetch_array($getsub2); - if ($getsub3['username'] == $username) - { - $delsub = "DELETE FROM subscriptions WHERE username = \"" . mysql_real_escape_string($username) . "\" AND url = \"" . mysql_real_escape_string($url) . "\")"; - $delsub2 = mysql_query($delsub); - - return true; - } - - return false; -} - -function instaDisc_cancelSubscription($username, $url) -{ - $getsub = "SELECT * FROM pending2 WHERE username = \"" . mysql_real_escape_string($username) . "\" AND url = \"" . mysql_real_escape_string($url) . "\")"; - $getsub2 = mysql_query($getsub); - $getsub3 = mysql_fetch_array($getsub2); - if ($getsub3['username'] == $username) - { - $delsub = "DELETE FROM pending2 WHERE username = \"" . mysql_real_escape_string($username) . "\" AND url = \"" . mysql_real_escape_string($url) . "\")"; - $delsub2 = mysql_query($delsub); - - return true; - } - - return false; -} - function instaDisc_changePassword($username, $password) { $setpass = "UPDATE users WHERE username = \"" . mysql_real_escape_string($username) . "\" SET password = \"" . mysql_real_escape_string(md5($password)) . "\""; -- cgit 1.4.1