Location: PHPKode > projects > Pratt Content-Management-System (CMS) > prattcms/variables/pages.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/pages.var.php
Description: variables from the pages 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.
*/

//set the id in the db
$sql_id = $global_var_id;

//are we testing in the wysiwyg or not?
if ($_GET['test'] == true) {
	$pages_table = "pages_test";
} else {
	$pages_table = "pages";
}

//the SQL query for page info
$pg_sql_q = "SELECT * FROM " . $pages_table . " WHERE id='" . $sql_id . "'";

	//run the query
	$pg_query = $db->getAll($pg_sql_q);

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


//set all the vars with two foreach loops

foreach ($pg_query as $value) {
	$string_pg = "id=" . $sql_id;
	parse_str($string_pg,$pg);
	$string_title = "id=" . $value[2];
	parse_str($string_title,$title);
}

//set the id of the wysiwyg page... someone needs to get rid of this stuff...
//eventually
$wysiwyg_id = $pg['id'];

//the variable that contains the filename to include
if (file_exists($pages_table . "/id" . $pg['id'] . ".html")) {
	$include_file = $PRATTCMS_dir . $pages_table . "/id" . $pg['id'] . ".html";
} else {
	$include_file = "pages/id_error.html";
}

$include_wysiwyg = $PRATTCMS_dir . $pages_table . "/id" . $pg['id'] . ".html";

//to get the wysiwyg title
$wysiwyg_title_sql = "SELECT text FROM " . $pages_table . " WHERE id='" . $wysiwyg_id . "'";
	//query
	$wysiwyg_title_query = $db->getRow($wysiwyg_title_sql);
	//error handling again
		if (DB::iserror($wysiwyg_title_query)) {
			require_once("admin/classes/error_report.class.php");
			$error = new Error;
			$error->report($wysiwyg_title_query,__LINE__,__FILE__);
		}
	$wysiwyg_page_title = $wysiwyg_title_query[0];
	
			
$page_title = stripslashes($title['id']);
//total title
$total_title = $config['base_title'] . " " . $config['title_seperator'] . " " . $page_title;
$wysiwyg_title = $config['base_title'] . " " . $config['title_seperator'] . " " . $wysiwyg_page_title;
?>
Return current item: Pratt Content-Management-System (CMS)