vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Poll Write-In & Change Vote Hack (https://vborg.vbsupport.ru/showthread.php?t=142964)

ezurick 03-24-2007 10:26 PM

I couldn't find the two (2) poll templates to edit....

TomasDR 03-24-2007 10:31 PM

Quote:

Originally Posted by ezurick (Post 1211380)
I couldn't find the two (2) poll templates to edit....

They are both under the "category" Poll Templates << in your style manager.

4x4 Mecca 03-24-2007 10:44 PM

What about my suggestion on seeing who added the option. I think it could get out of hand with people adding random crap if they were anonymous. Is is possible? Thanks for the mod, I love it.

TomasDR 03-24-2007 11:00 PM

Quote:

Originally Posted by 4x4 Mecca (Post 1211387)
What about my suggestion on seeing who added the option. I think it could get out of hand with people adding random crap if they were anonymous. Is is possible? Thanks for the mod, I love it.

Currently there is only one SQL change in the hack, to add the field "writein" to the poll table and I wanted to keep it simple.

Let me look into adding something like this, if this would work for you:
  • Coca-Cola
  • Pepsi
  • Mountain Dew (TomasDR)

4x4 Mecca 03-24-2007 11:45 PM

That's exactly what I'm looking for. Thanks :)

bitdefuser 03-25-2007 12:37 AM

Quote:

Originally Posted by TomasDR (Post 1211376)
As the other person mentioned, Write-In votes is an option, just like Public and/or Multiple voting is an option. Also there is a permission check in the plugin so someone cannot add a Write-in vote to a non write-in poll even if they knew the do=addwritein URL.

I agree with you hence why I added the permission check.

Oh, sorry. Looks like I've skipped that part out. Please forgive me. :(

TomasDR 03-25-2007 06:26 AM

Quote:

Originally Posted by 4x4 Mecca (Post 1211387)
What about my suggestion on seeing who added the option. I think it could get out of hand with people adding random crap if they were anonymous. Is is possible? Thanks for the mod, I love it.

Version updated to 1.1 with this option, please see the screenshot.

Thanks

4x4 Mecca 03-25-2007 03:57 PM

Thanks! I'm going to donate today or tomorrow. I appreciate the work.

bchertov 03-25-2007 09:36 PM

Does this hack allow users to change their votes on any poll (if the correct options are selected)? If so that would be fabulous! It would be good if vote-change feature could selected without the write in option.

Strongly considering installing!

TomasDR 03-25-2007 11:20 PM

Quote:

Originally Posted by bchertov (Post 1212175)
Does this hack allow users to change their votes on any poll (if the correct options are selected)? If so that would be fabulous! It would be good if vote-change feature could selected without the write in option.

Strongly considering installing!

It is just for write-in polls only but I just checked my code and forgot the write-in check permission for the Change Vote plugin so realistically you could remove the highlighted blue code from the following instructions.

In the template pollresults_table

Code:

<td class="tfoot" colspan="4" align="center"><span class="smallfont"><if condition="$show['multiple']">$vbphrase[multiple_choice_poll] </if>$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus<if condition="$pollinfo[writein]"><if condition="$uservoted">&nbsp;&nbsp;<a href="poll.php?$session[sessionurl]do=changevote&amp;pollid=$pollinfo[pollid]">$vbphrase[change_vote]</a></if></if></span></td>
I apologize for missing the write- in poll permission check for the change vote plugin, if you want to add the code to prevent anyone from entering the URL http://xxx.yourforum.xxx/poll.php?do...evote&pollid=# you can add the following to the plugin Change write-in poll vote

FIND

Code:

//check if poll is closed
 if (!$pollinfo['active'] OR !$threadinfo['open'] OR ($pollinfo['dateline'] + ($pollinfo['timeout'] * 86400) < TIMENOW AND $pollinfo['timeout'] != 0))
 { //poll closed
  eval(standard_error(fetch_error('pollclosed')));
 }

ADD AFTER
Code:

if (!$pollinfo['writein'])
 {
  print_no_permission();
 }

I will ensure that I include the permission check code in the next version, I apologize for any "smart" users you may have on the board that changes their votes with regular non write-in polls.

The permission check is definitely there for adding write ins so again no one can add a write-in vote to a non-write-in poll.

Finally I may consider making the change vote an option (for write-in's only or for all polls).


All times are GMT. The time now is 03:06 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01142 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete