Preventing multiple votes on a survey?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Preventing multiple votes on a survey?
fi2508
CZ Newbie
fi2508 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 05, 2004
0.00 posts per day
Posts: 10
Points: 676
   
I noticed you can vote more than once on a poll / survey... is there anyway to disable this?



Back to top Reply with quote
#2   re: Preventing multiple votes on a survey?
dkwds
CZ Active Member
dkwds has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student
Age: 38
Gender: Male
Website:
Status: Offline
Joined: Jul 29, 2004
0.04 posts per day
Posts: 282
Points: 12,713
   
i haven't come across any way myself. i would personally put the poll in the forum. There one can only vote once. However i'm sure somewhere out there there is a mod that restricts the user to voting a certain amount of times. I'll look around.




_________________
Back to top Reply with quote
#3   
aUsTiN
CZ Active Member
usa.gif georgia.gif
Age: 41
Gender: Male
Website:
Status: Offline
Joined: Sep 09, 2003
0.02 posts per day
Posts: 142
Points: 57
  MSN Messenger 
If you're good with php coding, download the poll block for the Blend Portal System (http://phpbb-portal.com) which is a standalone phpBB so you cant use it directly, BUT there is codes for this. As it is coded 1 vote per user per poll.



Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
You already have a poll check table in the database but it uses the user's ip to track them. If you attach your Survey block i will have a look I have mine coded to accept only one vote per ip per 30 days. If they have voted then they see the results in the block instead.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   re: Preventing multiple votes on a survey?
JRSweets
CZ Active Member
 Codezwiz Site Donator
JRSweets has been a member for over 20 year's 20 Year Member
usa.gif massachusetts.gif
Age: 43
Gender: Male
Fav. Sports Team: NE Patriots
Website:
Status: Offline
Joined: Apr 07, 2004
0.03 posts per day
Posts: 259
Points: 19,861
  MSN Messenger 
Here the default survey block.



Attached Files
block-Survey.zip (1.44 KB, Downloaded: 5234 Time(s))


Back to top Reply with quote
#6   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Here ya go...
[ Register or login to view links on this board. ]




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#7   re: Preventing multiple votes on a survey?
fi2508
CZ Newbie
fi2508 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 05, 2004
0.00 posts per day
Posts: 10
Points: 676
   
I uploaded that block, but now it seems to allow multiple voting straight after voting... whereas it used to make you wait a while... i checked it, and it does have '30' in the part where it asks for the number days.... help? icon_smile.gif



Back to top Reply with quote
#8   re: Preventing multiple votes on a survey?
DjTom-i
CZ Newbie
DjTom-i has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 15, 2004
0.00 posts per day
Posts: 1
Points: 300
   
hi guys,

i started this also but did not finish yet...

maybe one of you mange this...

here is my code for the function in the index.php



function pollCollector($pollID, $voteID, $forwarder) {
    global $HTTP_COOKIE_VARS, $prefix, $db, $cookie;
    /* Fix for lamers that like to cheat on polls */
    if (empty($ip)) {
   $ip = $_SERVER["REMOTE_ADDR"];
    }
    $pollID = intval($pollID);
    $voteID = intval($voteID);
    $past = time()-1800000;
    $puid = $cookie[0];
    $db->sql_query("DELETE FROM ".$prefix."_poll_check WHERE time < '$past'");
    $row = $db->sql_fetchrow($db->sql_query("SELECT ip, user_id FROM ".$prefix."_poll_check WHERE (ip='$ip') OR (user_id='$puid') AND (pollID='$pollID')"));
    $user_id = $row['user_id'];
    $ips = $row['ip'];
    $ctime = time();
   if (($ip == $ips OR $row['user_id'] == $puid) AND $user_id != 0) {
   $voteValid = 0;
    }else{
   $db->sql_query("INSERT INTO ".$prefix."_poll_check (ip, user_id, time, pollID) VALUES ('$ip', '$puid', '$ctime', '$pollID')");
   $voteValid = "1";
    }
    /* Fix end */
    /* update database if the vote is valid */
    if($voteValid>0) {
        $db->sql_query("UPDATE ".$prefix."_poll_data SET optionCount=optionCount+1 WHERE pollID='$pollID' AND voteID='$voteID'");
        if ($voteID != "") {
       $db->sql_query("UPDATE ".$prefix."_poll_desc SET voters=voters+1 WHERE pollID='$pollID'");
       update_points(8);
        }
   Header("Location: $forwarder");
    } else {
        Header("Location: $forwarder");
    }
    /* a lot of browsers can't handle it if there's an empty page */
    echo "<html><head></head><body></body></html>";
}


u need also to add a field to the nuke_poll_check table


ALTER TABLE nuke_poll_check ADD user_id int(11) NOT NULL default '1';



there must be a little mistake in the code.

would be nice if someone checks it!!!

thx

tom-i


Back to top Reply with quote
#9   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Verfiy that you have a nuke_poll_check table.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#10   Surevey not showing up on main page
Cirque
CZ Newbie
Cirque has been a member for over 20 year's 20 Year Member
usa.gif newyork.gif
Gender: Male
Status: Offline
Joined: Sep 03, 2004
0.00 posts per day
Posts: 18
Points: 2,150
   
I just installed the enhanced survey block and the surveys I had quit showing up and the ones I tried to add after also wouldnt show up. Using nuke 7.4 and chatserve 2.7 patchs. The edit polls and delete polls would show them still, but they did not show up on the main page, it would just say "there are no surveys' or something. The tables exist.

Any ideas?



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum