redirect non-members to splash page?

This seems like a really basic function but I don't see it in the admin anywhere: I want non-members (and members who aren't logged in) to be redirected to a page that has a log-in block and a "you must be a logged-in member to access this site - please log in or register" message.

Am I missing it or is it really not included?  Seems like there are lots of membership sites that would need this.

Quote · 4 Mar 2010

Turn off the menu for all non-members.  Go into Membership Levels and deny everything.  That will tell them to login or join if they want to do anything.

Quote · 4 Mar 2010

Thanks - I appreciate the suggestion but that's not what I'm looking for.  I want all site content blocked for people who aren't logged in, whether they try to connect to the index page or any internal pages.

It's a standard feature of lots of community sites I belong to - it certainly seems like it oughta be possible with Dolphin.  Any other ideas, anyone?

Quote · 4 Mar 2010

Anybody?

There has to be a simple way to do this - it's such a basic thing.

Quote · 5 Mar 2010

please someone help. I need this too.

 

Thank you in advance

Quote · 2 Dec 2010

Try this.

Open inc/design.inc.php

Go down to about line 124 and look for the PageCode Function.

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

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

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


Modifiy it to add the block of code marked in green.

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

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

if (!isMember()) {
header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
exit;
}

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


Change splash.php to the name of your actual splash page.


https://www.deanbassett.com
Quote · 3 Dec 2010

Thanks Deano!  I have been looking for the same thing.  Your fix works, however I encounter one problem.  I'm not sure if the OP has this same issue, but now when a guest clicks any link on the splash page (for example: a join button that directs to join.php or a link to the "About Us" page.) the splash page just reloads.  As soon as I remove the added code in design.inc.php, the problem goes away...but, of course, guests will no longer be taken to the splash page.

Quote · 16 Dec 2010

you can use the "Guest Surf Limit" from scriptologist for that.

I use it in my page so that people can just see 1 page and than go to join.php or member.php for already member.

You can change this configuration to go to splash.php in the module configuration.

Quote · 28 Dec 2010

Did this and it worked good, only 1 problem...
If someone wants to register ( join.php ) he's redirected again to the splashpage ( splash.php )
How can i set this right?

Try this.

Open inc/design.inc.php

Go down to about line 124 and look for the PageCode Function.

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

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

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


Modifiy it to add the block of code marked in green.

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

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

if (!isMember()) {
header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
exit;
}

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


Change splash.php to the name of your actual splash page.


 

Quote · 27 May 2013

 Try this instead



if (!isMember() || strpos($_SERVER['REQUEST_URI'],'join') !== false ) {
header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
exit;
}

 

 

Quote · 27 May 2013

 Doesn't work...

 Try this instead



if (!isMember() || strpos($_SERVER['REQUEST_URI'],'join') !== false ) {
header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
exit;
}

 

 

 

Quote · 27 May 2013

 

 

 Doesn't work...

 Try this instead



if (!isMember() || strpos($_SERVER['REQUEST_URI'],'join') !== false ) {
header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
exit;
}

 

 

 

 

 Sorry my bad...

 

This should work...

 


if(isMember() || strpos($_SERVER['REQUEST_URI'],'join') !== false){}else{

 

header('Location: ' . BX_DOL_URL_ROOT . 'splash.php');
exit;

}

Quote · 27 May 2013

Worked! Thanks ;)

Quote · 27 May 2013

When I try this I get "Too many redirects". 

 

I'm trying the following: 

 

if(isMember() || strpos($_SERVER['REQUEST_URI'],'index') || strpos($_SERVER['REQUEST_URI'],'join') || strpos($_SERVER['REQUEST_URI'],'contact') !== false){}else{

header('Location: ' . BX_DOL_URL_ROOT . 'index.php');

exit;

}

 

I basically want it to redirect them ONLY if they are not a member, and not on the contact page, index page or the join page.

Am I doing something wrong?

Quote · 4 Nov 2016
 
 
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.