https://www.icyphoenix.com/viewtopic.php?f=35&t=5856 ----------------------------------- DWho Sun 17 May, 2009 21:08 Goto A Certain Page After Login Second Time ----------------------------------- ok do not know if this is possible... can it be done that after a member registeres and then logins for the the first time they goto a certain page.... then everyone login after that they go to the normal page... for example goto page.php after first login and then goto portal.php after second and every other login... thanks for any help :mrgreen: :mrgreen: ----------------------------------- Lopalong Mon 18 May, 2009 00:53 Re: Goto A Certain Page After Login Second Time ----------------------------------- I suppose that one could create an argument in login_ip.php based on registration, post count or visits etc, to send the user to the "New Page" else => Normal Page. You could also try to convert this: [b]Redirect After Registration[/b] [spoiler][code linenumbers=false]############################################################## # Title: Redirect After Registration # Author: Thoul thoul@users.sourceforge.net http://darkmods.sourceforge.net # Description: Allows redirection on the registration confirmation page. # Version: 2.3.4 # Installation Level: Easy # Installation Time: 5 Minutes # Files To Edit: includes/usercp_register.php, login.php # Included Files: n/a ############################################################## # Author's Notes: # This MOD allows you to redirect a user, to a page you specify, after they've # registered. You have an option of allowing the user to be automatically logged in # on that page also. (Don't confuse this phpBB's "Log me on automatically each # visit" feature - this is a one time login. Usually, anyway.) # # There are four variables in the code to be added that you can change to modify # how this mod behaves. They are found on these lines: # $register_redirect = "index.$phpEx"; # $rds_auto_login = TRUE; # $rds_auto_each_login = 1; # $rds_outside = FALSE; # # $register_redirect should be set to the url of the page to which the user will be # redirected after registering. For example, if you want them to go to # http://site.com/index.html, that line needs to read: # $register_redirect = '/index.html'; # # If you are redirecting users to pages outside of your phpBB directories (aka # folders), be sure to read the file function_change.txt also. It contains other # modifications and instructions that you will need to read. # # $rds_auto_login should be set to either TRUE or FALSE. If it is true and your # board does not require account activation, then the user will automatically be # logged in when sent to the page specified in $register_redirect (assuming that # page is a phpBB enabled page). The registration confirmation page will not be # displayed in this case. If $rds_auto_login is FALSE or your board does require # account activation, then the user is redirected to the page specified in # $register_redirect and the registration confirmation page will be displayed. # Examples: # $rds_auto_login = TRUE; # $rds_auto_login = FALSE; # # $rds_auto_each_login should be set to either TRUE or FALSE. If it is set to true, # then the user will automatically be logged in each visit (just as if they had # checked the box on the login page). # Examples: # $rds_auto_each_login = TRUE; # $rds_auto_each_login = FALSE; # # (Special Notes: If you are familiar enough with phpBB, it's possible to add # options to the registration form that will let the user choose if they want to # be logged in automatically after registering ($rds_auto_login) or logged in # automatically each visit ($rds_auto_each_login). I might add it to a future # version of the mod as well, if someone wants the code for it.) ############################################################## # BEFORE ADDING THIS TO YOUR FORUM, YOU SHOULD BACK UP ALL RELATED FILES. ############################################################## # #-----[ OPEN ]------------------------------------------ # includes/usercp_register.php # #-----[ FIND ]------------------------------------------ # $message = $message . '

' . sprintf($lang['Click_return_index'], '', ''); # #-----[ REPLACE WITH ]------------------------------------------ # /* Original phpBB code - commented out for Redirect After Registration $message = $message . '

' . sprintf($lang['Click_return_index'], '', ''); */ //--------------------------------------------------------------------------------- // Redirect After Registration - Begin Code Addition // $register_redirect = 'index.' . $phpEx; // Automatically log user in after registering? TRUE or FALSE $rds_auto_login = TRUE; // Automatically log user in each visit? TRUE or FALSE $rds_auto_each_login = TRUE; // Redirecting to a url outside phpBB directories? TRUE or FALSE $rds_outside = FALSE; if ( $rds_auto_login && $board_config['require_activation'] == USER_ACTIVATION_NONE ) { $login_str = '?username=' . urlencode($username) . '&password=' . urlencode($password_confirm) . '&login=Login'; if ( $rds_auto_each_login ) { $login_str .= '&autologin=1'; } $redirect_str = '&redirect=' . $register_redirect; if ( $rds_outside ) { $redirect_str .= '&outside=1'; } redirect(append_sid('login.' .$phpEx . $login_str . $redirect_str, true)); } else { $message = $message . '

' . sprintf($lang['Click_return_index'], '', ''); $template->assign_vars(array( "META" => '') ); } // // Redirect After Registration - End Code Addition //--------------------------------------------------------------------------------- # #-----[ OPEN ]------------------------------------------ # login.php # #-----[ FIND ]------------------------------------------ # $username = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars($HTTP_POST_VARS['username'])) : ''; # #-----[ REPLACE WITH ]------------------------------------------ # /* Original phpBB code - commented out for Redirect After Registration $username = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars($HTTP_POST_VARS['username'])) : ''; */ //--------------------------------------------------------------------------------- // Redirect After Registration - Begin Code Addition // $username = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : (isset($HTTP_GET_VARS['username']) ? urldecode($HTTP_GET_VARS['username']) : ''); $username = trim(htmlspecialchars($username)); // // Redirect After Registration - End Code Addition //--------------------------------------------------------------------------------- # #-----[ FIND ]------------------------------------------ # $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : ''; # #-----[ REPLACE WITH ]------------------------------------------ # /* Original phpBB code - commented out for Redirect After Registration $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : ''; */ //--------------------------------------------------------------------------------- // Redirect After Registration - Begin Code Addition // $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : (isset($HTTP_GET_VARS['password']) ? urldecode($HTTP_GET_VARS['password']) : ''); // // Redirect After Registration - End Code Addition //--------------------------------------------------------------------------------- # #-----[ FIND ]------------------------------------------ # $autologin = ( isset($HTTP_POST_VARS['autologin']) ) ? TRUE : 0; # #-----[ REPLACE WITH ]------------------------------------------ # /* Original phpBB code - commented out for Redirect After Registration $autologin = ( isset($HTTP_POST_VARS['autologin']) ) ? TRUE : 0; */ //--------------------------------------------------------------------------------- // Redirect After Registration - Begin Code Addition // $autologin = isset($HTTP_POST_VARS['autologin']) ? TRUE : ( isset($HTTP_GET_VARS['autologin'] ) ? TRUE : 0); // // Redirect After Registration - End Code Addition //--------------------------------------------------------------------------------- # #-----[ FIND ]------------------------------------------ # if( $session_id ) { $url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx"; redirect(append_sid($url, true)); } # #-----[ REPLACE WITH ]------------------------------------------ # /* Original phpBB code - commented out for Redirect After Registration if( $session_id ) { $url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx"; redirect(append_sid($url, true)); } */ //--------------------------------------------------------------------------------- // Redirect After Registration - Begin Code Addition // if( $session_id ) { $url = ( !empty($_REQUEST['redirect']) ) ? str_replace('&', '&', htmlspecialchars(addslashes($_REQUEST['redirect']))) : 'index.' . $phpEx; $outside = ( !empty($_REQUEST['outside']) ) ? true : false; redirect(append_sid($url, true), $outside); } // // Redirect After Registration - End Code Addition //--------------------------------------------------------------------------------- # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # End[/code][/spoiler] ----------------------------------- DWho Mon 18 May, 2009 09:01 Re: Goto A Certain Page After Login Second Time ----------------------------------- thanks Lopalong I will have a look at that mod :mrgreen: :mrgreen: ----------------------------------- Lopalong Mon 18 May, 2009 12:53 Re: Goto A Certain Page After Login Second Time ----------------------------------- Shouldn't be too difficult. ;) I look forward to you doing it and completing the MOD with an example .php file and template to make it so much easier for others wanting to do the same thing. :P ----------------------------------- DWho Mon 18 May, 2009 13:34 Re: Goto A Certain Page After Login Second Time ----------------------------------- It works brilliantly.. thanks very much... I will write it up as a mod and make it available on final version... :mrgreen: :mrgreen: ----------------------------------- Lopalong Mon 18 May, 2009 13:59 Re: Goto A Certain Page After Login Second Time ----------------------------------- You didn't waste any time with it did you? :mricy: Here's the whole MOD that contains a lot of other re-direct stuff that I couldn't see as being very useful. Who knows, you may look at it differently. ;) And me, I'm not bothering to do too much at all until the final stable release of IP, as I [u][b]HATE[/b][/u] doing things [i][b]MORE [/b][/i]than once. ----------------------------------- DWho Mon 18 May, 2009 14:39 Re: [SOLVED] Goto A Certain Page After Login Second Time ----------------------------------- great thanks... I will have a look as I also want to redirect a user after posting back to the news category bypassing the forum page... thanks again yep I agree I will not release anything more till the final version... to many mods done and now to many upgrades to do ... :mryellow: :mryellow: :mrgreen: :mrgreen: