|
Page 1 of 1
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
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
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#1 Sun 17 May, 2009 21:08 |
|
Sponsors
|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
Inactive User
|
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:
Redirect After Registration
##############################################################
# Title: Redirect After Registration
# Author: Thoul thoul@users.sourceforge.net h**p://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
# h**p://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 . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
#
#-----[ REPLACE WITH ]------------------------------------------
#
/* Original phpBB code - commented out for Redirect After Registration
$message = $message . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
*/
//---------------------------------------------------------------------------------
// 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 . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid($register_redirect) . '">', '</a>');
$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="5;url=' . append_sid($register_redirect) . '">')
);
}
//
// 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
|
#2 Mon 18 May, 2009 00:53 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: Goto A Certain Page After Login Second Time
thanks Lopalong I will have a look at that mod
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#3 Mon 18 May, 2009 09:01 |
|
Inactive User
|
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.
|
#4 Mon 18 May, 2009 12:53 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
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...
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#5 Mon 18 May, 2009 13:34 |
|
Inactive User
|
Re: Goto A Certain Page After Login Second Time
You didn't waste any time with it did you?
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 HATE doing things MORE than once.
Description: |
|
Download |
Filename: |
redirect.zip |
Filesize: |
53.19 KB |
Downloaded: |
229 Time(s) |
|
#6 Mon 18 May, 2009 13:59 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
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 ...
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#7 Mon 18 May, 2009 14:39 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|