Location: PHPKode > projects > Changelog > changelog/changelog.php
<?php
/*
	Changelog
	~~~~~~~~~~
	Author	: Thomas Whitecotton
	Email	: hide@address.com
	Website	: http://www.ciamosbase.com

*/
if((isset($folderid)) AND ($folderid == '0')) {
	include_once('../../mainfile.php');
	redirect_header("index.php", 0, _MD_TOPLEVEL);
	exit();
} 

include("header.php");
OpenTable();

// Get the file's changelog information
if($cid) {
$query = $db->query("SELECT name,changes FROM ".$db->prefix("changelog_files")." WHERE cid ='" . $cid . "'");
list($name,$changes) = @$db->fetch_row($query);
	echo 'File name: <b>'.$name.'</b><br><br>';
	echo 'Changes: <br><br>'.$changes;
} 

// If its not a request for a changelog, display the folder's contents
if($folderid) {

	$sql = $db->query("SELECT name,folder FROM ".$db->prefix("changelog_folders")." WHERE fid ='" .$folderid. "'");
	list($fname,$up) = $db->fetch_row($sql); 
	echo "
		<img src=".SYS_URL._MT_FOLDER_IMAGE." alt='[ ]' title='Up a level'>
		<a href='changelog.php?folderid=$up' title='Up a level'> 
			Up a level
		</a><br>
		<img src=".SYS_URL._MT_OFOLDER_IMAGE." alt='[ ]' title=".$fname.">
		<a href='changelog.php?folderid=$folderid' title=".$fname."> 
			".$fname."
		</a><br>			";

	// Display Folders
	$query = $db->query("SELECT fid,name FROM ".$db->prefix("changelog_folders")." WHERE folder ='" .$folderid. "' ORDER BY name ASC");
	while (list($fid,$name) = @$db->fetch_row($query)) {
		print('
			<img src=' . SYS_URL ._MT_SUBFOLDER_IMAGE.' alt="[ ]" title='.$name.'>');  
		echo '
			<a href="changelog.php?folderid='.$fid.'" title='.$name.'>
				'.$name.'
			</a><br>'; 
	}

	// Display Files
	$query = $db->query("SELECT cid,name FROM ".$db->prefix("changelog_files")." WHERE folder ='" .$folderid. "' ORDER BY name ASC");
	while (list($cid,$name) = @$db->fetch_row($query)) {
		print('
			<img src=' . SYS_URL . _MT_SUBFILES.' alt="|~|" title='.$name.'>');
		echo '
			<a href="changelog.php?cid='.$cid.'" title='.$name.'>
				'.$name.'
			</a><br>'; 
	}
}

CloseTable();
include("footer.php");
?>
Return current item: Changelog