All pastes #440648 Raw Edit

lucas source

public php v1 · immutable
·published 2007-04-15 05:19 UTC
rendered paste body
<?php // defines the page variable as array$page = array();// this makes an array out of the variable names in the address bar// example: if you have http://abc.com/?var1=value1&var2=value2// the array should be ['var1','var2']foreach($_GET as $key => $value){	$page[] = $key;}$pages = array('index','news','hlinks','pics','tos','contact','sched','sitemap','ver');head();if(isset($page[0])){	if(in_array($page[0], $pages))		// and page is in your approved array, do that function		rf($page[0]);//	elseif(isset($page[0]))		// if it isnt, do the 404 page//		error($page[0]);	else		// anything else, do index		rf('index');}else	// if isnt set, do index	rf('index');foot();	function rf($file){	echo '<div id="content">';	readfile($file.'.luc');	echo '</div>';	echo '</div>';	}function head(){		echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>		<meta http-equiv="content-type" content="text/html; charset=utf-8" />		<meta name="author" content="Name of the company goes here" />	<meta name="design" content="Lucas Brown" />	<meta name="keywords" content="media" />	<meta name="description" content="media server" />		<link rel="stylesheet" type="text/css" media="screen" href="style/default.css" />	</head><body id="bhome">	<div id="container">			<div id="header">					<h1><a href="/" title="Home"><span>LucMedia.org</span></a></h1>					</div>				<div id="navigation">					<ul>							<li><a href="?index">Home</a></li><li><a href="video">Video</a></li><li><a href="?services">Services</a></li><li><a href="forums">Forums</a></li>						</ul>				</div>				<div id="wrapper">		<div id="sidebar-wrapper">							<div id="sidebar">									<h1>Notes</h1>										<ul id="sidenotes">											<li>							<a href="http://www.lucmedia.org" title="LucMedia">								<span class="title">LucMedia.org</span>								<span class="date">Posted On: 04-09-2007</span>								<span class="content">LucMedia is the new branch head site for LucMedia Co.</span>							</a>												</li> 																						<h6>More Info</h6>										<p>					For support for this site contact:<br><a href="mailto:omfgaturtle@gmail.com">Lucas Brown</a>					</p>								</div>			</div>					<div id="content-wrapper">';}function foot(){	echo '<div id="footer">					Copyright &copy; 2006 &ndash; 2007 LucMedia.org. All rights reserved.| 			<a href="http://validator.w3.org/check/referer" title="Xhtml 1.0 Strict">XHTML</a> | 			<a href="http://jigsaw.w3.org/css-validator/check/referer?warning=no&amp;profile=css2" title="CSS 2.0 Strict">CSS</a>				</div>		</div></body></html>';}function error($p){	echo $p.' isnt a valid page link <a href="index.php">Click Here To Return to Index</a>';}?>