Force a Login Box

If you do not want non-members viewing specific pages of your website, you can paste the following code into that php file.

Example: To not allow visitors to browse "People>All Members"

Edit the /browse.php

Add This :

//Check if Logged In
check_logged();
if(!isLogged()) {
login_form();
exit;
}

After This:

$_ni = $_page['name_index'];

This will present a login/join box instead like below:

login

You can do this with pretty much any "main" file.  Just insert the code after something like $_page['name_index']; or the last require_once('PageName.php). May take some playing around. I can help if needed.

Chris

Nothing to see here
Quote · 11 Mar 2010

This is handy for sure.
Thanks for sharing this Laughing

Be a dolphin, be creative in you own way and you will attract a audience
Quote · 14 Mar 2010

Hi, Zarcon.

Thank you for your script, it works perfectly.

Just one issue I am having now: I've decided not to restric the pages anymore, so I deleted all the scripts I have placed before, but now non-members can see all the pages, except the home page. The home page is the only page showing nothing more than the login box.

 

What should I do? Any suggestions?

 

Thank you so much.

Quote · 24 Feb 2012

Warning this script it will screw up your site, after a few clicks it will be blocked, even when you remove it, nothing happens, for me it my browser downloaded the index.php file on pc but every other page works It perfectly if you can help me.

Sorry for my english

Qui ne fait pas quand il peut ne fait pas quand il veut.
Quote · 25 Feb 2012
 
 
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.