Make votes work again
This commit is contained in:
@@ -5,7 +5,7 @@ class htmlmenu {
|
||||
{
|
||||
|
||||
if ($form)
|
||||
echo "<form action='$form' method=get>\n";
|
||||
echo "<form action=\"$form\" method=\"post\">\n";
|
||||
|
||||
echo '
|
||||
<div align=left>
|
||||
|
||||
@@ -139,15 +139,6 @@ function vote_menu()
|
||||
}
|
||||
|
||||
|
||||
function dump($arr)
|
||||
{
|
||||
while(list($key, $val) = each($arr))
|
||||
{
|
||||
echo "$key => $val <br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function vote_update($vars)
|
||||
{
|
||||
if(!$_SESSION['current']->isLoggedIn())
|
||||
@@ -156,9 +147,6 @@ function vote_update($vars)
|
||||
return;
|
||||
}
|
||||
|
||||
dump($vars);
|
||||
echo "<br>\n";
|
||||
|
||||
if( !is_numeric($vars['appId']) OR !is_numeric($vars['slot']))
|
||||
{
|
||||
addmsg("No application or vote slot selected", "red");
|
||||
@@ -169,12 +157,14 @@ function vote_update($vars)
|
||||
{
|
||||
addmsg("Registered vote for App #".$vars["appId"], "green");
|
||||
vote_add($vars["appId"], $vars["slot"]);
|
||||
redirect(apidb_fullurl("appview.php?appId=".$vars["appId"]));
|
||||
}
|
||||
else
|
||||
if($vars["clear"])
|
||||
{
|
||||
addmsg("Removed vote for App #".$vars["appId"], "green");
|
||||
vote_remove($vars["slot"]);
|
||||
vote_remove($vars["slot"]);
|
||||
redirect(apidb_fullurl("appview.php?appId=".$vars["appId"]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,15 +7,10 @@
|
||||
* application environment
|
||||
*/
|
||||
include("path.php");
|
||||
include(BASE."include/"."incl.php");
|
||||
include(BASE."include/"."vote.php");
|
||||
include(BASE."include/incl.php");
|
||||
include(BASE."include/vote.php");
|
||||
|
||||
redirectref();
|
||||
|
||||
apidb_header("Testing");
|
||||
|
||||
vote_update($_GET);
|
||||
vote_update($_POST);
|
||||
|
||||
apidb_footer();
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user