The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
As promised a few weeks ago, I finally found some time to make the much needed addition to allow users to change their votes in a poll. After examining the code a bit, I ended up reusing some of the vB code for this ... I hope this isn't a violation of the hacks rules. I read through them, and I think the code re-use is so small and specialized that it will be ok for redistribution via this forum. If it's not, please feel free to edit/lock this thread, I just ask that a moderator let me know what parts are unacceptable.
Here is the hack, it's fairly simple: Open up poll.php: At the bottom of the file, find ?> Just above this, insert this code: PHP Code:
In your templates, you will need to add two templates and modify 1 existing one. First: Code:
Add template " error_userhasnotvoted " The text of the template should be: You have not voted on this thread, so you can not change your vote. Code:
Add template " redirect_pollchange " The text of the template should be: You have deleted your vote. You will be taken to the poll, where you will be allowed to revote. Code:
Edit your "showthread_pollresults_voted" template. Change the text to: You have already voted on this poll! <BR>If you wish to change your vote, click <a href="poll.php?action=changevote&pollid=$pollinfo[pollid]">here</a>. Now your users will have the option to erase thier vote and revote. Not <i>quite</i> as elegant as allowing them to actually revote, but it will suffice for now ... at least for me. Someone feel free to expand on this if they want something a bit more robust. Thanks, and good luck! -Flare Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
I apologize if I misundestood the meaning of the hack, but if I understood correctly, there is already a feature to allow users to change their vote
|
|
#3
|
||||
|
||||
|
There's a way to allow users to change their thread ratings, not votes on polls.
|
|
#4
|
|||
|
|||
|
that code is somewhat unclean (select *).
|
|
#5
|
|||
|
|||
|
Oh I see my bad
![]() Thanks for clearing that up tuebdogg Quote:
|
|
#6
|
|||
|
|||
|
Jeez... thought this was something a bunch of people wanted
Instead... I'm... *sob* ... unclean! I'll go back in my corner now and eat paint chips
|
|
#7
|
|||
|
|||
|
Nice one thx youuu
|
|
#8
|
|||
|
|||
|
I get a Parse Error
|
|
#9
|
|||
|
|||
|
Quote:
|
|
#10
|
|||
|
|||
|
Where is this error generated? Can you show me a on your system?
|
![]() |
|
|