News:

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

Main Menu

How to edit text above login?

Started by abrodski, August 20, 2016, 10:06:42 PM

Previous topic - Next topic

abrodski

Hello!

Couple of years ago there was an interesting discussion in this thread here:

http://www.simplemachines.org/community/index.php?topic=523714.0

Ninja ZX-10RR described how to remove "register an account" link from Login if registration is disabled and there's no need for it. That old topic seems to be closed now, so I couldn't revive it. I followed all the steps from the 1st post and it did work. I mean, I did manage to remove that needless link, BUT...
What happens after that is that THE REST OF THE TEXT that remains becomes like jibberish. Like in my case WITH the link it's like this:

Please login below or register an account with VIP CUSTOMER COMMUNICATION CENTER.

After I remove the link, it's kinda like this:

Please login below orwith VIP CUSTOMER COMMUNICATION CENTER.  ("or" and "with" come together)

So it's even worse than the pointless link. I'm not a coder, so I have no clue how to edit that text, so in the end AFTER removing the link, it would look like this:

Please login below to VIP CUSTOMER COMMUNICATION CENTER.

OR:

Please login below

Something along those lines...

I'm attaching the printscreen of my login just in case.

Grammy

A similar question was asked here:

http://www.simplemachines.org/community/index.php?topic=548048.0

(I mentioned being careful to not remove "apostrophes" or semi-colons.  I had meant to say "single quotes".)

Back up your file, first. 


Hope it helps.   :)

Sir Osis of Liver

Login.template.php



/// Show the message or default message.

if ($modSettings['registration_method'] == 3)

echo '
<p class="information centertext">
', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />
', sprintf($txt['login_below_2'], $context['forum_name_html_safe']), '
</p>';

else

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']), '
</p>';

// And now the login information.



Login.english.php



$txt['login_below'] = 'Please login below or';
$txt['register_an_account'] = 'register an account';
$txt['login_with_forum'] = 'with %1$s.';

$txt['login_below_2'] = 'Please login below to %1$s.';


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

                                     - R. Waters

abrodski

Thank you both for your replies!

And where do I find a file Login.english.php? I can't find it anywhere. I do have though Login.template.php in my /forum/Themes/default directory.
And if I don't have Login.english.php, then what should I do?
I opened that thread. This one:

http://www.simplemachines.org/community/index.php?topic=548048.0

That guy had a somewhat different situation. Like he had another login in the upper left corner that I don't have. So the reply that he got from Pipke might not be exactly applicable to my situation. Also I don't understand Pipke's sentence below his first code block. He wrote:

"and replace/add on the section of the removed lines: (wich you removed above)"

Does he mean that the first block of code must be removed and the second must be inserted in the place where the removed code was?

But anyhow, his answer was to a different question, so I'll appreciate if I get an answer to my particular situation too.

Also in the reply Sir Osis of Liver wrote to edit Login.template.php file that I do have. But I think my code there is different. That part is like this in my file:

// 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']), '
</p>';

// And now the login information.


I'm also attaching my Login.template.php file just in case.

P.S. Actually, maybe it's just easier to remove the whole Warning block altogether. Like when you click on "Login" menu item it disappears like it was never there.
Also if "Forgot your password?" link could be removed from the Login block, for me it would be the best, if possible. And the search box in the upper right corner.

abrodski

P.S.S. Also Sir Osis of Liver didn't indicate what to do with that block of code in Login.template.php file. Should it be deleted or edited or what?

abrodski

#5
Finally found Login.english.php in my /Themes/default/languages folder! Who knew! So there I delete the text or edit it in Warning section, correct?
Also I found a solution how to remove search here (if it's a correct one?):

http://www.invest-tracing.com/forum/index.php?topic=2601.0

So should I first remove the register link and then edit the text in Warning section? What's the order of the process?

abrodski

UPDATE. I've found the way to remove SEARCH.

Sir Osis of Liver

You're not removing anything in either file, you're adding an if/else option for when registration is disabled in Login.template.php, and an additional text string in Login.english.php.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

abrodski

Quote from: Sir Osis of Liver on August 22, 2016, 12:49:25 PM
You're not removing anything in either file, you're adding an if/else option for when registration is disabled in Login.template.php, and an additional text string in Login.english.php.

Thanks for your reply, Sir!
So I should first disable registration in the back end of forum, and then add first block of code to Login.template.php and the second one to Login.english.php?
Not to change anything in the files, just to add your code in any place I like?

Sir Osis of Liver

In Login.template.php, find this (you already have) -



// 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']), '
</p>';

// And now the login information.



Replace it with this -





/// Show the message or default message.

if ($modSettings['registration_method'] == 3)

echo '
<p class="information centertext">
', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />
', sprintf($txt['login_below_2'], $context['forum_name_html_safe']), '
</p>';

else

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']), '
</p>';

// And now the login information.



In /languages/Login.english php find this -



$txt['login_below'] = 'Please login below or';
$txt['register_an_account'] = 'register an account';
$txt['login_with_forum'] = 'with %1$s.';



and just add the new text string below it, so it's easy to find -





$txt['login_below'] = 'Please login below or';
$txt['register_an_account'] = 'register an account';
$txt['login_with_forum'] = 'with %1$s.';

$txt['login_below_2'] = 'Please login below to %1$s.';



You can edit the text any way you like, but don't touch '%1$s'.

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

                                     - R. Waters

abrodski


Advertisement: