How can I hide some items in the Registration form?

Started by User2, July 10, 2021, 02:51:47 AM

Previous topic - Next topic

User2

Hello, how do I hide the items in the Registration form that I have surrounded with a red frame?

Aleksi "Lex" Kilpinen

For the first one, you can try this mod Disable EMail-sending for users
For the second one, I think it's really better you leave it there.
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

User2

Aleksi "Lex" Kilpinen, why do you suggest leaving the second item? It is difficult to remove it, which can disrupt the forum. Or do you just evaluate it as a user - do you think that it is necessary for the user?

Aleksi "Lex" Kilpinen

Both, it actually has a function, and it is a valuable setting for both the users and your own protection. If you remove it, any possible newsletter you send will never reach anyone, unless you always override that and send it to all. And that could be seen as spamming.
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

GL700Wing

Quote from: Participant on July 10, 2021, 02:51:47 AM
Hello, how do I hide the items in the Registration form that I have surrounded with a red frame?
In ./Themes/default/Register.template.php

Around line 166:
Find:
<dt><strong><label for="allow_email">', $txt['allow_user_email'], ':</label></strong></dt>
<dd>
<input type="checkbox" name="allow_email" id="allow_email" tabindex="', $context['tabindex']++, '" class="input_check" />
</dd>
</dl>';


Replace With:
</dl>';
//<dt><strong><label for="allow_email">', $txt['allow_user_email'], ':</label></strong></dt>
//<dd>
//<input type="checkbox" name="allow_email" id="allow_email" tabindex="', $context['tabindex']++, '" class="input_check" />
//</dd>




Around line 228:
Find:
if (!empty($context['announcements_ask']))
echo '
<dl class="register_form" id="notify_announcements_group">
<dt><strong><label for="notify_announcements">', $txt['notify_announcements'], ':</label></strong></dt>
<dd>
<input type="checkbox" name="notify_announcements" id="notify_announcements" tabindex="', $context['tabindex']++, '" class="input_check"', (!empty($context['notify_announcements']) ? ' checked="checked"' : ''), ' />
</dd>
</dl>';



Replace With:

//if (!empty($context['announcements_ask']))
//echo '
//<dl class="register_form" id="notify_announcements_group">
//<dt><strong><label for="notify_announcements">', $txt['notify_announcements'], ':</label></strong></dt>
//<dd>
//<input type="checkbox" name="notify_announcements" id="notify_announcements" tabindex="', $context['tabindex']++, '" class="input_check"', (!empty($context['notify_announcements']) ? ' checked="checked"' : ''), ' />
//</dd>
//</dl>';

Life doesn't have to be perfect to be wonderful ...

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

User2

Aleksi "Lex" Kilpinen, I do not have any important information on the forum and user accounts have no value either.
It's another matter if changing the forum code can break the forum code and the forum will stop working.

Aleksi "Lex" Kilpinen

Okay, then if you really only want to hide the question, look for setting "Allow users to disable announcements".
Turning this off will do it so that it is not asked, and if you do decide to use the newsletters it will send out to everyone by default.
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

GL700Wing

Quote from: Aleksi "Lex" Kilpinen on July 10, 2021, 03:14:28 AM
Okay, then if you really only want to hide the question, look for setting "Allow users to disable announcements".
Turning this off will do it so that it is not asked, and if you do decide to use the newsletters it will send out to everyone by default.
I just tested on SMF 2.0.18 (no mods installed) and even with the 'Allow users to disable announcements' setting enabled the option 'Allow the administrators to send me important news by email:' is still shown on the registration form.
Life doesn't have to be perfect to be wonderful ...

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

Aleksi "Lex" Kilpinen

Quote from: GL700Wing on July 10, 2021, 03:19:59 AM
Quote from: Aleksi "Lex" Kilpinen on July 10, 2021, 03:14:28 AM
Okay, then if you really only want to hide the question, look for setting "Allow users to disable announcements".
Turning this off will do it so that it is not asked, and if you do decide to use the newsletters it will send out to everyone by default.
I just tested on SMF 2.0.18 (no mods installed) and even with the 'Allow users to disable announcements' setting enabled the option 'Allow the administrators to send me important news by email:' is still shown on the registration form.
No, disable it. Enabling it adds the setting in the registration form.
Edit: Also to make sure, I tested this as well with a fresh 2.0.18 just now and seems to work as intended for me.
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

GL700Wing

Quote from: Aleksi "Lex" Kilpinen on July 10, 2021, 03:20:54 AM
No, disable it. Enabling it adds the setting in the registration form.
Edit: Also to make sure, I tested this as well with a fresh 2.0.18 just now and seems to work as intended for me.
Correct - I was looking at a different setting.

Edit: In which case the second code edit I suggested is not required ...
Life doesn't have to be perfect to be wonderful ...

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

Aleksi "Lex" Kilpinen

Quote from: GL700Wing on July 10, 2021, 03:37:19 AM
Quote from: Aleksi "Lex" Kilpinen on July 10, 2021, 03:20:54 AM
No, disable it. Enabling it adds the setting in the registration form.
Edit: Also to make sure, I tested this as well with a fresh 2.0.18 just now and seems to work as intended for me.
Correct - I was looking at a different setting.
Thanks for confirming :)
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

User2

Aleksi "Lex" Kilpinen, GL700Wing, thank you.
I used the mod to disable the first item and removed the checkbox for the second item.

Aleksi "Lex" Kilpinen

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

Advertisement: