Advertisement:

Author Topic: [TIP/TRICK] Remove register button  (Read 9318 times)

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
[TIP/TRICK] Remove register button
« on: June 10, 2014, 01:36:14 PM »
Question: How can I remove the registration button and prevent user from registering?


Open /Sources/Subs.php and find:
Code: [Select]
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],

Replace with:
Code: [Select]
'href' => $scripturl . '?action=register',
'show' => false,



Open root/index.php and find:
Code: [Select]
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa', 'login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', 'smstats', 'mailq', 'verificationcode', 'openidreturn'))))

Replace with:
Code: [Select]
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa', 'login', 'login2', /*'register', 'register2',*/ 'reminder', 'activate', 'help', 'smstats', 'mailq', 'verificationcode', 'openidreturn'))))



Again in index.php find:
Code: [Select]
'register' => array('Register.php', 'Register'),
'register2' => array('Register.php', 'Register2'),

Replace with:
Code: [Select]
/*'register' => array('Register.php', 'Register'),
'register2' => array('Register.php', 'Register2'),*/



Open the login.template.php of your theme and find:
Code: [Select]
', $txt['login_below'], ' <a href="', $scripturl, '?action=register">', $txt['register_an_account'], '</a> ', sprintf($txt['login_with_forum'],
Replace with:
Code: [Select]
', $txt['login_below'], /* '<a href="', $scripturl, '?action=register">', $txt['register_an_account'], '</a> ', */ sprintf($txt['login_with_forum'],



Important:  you will also need to disable the registration process by going in Admin-->Registration-->Settings-->Method of registration employed for new members and set "Registration Disabled"

And that's it ;) it can be useful if you want your forum to be private or even if you have too many users etc...

For further reference please check out this topic --> http://www.simplemachines.org/community/index.php?topic=523689.0





Special thanks to mashby, Illori and Krash, Herman's Mixen and as always Arantor for helping me in writing this.



« Last Edit: June 10, 2014, 05:16:38 PM by Flavio93Zena »
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #1 on: June 10, 2014, 01:38:20 PM »
#request move as indicated in tips and tricks board.
#request deletion of this message after that ;)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,564
Re: [TIP/TRICK] Remove register button
« Reply #2 on: June 10, 2014, 01:49:07 PM »
that is not the only location where
Code: [Select]
'show' => $user_info['is_guest'], is found in that file the first location would be for the log in button.

also without disabling registration, you are not stopping them from registering

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,459
Re: [TIP/TRICK] Remove register button
« Reply #3 on: June 10, 2014, 03:22:12 PM »
Yep, bots don't need the button, they link directly to registration -

Code: [Select]

http://www.forum.com/index.php?action=register


Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [TIP/TRICK] Remove register button
« Reply #4 on: June 10, 2014, 03:23:47 PM »
Yeah, exactly as Krash. is saying, removing the button will not prevent registrations. It will just stop real people from knowing it's there (and people who don't know SMF)

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #5 on: June 10, 2014, 03:24:36 PM »
Updated and edited ;)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,459
Re: [TIP/TRICK] Remove register button
« Reply #6 on: June 10, 2014, 03:33:52 PM »
There's also a register link in the header login, for those themes that have one (i.e., Curve), which you would want to remove for consistency.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #7 on: June 10, 2014, 03:40:18 PM »
There's also a register link in the header login, for those themes that have one (i.e., Curve), which you would want to remove for consistency.
Doesn't it get deactivated in the same way by disabling the function from the admin settings? If not can you please tell me how to disable that so I can add it because I can't find where it is? After that *hopefully  O:)* everything will be correct :)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,564
Re: [TIP/TRICK] Remove register button
« Reply #8 on: June 10, 2014, 03:42:39 PM »
i doubt it gets disabled automatically. you would find it in index.template.php

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #9 on: June 10, 2014, 03:48:08 PM »
I think I found it and you are referring to this one:
Code: [Select]
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
elseif (!empty($context['show_login_bar']))
{
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
<form id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<div class="info">', sprintf($txt['welcome_guest'], $txt['guest_title']), '</div>
<input type="text" name="user" size="10" class="input_text" />
<input type="password" name="passwrd" size="10" class="input_password" />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
<div class="info">', $txt['quick_login_dec'], '</div>';

if (!empty($modSettings['enableOpenID']))
echo '
<br /><input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';

echo '
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}
Still it refers to a login bar but I don't want to disable the whole bar putting */ stuff /* because I would disable the whole bar. How could I do it then leaving the login untouched but removing the register thing only?
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,459
Re: [TIP/TRICK] Remove register button
« Reply #10 on: June 10, 2014, 03:52:28 PM »
Disabling registration does not remove the buttons/links.  User gets an error message that registration is disabled.  The header login is in index.template.php, and pulls the link text from index.english.php -

Code: [Select]

$txt['welcome_guest'] = 'Welcome, <strong>%1$s</strong>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
$txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';


That's from Curve, it can vary with theme.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #11 on: June 10, 2014, 04:08:30 PM »
Soooo if I am correct even if I am noob at coding... Could this one be ok?
Code: [Select]
$txt['welcome_guest'] = 'Welcome, <strong>%1$s</strong>. Please <a href="' . $scripturl . '?action=login">login</a>;
$txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a>;
(uhm I think I should leave the "register" in the txt because it would not be able to call it properly.. Correct me if I'm wrong)

And shall I edit only this one in languages or more? And for each language? D:
Tried the index.template.php but couldn't find more than what I already wrote before.
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Herman's Mixen

  • SMF Hero
  • ******
  • Posts: 7,257
    • HermanMixen on Facebook
    • @Hermans_Mixen on Twitter
    • Herman's Mixen
Re: [TIP/TRICK] Remove register button
« Reply #12 on: June 10, 2014, 04:14:08 PM »
index.php

Code: [Select]
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa', 'login', 'login2', /*'register', 'register2',*/ 'reminder', 'activate', 'help', 'smstats', 'mailq', 'verificationcode', 'openidreturn'))))

remove the "register" and "register2" from that line

also in the array of actions disable it so it can not be executed...

Code: [Select]
/*'register' => array('Register.php', 'Register'),
'register2' => array('Register.php', 'Register2'),*/
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,459
Re: [TIP/TRICK] Remove register button
« Reply #13 on: June 10, 2014, 04:22:34 PM »
That should work.  All you're doing is removing the register link from the text string.  Yes, you would have to change it in any other languages that are installed.  There's also a register link in the login window that guests see if guest access is disabled.  That's in login.template.php in kick_guest template =

Code: [Select]

', $txt['login_below'], ' <a href="', $scripturl, '?action=register">', $txt['register_an_account'], '</a> ', sprintf($txt['login_with_forum'], $context['forum_name_html_safe']), '


Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [TIP/TRICK] Remove register button
« Reply #14 on: June 10, 2014, 04:26:18 PM »
If registration is actually disabled from the admin panel, all the effort of faffing with index.php to remove guestAccess and removing the actions is suddenly irrelevant.

Oh, and if you use Tapatalk too. That has all kinds of 'eh, don't care about SMF's settings or rules' in it.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #15 on: June 10, 2014, 05:07:53 PM »
If registration is actually disabled from the admin panel, all the effort of faffing with index.php to remove guestAccess and removing the actions is suddenly irrelevant.
Actually yes but I believe that any human being can understand this already :) People wanting to disable totally the guest access might be experienced users as they want their forum to be private-only so probably they would like to know how to totally delete that function that's why we are trying to get rid of all of those ;)

Oh, and if you use Tapatalk too. That has all kinds of 'eh, don't care about SMF's settings or rules' in it.
Did you have any doubt about it? It's Tapatalk xD




Anyway, updated :) check it (once again) if you don't mind ;)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [TIP/TRICK] Remove register button
« Reply #16 on: June 10, 2014, 05:09:12 PM »
But that's the point... if it's already disabled in the admin panel, you don't need to remove the declaration of the action, because it'll stop when it gets to the action itself.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #17 on: June 10, 2014, 05:12:53 PM »
I know it will not work anyhow even if people *will* be able to see it but the fact is that admins wanting their forum to be private-only for ever wouldn't like it to appear anyway as it's not possible. Why showing up an option if it doesn't work? It would be my point if I was admin of such a forum.

And besides thank you everyone huh! I couldn't do this all by myself, now I understand why noone had ever made this :P
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [TIP/TRICK] Remove register button
« Reply #18 on: June 10, 2014, 05:14:11 PM »
Just removing the reference in index.php like that only means the difference between an error message and a login box anyway ;)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #19 on: June 10, 2014, 05:18:52 PM »
Yeah indeed but *I* don't want the registration box xD login box is ok but no the registration one :P
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [TIP/TRICK] Remove register button
« Reply #20 on: June 10, 2014, 05:20:23 PM »
And you changing index.php won't magically fix that... ;) All the other changes, sure, but the changes to index.php won't do that.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #21 on: June 10, 2014, 05:24:58 PM »
*yells at the code thinking it's too complicated but asks kindly xD*
Then any clue on what else should I be doing to get totally rid of that bloody thingy before my patience goes away and I just say "do you want to do that? well delete everything and it will work  :P" just kidding, seriously is there anything else that I should say?
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,459
Re: [TIP/TRICK] Remove register button
« Reply #22 on: June 10, 2014, 05:26:09 PM »
FWIW, I run two private forums, and disabling registration works fine for me.  Really isn't any reason to remove the register buttons/links, because users get a message that registration is disabled.  The referenced thread that originated this idea is a completely different situation, where users register elsewhere on the website, and the SMF register buttons/links are not functional.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [TIP/TRICK] Remove register button
« Reply #23 on: June 10, 2014, 05:26:26 PM »
You need to change Subs.php to remove the menu button. You need to change the index.{language}.php file to remove the link to it. You also need to edit the login template.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,844
  • Master of BBC Abuse
Re: [TIP/TRICK] Remove register button
« Reply #24 on: June 10, 2014, 05:34:18 PM »
How about a really basic way of doing this, that requires only a minor CSS change?

Code: [Select]
#button_register {display: none;}
That will hide the button. Then just disable registration in admin. Sorted.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [TIP/TRICK] Remove register button
« Reply #25 on: June 10, 2014, 05:36:30 PM »
Except for the places it won't ;) Like the link that shows up to guests that says "Welcome guest! Please login or register" or the login page ;)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,844
  • Master of BBC Abuse
Re: [TIP/TRICK] Remove register button
« Reply #26 on: June 10, 2014, 05:39:29 PM »
Yeah but you could just edit language strings to handle those.* The thread is about the "register button". :P

*Which you can do via the admin interface, without needing to access any PHP files directly.

* Antechinus is trying to make things n00b-friendly here ;)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [TIP/TRICK] Remove register button
« Reply #27 on: June 10, 2014, 05:46:06 PM »
* except when it doesn't work 100% properly and requires elevated file permissions
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #28 on: June 10, 2014, 05:48:13 PM »
FWIW, I run two private forums, and disabling registration works fine for me.  Really isn't any reason to remove the register buttons/links, because users get a message that registration is disabled.
Well actually I would like it to disappear if it was to me. It sounds like as if I went to a dealership and I see a good car I ask for the price and the guy tells me no you can't buy it. And not because it would be a show car or something, just because I "can't" and well I don't like it. There is no possibility to do a thing? To hell with it I don't show it either ;)

The referenced thread that originated this idea is a completely different situation, where users register elsewhere on the website, and the SMF register buttons/links are not functional.
Indeed now because I slightly deviated from what I was thinking about.

You need to change Subs.php to remove the menu button. You need to change the index.{language}.php file to remove the link to it. You also need to edit the login template.
I'm about to cry but I don't give up, I want to learn something.
Then I found lots of stuff in the first file but I don't think I should be deleting everything but at least this, let's start:
Code: [Select]
'register' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
and set it like "/* stuff */"

Here as well:
Code: [Select]
elseif ($context['current_action'] == 'register2')
$current_action = 'register';
here again "/* stuff */"? Hope these ones works good. Let's continue.

Let's see the index.{language}.php
Code: [Select]
$txt['welcome_guest'] = 'Welcome, <strong>%1$s</strong>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
$txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
Replace with
Code: [Select]
$txt['welcome_guest'] = 'Welcome, <strong>%1$s</strong>. Please <a href="' . $scripturl . '?action=login">login</a> /* or <a href="' . $scripturl . '?action=register">register</a>.' */ ;
$txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a> /* or <a href="' . $scripturl . '?action=register">register</a>.' */ ;
?
Again I hope I'm right here as well.

And the 3rd file isn't already done in the first message of this topic atm?

*hopes he is correct, scared while waiting for his answer telling him he screwed up everything xD*
P.s. added 4 replies while posting this .-.
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #29 on: June 10, 2014, 05:50:31 PM »
How about a really basic way of doing this, that requires only a minor CSS change?

Code: [Select]
#button_register {display: none;}
Gotcha for this I'm gonna add it anyway.

EDIT: Except for the fact that I can't find it? I think that maybe it's because I start to be a bit tired Idk.. Pointing me there like a newb?  :-[
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,844
  • Master of BBC Abuse
Re: [TIP/TRICK] Remove register button
« Reply #30 on: June 10, 2014, 05:55:09 PM »
* except when it doesn't work 100% properly and requires elevated file permissions

Well ok then, so perhaps they have to use another admin page and do a basic chmod. They should know how to do that anyway (or will have to learn, anyway). My basic point is that although you can go through the entire codebase and completely remove all references to the register function, it's not necessary to do that to get a result that will satisfy most admins. It's more the sort of thing that appeals to devs. The average admin can use a much simpler method.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #31 on: June 10, 2014, 05:58:36 PM »
Well ok then, so perhaps they have to use another admin page and do a basic chmod. They should know how to do that anyway (or will have to learn, anyway). My basic point is that although you can go through the entire codebase and completely remove all references to the register function, it's not necessary to do that to get a result that will satisfy most admins. It's more the sort of thing that appeals to devs. The average admin can use a much simpler method.
Indeed it started to sound as if we were developing a whole mod here not just a tip xD
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [TIP/TRICK] Remove register button
« Reply #32 on: June 10, 2014, 06:02:00 PM »
That got me thinking... http://custom.simplemachines.org/mods/index.php?mod=3618 was what I found.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,844
  • Master of BBC Abuse
Re: [TIP/TRICK] Remove register button
« Reply #33 on: June 10, 2014, 06:03:34 PM »
Indeed it started to sound as if we were developing a whole mod here not just a tip xD

There are only three language strings that need editing in "General Strings". Those should take care of most of the publicly visible stuff. There may be one or two other strings that a really fussy admin might want to edit.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,844
  • Master of BBC Abuse
Re: [TIP/TRICK] Remove register button
« Reply #34 on: June 10, 2014, 06:05:56 PM »

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP/TRICK] Remove register button
« Reply #35 on: June 10, 2014, 06:08:11 PM »
That got me thinking... http://custom.simplemachines.org/mods/index.php?mod=3618 was what I found.
Yep but it somehow puts registration mode into a so-called maintenance mode.
Grabbed directly from the mod's code
Code: [Select]
$modSettings['registration_method'] != 3 && !$context['in_maintenance']) and things like that so it's pretty much different I would say *wew* :P
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [TIP/TRICK] Remove register button
« Reply #36 on: June 11, 2014, 09:55:27 AM »
All that code is doing is saying as long as registration isn't disabled completely, and the forum isn't in maintenance mode.