<?php

/***************************************************************************

 selecttheme.php
 ----------------
 copyright : (C) 2002-2003 The ezContents Development Team

 ***************************************************************************/

/***************************************************************************
 The ezContents Development Team offers no warranties on this script.
 The owner/licensee of the script is solely responsible for any problems
 caused by installation of the script or use of the script.

 All copyright notices regarding ezContents must remain intact on the
 scripts and in the HTML for the scripts.

 For more info on ezContents,
 visit http://www.ezcontents.org/

/***************************************************************************

/***************************************************************************
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the License which can be found within the
 *	zipped package.
 *
 ***************************************************************************/

$GLOBALS["rootdp"] = './';
require_once ($GLOBALS["rootdp"]."include/config.php");
require_once ($GLOBALS["rootdp"]."include/db.php");
require_once ($GLOBALS["rootdp"]."include/session.php");
include ($GLOBALS["rootdp"]."include/functions.php");
require_once ($GLOBALS["rootdp"]."include/settings.php");

if ($HTTP_GET_VARS["Theme"] != '') {
	//  First see if the theme exists.
	$strQuery = "SELECT themecode FROM ".$GLOBALS["eztbThemes"]." WHERE themecode='".$HTTP_GET_VARS["Theme"]."' AND themeenabled='1'";
	$sresult = dbRetrieve($strQuery,true,0,0);
	$sRecCount = dbRowsReturned($sresult);
	dbFreeResult($sresult);

	if ($sRecCount > 0) { $EZ_SESSION_VARS["Theme"] = $HTTP_GET_VARS["Theme"];
	} else { $EZ_SESSION_VARS["Theme"] = ''; }
} else {
	$EZ_SESSION_VARS["Theme"] = '';
}
db_session_write();


Header("Location: ".BuildLink('control.php').'&topgroupname='.$HTTP_GET_VARS["topgroupname"].'&groupname='.$HTTP_GET_VARS["groupname"].'&subgroupname='.$HTTP_GET_VARS["subgroupname"].'&contentname='.$HTTP_GET_VARS["contentname"].'&page='.$HTTP_GET_VARS["page"].'&link='.$HTTP_GET_VARS["link"].'&ref='.$HTTP_GET_VARS["ref"]);

?>
