Advertisement:

Author Topic: Error message is not being displayed  (Read 356 times)

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Error message is not being displayed
« on: February 25, 2018, 11:48:01 AM »
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.

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

Any pointers will be much appreciated.
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline Pipke

  • Full Member
  • ***
  • Posts: 444
    • [NRNS]
Re: Error message is not being displayed
« Reply #1 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:
Code: [Select]
$txt['my_error_message'] = 'my_error_message text';

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Re: Error message is not being displayed
« Reply #2 on: February 25, 2018, 02:51:31 PM »
https://wiki.simplemachines.org/smf/Using_the_SMF_language_system_in_your_mods

so your text will be then:
Code: [Select]
$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.
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,737
Re: Error message is not being displayed
« Reply #3 on: February 25, 2018, 02:58:16 PM »
then you need to post more code so we can see what you are doing.

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Re: Error message is not being displayed
« Reply #4 on: February 25, 2018, 03:07:29 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.

It's fast, it's furious, it's generalcartalk.com

Check out my mods