First of all, I want to thank you for creating this hack. It's cool as hell, and best of all, easy to install.
For those of you who are having problems with normal, everyday polls being closed whenever someone votes, I believe I have found the solution.
Open POLL.PHP and find
PHP Code:
//RBS
$battlesys = $DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "battlesys_battles WHERE pollid = '".$pollinfo['pollid']."'");
$votestowin = $battlesys['votestowin'];
$splitoptions = explode("|||", $pollinfo['options']);
$maxvotes = 0;
$leastvotes = 0;
foreach ($splitvotes as $number => $vote)
{
global $maxvotes;
global $leastvotes;
global $splitoptions;
if ( $vote > $maxvotes ) {
$maxvotes = $vote;
$winner = $splitoptions[$number];
global $winner;
}
if ( $vote < $leastvotes or $vote == 0 ) {
$leastvotes = $vote;
$loser = $splitoptions[$number];
global $loser;
}
}
if ( $maxvotes >= $votestowin )
{
$DB_site->query_first("UPDATE " . TABLE_PREFIX . "poll SET active = '0' WHERE pollid = '".$pollinfo['pollid']."'"); //close poll
//$winnerinfo = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE username = '".$winner."'");
$DB_site->query("UPDATE user SET bs_wins = bs_wins + 1 WHERE username = '".$winner."'");
$DB_site->query("UPDATE user SET bs_loses = bs_loses + 1 WHERE username = '".$loser."'");
}
//RBS
And replace with
PHP Code:
//RBS
$battlesys = $DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "battlesys_battles WHERE pollid = '".$pollinfo['pollid']."'");
if($battlesys)
{
$votestowin = $battlesys['votestowin'];
$splitoptions = explode("|||", $pollinfo['options']);
$maxvotes = 0;
$leastvotes = 0;
foreach ($splitvotes as $number => $vote)
{
global $maxvotes;
global $leastvotes;
global $splitoptions;
if ( $vote > $maxvotes ) {
$maxvotes = $vote;
$winner = $splitoptions[$number];
global $winner;
}
if ( $vote < $leastvotes or $vote == 0 ) {
$leastvotes = $vote;
$loser = $splitoptions[$number];
global $loser;
}
}
if ( $maxvotes >= $votestowin )
{
$DB_site->query_first("UPDATE " . TABLE_PREFIX . "poll SET active = '0' WHERE pollid = '".$pollinfo['pollid']."'"); //close poll
//$winnerinfo = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE username = '".$winner."'");
$DB_site->query("UPDATE user SET bs_wins = bs_wins + 1 WHERE username = '".$winner."'");
$DB_site->query("UPDATE user SET bs_loses = bs_loses + 1 WHERE username = '".$loser."'");
}
}
//RBS
This should fix that problem. Enjoy!