Advertisement:

Author Topic: Remove the Register Button  (Read 3613 times)

Offline NicolasLiatti

  • Newbie
  • *
  • Posts: 7
Remove the Register Button
« on: June 09, 2014, 11:56:25 PM »
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

  • Guest
Re: Remove the Register Button
« Reply #1 on: June 10, 2014, 05:46:28 AM »
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:

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

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

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,571
Re: Remove the Register Button
« Reply #2 on: June 10, 2014, 06:20:09 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

  • Guest
Re: Remove the Register Button
« Reply #3 on: June 10, 2014, 06:25:19 AM »
That's eminently sensible, innit? :)

Offline mashby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,394
  • Gender: Male
  • badass beer hound
    • Choppix
Re: Remove the Register Button
« Reply #4 on: June 10, 2014, 06:29:35 AM »
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

  • Guest
Re: Remove the Register Button
« Reply #5 on: June 10, 2014, 06:36:26 AM »
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!

Offline mashby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,394
  • Gender: Male
  • badass beer hound
    • Choppix
Re: Remove the Register Button
« Reply #6 on: June 10, 2014, 07:00:49 AM »
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

  • Guest
Re: Remove the Register Button
« Reply #7 on: June 10, 2014, 07:04:24 AM »
Ours is not to reason why. Ours is but to do and get told off for doing it wrong. ;)

Offline NicolasLiatti

  • Newbie
  • *
  • Posts: 7
Re: Remove the Register Button
« Reply #8 on: June 10, 2014, 07:13:43 AM »
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

  • Guest
Re: Remove the Register Button
« Reply #9 on: June 10, 2014, 07:17:46 AM »
Cool! Let us know if you get this working, yeah?

Offline Steve

  • Freak
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,500
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Remove the Register Button
« Reply #10 on: June 10, 2014, 08:00:25 AM »
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. :)
Online Manual

Please do not PM me for support.

Offline mashby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,394
  • Gender: Male
  • badass beer hound
    • Choppix
Re: Remove the Register Button
« Reply #11 on: June 10, 2014, 08:02:25 AM »
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

Offline Steve

  • Freak
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,500
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Remove the Register Button
« Reply #12 on: June 10, 2014, 08:03:35 AM »
Yea, but how would they register if I didn't have it disabled and there's no button?
Online Manual

Please do not PM me for support.

Offline Morsyl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Remove the Register Button
« Reply #13 on: June 10, 2014, 08:42:50 AM »
You can still access the registration form through /index.php?action=register


Offline Steve

  • Freak
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,500
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Remove the Register Button
« Reply #14 on: June 10, 2014, 08:59:36 AM »
... I be an idjit sometimes ...
Online Manual

Please do not PM me for support.

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Remove the Register Button
« Reply #15 on: June 10, 2014, 10:13:57 AM »
Menu Editor Lite + Menu Editor Pro

Or make the modification(s) suggested above.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,152
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Remove the Register Button
« Reply #16 on: June 10, 2014, 01:43:32 PM »
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