News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Editing Error pages

Started by Redric, June 07, 2012, 04:08:54 PM

Previous topic - Next topic

Redric

SMF Version: 2.0.2

I have 2 passworded boards on my forum, and a lot of times users hotlink the threads inside of these boards, so it shows guests and members
"An Error Has Occurred!
This board is password protected and you have not provided the correct password during this session
Please enter the board password:"

What I would like to do is edit it so that each board has a distinct Error message, so that I can put the hint in the error page.  Worst case I would like to be able to do something like

"Board 1: Hint is blah blah blah
Board 2: Hint is blarghle blargh"

I'd like to know which SMF file contains this information so that I can modify it.  I'm sorry if I posted in the wrong area, I wasn't sure if this belongs in SMF 2.x support or Coding Discussion.

kat

If I've understood what you want, have a look at (Believe it or not) Errors.english.php in the default theme's "languages" directory.

Kindred

do note, editing that file edits your general error messages.
If you want error messages specific to the error (in other words, error_message_1 for board 1, etc) then you'll have to modify the coding....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Redric

#3
Quote from: K@ on June 07, 2012, 04:16:38 PM
If I've understood what you want, have a look at (Believe it or not) Errors.english.php in the default theme's "languages" directory.
I'm using a custom theme, does that make a difference?

Quote from: Kindred on June 07, 2012, 04:23:02 PM
do note, editing that file edits your general error messages.
If you want error messages specific to the error (in other words, error_message_1 for board 1, etc) then you'll have to modify the coding....
That was a concern I was thinking about, but I'm willing to be lazy and just have both hints added to the generic error page for simplicity on my part.

Redric

The Errors.english.php file didn't have the information for board password errors.  Or at the very least I couldn't find the information for board password errors in the file.

Is it maybe in a different file?

kat

Seems so. The only way that I could figure-out which file(s), though, would be to go through each file, looking. (Which you could do, of course).

It's most likely to be a file in the "languages" directory, though.

Arantor

Most likely it's in Modifications.english.php but it's not a different error message for each board, it shows a single message that it uses multiple times.

Odds are you'd have to modify the coding of the mod on top of changing the error messages, and that's not quite so easy.

Redric

Quote from: Arantor on June 10, 2012, 11:28:31 AM
Most likely it's in Modifications.english.php but it's not a different error message for each board, it shows a single message that it uses multiple times.

Odds are you'd have to modify the coding of the mod on top of changing the error messages, and that's not quite so easy.
Thanks, that's just what I needed.  Coded the page to say the hint for both boards, so it's kind of universal.

SaltedWeb

Where is this file located under which directory ?
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Kindred

Same place as every other language template file...
Themes/default/languages
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

SaltedWeb

LOL Yep sorry was not thinking . Thanks this thread didn't answer my question on another.
I'll wait for one over there on another thread thanks.
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Advertisement: