Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons

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
  #12  
Old 07-03-2008, 11:03 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem. I'm glad my first modification has been bug free
Reply With Quote
  #13  
Old 07-13-2008, 07:10 PM
Slaxi Slaxi is offline
 
Join Date: Aug 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks. Very nice mod!
Reply With Quote
  #14  
Old 07-15-2008, 01:39 PM
zhabbo zhabbo is offline
 
Join Date: Aug 2006
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excuse me, but how do you actually edit the permissions?
Reply With Quote
  #15  
Old 07-15-2008, 02:13 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can set the permissions when adding/editing the Prefix Set.
Reply With Quote
  #16  
Old 07-15-2008, 02:18 PM
zhabbo zhabbo is offline
 
Join Date: Aug 2006
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Eh? I took a look at that, and there was nothing there.
Reply With Quote
  #17  
Old 07-15-2008, 02:38 PM
zhabbo zhabbo is offline
 
Join Date: Aug 2006
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, found it. Thanks for support and release.
Reply With Quote
  #18  
Old 08-04-2008, 05:19 AM
superjeff superjeff is offline
 
Join Date: Apr 2007
Location: Italy
Posts: 394
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for this!
Reply With Quote
  #19  
Old 08-04-2008, 09:23 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are most welcome
Reply With Quote
  #20  
Old 08-07-2008, 10:41 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks alot for this Opserty, using this I was able to create a front page/semi-CMS where the staff can control whats shown and where its shown on the front page by using certain prefixes on threads. It saved me alot of work.
Reply With Quote
  #21  
Old 08-08-2008, 08:38 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem.

Note as of 4th Aug. vBulletin has announced a similar feature in 3.8 development update:
Quote:
Thread Prefix Permissions
For those who want to be able to limit the ability of their users to access thread prefixes and prefix sets, vBulletin 3.8 now gives you that ability.
As such, further development of this modification seems unlikely. I will however try to ensure that any bugs are fixed.
Reply With Quote
Reply

Thread Tools

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 04:20 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.04231 seconds
  • Memory Usage 2,308KB
  • Queries Executed 25 (?)
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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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