Thread: Show Thread Enhancements - Hide BBCodes/Signatures From Guests/Users
View Single Post
  #110  
Old 12-22-2017, 01:42 PM
Peter Walker Peter Walker is offline
 
Join Date: Oct 2005
Location: Germany
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I needed this for a different reason, that a minor change to this mod made possible:

I have a premium membership system on my forum, where those that are in the Premium secondary usergroup are allowed to view videos, etc. that are displayed with custom bb codes.
Everybody else, should see a message explaining that they need to join the Premium usergroup to view the content.

As this mod does the opposite, I needed to change the code to make it work for me. With the change, it disables the named bbcodes everywhere but, for those who are members of the premium additional usergroup in the given forums.

This means that normal members see the error message, which I changed to tell them to buy a subscription, and members of the premium usergroup can now see the bbcode (videos, etc.)

After chatting with Mark about this and looking closely at the code, I was able to make this work with just a minor change to the product file and reinstalling it.

Find:
Code:
if ($vbulletin->options['markfl_hbfg_active'] AND array_intersect(explode(',', $foruminfo['parentlist']), explode(',', $vbulletin->options['markfl_hbfg_forums'])) AND !in_array($threadinfo['threadid'], array_map('trim', explode(',', $vbulletin->options['markfl_hbfg_threadsignore']))))
{
                if ($show['guest'] OR is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['markfl_hbfg_addgroups'])))
                {
                                $show['markfl_hbfg_bbcodes'] = 1;
                }
Replace with:
Code:
if ($vbulletin->options['markfl_hbfg_active'] AND array_intersect(explode(',', $foruminfo['parentlist']), explode(',', $vbulletin->options['markfl_hbfg_forums'])) AND !in_array($threadinfo['threadid'], array_map('trim', explode(',', $vbulletin->options['markfl_hbfg_threadsignore']))))
{
                if ($show['guest'] OR is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['markfl_hbfg_addgroups'])))
                {
                                $show['markfl_hbfg_bbcodes'] = 0;
                }
                else
                {
                                $show['markfl_hbfg_bbcodes'] = 1;
                }
Or simply use the attached file. Important, this changes the use of the mod, now allowing bbcodes in specific locations, it is the only way I found to do it.

Usage:
BBCode Tag Content To Hide From Guests: Give the mods that are to be activated. In my case they were the custom mods: audiop,videomp4p,videomp4vttp

Active Forums: Mark all the forums that contain premium content that use the above bbcodes.

Usergroup(s) From Which To Hide BBCodes: Set only the usergroups that are ALLOWED to use the BBCodes. e.g. Premium usergroup.

Hide BBCodes From Users Until They Reply? No Users

Usergroups Required To Reply: All

The remaining fields remain empty.

I also changed the phase displayed to:
Code:
This content is reserved for premium members only. Please obtain a premium subscription to view this content.
This is working perfectly in vb 4.2.5.
I have enclosed some images of how it works. Regular members see the blocked message while members that have Premium status can play the content - great!

Enjoy and thanks to Mark for his excellent work that just needed a little tweak.
Attached Images
File Type: jpg audioblocked.jpg (58.0 KB, 0 views)
File Type: jpg audiodisplay.jpg (42.6 KB, 0 views)
File Type: jpg audioplay.jpg (41.4 KB, 0 views)
Attached Files
File Type: xml product-hidebbcodesandsigsfromque.xml (16.8 KB, 13 views)
Reply With Quote
Благодарность от:
slash77xx
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01356 seconds
  • Memory Usage 1,808KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_box_bit
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (4)postbit_attachment
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete