News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Will this work?

Started by MensaMod, June 27, 2021, 10:24:17 PM

Previous topic - Next topic

MensaMod

My admin would like me to revise our board's login screen to tell new users to refer to a separate website for our registration process.  Not being a php programmer, much less being familiar with the SMF conventions, I'd appreciate it if someone could check my one-line revision to the Login.template.php file:

function template_kick_guest()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;

...;
// Show the message or default message.
echo '
<p class="information centertext">
', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />
// ', $txt['login_below'], ' <a href="', $scripturl, '?action=register">', $txt['register_an_account'], '</a> ', sprintf($txt['login_with_forum'], $context['forum_name_html_safe']), '
', $txt['login_below'], ' <a href="https://www.us.mensa.org/connect/sigs/sig-listing/">'get registration instructions for '</a> ', sprintf($txt['login_with_forum'], $context['forum_name_html_safe']), '
</p>';



Thanks.

Sir Osis of Liver

You can just redirect them to the website registration page -

index.php



// The main controlling function.
function smf_main()
{
global $modSettings, $settings, $user_info, $board, $topic, $board_info, $maintenance, $sourcedir;

/// Register redirect
if (isset($_GET['action']) && $_GET['action'] == 'register')
{
redirectexit('http://www.simplemachines.org');
}

[code]
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Aleksi "Lex" Kilpinen

Except, the code in the OP isn't trying to replace the register link - it is trying to supplement it with another link to instructions about the process.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

MensaMod

Correct, Aleksi.  The admin has reasons for having the SMF portion of the registration process manual-only.  As we understand it, that precludes using the registration page.

Sir Osis of Liver

Couple of syntax errors.  Try this -



// Show the message or default message.
echo '
<p class="information centertext">
', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />
', $txt['login_below'], ' <a href="https://www.us.mensa.org/connect/sigs/sig-listing/">get registration instructions for </a> ', sprintf($txt['login_with_forum'], $context['forum_name_html_safe']), '
</p>';



You'll need to tidy up $txt['login_with_forum'] in Login.english.php.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

MensaMod

I expected there was at least something wrong in there.

Thanks for the quick help.

MensaMod

Sorry, need just a little more hand-holding.  I found that line in Login.english.php:

$txt['login_with_forum'] = 'with %1$s.';

but I don't understand how I need to change it on order to "tidy up."

Sir Osis of Liver

The text displays as 'get registration instructions for with'.  Just delete 'with'.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

MensaMod


Steve

So, is your question resolved? If so, click the 'Mark Topic Solved' for us please. :)
DO NOT pm me for support!

Advertisement: