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
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.
Lainaus käyttäjältä: Krash - heinäkuu 27, 2014, 12:52:18 AP
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.
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.
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
You can download a menu mod and add ur new register button and remove the default one. :P
Lainaus käyttäjältä: Mstcool - heinäkuu 28, 2014, 02:40:11 AP
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.
Thats true but I was just talking about changing the menu link. :p
Eh, you'd hijack action=register to point to the other place if you were going down that route, minor tweak to index.php.
Lainaus käyttäjältä: ‽ - heinäkuu 28, 2014, 08:56:25 AP
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'),
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.
Will play with that tonight. What's the syntax to just redirect the action in index.php?
You just do an intercept on $_GET['action'] before the main checking goes and use redirectexit like I just said.
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! (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.thekrashsite.com%2Fpics%2Fthu.gif&hash=f4392e100b91a27ad55c137fafc83bec6aefd9cf)
Thx.
Yup, both ways work, and sometimes one will be better than the other.