comparison usrajax.php @ 216:bcc3c4696b3e

Some more work.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 17 Nov 2013 22:28:48 +0200
parents 5bae42020034
children 1bb4f4bcb027
comparison
equal deleted inserted replaced
215:bfd480370a70 216:bcc3c4696b3e
73 73
74 74
75 // 75 //
76 // Handle the request 76 // Handle the request
77 // 77 //
78 $action = "ERROR"; 78 switch (stGetRequestItem("action"))
79 if (stChkRequestItem("action") && stChkRequestItem("type"))
80 { 79 {
81 $action = $_REQUEST["action"];
82 $type = $_REQUEST["type"];
83 }
84
85 switch ($action)
86 {
87 case "get":
88 //
89 // Get specific data
90 //
91 switch ($type)
92 {
93 case "votes":
94 $sql = "SELECT * FROM votes ORDER BY utime DESC";
95 break;
96 }
97
98 //
99 // Perform query if we need to, output results
100 //
101 if (isset($sql) && ($res = stExecSQLCond($sql, "")) !== FALSE)
102 {
103 if ($type == "votes")
104 {
105 }
106 }
107 break;
108
109 case "set": 80 case "set":
110 // 81 //
111 // Set vote, if voting is enabled 82 // Set vote, if voting is enabled
112 // 83 //
113 if ($type == "votes" && stChkSetting("allowVoting") && 84 if (stChkSetting("allowVoting") &&
114 stChkRequestItem("votekey") && 85 stChkRequestItem("votekey") &&
115 stChkRequestItem("entry_id") && 86 stChkRequestItem("entry_id") &&
116 stChkRequestItem("vote")) 87 stChkRequestItem("vote"))
117 { 88 {
118 // Check if voting is enabled on the compo and voter is valid 89 // Check if voting is enabled on the compo and voter is valid