View Full Version : Show Thread Enhancements - Yilmaz - Hide [code,php,html] content from guests (vb5.6.x)
yilmaz
10-26-2020, 10:00 PM
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 (https://www.paypal.com/paypalme/yilmaztv/5). :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"
Chicoynano
10-27-2020, 08:24 PM
I just want to make a suggestion just to point. In hiding html code the phrase Click Here To Register does not appear
It is found in core / packages / yilmazhidebbcodes / api / content / text.php on line 50. Maybe you left it that way for some reason but I left screenshots for if it is of interest for the text to be displayed. As always, thank you very much for your work and I'm just trying to help.
yilmaz
10-27-2020, 10:55 PM
@Chicoynano
Thank you for your attention.
I edited the overlooked part.
It does not accept bbcode and html tags in HTML and PHP.
It is necessary to find a solution to this, I would be glad if someone who knows the solution definitely offers a suggestion.
Thanks again.
Chicoynano
10-28-2020, 01:09 AM
So far i got this
Zweeper
10-28-2020, 05:13 AM
Hey, just installed, but problem as previous versions of this hack. Maybe it is just me?
1. Load a page with a hidden code as a guest, delete cache.
2. visit the page as user: code is hidden.
3. visit the page as user (you did that before), delete cache.
4. visit the page as a guest: code is not hidden and you can see all content
Can anyone confirm this? VB 5.6.4
yilmaz
10-28-2020, 07:34 AM
Hey, just installed, but problem as previous versions of this hack. Maybe it is just me?
1. Load a page with a hidden code as a guest, delete cache.
2. visit the page as user: code is hidden.
3. visit the page as user (you did that before), delete cache.
4. visit the page as a guest: code is not hidden and you can see all content
Can anyone confirm this? VB 5.6.4
I tested it again in VB 5.6.4, if I put the text.php line 18 in front of it with // comment, it will be what you said. 18. This line will delete the cache.
The problem may be whether or not line 18 works.
core/packages/yilmazhidebbcodes/api/ content/text.php on 18. Screenshot
yilmaz
10-28-2020, 07:38 AM
So far i got this
It's bad that there is no separate login page in VB 5.x.x.
How do we detect the login link, that's the problem.
yilmaz
10-28-2020, 08:13 AM
Hey, just installed, but problem as previous versions of this hack. Maybe it is just me?
1. Load a page with a hidden code as a guest, delete cache.
2. visit the page as user: code is hidden.
3. visit the page as user (you did that before), delete cache.
4. visit the page as a guest: code is not hidden and you can see all content
Can anyone confirm this? VB 5.6.4
Cache issue fixed in version 1.2.0
Zweeper
10-28-2020, 08:20 AM
Seems to work now! Good job, nice hack! :) I keep on testing
lange
10-28-2020, 10:51 AM
Thank you very much! I will test later.
yilmaz
10-28-2020, 05:07 PM
Seems to work now! Good job, nice hack! :) I keep on testing
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
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
protected function __construct($nodeid)
{
if (vB::getDatastore()->getOption('cachebbcodebyusergroup')==0)
{
vB_Cache::resetCache();
vB::getDatastore()->resetCache();
}
}
delicjous
10-29-2020, 01:20 PM
@delicjous, thank you for the great suggestion.
I will apply and update the option you said.
Thanks again.
I did as you suggested
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
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
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
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
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/vbulletin5/issues/VBV-17825
https://tracker.vbulletin.com/vbulletin5/issues/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.
Zweeper
10-30-2020, 06:40 AM
Done voting!
yilmaz
10-30-2020, 09:33 AM
Done voting!
Chicoynano
10-30-2020, 03:12 PM
Done voting!
lange
10-30-2020, 03:35 PM
Thank you very much
Donation sent by Paypal.
megabink
11-01-2020, 05:51 PM
Interesting addon...thanks Yilmaz :up:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.