For those who are still having problems with this { with v2 }
I have a fix
Open up your voting.php
And replace it with this
<?php
@include_once(DIRNAME(__FILE__) .'/globals.php');
$t = time();
$qt = $db->fetch_row($db->query("SELECT * FROM votes2 WHERE Userid=0"));
if($t > $qt['Voted'])
{
$del = sprintf("DELETE FROM votes WHERE userid > 0");
$db->query($del);
$new=mktime(0,0,0)+86400;
$upp = sprintf("UPDATE votes2 SET Voted=%u WHERE userid=0", $new);
$db->query($upp);
}
print "<br><br><center>";
if($userid == 1)
{
print"<a href=voting.php?add=site>Add New Voting Site</a><br><br>";
}
$width=50;
$second="";
if($userid == 1)
{
$width=70;
$second="<th>---</th><th>---</th>";
}
print"<table width=$width% border=1>
<tr><th>Voting Site</th><th>Reward</th><th>---</th>$second</tr>";
$hk=$db->query("SELECT * FROM votingsites");
while($r=$db->fetch_row($hk))
{
$blahhh=$db->query("SELECT * FROM votes WHERE site={$r['id']} && userid=$userid");
if($db->num_rows($blahhh) > 0)
{
$link="<font color=red><i>Done!</i></font>";
}
else
{
$link="<a href=voted.php?ID={$r['id']} target=_blank><b><font color=green>Vote</font></b></a>";
}
if($r['rewardtype'] == 1)
{
$reward=money_formatter($r['reward']);
}
if($r['rewardtype'] == 2 && $r['reward'] > 1)
{
$reward="{$r['reward']} Crystals";
}
if($r['rewardtype'] == 2 && $r['reward'] == 1)
{
$reward="{$r['reward']} Crystal";
}
if($r['rewardtype'] == 3)
{
$juk=$db->query("SELECT * FROM items WHERE itmid={$r['reward']}");
$item=$db->fetch_row($juk);
$reward="{$item['itmname']}";
}
if($r['rewardtype'] == 4)
{
$reward="{$r['reward']} Energy";
}
if($r['rewardtype'] == 5)
{
$reward="{$r['reward']} Brave";
}
if($r['rewardtype'] == 6)
{
$reward="{$r['reward']} Will";
}
if($userid == 1)
{
$sekond="<td><center><a href=voting.php?edit={$r['id']}><font color=blue>Edit</font></a></center></td><td><center><a href=voting.php?del={$r['id']}><font color=red>Del</font></a></center></td>";
}
print"<tr><td>{$r['name']}</td><td><center>$reward</center></td><td><center>$link</center></td>$sekond</tr>";
}
print"</table></center>";
if($userid == 1 && $_GET['add'])
{
print"<br><hr width=75%><br>";
if($_POST['name'] && $_POST['link'] && $_POST['type'] && $_POST['reward'])
{
$type = abs((int) $_POST['type']);
$reward = abs((int) $_POST['reward']);
$info=str_replace(array("'","\n"),array("'","<br />"),strip_tags($_POST['name']));
$name = mysql_real_escape_string($info);
$info=str_replace(array("'","\n"),array("'","<br />"),strip_tags($_POST['link']));
$link = mysql_real_escape_string($info);
if($type == 3)
{
$juk=$db->query("SELECT * FROM items WHERE itmid=$reward");
if($db->num_rows($juk) == 0)
{
print"<center>The item you have selected for a reward does not exist.<br>><a href=voting.php>Back</a>";
die("");
}
}
$db->query("INSERT INTO votingsites VALUES ('','$name','$link','$type','$reward');");
print"<center>You have successfully added the site: $name<br>><a href=voting.php>Back</a>";
}
else
{
print"<form action='voting.php?add=site' method='post'>
<table width=40% border=1>
<tr>
<th colspan=2>Add A New Voting Site</th>
</tr>
<tr>
<th>Name:</th>
<td><center><input type='text' name='name' value='{$_POST['name']}' /></center></td>
</tr>
<tr>
<th>Voting Link:<br><font size=1 color=red>Include http://<font></th>
<td><center><input type='text' name='link' value='{$_POST['link']}' /></center></td>
</tr>
<tr>
<th>Reward Type:</th>
<td><center><select type='dropdown' name='type'>
<option value='1'>Money
<option value='2'>Crystals
<option value='3'>Item
<option value='4'>Energy
<option value='5'>Brave
<option value='6'>Will
</select></center></td>
</tr>
<tr>
<th>Reward Amount:<br><font size=1 color=red>If Item Put ID #</font></th>
<td><center><input type='text' name='reward' value='{$_POST['reward']}' /></center></td>
</tr>
<tr>
<th colspan=2><input type='submit' value='Add New Voting Site' /></form></th>
</tr>
</table>";
}
}
if($userid == 1 && $_GET['edit'])
{
$_GET['edit'] = abs((int) $_GET['edit']);
$blak=$db->query("SELECT * FROM votingsites WHERE id={$_GET['edit']}");
if($db->num_rows($blak) == 0)
{
print"<center>This voting site does not exist!<br>>Back</center>";
die("");
}
else
{
$r=$db->fetch_row($blak);
}
print"<br><hr width=75%><br>";
if($_POST['name'] && $_POST['link'] && $_POST['type'] && $_POST['reward'])
{
$type = abs((int) $_POST['type']);
$reward = abs((int) $_POST['reward']);
$info=str_replace(array("'","\n"),array("'","<br />"),strip_tags($_POST['name']));
$name = mysql_real_escape_string($info);
$info=str_replace(array("'","\n"),array("'","<br />"),strip_tags($_POST['link']));
$link = mysql_real_escape_string($info);
if($type == 3)
{
$juk=$db->query("SELECT * FROM items WHERE itmid=$reward");
if($db->num_rows($juk) == 0)
{
print"<center>The item you have selected for a reward does not exist.<br>><a href=voting.php>Back</a>";
die("");
}
}
$db->query("UPDATE votingsites SET name='$name' WHERE id='{$_GET['edit']}'");
$db->query("UPDATE votingsites SET url='$link' WHERE id='{$_GET['edit']}'");
$db->query("UPDATE votingsites SET rewardtype='$type' WHERE id='{$_GET['edit']}'");
$db->query("UPDATE votingsites SET reward='$reward' WHERE id='{$_GET['edit']}'");
print"<center>You have successfully edited the site: $name<br>><a href=voting.php>Back</a>";
}
else
{
print"<form action='voting.php?edit={$_GET['edit']}' method='post'>
<table width=40% border=1>
<tr>
<th colspan=2>Edit An Existing Voting Site</th>
</tr>
<tr>
<th>Name:</th>
<td><center><input type='text' name='name' value='{$r['name']}' /></center></td>
</tr>
<tr>
<th>Voting Link:<br><font size=1 color=red>Include http://<font></th>
<td><center><input type='text' name='link' value='{$r['url']}' /></center></td>
</tr>
<tr>
<th>Reward Type:</th>
<td><center><select type='dropdown' name='type'>
<option ";
if($r['rewardtype'] == 1)
{
print"selected ";
}
print"value='1'>Money
<option ";
if($r['rewardtype'] == 2)
{
print"selected ";
}
print"value='2'>Crystals
<option ";
if($r['rewardtype'] == 3)
{
print"selected ";
}
print"value='3'>Item
<option ";
if($r['rewardtype'] == 4)
{
print"selected ";
}
print"value='4'>Energy
<option ";
if($r['rewardtype'] == 5)
{
print"selected ";
}
print"value='5'>Brave
<option ";
if($r['rewardtype'] == 6)
{
print"selected ";
}
print"value='6'>Will
</select></center></td>
</tr>
<tr>
<th>Reward Amount:<br><font size=1 color=red>If Item Put ID #</font></th>
<td><center><input type='text' name='reward' value='{$r['reward']}' /></center></td>
</tr>
<tr>
<th colspan=2><input type='submit' value='Edit Voting Site' /></form></th>
</tr>
</table>";
}
}
if($userid == 1 && $_GET['del'])
{
$_GET['del'] = abs((int) $_GET['del']);
$blak=$db->query("SELECT * FROM votingsites WHERE id={$_GET['del']}");
if($db->num_rows($blak) == 0)
{
print"<center>This voting site does not exist!<br>><a href=voting.php>Back</a></center>";
die("");
}
else
{
$r=$db->fetch_row($blak);
}
print"<br><hr width=75%><br>";
if($_GET['confirm'])
{
$db->query("DELETE FROM votingsites WHERE id='{$_GET['del']}'");
print"<center>You have successfully deleted the site: {$r['name']}<br>><a href=voting.php>Back</a>";
}
else
{
print"<form action='voting.php?del={$_GET['del']}&confirm=delete' method='post'>
<table width=55% border=1>
<tr>
<th colspan=2>Are you sure you would like to delete {$r['name']}?</th>
</tr>
<tr>
<th colspan=2><input type='submit' value='Delete Voting Site' /></form></th>
</tr>
</table>";
}
}
$h->endpage();
?>
that should fix it, if not tell me ill have another look.