SMF Support > SMF 1.1.x Support

Change Registration Disabled Error Messages

(1/3) > >>

peterinwa:
I want to disable registration, and change the error messages you get when you click on Registration with it disabled.

They are:

An Error Has Occurred!

Sorry, registration is currently disabled.

I want to replace the above with text directing them to click on back, and then my instructions (which are at the top of my forum).

I want to replace An Error Has Occurred! as well as the line that follows.

My instructions will ask them to send me an e-mail giving me a little info, then I'll register them.

I was going to do this another way, and remove the Registration links. But they'd probably go nuts looking for them!

Thanks! Peter

Elmacik:
Go to /Themes/default/languages/Erros.english.php
Open it with a text editor and drop down to 125th line which is:

--- Code: ---$txt['registration_disabled'] = 'Sorry, registration is currently disabled.';
--- End code ---

Now you can change it to whatever you like. A little note: you have to escape the single quotes ( ' ) here with a backslash ( \ ). For example if you will say "don't", you have to type it as "don\'t".

You can also change the title (An Error Has Occured) Go to /Sources/Register.php


--- Code: (Find) --- if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3)
fatal_lang_error('registration_disabled', false);
--- End code ---


--- Code: (Replace) --- if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3)
{
$context['error_title'] = 'Whatever title you want, type it here..';
fatal_lang_error('registration_disabled', false);
}
--- End code ---

Do you see "Whatever title.." in the code? You will type your title there.

peterinwa:
Thanks for the help, but I'm having a problem.

I was able to change the message (Sorry, registration...) just fine. But there are two locations where I can change the title:

// Check if the administrator has it disabled.

and

// You can't register if it's disabled.

If I change the title in the second location, it doesn't show when you click on Registration. Though the registration message does show.

But changing the title in the first location causes the message to be blank.

Thanks again, and I have another question.

When I make changes like this, is it possible that future software updates will include whole files that replace my modifications?

Peter

Elmacik:
I think you didn't do the title change as I suggested. Other ways will probably affect all of the error pages.


--- Quote from: peterinwa ---When I make changes like this, is it possible that future software updates will include whole files that replace my modifications?
--- End quote ---

If you update your forum with patch files, it mostly won't brake your modifications down. But if you upgrade with full packages or if you upgrade to a very new version (like from 1.x to 2.x) then all your modeifications will be gone.. For example I updated my forum from 1.1.6 to 1.1.7 and all my modifications are still working without any problems. I updated with a little patch from the administration panel.

peterinwa:
But your instructions don't tell me where to change:

   if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3)
      fatal_lang_error('registration_disabled', false);

It appears in the file in two places?

I tried it in the first, second, and both.

I'll start from scratch and try again, but first please tell me which one to replace... or both.

Thanks.

Navigation

[0] Message Index

[#] Next page

Go to full version