Remove the Register Button

Started by NicolasLiatti, June 09, 2014, 11:56:25 PM

Previous topic - Next topic

NicolasLiatti

Hi,

Our forum is linked to our main site, and uses the same account system. I would thus like to remove the "Register" button and keep only the log in one.
How can I do it?

Cheers,
Nicolas

kat

If you disable registration, in SMF, the button should vanish.

Otherwise, have a look at Subs.php.

I think you'll find that getting rid of this:

'register' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),


will remove it. :) (Keep a copy of the file, as a backup, in case I've goofed)

Illori

Quote from: K@ on June 10, 2014, 05:46:28 AM
If you disable registration, in SMF, the button should vanish.


nope the button does not disappear when registration has been disabled. you just get an error when you go to the registration page that it has been disabled.

kat

That's eminently sensible, innit? :)

mashby

Alternatively, rather than removing that code, one could edit it like this:
Quote'register' => array(
            'title' => $txt['register'],
            'href' => $scripturl . '?action=register',
            'show' => false,
            'sub_buttons' => array(
            ),
            'is_last' => !$context['right_to_left'],
         ),
I'd guess Register is left in the menu so that when viewed, guests are informed that registration is closed. :)
Always be a little kinder than necessary.
- James M. Barrie

kat

That'd be a far better option, really, wouldn't it?

If the feature was required, later, the "false" could be changed to "true".

Good finkin', doooood!

mashby

Of course, I'm really curious as to how users register on the main site, but I'll let that not trouble me.
Always be a little kinder than necessary.
- James M. Barrie

kat

Ours is not to reason why. Ours is but to do and get told off for doing it wrong. ;)

NicolasLiatti

Thanks, I'll have a try!

Regarding the way to register: our users create an account on our main site (in Drupal), and when they want to log in on the forum we have a module which is checking the drupal database. So currently the "Register" button on the forum doesn't really work, and that's why I want to get rid of it.

Cheers,

kat

Cool! Let us know if you get this working, yeah?

Steve

Thanks mashby! As mine is a private forum there isn't a need for a register button so removing it will also prevent the spammers from registering. :)
DO NOT pm me for support!

mashby

Cool...although, just making the button go away doesn't really disable spammers from registering. Do you have registration disabled? I'm thinking you might, just clarifying :)
Always be a little kinder than necessary.
- James M. Barrie

Steve

Yea, but how would they register if I didn't have it disabled and there's no button?
DO NOT pm me for support!

Morsyl

You can still access the registration form through /index.php?action=register


Steve

... I be an idjit sometimes ...
DO NOT pm me for support!

Matthew K.

Menu Editor Lite + Menu Editor Pro

Or make the modification(s) suggested above.

Ninja ZX-10RR

As it was not present in that section I just made a topic in smf coding discussion requesting to be moved to tips and tricks as requested here.
You can find it here at the moment--> http://www.simplemachines.org/community/index.php?topic=523714.0
Additionally credits go to mashby for pointing us there ;)
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

Advertisement: