Tutorial
How to change the page your members land on (redirect to) after login.

By default your members will see the member.php after logging in. Many prefer that their members see the profile page after logging in like most other popular social networking sites do.

You can easily accomplish this by adding 1 piece of small code to /member.php.

First backup your original member.php file.

Open member.php in your main dolphin directory and find:

$_page['name_index'] = 150;
$_page['css_name'] = '';

$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = MsgBox( _t( '_Please Wait' ) );
$_page_cont[$_ni]['url_relocate'] = htmlspecialchars( $sUrlRelocate );
PageCode();

Add the following code: $sUrlRelocate = getProfileLink($member['ID']);

Right before / above:
$_page_cont[$_ni]['url_relocate'] = htmlspecialchars( $sUrlRelocate );

Like:
$_page['name_index'] = 150;
$_page['css_name'] = '';

$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = MsgBox( _t( '_Please Wait' ) );
$sUrlRelocate = getProfileLink($member['ID']);
$_page_cont[$_ni]['url_relocate'] = htmlspecialchars( $sUrlRelocate );
PageCode();

Save and reupload.

Tested with Dolphin 6.1.4 with mod_rewrite enabled and friendly permalinks

If your host has mod_rewrite disabled or off and you have disabled friendly permalinks in your admin panel you will need to use a slightly different code.

If your members profile pages work as yoursite.com/member-name This will work as is.

If your members profile pages have the permalink/mod_rewrite off such as:
yoursite.com/profile.php?ID=1

You will need to change the code slightly such as:
$sUrlRelocate = '/profile.php?ID='.$member['ID'];

If you want members to land on a page other than profile page such as news you will have to adjust the code to reflect the page you want them to land on.

Such as after signing in you want them to land on news.php

$sUrlRelocate = '/news.php';

Example with mod_rewrite:

$_page['name_index'] = 150;
$_page['css_name'] = '';

$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = MsgBox( _t( '_Please Wait' ) );
$sUrlRelocate = getProfileLink($member['ID']);
$_page_cont[$_ni]['url_relocate'] = htmlspecialchars( $sUrlRelocate );
PageCode();

Example no mod_rewrite/friendly permalinks disabled:
$_page['name_index'] = 150;
$_page['css_name'] = '';

$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = MsgBox( _t( '_Please Wait' ) );
$sUrlRelocate = '/profile.php?ID='.$member['ID'];
$_page_cont[$_ni]['url_relocate'] = htmlspecialchars( $sUrlRelocate );
PageCode();

Example with news.php after login:
$_page['name_index'] = 150;
$_page['css_name'] = '';

$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = MsgBox( _t( '_Please Wait' ) );
$sUrlRelocate = '/news.php';
$_page_cont[$_ni]['url_relocate'] = htmlspecialchars( $sUrlRelocate );
PageCode();

 
Written By
Tutorial by: Jeremy LeSarge (AKA Ray)

I am the owner and administrator of DialMe.com. I write Tutorials for Boonex Dolphin as well as tips and resources surrounding website programming and development. I enjoy working with WordPress, SEO, and Web Hosting / Servers. I also maintain a WordPress Blog here on this site where you will find a variety of technology and webmaster resources.

Actions
Sponsored Links
Recommend