Go Back   vb.org Archive > vBulletin Modifications > vBulletin 5.x Modifications > vBulletin 5.x Products & Extensions

Reply
 
Thread Tools
Yilmaz - Hide [code,php,html] content from guests (vb5.6.x) Details »»
Yilmaz - Hide [code,php,html] content from guests (vb5.6.x)
Version: 1.3.1, by yilmaz yilmaz is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 5.5.5 Rating:
Released: 10-26-2020 Last Update: 03-25-2022 Installs: 11
Supported
Additional Files  

Tested in vbulletin version 5.6.4 works fine

Features:
This mod makes it so you can hide [CODE] [PHP] [HTML] BBcode content from guests
Hide [CODE], [HTML] ve [PHP] from Unregistered/Unverified account.

Description:
This product allows you to decide if you want to hide [CODE], [HTML] and [PHP] BBCode content from Unregistered/Unverified on your site.
Hidden content is replaced by a link to your registration page for guests and a simple message for restricted user groups.

========================================
How to install:
========================================
Upload the content of Yilmaz - Hide [code,php,html] content from guests directory to your root.
that's all it.
enjoy..



Please Mark as Installed if you use this.
Donations always appreciated. :up:


1.3.0
Cache issue fixed

========================================
How to uninstall:
========================================
1. Remove the package "yilmazhidebbcodes" that located in /core/packages/
2. Go to "Manage Products" in the admincp and delete the product named "Yilmaz - Hide [code,php,html] content from guests"

Download Now

File Type: zip Yilmaz - Hide [code,php,html] content from guests.zip (4.7 KB, 13 views)

Screenshots

File Type: png 2020.10.27-14_37_54.png (41.6 KB, 0 views)
File Type: png 2020.10.27-14_39_26.png (158.6 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
lange

Comments
  #12  
Old 10-28-2020, 05:07 PM
yilmaz's Avatar
yilmaz yilmaz is offline
 
Join Date: Sep 2004
Posts: 751
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zweeper View Post
Seems to work now! Good job, nice hack! I keep on testing
Quote:
Originally Posted by Wayne Luke;n4449447
Do you have "Cache BBCode Render by Usergroup" enabled on your site?
This can help

your-website.ext/admincp/options.php?do=options&dogroup=bbcode

Cache BBCode Render by Usergroup
Reply With Quote
  #13  
Old 10-28-2020, 06:55 PM
Zweeper Zweeper is offline
 
Join Date: Jan 2005
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is working since your last update without the cache bbcode render by usergroup option!
Reply With Quote
  #14  
Old 10-29-2020, 08:50 AM
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great idea, and I respect your work... but I have some concerns.
The way you did the trick wipe out the entire cache every time a user LOOK into any post/ thread. Thats because you emty the cache every time an object of the class of your API-Extension been created/ initialized (thats the way the constructor works). So the forum will never build a cache of any data if any of your hide-mods are installed and that will (probably) affect the entire page speed. #Also if you install more than one of your hide-mods, the database-tables will be emptied for each mod. So if 2 of your mods installed and a user is open 1 thread, post, page.... the entire cache-table-data will be deleted 2 times. There is a table cache and another cacheevent. You comment out the part that emty the cacheevent ... you should delete that also.

If it is ok for you, I will upload a similar mod in the next days/weeks that only delete the cache of the nodes with bbcodes. So the cache works almost normal... and if the option "Cache BBCode Render by Usergroup" is enabled you do not need to delete the cache... so I would select that option to find out if it is necessary to delete the cache of the post.
Reply With Quote
2 благодарности(ей) от:
yilmaz, Zweeper
  #15  
Old 10-29-2020, 11:43 AM
yilmaz's Avatar
yilmaz yilmaz is offline
 
Join Date: Sep 2004
Posts: 751
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by delicjous View Post
If it is ok for you, I will upload a similar mod in the next days/weeks that only delete the cache of the nodes with bbcodes. So the cache works almost normal... and if the option "Cache BBCode Render by Usergroup" is enabled you do not need to delete the cache... so I would select that option to find out if it is necessary to delete the cache of the post.
@delicjous, thank you for the great suggestion.
I will apply and update the option you said.
Thanks again.


I did as you suggested
PHP Code:
     protected function __construct($nodeid)
     {
         if (
vB::getDatastore()->getOption('cachebbcodebyusergroup')==0)
         {
             
vB_Cache::resetCache();
             
vB::getDatastore()->resetCache();
         }
    } 
Reply With Quote
  #16  
Old 10-29-2020, 01:20 PM
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yilmaz View Post
@delicjous, thank you for the great suggestion.
I will apply and update the option you said.
Thanks again.


I did as you suggested
PHP Code:
     protected function __construct($nodeid)
     {
         if (
vB::getDatastore()->getOption('cachebbcodebyusergroup')==0)
         {
             
vB_Cache::resetCache();
             
vB::getDatastore()->resetCache();
         }
    } 
Thats only a part of my suggestion but even that is more solid than before (recommand if empty because options could be empty!).
Now you have the best solution for users who cachebbcodebyusergroup, but if not cachebbcodebyusergroup the entire cache is still emtied every time a user look into a post. The cache of 30 posts are about 1MB of data, so if you have 30 000 posts and a highly frequented forum you have around 1000 MB data without cache by usergroup, even you use only 5 usergroups the cache could grow fast. So this option is not good for everyone.
Reply With Quote
  #17  
Old 10-29-2020, 02:03 PM
yilmaz's Avatar
yilmaz yilmaz is offline
 
Join Date: Sep 2004
Posts: 751
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by delicjous View Post
Thats only a part of my suggestion but even that is more solid than before (recommand if empty because options could be empty!).
Now you have the best solution for users who cachebbcodebyusergroup, but if not cachebbcodebyusergroup the entire cache is still emtied every time a user look into a post. The cache of 30 posts are about 1MB of data, so if you have 30 000 posts and a highly frequented forum you have around 1000 MB data without cache by usergroup, even you use only 5 usergroups the cache could grow fast. So this option is not good for everyone.
You are absolutely right.
The bbcode_code, bbcode_html and bbcode_php templates do not appear in the results.
If it was out, I would replace these templates with other templates.
This topic gives clues. https://vborg.vbsupport.ru/showthread.php?t=327871
Reply With Quote
  #18  
Old 10-29-2020, 03:37 PM
shka shka is offline
 
Join Date: Mar 2016
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another approach: I had created a prototype for zweeper with a frontend controller. This means that the post / bbcode only contains a placeholder and an ajax call, the frontend controller can map any complex (cachable) display logic based on the ajax credentials.

Advantage: No cache reset necessary
Disadvantage: An additional ajax call for each content to be hidden. So only useful for certain constellations (in the case of Zweeper only a hide bbcode in the first post of a thread / blog).

PS @zweeper: Ja du hättest die Tabelle einfach löschen können, nur dann einmalig den Cache leeren.
Reply With Quote
  #19  
Old 10-30-2020, 04:35 AM
Zweeper Zweeper is offline
 
Join Date: Jan 2005
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by delicjous View Post
Thats only a part of my suggestion but even that is more solid than before (recommand if empty because options could be empty!).
Now you have the best solution for users who cachebbcodebyusergroup, but if not cachebbcodebyusergroup the entire cache is still emtied every time a user look into a post. The cache of 30 posts are about 1MB of data, so if you have 30 000 posts and a highly frequented forum you have around 1000 MB data without cache by usergroup, even you use only 5 usergroups the cache could grow fast. So this option is not good for everyone.



So that actually can cause my servers RAM usage grow high, right? because I think i just experience that.
Reply With Quote
  #20  
Old 10-30-2020, 04:36 AM
Zweeper Zweeper is offline
 
Join Date: Jan 2005
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by shka View Post
Another approach: I had created a prototype for zweeper with a frontend controller. This means that the post / bbcode only contains a placeholder and an ajax call, the frontend controller can map any complex (cachable) display logic based on the ajax credentials.

Advantage: No cache reset necessary
Disadvantage: An additional ajax call for each content to be hidden. So only useful for certain constellations (in the case of Zweeper only a hide bbcode in the first post of a thread / blog).

PS @zweeper: Ja du h?ttest die Tabelle einfach l?schen k?nnen, nur dann einmalig den Cache leeren.

And it still works greate
Reply With Quote
  #21  
Old 10-30-2020, 05:55 AM
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All of you should vote for this bug-/ featurerequest-reports:

https://tracker.vbulletin.com/vbulle...sues/VBV-17825
https://tracker.vbulletin.com/vbulle...ssues/VBV-5356

Delete the cache always rise server-usage and will slow down the page. Means it must be possible to modify the content on presentationlayer and not behind the scenes. Right now ...
1. cache have to be cleaned (fully or like I do/ did for the post with bbcode in it) = first database action
2. modify the post content (all in php and only a little serverpower needed)
3. build new cache (for the one post or in this mod fully) = second database action

If the cache emtied fully the entire cache of all post, stylevars, styles ... builds up every pageview.
Reply With Quote
Благодарность от:
Chicoynano
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 12:28 AM.


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.05027 seconds
  • Memory Usage 2,359KB
  • Queries Executed 28 (?)
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_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (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_postinfo_query
  • fetch_postinfo
  • 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
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete