Make votes work again

This commit is contained in:
Jonathan Ernst
2005-02-26 16:36:52 +00:00
committed by WineHQ
parent 62a44c00d0
commit 7e7d514274
3 changed files with 7 additions and 22 deletions

View File

@@ -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>

View File

@@ -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"]));
}
}

View File

@@ -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();
?>