News:

Wondering if this will always be free?  See why free is better.

Main Menu

Hide Content

Started by kelvincool, January 03, 2015, 11:08:17 PM

Previous topic - Next topic

kelvincool

Hi, please try v2.3.1 that I have just released, it should resolve this issue.

The cause of this issue is related to how smf sends notifications/alerts, the job that runs the tasks have been moved to cron.php since 2.1.4 (see https://github.com/SimpleMachines/SMF/issues/7696). I loaded my templates in integrate_bbc_codes hook (can't remember why I needed to do this but doesn't seem necessary anymore), the loadTemplate function loads the css and this causes the filemtime(): stat failed error, normally in the code that error is suppressed with the @ sign but because cron.php sets its own error handler the error is no longer suppressed.

@live627 might be interested to know about this issue as it affects his message boxes mod and not @Diego Andrés mod, you posted in the wrong support thread which was quite confusing.

Arantor

loadTemplate probably shouldn't load CSS at all if it's coming from cron.

(Also, the job that runs the tasks long since predates 2.1.4. I added it when it was still 2.1 alpha more than 10 years ago.)
Holder of controversial views, all of which my own.


Lucarella

I installed the update yesterday and, so far, no errors related to the mod, so I can say that the problem has been solved ;)

Thank you

Lucarella

I come back here to understand what's going on with this mod...
After installing the latest version, the SMF error log no longer records any errors, it works fine and I have no problems.
However, I realized in recent days that this mod is generating a lot of errors in the error_log in the FTP directory and the error is the following:
[28-Feb-2024 21:01:38 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to undefined function template_hidecontent_error_wrapper() in /home/ddcrewne/public_html/forum/Sources/HideContent.php:505
Stack traces:
#0 /home/ddcrewne/public_html/forum/Sources/HideContent.php(73): HideContent->evaluateConditions()
#1 /home/ddcrewne/public_html/forum/Sources/Subs.php(3643): HideContent->{closure}()
#2 /home/ddcrewne/public_html/forum/Sources/tasks/CreatePost-Notify.php(561): parse_bbc()
#3 /home/ddcrewne/public_html/forum/Sources/tasks/CreatePost-Notify.php(270): CreatePost_Notify_Background->handleWatchedNotifications()
#4 /home/ddcrewne/public_html/forum/cron.php(249): CreatePost_Notify_Background->execute()
#5 /home/ddcrewne/public_html/forum/cron.php(131): perform_task()
#6 {main}
   thrown in /home/ddcrewne/public_html/forum/Sources/HideContent.php on line 505

This is only the latest one recorded, but there are a lot of them, maybe around 14000, but none in the SMF error log, only in the error_log in FTP.

Should I worry or is it a minor error?

Thank you

kelvincool

@Lucarella I've managed to replicate that, bit surprised they did not go into the smf log but I have released the fix v2.3.2.

Lucarella

Thanks @kelvincool  for your help. Yesterday I installed the new update and the errors stopped, from last night to today none have appeared
The only strange thing I noticed was that immediately after installing the mod, the following errors appeared in the SMF error log:
https://dd-crew.net/forum/cron.php
 /home/ddcrewne/public_html/forum/Sources/Load.php (Linea 2876)

Tipo di errore: Manutenzioni programmate
Messaggio di erroreSeleziona
2: filemtime(): stat failed for /home/ddcrewne/public_html/forum/Themes/Halloween/css/spoiler.css

https://dd-crew.net/forum/cron.php
 /home/ddcrewne/public_html/forum/Sources/Subs.php (Linea 5787) 

Tipo di errore: Manutenzioni programmate
Messaggio di erroreSeleziona
2: SayThanks::integratePreJavascriptOutput(): Argument #1 ($do_deferred) must be passed by reference, value given
I don't know if it's because of this update, but then there weren't any, just these and that's it and related to a single user and both the say thanks and the spoiler function without problems
Maybe a coincidence?

kelvincool

I replicated those errors and they happen when someone exports their profile data, a very rare occurrence so you won't see them very often.

Not sure about the first one but I also got that error and for index.css as well. Seems similar to the earlier css issue.

It looks like the root cause of the second error is an SMF bug in profile export.

All in all I don't think you have to worry about these errors.

Lucarella

In fact I'm not worried, also because I haven't seen them again.

Thank's for your job

Lucarella

Hi kelvincool,
I'm sorry that lately you've been working just for me, but maybe I have a new problem with the hide mod.
As you can see from the image, when you cite a post that contains a non-hidden ed2k link, the ed2k links appear in the citation together with the html tags (which we do not insert with the links) and the link to the file statistics site.


I say that the problem is caused by the hide mod because, to understand what it was, I started uninstalling the mods I have one at a time and, right after removing the hide mod, the problem disappeared and the quotes are perfect.
The mod for ed2k links is this: Ed2k Autolinker
It's not a very big problem, also because quotes with ed2k links inside are not common, so if it can be solved, ok, otherwise never mind...

Thank you

kelvincool

@Lucarella I've been thinking about this problem this past week, unfortunately I think it's a case of the 2 mods do not work well together.

Dorin1

it's just to hide the content, not the attached files


Cola-Coca

I installed the mod successfully.
I want to set that visitors (not registered members) cannot see the hide content while everyone else can. How do I set it up?
I've been trying half an hour.
I LOVE SMF

kelvincool

See screenshot of the option to enable and check as default.

lord alibaski

I'm having 1 simple problem with this mod but no idea why.

I only want to use it to hide links but every time I set it and put a link in the hide tag the like option isn't in the post.

kelvincool

Quote from: lord alibaski on December 30, 2024, 06:26:09 PMI'm having 1 simple problem with this mod but no idea why.

I only want to use it to hide links but every time I set it and put a link in the hide tag the like option isn't in the post.

Can you go into more detail about what you are doing and the eventual output in the post? Screenshots, videos would be helpful to see where you are going wrong. Have you enabled the like option in the mod settings?

lord alibaski

Yeah sorry I meant to get back to this but forgot. I will put more detailed info later on the problems I was having. I had to uninstall it because it just wouldn't work.

lord alibaski

@kelvincool

Thanks for getting back to me on this it's much appreciated.

I won't put any screenshots up mate no need because I got it working in the end though.

Will start by telling you I wanted to try this modification so I could hide links but it didn't work as I thought it would.

Main issue with it when I got it working was, I wanted to know who liked the post so I could see who actually downloaded the link. Though once someone clicked on like post to view the link all they had to do was click on like post again and this removed that person from the like post notification box so I had no idea who had downloaded the link.

Is there anyway of stopping people from clicking the like post again so it stops them from removing themselves from liking the post.

Arantor

What point does it actually serve for people to click the like button? It's not sincerely "liking" the content, because everyone knows it's just a thing you have to do to get the content.

If the goal is to prevent guests getting it, don't show it to guests, only authenticated users.

If the goal is to see who downloaded it, firstly why does that matter? Or if it does matter, maybe https://custom.simplemachines.org/index.php?mod=4146 (there looks to be a 2.1 version on GitHub, but the mod thread may well have more details)
Holder of controversial views, all of which my own.


kelvincool

@lord alibaski

You could remove the unlike option from the template I suppose. Another option is to use my other mod Say Thanks which you can disable unthanking.

Arantor

Quote from: kelvincool on January 04, 2025, 05:47:46 AMYou could remove the unlike option from the template I suppose. Another option is to use my other mod Say Thanks which you can disable unthanking.

The stock likes feature does stuff with AJAX, though and removing it from the template is suddenly a whole lot harder.
Holder of controversial views, all of which my own.


Advertisement: