News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Disable self registration

Started by sonnyh, July 08, 2019, 08:15:09 AM

Previous topic - Next topic

sonnyh

Hi,
I have the self register turned off.
Is there a way to remove the "Register" button?
If not is there a way to change the message that pops up when register is selected?

GigaWatt

You can disable registrations all together ;).

Admin --> Members --> Registration --> Settings --> Method of registration employed for new members: Registration Disabled
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Illori

Quote from: GigaWatt on July 08, 2019, 08:35:44 AM
You can disable registrations all together ;).

Admin --> Members --> Registration --> Settings --> Method of registration employed for new members: Registration Disabled

they said they have done that already, that does not remove the registration button.

GigaWatt

Then the OP would have to do manual edits :-\.

PS: Why doesn't the Registration button disappear when registrations are disabled? Seems logical to make it appear and disappear based on whether the forum's admin wants registrations enabled or disabled. 
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Kindred

note: not fully tested...


Code (in Subs.php -- search for) Select

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



Code (replace with) Select

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

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Quote from: GigaWatt on July 08, 2019, 08:57:53 AM
Why doesn't the Registration button disappear when registrations are disabled? Seems logical to make it appear and disappear based on whether the forum's admin wants registrations enabled or disabled. 

This has been done in 2.1, and I think it's a bad idea, especially if there's no contact link on the forum.  People visiting a forum they're interested in for first time expect to see some means or instructions for registering.  If there's nothing, it leaves them floundering with no way to join the forum, and no explanation why they can't.  We sometimes see posts here from people who are unable to join forums, and have no way of contacting a forum admin.

I think it's a bad idea. >:(
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

usually those that cant register and come here, cannot complete registration due to a question they cannot answer not because the registration is disabled.

Sir Osis of Liver

There are various reasons why people come here with registration questions, most commonly that they can't register and there's no way to contact an admin.  But that kind of misses the point.  Running a public forum with no registration or contact link is a good way to discourage visitors from ever returning.  In 2.0 there's at least a message that registration is disabled, it's better than giving them nothing.  I've restored the button and message on my RC2 work install, it's not a big deal and provides a basic courtesy to visitors.

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

                                     - R. Waters

GigaWatt

You have a point there Sir Osis of Liver... but... if it's a private forum and the owner doesn't want anyone to register or contact him/her, IMO that's a valid reason to have the Registration button disabled. He/she might not want visitors returning... in the admin's eyes, maybe discouraging visitors to visit the site is a good thing ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

sonnyh

Thank you for the replies.
This is, in fact, a private forum, where registration is done by the admin based on certain required vetting.

The code provided by "Kindred" was helpful and did remove one of the registration buttons on the guest page.
Thank you Kindred.

There is one other are on the right of the guest page that says " Welcome, Guest. Please login or register" which I would also like to get rid of.

I would appreciate any suggestions.

Again, thank you for all the replies.

Best,
Sonny

Sir Osis of Liver

You can edit the text here -

/Themes/default/languages/index.english.php



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



  or remove it here -

index.template.php



// 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>';


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

                                     - R. Waters

Sir Osis of Liver

Quote from: GigaWatt on July 08, 2019, 08:28:56 PM
if it's a private forum and the owner doesn't want anyone to register or contact him/her, IMO that's a valid reason to have the Registration button disabled. He/she might not want visitors returning... in the admin's eyes, maybe discouraging visitors to visit the site is a good thing ;).

My two production forums are private, invitation only.  Registration is disabled on my family forum, admin approval on my support forum.  I don't have any problem with the registration button, have never had a bot register or spammer post on either forum.  If visitors or spiders are seeing the forum, it's unavoidable, but has no effect on the forum or my members.  It's just not a problem.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Aleksi "Lex" Kilpinen

Quote from: Sir Osis of Liver on July 08, 2019, 12:24:13 PM
Quote from: GigaWatt on July 08, 2019, 08:57:53 AM
Why doesn't the Registration button disappear when registrations are disabled? Seems logical to make it appear and disappear based on whether the forum's admin wants registrations enabled or disabled. 

This has been done in 2.1, and I think it's a bad idea, especially if there's no contact link on the forum.  People visiting a forum they're interested in for first time expect to see some means or instructions for registering.  If there's nothing, it leaves them floundering with no way to join the forum, and no explanation why they can't.  We sometimes see posts here from people who are unable to join forums, and have no way of contacting a forum admin.

I think it's a bad idea. >:(

Going off topic, but I agree with you. I believe the original idea to keep the button and offer an explanation was done just because of this. It can be confusing to find a forum that you don't know how to register to, or are unsure if you even can.
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

sonnyh

Thanks to Sir Osis of Liver for location of "Welcome Guest line"

Thank you all for the help and discussion regarding this issue.

Best,
Sonny

Mareid

#14
I want to do the same thing, disable the "Register" button.  What I've done is provided a forum called "Click HERE to register or retrieve a lost password/user ID" and within that forum are just two posts, one telling potential registrants to send an email to [email protected], and the other saying how to retrieve a lost password.  Still, my unsophisticated potential users are confused and click the "Register" button in the menu above, which leads to more confusion when they get the "Registrations are disabled" message.  I'd also like to get rid of the search box (not shown in the screenshot) in the upper right corner, but I can live with that.





Kindred's code worked great!

Advertisement: