Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Limit Thread Prefix by Usergroup Details »»
Limit Thread Prefix by Usergroup
Version: 1.0, by Opserty Opserty is offline
Developer Last Online: Apr 2009 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.7.1 Rating:
Released: 06-23-2008 Last Update: Never Installs: 30
DB Changes Uses Plugins
Code Changes Additional Files  
No support by the author.

/*================================================= =====================*\
|| ################################################## ################## ||
|| # ---------------- 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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 06-24-2008, 05:54 PM
KURTZ KURTZ is offline
 
Join Date: Nov 2006
Location: Italy
Posts: 2,257
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice one mate!

ps. it's time to put an avatar ...
Reply With Quote
  #3  
Old 06-24-2008, 06:06 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 06-25-2008, 08:16 PM
Gamezod Gamezod is offline
 
Join Date: Jan 2008
Location: England
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

done well. Thanks for all your help. Ive done some further testing and all seems to work fine.
Reply With Quote
  #5  
Old 06-25-2008, 09:27 PM
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Posts: 1,674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 06-27-2008, 02:51 PM
RedGTiVR6 RedGTiVR6 is offline
 
Join Date: Dec 2006
Location: Little Elm, TX
Posts: 817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How is this mod different from this one?

https://vborg.vbsupport.ru/showthread.php?t=181644
Reply With Quote
  #7  
Old 06-27-2008, 02:54 PM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RedGTiVR6 View Post
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?
Reply With Quote
  #8  
Old 06-27-2008, 03:33 PM
RedGTiVR6 RedGTiVR6 is offline
 
Join Date: Dec 2006
Location: Little Elm, TX
Posts: 817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope - you can set the user groups per forum via a setting....
Reply With Quote
  #9  
Old 06-28-2008, 09:09 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 07-01-2008, 03:05 AM
transparent transparent is offline
 
Join Date: Apr 2008
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04454 seconds
  • Memory Usage 2,307KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete