about summary refs log tree commit diff stats
path: root/series/trunk/includes/instadisc.php
diff options
context:
space:
mode:
Diffstat (limited to 'series/trunk/includes/instadisc.php')
-rw-r--r--series/trunk/includes/instadisc.php72
1 files changed, 72 insertions, 0 deletions
diff --git a/series/trunk/includes/instadisc.php b/series/trunk/includes/instadisc.php new file mode 100644 index 0000000..dd879c6 --- /dev/null +++ b/series/trunk/includes/instadisc.php
@@ -0,0 +1,72 @@
1<?php
2
3/* InstaDisc Series - A Four Island Project */
4
5include('includes/db.php');
6include('includes/template.php');
7include('includes/xmlrpc/xmlrpc.inc');
8include('includes/xmlrpc/xmlrpcs.inc');
9
10function instaDisc_subscriptionExists($id)
11{
12 $getsub = "SELECT * FROM subscriptions WHERE identity = \"" . mysql_real_escape_string($id) . "\"";
13 $getsub2 = mysql_query($getsub);
14 $getsub3 = mysql_fetch_array($getsub2);
15 if ($getsub3['identity'] != $id)
16 {
17 return 'false';
18 } else {
19 return 'true';
20 }
21}
22
23function instaDisc_getSubscription($id)
24{
25 $getsub = "SELECT * FROM subscriptions WHERE identity = \"" . mysql_real_escape_string($id) . "\"";
26 $getsub2 = mysql_query($getsub);
27 $getsub3 = mysql_fetch_array($getsub2);
28
29 return $getsub3;
30}
31
32function instaDisc_getAllSubscriptions()
33{
34 $getsubs = "SELECT * FROM subscriptions";
35 $getsubs2 = mysql_query($getsubs);
36 $i=0;
37 while ($getsubs3[$i] = mysql_fetch_array($getsubs2))
38 {
39 $i++;
40 }
41
42 return $getsubs3;
43}
44
45function instaDisc_getConfig($name)
46{
47 $getconfig = "SELECT * FROM config WHERE name = \"" . mysql_real_escape_string($name) . "\"";
48 $getconfig2 = mysql_query($getconfig);
49 $getconfig3 = mysql_fetch_array($getconfig2);
50
51 return $getconfig3['value'];
52}
53
54function instaDisc_verifyUser($username, $password)
55{
56 return (($username == instaDisc_getConfig('adminUser')) && (md5($password) == instaDisc_getConfig('adminPass')));
57}
58
59function instaDisc_changePassword($password)
60{
61 $setconfig = "UPDATE config SET value = \"" . mysql_real_escape_string(md5($password)) . "\" WHERE name = \"adminPass\"";
62 $setconfig2 = mysql_query($setconfig);
63 $setconfig3 = mysql_fetch_array($setconfig2);
64}
65
66function instaDisc_addSubscription($id, $title, $url, $category, $password = '')
67{
68 $inssub = "INSERT INTO subscriptions (identity, title, url, category, password, personal) VALUES (\"" . mysql_real_escape_string($id) . "\",\"" . mysql_real_escape_string($title) . "\",\"" . mysql_real_escape_string($url) . "\",\"" . mysql_real_escape_string($category) . "\",\"" . mysql_real_escape_string(($password == '' ? '' : md5($password))) . "\",\"false\")";
69 $inssub2 = mysql_query($inssub);
70}
71
72?>