Location: PHPKode > projects > phpCAMALEO > LoadPage.php
<?php
/***************************************************************************
 *	LoadPage.php
 *
 *	begin		: June 2004
 *	version		: 10 October 2006
 *	copyright	: (C) 2004,2006 grandolini.net
 *
 *	Load a page
 *
 ***************************************************************************/
if(!file_exists('private/Host.inc'))
{
	header('Location: install/Setup.php');
	die;
	#-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
}
if($_GET[skid]!='')
{
	#	load a skin (activation links)
	#
	session_start(); $_SESSION[id]=session_id();
	$skin=$_GET[skid];
	$_SESSION[misc][skin]=$_GET[skid];
	#
	#	remove the skid parameter
	#
	$redirect=str_replace('&skid='.$_GET[skid],'',$_SERVER[QUERY_STRING]);	
	$redirect=str_replace('skid='.$_GET[skid],'',$redirect);
	header('Location: '.$_SERVER[PHP_SELF].'?'.$redirect);
	die;
}
include('Session.php');
#
#	Variable initialization
#
$err=''; $resetmenu=''; $set_submenu='';
#
if(isset($_GET[head]))		{ $head=$_GET[head]; }
if(isset($_GET[warning]))	{ $warning=$_GET[warning]; }
if(isset($_GET[page]))		{ $PageNr=$_GET[page]; } else { $PageNr='welcome'; }
#
#	Log out user
#
if($_GET[act]=='logout' && $USER_ID!='')
{
	include($_SESSION[common].'private/Stat_logoff.php');
	#
	#	Update online user info
	#
	$sth=db_query("SELECT * FROM online WHERE ip='$IP'");
	if($sth[1]>0)
	{
		$sth=db_query("UPDATE online SET user='',privil='',userRRN='',team='',time='$timestamp' WHERE ip='$IP' LIMIT 1");
	}
	unset($_SESSION[visits],$_SESSION[user_email]);
	if($_GET[page]!='')
	{
		if(stristr($_GET[page],'.php')) { header('Location: '.$_GET[page]); }
		else { header('Location: LoadPage.php?page='.$_GET[page]); }
		die;
		#-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	}
}
#
#	Show confirmation message
#
if($_GET[act]=='ok' && $_GET[msg]!='') { $_SESSION[PageMsg]=$_GET[msg]; }
#
#	Prepare page
#
$_SESSION[PageNr]=strtolower($PageNr);
$_SESSION[auto_page]='';
include($_SERVER[DOCUMENT_ROOT].$_SESSION[misc][folder].'skins/'.$_SESSION[misc][skin].'/Layout.php');
?>
Return current item: phpCAMALEO