Location: PHPKode > projects > Pratt Content-Management-System (CMS) > prattcms/variables/config.var.php
<?php
/*
This file is (C) Copyright 2003 by the Pratt Museum and licensed under the GPL.
Please see the README for details.

File: $root/variables/config.var.php
Description: variables from the config table
Notes: This file is currently being used for a prototype for the calendar of events
	page to see if this project will take off.
*/

//the query: select everything from the configuration table...
$sql_config = "SELECT * FROM config";

$query_config = $db->getAll($sql_config);
//error handling again
if (DB::iserror($query_config)) {
	require_once("admin/classes/error_report.class.php");
	$error = new Error;
	$error->report($query_config,__LINE__,__FILE__);
}

//run the query
foreach ($query_config as $value) {
	$config[$value[1]] = $value[2];
}

//the pages_dir config value is very important for testing
if ($_GET['test'] == true) {
	//so if we are testing we need to change it!
	$dir = explode("/",$pages_dir);
	
	//find out where the pages directory is
	$ary_id = array_search("pages",$dir);
	
	//change the array accordingly
	$dir[$ary_id] = "pages_test";
	
	//and put it back together
	for($i = 0; $i < count($dir)-1; $i++) {
		$directory .= $dir[$i] . "/";
	}
	
	//and reset the variable
	$config['pages_dir'] = $directory;
	
}
?>
Return current item: Pratt Content-Management-System (CMS)