vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - Limit Thread Prefix by Usergroup (https://vborg.vbsupport.ru/showthread.php?t=183419)

Opserty 06-23-2008 10:00 PM

Limit Thread Prefix by Usergroup
 
/*================================================= =====================*\
|| ################################################## ################## ||
|| # ---------------- LIMIT THREAD PREFIX BY USERGROUP -------------- # ||
|| # ---------------------- CREATED BY OPSERTY ---------------------- # ||
|| # This modification may not be redistributed without prior consent # ||
|| ################################################## ################## ||
\*================================================ ======================*/


WARNING: THIS MODIFICATION REQUIRES FILE EDITS.
Please follow all instructions carefully before attempting to use this modification


What does this modification do?
This modification allow you to control which Usergroups have access to use certain prefix sets. For example in a Help/Bug Report forum, you may only want to allow staff to prefix problems into categories.

Why does this modification require file edits?
The AdminCP has a minimal number of hook locations onto which to attach plugins, this is done for security and stability reasons by the vBulletin team. Therefore it has not been possible to make this modification 'file edit' free.

What versions of vBulletin does this modification work with?
This modification has been tested to work with 3.7.1, however it will most probably also work on 3.7.0. Please note I cannot offer support for help with this modification on 3.7.0 so if you experience problems it will be best to upgrade to 3.7.1 and then see if your errors are resolved.

How to install:
(These instructions are detailed also in the README file attached in the ZIP Archive.)


1. IMPORT PRODUCT
------------------------------------------------

Import the product as normal through the AdminCP.

AdminCP > Plugins & Products > Manage Products


2. UPLOAD FILE
------------------------------------------------

Upload functions_opserty_prefix_ugps.php to the '/includes/' directory of your forum root


3. MAKE FILE EDIT (1)
------------------------------------------------

Download and Open admincp/prefix.php from your vBulletin installation. (Code additions have been highlighted in Green)

You will need to edit the file in a plain text editor, notepad or wordpad will do fine.

Find (approx. Line 303):


PHP Code:

$prefixsetdm->set('displayorder'$vbulletin->GPC['displayorder']);
$prefixsetdm->set_info('title'$vbulletin->GPC['title']);

$prefixsetdm->save(); 

Replace with:

Code:

$prefixsetdm->set('displayorder', $vbulletin->GPC['displayorder']);
$prefixsetdm->set_info('title', $vbulletin->GPC['title']);

require_once(DIR . '/includes/functions_opserty_prefix_ugps.php');
process_selected_groups();


$prefixsetdm->save();

3. MAKE FILE EDIT (2)
------------------------------------------------

Find (approx. Line 448):

PHP Code:


    
if (empty($enabled_forums))
    {
        
// default to selecting "none"
        
$enabled_forums = array(-1);
    }

    
print_forum_chooser($vbphrase['use_prefix_set_in_these_forums'], 'forumids[]'$enabled_forums$vbphrase['none'], falsetrue);
    
    
print_submit_row(); 

Replace with:

Code:


    if (empty($enabled_forums))
    {
        // default to selecting "none"
        $enabled_forums = array(-1);
    }

    print_forum_chooser($vbphrase['use_prefix_set_in_these_forums'], 'forumids[]', $enabled_forums, $vbphrase['none'], false, true);
   
    require_once(DIR . '/includes/functions_opserty_prefix_ugps.php');
    show_usergroup_list($prefixset['allowedugps']);

   
    print_submit_row();

]


4. UPLOAD
------------------------------------------------

Upload the newly edited prefix.php to your server and test away =]

If you receive PHP Parse errors it means you have probably edited prefix.php incorrectly, download a new copy of prefix.php from vBulletin.com and try editing the file again.

Remember to undo file edits and remove files, if you uninstall this product in order to avoid errors in future.

I have done my best to test this modification, however if you notice any bugs please post them in this thread so I can look into them.

Please do not private message me for support with this modification, all support will be given through this thread ONLY.

KURTZ 06-24-2008 05:54 PM

nice one mate! :)

ps. it's time to put an avatar ... :p

Opserty 06-24-2008 06:06 PM

Glad you like it ;)

Well hopefully if I hang around here long enough I might be able to bribe an Admin into getting me promoted and be then be able to get my sticky mits on a vB.org Staff Avatar :D

Gamezod 06-25-2008 08:16 PM

done well. Thanks for all your help. Ive done some further testing and all seems to work fine.

FleaBag 06-25-2008 09:27 PM

Great work, thank you. I needed this to allow me to post "Site News" on my vBadvanced without allowing regular users to do so too.

RedGTiVR6 06-27-2008 02:51 PM

How is this mod different from this one?

https://vborg.vbsupport.ru/showthread.php?t=181644

Charlie98902 06-27-2008 02:54 PM

Quote:

Originally Posted by RedGTiVR6 (Post 1560457)
How is this mod different from this one?

https://vborg.vbsupport.ru/showthread.php?t=181644

That one is limited to just mods and admins. I think this one still allows users to use prefixes but only the ones you let them?

RedGTiVR6 06-27-2008 03:33 PM

nope - you can set the user groups per forum via a setting....

Opserty 06-28-2008 09:09 AM

RedGTiVR6 - That modification is done on a per forum basis I believe (i.e. enable usergroups to use any prefixes in a forum or not).

Where as this modification is per prefix set. With this one you can still allow people to use selected prefixes but restrict certain prefixes to certain User groups, for example only Administrators could use an "Announcement" prefix or something.

transparent 07-01-2008 03:05 AM

I installed this and it works perfect! I was gonna put in a feature request and then I found this and it's exactly what I needed.

Thank you so much Opserty! :)


All times are GMT. The time now is 02:42 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,753KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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