vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Moderators Functions - Edit Poll Options (https://vborg.vbsupport.ru/showthread.php?t=82614)

Andreas 06-06-2005 10:00 PM

Edit Poll Options
 
Description
By default it is not possible to change poll options (multiple votes, public) when you edit a poll.
This hack allows to change these options.
Please note that it is only possible to make a public poll non-public, you cannot make a non-public poll public with this hack.

Details
File edits: 0
Template edits: 1
Difficulty: Easy

History
1.0.0
Initial Version for vBulletin 3.5.0 Beta 1

1.0.1
Quick tweak to support PHP 5
Converted to a product

Please only click Install if you actually have installed/are using this Hack, and click Uninstall whan you don't use it any longer!

Update 10.10.2009
I am sorry for having to pull off this Add-on completely as this is the only option to stop it being abused for ilegal actions.

C.Birch 06-09-2005 10:11 PM

many thanx, installed on test forum and works fine.

Chris M 06-09-2005 10:15 PM

Installed and working thanks :)

Satan

Link14716 06-09-2005 10:41 PM

I installed but I haven't tested it. ;)

nexialys 06-11-2005 03:25 AM

Quote:

Originally Posted by KirbyDE
Please note that it is only possible to make a public poll non-public, you cannot make a non-public poll public with this hack.

to make it possible to make it, instead of using a checkbox, use a dropdown or a yes/no button with the proper values, you will have the needed effect.

Andreas 06-11-2005 11:47 AM

Err ... this could also be done with a checkbox, but I don't want it to be possible.
If a user has decided that a poll is private - it should be kept private
That's why I don't support making non-public polls public.

nexialys 06-11-2005 05:47 PM

ah.. personal means then.. lol...

mholtum 06-12-2005 03:26 AM

quick and easy, thanks!

FleaBag 07-31-2005 11:47 AM

Confirmed working with RC1 with the instructions in the zip Kirby, thanks! :)

RoryF 08-07-2005 01:45 PM

Does not for me in RC2 i'm afraid :(, i get a template error when i edit the templates for the plugin.

Rich 08-07-2005 02:56 PM

Hello,

This works fine on RC2. I just installed and tested it. You did something wrong with either the template edit, or perhaps the xml upload.

akanevsky 10-09-2005 11:31 AM

Nice! Installed.

Holidazed 11-03-2005 06:38 PM

Will this allow me to remove votes already cast? I have a poll on my site that have some votes cast by the same member on a different account. I want to remove those votes.

Holidazed 11-08-2005 05:29 PM

Any answer to my question?

Aaron RV 12-03-2005 03:45 AM

Hi,

in vb 3.5.1: "Parse error: parse error, unexpected T_PUBLIC, expecting ']' in /var/www/html/forum/includes/adminfunctions_template.php(3532) : eval()'d code on line 78"

:disappointed:

Andreas 12-03-2005 03:48 AM

Don't use PHP 5 :)

msimplay 12-12-2005 05:26 PM

Quote:

Originally Posted by Andreas
Err ... this could also be done with a checkbox, but I don't want it to be possible.
If a user has decided that a poll is private - it should be kept private
That's why I don't support making non-public polls public.

That doesn't make sense especially if the same user wanted the admin to change the value to make it public or if the original user wanted to change the value back to public

Andreas 12-12-2005 09:14 PM

It does make sense.

What about the users that already voted, knowing that the poll is private?
They might not have voted if it was public and might not want their votes to be publically displayed.

msimplay 12-12-2005 09:19 PM

Quote:

Originally Posted by Andreas
It does make sense.

What about the users that already voted, knowing that the poll is private?
They might not have voted if it was public and might not want their votes to be publically displayed.

I can see what you are saying but why is this so important after all if the Admin reserves the right to edit their posts and anything else that they have then why not their polls ?

Andreas 12-12-2005 09:26 PM

Because the polls were made private, and private things should be kept as that - private.
Same thing as with private messages - you can't read/edit private messages of you users (well, of course you can with hacks or through mySQL directly).

msimplay 12-12-2005 09:32 PM

Quote:

Originally Posted by Andreas
Because the polls were made private, and private things should be kept as that - private.
Same thing as with private messages - you can't read/edit private messages of you users (well, of course you can with hacks or through mySQL directly).

Polls aren't private u can check who voted in the admin panel

Andreas 12-12-2005 09:38 PM

You can also read private messages, that's not the point.
For the users they are not public; neither the threadstarter nor any user user does know who voted what (unless they tell in the thread).

EoD

Trevor Hannant 04-30-2006 05:42 PM

Can you supply the code that would allow it to work both ways and leave it up to individual site owners to decide whether it should be available or not?

stemmy 09-05-2006 09:51 AM

Does this work for vb 3.6.0 ?

kansei 12-12-2007 12:33 PM

Quote:

Originally Posted by stemmy (Post 1068403)
Does this work for vb 3.6.0 ?

I just installed it on 3.6.8 patch level 2 and it seems to work fine. It let me edit a poll and change it to multiple choice, which was my goal :)

rnixon 03-09-2008 07:56 AM

Turned the trick on my 3.6.8 PL2 as well, many thanks.

SBlueman 04-30-2008 02:41 AM

Any way to allow adding poll options?

wmlvb 01-18-2009 05:39 PM

will this work on 3.8 or does 3.8 now offer private polling?

ndut 03-29-2009 04:33 PM

installed, and work on 3.8.1

but, i have questions... maybe anybody can help?
how to make, poll result viewable for members?
any script, can make the poll result viewable?

thank you

CycleChat 05-22-2009 09:25 PM

Thanks :D

briangreul 09-28-2009 02:35 AM

Quote:

Originally Posted by Andreas (Post 665014)
Err ... this could also be done with a checkbox, but I don't want it to be possible.
If a user has decided that a poll is private - it should be kept private
That's why I don't support making non-public polls public.

I think it's best to let the admin decide how to run their site. On our site we use polls for "meetup" type voting and activity management. So features that would be useful for us are:
- changing polls to public (because the default is non-public and people forget to check it because they have to scroll down to find it).... and there is no way to fix it without recreating the thread... which is a giant pain in the butt for admins.
- the ability to have more than one poll on a thread.
- letting users change their votes.

For example, I posted a poll about an upcoming camping trip. I forgot to make it public, so we can't see who is interested. The only fix is to delete the event/thread (we have a mod installed that ties events to a thread for discussion).

As the event evolves people may need to change their vote from yes to no or vice versa. Likewise, we may want to post another poll as we solidify the event.

Our needs aren't necessarily the way someone else may use it and I think it's important to leave the options up to the site operator. A site for sports might not want people shifting around on their votes. I can see where it would become a popularity contest on some forums.

Overall, vbulletin is great. However there are some options that are annoying and the lack of control over polls is one of them. Ideallly, this should all be built in and controllable from the admin panel. :)

briangreul 09-28-2009 02:54 AM

I spent a few minutes on this and managed to modify it to allow the poll to be made public.

There are two modifications needed:
1. Modify the XML code:
PHP Code:

<title>Edit Poll OptionsProcess Data</title>
            <
hookname>poll_update_process</hookname>
            <
phpcode><![CDATA[$poll->set('multiple'$vbulletin->input->clean_gpc('p''multiple'TYPE_BOOL));
if (
$pollinfo['public'])
{
    
$poll->set('public'$vbulletin->input->clean_gpc('p''public'TYPE_BOOL));
}]]></
phpcode

Make it look like this:
PHP Code:

<title>Edit Poll OptionsProcess Data</title>
            <
hookname>poll_update_process</hookname>
            <
phpcode><![CDATA[$poll->set('multiple'$vbulletin->input->clean_gpc('p''multiple'TYPE_BOOL));
    
$poll->set('public'$vbulletin->input->clean_gpc('p''public'TYPE_BOOL));
]]></
phpcode

\\
Save as -v2 or something in case you need the original mod. If you are going to re-install this don't forget to check "allow overwrite"

Step 2:
Use this code on the template mod:
PHP Code:

<fieldset class="fieldset">
     <
legend>$vbphrase[miscellaneous_options]</legend>
    <
div style="padding:$stylevar[formspacer]px">
        <
div><label for="cb_multiple"><input type="checkbox" name="multiple" value="1" id="cb_multiple" tabindex="1" $checked[multiple] />$vbphrase[allow_multiple_choice]</label></div>
      
      <
div><label for="cb_public"><input type="checkbox" name="public" value="1" id="cb_public" tabindex="1" $checked[public] />$vbphrase[make_votes_public]</label></div>
      </
div>
   </
fieldset

NOTE: I agree with the original author that care should be exercised when converting a poll from private to public. I also think that there are times when it is appropriate and I needed this feature on my system. Many thanks to Andreas for the original mod as he did all of the heavy lifting and I simply hacked his script a little bit.

I am new to mods on vbulletin and can't promise that this won't cause you headaches. It works on my board on v.3.8.2 Please exercise caution and make a backup before installing any mod.

Andreas 09-30-2009 04:03 PM

@briangreul
As said I don't support adding such (which most likely would be illegal in germany at least)

Please remove the code you've posted immediately.
Thanks.

Andreas 10-10-2009 10:22 AM

As this Add-on still gets abused for illegal actions I've got no choice but to pull if off completely.

Sorry.


All times are GMT. The time now is 04:45 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.01241 seconds
  • Memory Usage 1,823KB
  • 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_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (34)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete