redirect splash.php to index.php when member login

OK  When a guest go on mysite.com they get redirect to  splash.php if they are not login. when they logo out they go back to splash.php

 

So when Not login  mysite.com --redirect--- > splash.php

When login splash.php --redirect--- >member.php

if not login  Any URL--redirect--- > splash.php

 

Help Plz how do i do this

Quote · 4 Sep 2010

This free mod from Deano will let you set the page to redirect people to on login:

 

http://www.boonex.com/unity/extensions/entry/Redirect_to_any_page_after_logon_

 

Hope that is what you are looking for.

 

Geri

Quote · 4 Sep 2010

Thanks but its not that

Quote · 4 Sep 2010

any one plz

Quote · 4 Sep 2010

Does your site not already go to member.php after logon? That is the normal default behavior.

Also. For guests. Do you need them redirected to spash.php regardless of what page they go to, or only for the default index.php.

https://www.deanbassett.com
Quote · 4 Sep 2010

 

Does your site not already go to member.php after logon? That is the normal default behavior.

Also. For guests. Do you need them redirected to spash.php regardless of what page they go to, or only for the default index.php.

if anyone is not login they get redirect to spash.php no matter what URL type use on my site

Quote · 5 Sep 2010

Did you build you spash page in page builder?

Or did you make a custom spash page from scratch.

I have some code to do the redirect, but if the spash page is a page builder page, it may not work becuse it will try to redirect that one also creating a loop.

So i need a bit more info on how you created your spash page.

https://www.deanbassett.com
Quote · 5 Sep 2010

 

Did you build you spash page in page builder?

Or did you make a custom spash page from scratch.

I have some code to do the redirect, but if the spash page is a page builder page, it may not work becuse it will try to redirect that one also creating a loop.

So i need a bit more info on how you created your spash page.

custom spash page from scratch. and someone made it

Quote · 5 Sep 2010

The try this. Make a back of your current file first before you change it.

Open inc/design.inc.php on your server and make the PageCode function look as it does below.
The code that is to be inserted is marked below.

The function starts at about line 120.


function PageCode($oTemplate = null) {
global $echo;
global $_page;
global $_page_cont;   
global $oSysTemplate;

if(empty($oTemplate))
$oTemplate = $oSysTemplate;

/* Deanos Redirect Guests to splash.php - Code Add - Start */
/* NOTE: If this is a dolphin page that uses the dolphin template system then this */
/* may cause a loop.
if ((int)$_COOKIE['memberID'] == 0) {
header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
}
/* Redirect Guests to splash.php - Code Add - End */

header( 'Content-type: text/html; charset=utf-8' );
$echo($oTemplate, 'page_' . $_page['name_index'] . '.html');
}

https://www.deanbassett.com
Quote · 5 Sep 2010

so it would be?

function PageCode($oTemplate = null) {
global $echo;
global $_page;
global $_page_cont;   
global $oSysTemplate;

if(empty($oTemplate))
$oTemplate = $oSysTemplate;

/* Deanos Redirect Guests to splash.php - Code Add - Start */
/* NOTE: If this is a dolphin page that uses the dolphin template system then this */
/* may cause a loop.
if ((int)_$COOKIE['memberID'] == 0) {
header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
}
/* Redirect Guests to splash.php - Code Add - End */

header( 'Content-type: text/html; charset=utf-8' );
$echo($oTemplate, 'page_' . $_page['name_index'] . '.html');
}

119 line //check correct hostname
120 line  $aUrl = parse_url( $site['url'] );
if( isset($_SERVER['HTTP_HOST']) and 0 != strcasecmp($_SERVER['HTTP_HOST'], $aUrl['host']) and 0 != strcasecmp($_SERVER['HTTP_HOST'], $aUrl['host'] . ':80') )
{
header( "Location:http://{$aUrl['host']}{$_SERVER['REQUEST_URI']}" );
exit;
}

// check if install folder exists
if ( !defined ('BX_SKIP_INSTALL_CHECK') && file_exists( $dir['root'] . 'install' ) )
{
$ret = <<<EOJ
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>Dolphin Smart Community Builder Installed</title>
<link href="install/general.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="main">
<div id="header">
<img src="install/images/boonex-logo.png" alt="" /></div>
<div id="content">
<div class="installed_pic">
<img alt="Dolphin Installed" src="install/images/dolphin_installed.jpg" />
</div>

<div class="installed_text">
Please, remove INSTALL directory from your server and reload this page to activate your community site.
</div>
<div class="installed_text">
NOTE: Once you remove this page you can safely <a href="administration/modules.php">install modules via Admin Panel</a>.
</div>
</body>
</html>
EOJ;
echo $ret;
exit();
}

// set error reporting level
if (version_compare(phpversion(), "5.3.0", ">=") == 1)
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
else
error_reporting(E_ALL & ~E_NOTICE);
set_magic_quotes_runtime(0);
ini_set('magic_quotes_sybase', 0);

// set default encoding for multibyte functions
mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');

require_once(BX_DIRECTORY_PATH_INC . "security.inc.php");
require_once(BX_DIRECTORY_PATH_ROOT . "flash/modules/global/inc/header.inc.php");
require_once(BX_DIRECTORY_PATH_ROOT . "flash/modules/global/inc/content.inc.php");
require_once(BX_DIRECTORY_PATH_CLASSES . "BxDolService.php");
require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php');
$oZ = new BxDolAlerts('system', 'begin', 0);
$oZ->alert();
?>

Quote · 5 Sep 2010

Nope.


You edit the file inc/design.inc.php

Goto line 120 and look for the current PageCode

Modify it to add the code in green.

I don't know what your trying to edit, but that code looks way off.

https://www.deanbassett.com
Quote · 5 Sep 2010

Update to that code. I overlooked the fact that join.php still needed to function if the splash page does not have a join form.

/* Deanos Redirect Guests to splash.php - Code Add - Start */
/* NOTE: If this is a dolphin page that uses the dolphin template system then this */
/* may cause a loop. */
if ((int)$_COOKIE['memberID'] == 0) {
    if ($_page['header'] != 'Join') {
        header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
    }
}
/* Deanos Redirect Guests to splash.php - Code Add - End */

https://www.deanbassett.com
Quote · 21 Aug 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.