vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Products & Extensions (https://vborg.vbsupport.ru/forumdisplay.php?f=258)
-   -   Show Thread Enhancements - Yilmaz - Hide [code,php,html] content from guests (vb5.6.x) (https://vborg.vbsupport.ru/showthread.php?t=328306)

yilmaz 10-28-2020 05:07 PM

Quote:

Originally Posted by Zweeper (Post 2604406)
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

Zweeper 10-28-2020 06:55 PM

It is working since your last update without the cache bbcode render by usergroup option!

delicjous 10-29-2020 08:50 AM

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.

yilmaz 10-29-2020 11:43 AM

Quote:

Originally Posted by delicjous (Post 2604421)
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();
         }
    } 


delicjous 10-29-2020 01:20 PM

Quote:

Originally Posted by yilmaz (Post 2604424)
@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.

yilmaz 10-29-2020 02:03 PM

Quote:

Originally Posted by delicjous (Post 2604425)
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

shka 10-29-2020 03:37 PM

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.

Zweeper 10-30-2020 04:35 AM

Quote:

Originally Posted by delicjous (Post 2604425)
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.

Zweeper 10-30-2020 04:36 AM

Quote:

Originally Posted by shka (Post 2604428)
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 :)

delicjous 10-30-2020 05:55 AM

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.


All times are GMT. The time now is 08:11 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.01260 seconds
  • Memory Usage 1,759KB
  • 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_php_printable
  • (7)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