Error message is not being displayed

Started by Doug Heffernan, February 25, 2018, 11:48:01 AM

Previous topic - Next topic

Doug Heffernan

Hello,

I am writing a mod and so far so good. The only issue that I am having is that the error message will not be displayed. I get only the standard error message, but without my custom error message.

What I am trying to do is show an error to guests when they view the topics if certain criteria is met. I am using this code to display the error message after the criteria is met, at the Display.php file in the Sources folder.

if ($context['user']['is_guest'])
fatal_lang_error('my_error_message', false);


Any pointers will be much appreciated.

Pipke

"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Doug Heffernan

Quote from: Pipke on February 25, 2018, 01:04:21 PM
https://wiki.simplemachines.org/smf/Using_the_SMF_language_system_in_your_mods

so your text will be then:
$txt['my_error_message'] = 'my_error_message text';

Thank you for your reply. Yes, I have the language string created. Also if I hard code the error message, it displays nothing as well.

Illori

then you need to post more code so we can see what you are doing.

Doug Heffernan

Quote from: Illori on February 25, 2018, 02:58:16 PM
then you need to post more code so we can see what you are doing.

I did a fresh install of Smf and tried it again and now the error is being outputed correctly. Now I have to package up the mod.


Advertisement: