News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Help find this link in file

Started by Yes-U-Can, July 26, 2014, 10:36:42 PM

Previous topic - Next topic

Yes-U-Can

Can someone help me and tell me on which file i can find the "register an account" link in the shot,, want to route it different but i am new to smf and i just can't locate it..Thank you in advance
Bullying people is not right, STOP YOUR BULLYING GROW UP AND BE AN ADULT!!!

Sir Osis of Liver

It's in the kick_guest template in Login.template.php -



// Show the message or default message.
echo '
<p class="information centertext">
', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />
', $txt['login_below'], ' <a href="', $scripturl, '?action=register">', $txt['register_an_account'], '</a> ', sprintf($txt['login_with_forum'], $context['forum_name_html_safe']), '
</p>';



Bear in mind there are other register links elsewhere that do the same thing.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Yes-U-Can

Quote from: Krash on July 27, 2014, 12:52:18 AM
It's in the kick_guest template in Login.template.php -



   // Show the message or default message.
   echo '
         <p class="information centertext">
            ', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />
            ', $txt['login_below'], ' <a href="', $scripturl, '?action=register">', $txt['register_an_account'], '</a> ', sprintf($txt['login_with_forum'], $context['forum_name_html_safe']), '
         </p>';



Bear in mind there are other register links elsewhere that do the same thing.




Thank you , Thank you  Krash..
Yes,  i am aware of the others.  but i am still learning the coding from smf :)  ex: action=register
Thanks again for that.
Bullying people is not right, STOP YOUR BULLYING GROW UP AND BE AN ADULT!!!

Sir Osis of Liver

Don't know exactly what you're trying to do, but there's a simple way to redirect all register links without having to find/edit each one.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Yes-U-Can

Hello Krash, i wanted to redirect that link and the others i did find to my register.php page from our site, as that is what i prefer as  site requires more input information when registering..Not long ago we added SMF to register in site with same password , same username etc etc with main site..I'm still working on it, have a bits more work to do..If you like to help me ,


Can you post it up how you say it's alot easier to do it with them links..Thank i really do appreciate anyone that helps me out.
Thanks again
Bullying people is not right, STOP YOUR BULLYING GROW UP AND BE AN ADULT!!!

Mstcool

You can download a menu mod and add ur new register button and remove the default one. :P

Illori

Quote from: Mstcool on July 28, 2014, 02:40:11 AM
You can download a menu mod and add ur new register button and remove the default one. :P

that does not fix all the links in various other places.

Mstcool

Thats true but I was just talking about changing the menu link. :p

Arantor

Eh, you'd hijack action=register to point to the other place if you were going down that route, minor tweak to index.php.

Sir Osis of Liver

Quote from: ‽ on July 28, 2014, 08:56:25 AM
Eh, you'd hijack action=register to point to the other place if you were going down that route, minor tweak to index.php.

Couldn't get that to work. >:(

You can also create a new function in Register.php that's just a redirect, like this:



/// Register redirect
function RegisterRedirect()
{
header( 'Location: http://www.simplemachines.org' ) ;
}



... then change the action in index.php to this:



'register' => array('Register.php', 'RegisterRedirect'),


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

                                     - R. Waters

Arantor

Cannot recommend that.

Either use redirectexit('http://site.com'); or use the header with an exit statement to prevent further execution since browsers can choose to ignore Location headers.

Sir Osis of Liver

Will play with that tonight.  What's the syntax to just redirect the action in index.php?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

You just do an intercept on $_GET['action'] before the main checking goes and use redirectexit like I just said.

Sir Osis of Liver

Ok, you mean like this -

index.php



// The main controlling function.
function smf_main()
{
global $modSettings, $settings, $user_info, $board, $topic, $board_info, $maintenance, $sourcedir;

/// Register redirect
if (isset($_GET['action']) && $_GET['action'] == 'register')
{
redirectexit('http://www.simplemachines.org');
}



Then using new function would be like this -

index.php



'register' => array('Register.php', 'RegisterRedirect'),



... and Register.php




/// Register redirect
function RegisterRedirect()
{
redirectexit('http://www.simplemachines.org');
}



Both werk gud!

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

                                     - R. Waters

Arantor

Yup, both ways work, and sometimes one will be better than the other.

Advertisement: