vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - Enable/Disable Poll Permissions Per Forum (https://vborg.vbsupport.ru/showthread.php?t=114088)

Logikos 04-25-2006 10:00 PM

Enable/Disable Poll Permissions Per Forum
 

Enable/Disable Poll Permissions Per Forum



Keywords
Poll, Polls, Permissions, Per-Forum

What this does
This will give you the option to enable or disable poll permissions on a per-forum basis. You could create this effect using the forum permissions, but you would have to edit every single forum, and every single usergroup to create this effect. This was requested by a user, so I created it for that user.

How this plugin works
The concept of this plugin is simple. If you have polls enabled on one forum, then all users will be allowed to post polls and add polls to threads in that forum. It will look for the forum permissions if enabled in a forum. If you have polls disabled on a forum, then this hack will over-ride the forum permissions and stop users from posting new polls and adding polls to existing threads in that forum; even if they know the full URL (poll.php?do=newpoll&t=X)

Also note that if you disable polls on a forum, all existing polls in that forum will not be shown. (They won't be deleted, just hidden from view)

To do list...
  • Time to install: 1 minute
  • Queries to run: 1 (Installer Controlled)
  • File Mods: 0
  • Templates to edit: 0
  • Templates to add: 0
  • New Phrases: 3
  • New Plugins: 5
Credits
Thanks to Paul M for eliminating a template edit.
Thanks to Boofo for the idea of this hack and cleaning some of the code up for me.

Click It For Support!

Install This Product



Important Notes
This feature is disabled on all forums by default
Read next post for more info on how to enable/disable polls on all forums

Testing Information
This hack was tested on 2 live sites and my local machine with zero problems. Though bugs could always appear. If so, please post them here and we will see what we can do to fix them.

Product History
Wednesday, April 26, 2006 - Public Released

Help & Support
Before asking for support, please make sure you have done all the necessary changes! If you still need support, please post a reply here and double check that you have clicked the Install Button. We will try to support this hack the best we can. Support is not guaranteed!

Please post any bugs and errors here. Hope you like it, feedback is always welcomed! :)

Logikos 04-26-2006 04:06 AM

Enable On All Forums
If your a member that has alot of forums and would like to enable this feature on ALL forums. Then please run the following query after you have installed the product:

[sql]UPDATE forum SET canpostpolls = 1[/sql]

Once you have executed the above query, please remember to save at least one of your forum options, so the above query will be cached in the datastore.


Disable On All Forums
By default, this feature is disabled on all forums. Though if you need to disable the feature on all forums for whatever reason. Then please run the following query after you have installed the product:

[sql]UPDATE forum SET canpostpolls = 0[/sql]

Once you have executed the above query, please remember to save at least one of your forum options, so the above query will be cached in the datastore.

Boofo 04-26-2006 04:20 AM

Excellent job, sir. Clicking Install as I type. ;)

Atakan KOC 04-26-2006 05:21 AM

great mod !

Snake 04-26-2006 05:58 PM

Thanks man!

Boofo 04-26-2006 06:21 PM

Don't forget the install button, guys. ;)

TwTom 04-30-2006 11:07 PM

Just what I'm looking for. Thanks much!


All times are GMT. The time now is 01:48 AM.

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.01338 seconds
  • Memory Usage 1,725KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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