News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Where is the code for the Register button?

Started by peterinwa, July 05, 2014, 03:30:01 PM

Previous topic - Next topic

peterinwa

In version 1.x it was in index.template.php. You can see in this version 1.x code how I changed it so that clicking on the button took you to my own instructions for registering:

// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="http://www.myschnauzer.net/forums/index.php?board=2.0">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


I register members via e-mail to eliminate jerks!

But I can't find similar code in version 2.x.

Thanks, Peter
Here's my forum:  www.MySchnauzer.net/forums

margarett

In 2.0, menu buttons are defined in Subs.php for cross-theme compatibility ;)

How do I add buttons to SMF 2.0?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

peterinwa

#2
Thank you, but the punctuation is different from my change in version 1.x and I don't want to mess it up. Could you please show me just how to insert my url:

http://www.myschnauzer.net/forums/index.php?topic=5309.0

Into the existing code in Sources > Subs.php:

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


I want to bypass the entire registration process and have the Register link/button simply take them to my instructions.

Thanks in advance! You've helped me many times.

Peter
Here's my forum:  www.MySchnauzer.net/forums

Illori

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


this will replace the normal url with a link to topic 5309. you would need to disable registration so that users can not use the normal process.

peterinwa

Wonderful!

How else could they get to the register code? If they can I think I'll change the note there, too, to direct them to my instructions.

Thank you.
Here's my forum:  www.MySchnauzer.net/forums

Kindred

There are several other places,  none of which are as straight forward as the menu.

you eoukd be better just turning off registration completely if you intend to  try to bypass standard functionality in that way
Сл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."

NanoSector

If you're paranoid, removing one line in index.php that starts with: 'register' =>
will disable registration functionality altogether, but as Kindred said toggling it off in the admin panel will also work.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

peterinwa

Good to know. I was thinking I might remove the code for registration altogether, but then thought that might keep ME from being able to register new members!

I just figured then "robots" couldn't get in.

I'll go with the Admin shut-off for now.

Thanks everyone!

Peter

Here's my forum:  www.MySchnauzer.net/forums

a10

#8
Maybe this? With registration disabled, change "Sorry, registration is currently disabled." (Themes\default\languages\Errors.english.php) into some message, link or whatever, example:

['registration_disabled'] = 'To register, send an email to [email protected] or visit <a href="http://123zxc123.org">123zxc123.org</a> for instructions.';
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Advertisement: