PDA

View Full Version : Who voted?


Konqueror
12-17-2001, 10:00 PM
Who voted? v1.1b

1.1b:
-----
Important bugfix thanks to kypdurron:
Votes did show up even when the voter chose not to make it public.
Added seperate instructions if you want all votes to be public.

1.1:
----
The hack now also works with multiple choice polls.
Displays a message when no public votes are found.

1.0a:
-----
Important bugfix. Somehow I forgot to include the database changes in the instructions.
If you've already installed version 1.0 please just run this MySQL query:
ALTER TABLE pollvote ADD showvote TINYINT(1) DEFAULT "0" NOT NULL;

1.0:
----
Initial release

This hack was requested at https://vborg.vbsupport.ru/showthread.php?s=&threadid=33239
Basically what this hack does is that it gives voters the option to select if their vote is to be made public. If they select yes, everyone can see what they voted for.
I'm not good at writing descriptions, so just go and have a look here:

http://www.stefanh3.f2s.com/hacks/whovoted/step1.jpg

http://www.stefanh3.f2s.com/hacks/whovoted/step2.jpg

http://www.stefanh3.f2s.com/hacks/whovoted/step3.jpg

Have fun! :)

LanciaStratos
12-18-2001, 07:48 PM
Both me and my members thank you very much! Great hack! :D

Lesane
12-18-2001, 08:00 PM
Thanks for the great hack Konqueror.

Tommy Boy
12-18-2001, 08:04 PM
Excellent! :p

squawell
12-18-2001, 11:00 PM
it's great!!

thankz~:D

Konqueror
12-19-2001, 08:09 AM
Updated! Please everyone download the new instructions...

phase1
12-19-2001, 05:11 PM
When I install this script and try to use it I get this error:
Fatal error: Call to undefined function: updateuserforum() in /hsphere/local/home/phase1/networking.phase1design.com/forums/poll.php on line 43

Anyone have a suggestion on how to fix, or does this script not work with old polls????

Konqueror
12-20-2001, 08:09 AM
Updated version posted. This should also work for you now, phase1. :)

kypdurron
12-28-2001, 06:57 PM
Great hack! one problem, however is that it doesn't work correctly.
It is displaying all votes, regardless of whether they are public or not.
I made the following additions to poll.php

if ($votes = $DB_site->query_first("SELECT pollid FROM pollvote
WHERE pollid='$pollid' AND voteoption='$tmp'AND SHOWVOTE=1")) {
$votes = $DB_site->query("SELECT * FROM pollvote WHERE poll
id='$pollid' AND voteoption='$tmp' AND SHOWVOTE=1 ORDER BY userid ASC");

atrl
12-29-2001, 12:57 AM
I cant get the My SQL DB change right can anyone help by showing me a pic of what it should look like, im not sure of all the values? Please Help?

kypdurron
12-29-2001, 01:36 AM
you mean the changes to Mysql DB?
I guess..do the following(prompt in limegreen,type commands in skyblue):

WARNING! TRY AT YOUR OWN RISK!

$mysql (you may have to do mysql -u <userid> -p, then type the admin password)
mysql>connect vbulletin; (or whatever the database is called)
mysql>TABLE pollvote ADD showvote TINYINT(1) DEFAULT "0" NOT NULL;

To verify it worked, do
mysql>select * from pollvote;
you should see something like:
+------------+--------+--------+---------------+--------------+-------------+
| pollvoteid | pollid | userid | votedate | voteoption | showvote |
+------------+--------+--------+----------------+----------+----------+
| 1 | 1 | 1 | 1009029051 | 3 | 0 |
+------------+--------+--------+------------+------------+----------+
mysql>exit;

Tommy Boy
01-02-2002, 08:05 PM
Good hack, Konqueror. And nice catch, kypdurron!

BTW: I think you forgot to modify the "pollresults" template as well... ;)

SirSteve
01-12-2002, 02:09 PM
Not sure why but if you choose not to make your vote public, it still shows up as if you choose yes...

kypdurron
01-12-2002, 09:55 PM
SirSteve: make the modifications I suggested to fix this.

Basically, I added "AND SHOWVOTE=1" to the two lines shown above.

SirSteve
01-12-2002, 11:55 PM
Thanks. That worked. However, look here:

http://www.sirstevesguide.com/vbportal/forums/poll.php?action=whovoted&pollid=23

You don't have to be registered to vote so I think it's not showing the text because of that. Can you display the # of guests that votes? Like:

It was OK, but distribution continued to be a problem for me.:
JediTricks master jedi The Eradicator Guests (25 votes)

or something like that.

Lucky
01-13-2002, 01:50 AM
Great Tool!

Thanks :)

trainer
01-20-2002, 03:43 PM
great hack! this would be perfect for my site if it could be setup so only admins/supermods can see the results of who voted.

any ideas if that could be easily done?

thanks a pile

glenvw
02-11-2002, 03:43 PM
This looks great.

Two questions:

Can it be set up so that the voter has no choice. That is I want all votes to be made public.

Also, I see talk about the fact that anyone can vote. Can it be set up so that only registered members can vote?

Thank you!

Glen

trainer
02-11-2002, 06:32 PM
[QUOTE]Originally posted by glenvw
This looks great.

Two questions:

Can it be set up so that the voter has no choice. That is I want all votes to be made public.

Also, I see talk about the fact that anyone can vote. Can it be set up so that only registered members can vote?

Thank you!

Glen

Sufian
02-07-2003, 10:14 PM
Great hack, it does what I need, however, I just want who voted and not the option they voted for..how can I modify this hack for that?

subu1
02-22-2003, 08:28 AM
i install this, but i thing i am stupid because where can i see who votet

Yahooman
10-02-2007, 11:56 AM
Yeah, that's exactly what I was looking for! I wanna see if the users who read the poll voted too! - Just for control ;)

Yahooman


[QUOTE=Sufian;351644]Great hack, it does what I need, however, I just want who voted and not the option they voted for..how can I modify this hack for that?