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   re: Preventing multiple votes on a survey?
n3wD
CZ Newbie
n3wD has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 21, 2004
0.00 posts per day
Posts: 6
Points: 1,108
   
I get the same message in the survey block. icon_sad.gif

Please help.



Back to top Reply with quote
#2   
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,475
   
Try opening the block and changing the top:


$make_random = 0; //0- Means NO random polls. 1- Means random poll.


Make it whatever it isnt and see if it works.



_________________
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
#3   re: Preventing multiple votes on a survey?
n3wD
CZ Newbie
n3wD has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 21, 2004
0.00 posts per day
Posts: 6
Points: 1,108
   
Nope... i changed that, and the days back to the default of 30 and still no luck. icon_sad.gif

I put the old block back in and the surveys show up in that block.



Back to top Reply with quote
#4   re: Preventing multiple votes on a survey?
n3wD
CZ Newbie
n3wD has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 21, 2004
0.00 posts per day
Posts: 6
Points: 1,108
   
So this Block works for others?

It still shows no surveys for me.



Back to top Reply with quote
#5   re: Preventing multiple votes on a survey?
Kilim
CZ Newbie
Kilim has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Dec 06, 2004
0.00 posts per day
Posts: 15
Points: 1,581
   
I just installed the Enhanced Survey block on my site and now it is saying:
No Surveys!

I know for a fact that I have surveys made prior to the change of the block getting over-written w/ the new 1.

Any idea whats up?

I have Nuke 7.5 w/ the patch files from chatserv.

My website is [ Register or login to view links on this board. ]



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,475
   
Alright seems to a problem between the versions even though i am positive nothing was added. Please attach a dump of your:

nuke_poll_check
nuke_poll_data
nuke_poll_desc




_________________
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?
Kilim
CZ Newbie
Kilim has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Dec 06, 2004
0.00 posts per day
Posts: 15
Points: 1,581
   
here is mine:



Attached Files
nuke_poll_desc[1].sql.zip (843 Bytes, Downloaded: 5232 Time(s))
Attached Files
nuke_poll_data[1].sql.zip (1.32 KB, Downloaded: 5232 Time(s))
Attached Files
nuke_poll_check[1].sql.zip (504 Bytes, Downloaded: 5232 Time(s))


Back to top Reply with quote
#8   
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,475
   
Please try this block for me...



Attached Files
kilim.zip (1.72 KB, Downloaded: 5239 Time(s))



_________________
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
#9   re: Preventing multiple votes on a survey?
Kilim
CZ Newbie
Kilim has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Dec 06, 2004
0.00 posts per day
Posts: 15
Points: 1,581
   
Ok it looks like that semi fixed it.
1 issue at the moment is that teh random poll option does not seem to work.
I tried both option 0 & 1 and it stays at teh same poll.

I did remember finding this mod changes to the Survey Mod/block that mighjt help:



Random Survey:
[ Register or login to view links on this board. ]

Open the Survey block and fine this line (or something close to it mine is heavily modded)

$result = $db->sql_query("SELECT pollID, pollTitle, voters FROM ".$prefix."_poll_desc WHERE artid='0' $querylang ORDER BY pollID DESC LIMIT 1"); '); //--> 



Change it to this and give it a shot:

$result = $db->sql_query("SELECT pollID, pollTitle, voters FROM ".$prefix."_poll_desc WHERE artid='0' $querylang ORDER BY rand()"); '); //--> 

or

Here is what I found tho as not exact as yours.

$row = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1")); '); //--> 

change it to this and try it. Worked great for me:
$row = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY rand() LIMIT 1")); '); //--> 





1 vote per user fix:
[ Register or login to view links on this board. ]

Try this, in the surveys module's index find the pollCollector function, its last lines read:
Header("Location: $forwarder");
}
/* a lot of browsers can't handle it if there's an empty page */
echo "<html><head></head><body></body></htm l>";


change to:
include ('header.php');
OpenTable();
echo "<center>You Have Already Voted - [ <a href="javascript:history.go(-1)">Go Back</a> ]</center>";
CloseTable();
include ('footer.php');
}



I remember that the above codes worked ok when I was using the regular Survey Block & mod.
But if your thing can be faster, I would rather figure out how to use yours icon_biggrin.gif


Back to top Reply with quote
#10   
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,475
   
The original code in the block works just fine. Do you have article's assigned to the polls? You can run the query in your mysql to test it i get a random result everytime:


SELECT pollID, pollTitle, voters FROM nuke_poll_desc WHERE artid='0' ORDER BY rand() LIMIT 1;


Not sure why it won't work for you. You can try just replacing this whole section:


if ($make_random == 1) {
$result = $db->sql_query("SELECT pollID, pollTitle, voters FROM ".$prefix."_poll_desc $querylang ORDER BY rand() LIMIT 1");
} elseif ($make_random == 0) {
$result = $db->sql_query("SELECT pollID, pollTitle, voters FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1");
}


To just this:


$result = $db->sql_query("SELECT pollID, pollTitle, voters FROM ".$prefix."_poll_desc $querylang ORDER BY rand() LIMIT 1");




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