ragtek
03-25-2007, 10:21 AM
i'd like to check if someone is allowed to vote or not and to write the votenumber into a db
my code looks at moment so:
if ($foruminfo['forumid'] == $vbulletin->options['battleforumid']
AND !$check = $db->query_first("SELECT postid FROM " . TABLE_PREFIX . "post WHERE threadid = $threadinfo[threadid]
AND userid = " . $vbulletin->userinfo['userid']))
{
print_no_permission();
}
else {
$entry = $db->query_first("SELECT answers FROM " .TABLE_PREFIX. "battles WHERE threadid = '" .$threadinfo[threadid] . "'");
$antworten = $db->fetch_array($entry);
if ($entry['answers'] < $vbulletin->options['maxpolls']){
$db->query_write("
update " . TABLE_PREFIX . "battles set answers = answers +1");
}
else print_no_permission();
}
it doesnt update the answers nr :/
my code looks at moment so:
if ($foruminfo['forumid'] == $vbulletin->options['battleforumid']
AND !$check = $db->query_first("SELECT postid FROM " . TABLE_PREFIX . "post WHERE threadid = $threadinfo[threadid]
AND userid = " . $vbulletin->userinfo['userid']))
{
print_no_permission();
}
else {
$entry = $db->query_first("SELECT answers FROM " .TABLE_PREFIX. "battles WHERE threadid = '" .$threadinfo[threadid] . "'");
$antworten = $db->fetch_array($entry);
if ($entry['answers'] < $vbulletin->options['maxpolls']){
$db->query_write("
update " . TABLE_PREFIX . "battles set answers = answers +1");
}
else print_no_permission();
}
it doesnt update the answers nr :/