<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Quixotism.org</title>
	<atom:link href="http://quixotism.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://quixotism.org</link>
	<description>A little of everything</description>
	<lastBuildDate>Mon, 30 Nov 2009 08:41:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple/Beginner&#8217;s PHP Website Template</title>
		<link>http://quixotism.org/?p=419</link>
		<comments>http://quixotism.org/?p=419#comments</comments>
		<pubDate>Sat, 28 Nov 2009 08:23:31 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://quixotism.org/?p=419</guid>
		<description><![CDATA[This silly little &#8216;guide&#8217; is meant for beginners in PHP.  It&#8217;s a super quick template you can begin a website with (I claim no copyright to the code I wrote below, do what you want with it).  Managing a site is much easier if the common elements are made dynamically, and for this [...]]]></description>
			<content:encoded><![CDATA[<p>This silly little &#8216;guide&#8217; is meant for beginners in PHP.  It&#8217;s a super quick template you can begin a website with (I claim no copyright to the code I wrote below, do what you want with it).  Managing a site is much easier if the common elements are made dynamically, and for this it is best if you begin with clear, simple standards you can pick up on again later when you return to editing the site.
</p><p>
My code here is meant to be &#8216;quick and dirty&#8217;, getting the job done in the most obvious of ways.  It can of course be used around CSS styles, and note also that a proper site would have the standard HTML/head/body tags.  In the template code below, common template elements (header and footer) are included in each web page.  This way, only one template file must be edited if site-spanning template pieces must be altered.  That is, one page holds links which appear in a menu on all pages in the website, for instance. It is a bit redundant, but the .tpl.php files are stored in the sub-directory &#8216;tpl&#8217; within the root directory where index.php stays. 
</p><p>
Note that PHP5 allows included files to inherit variable scope from the parent page &#8211; this way, the variables $curPage and $rootDir are passed along to the tpl files.  From this, simple switches can be made depending on what the current page is, for instance keeping hyperlinks from appearing when you&#8217;re currently on the linked page.
</p><p>
Note also that there are (at least) two ways of going about making a PHP website template.  One way is how I show here, where individual pages include template pieces while themselves showing the content.  Another way would be to have a main page which assembles the entire page, putting the template together and then putting in content, so to the user it may actually look like the same page.
</p><p>
So..Hopefully this quick little demo will prove useful!  Enjoy.
</p><pre>
<blockquote><code><strong>index.php:</strong>
&lt;?php
$curPage = 'Home';
$rootDir = '.';
include("$rootDir/tpl/links.tpl.php");

echo 'content here';

include("$rootDir/tpl/footer.tpl.php");
?&gt;</code></blockquote>
</pre>

<pre>
<blockquote><code><strong>about.php:</strong>
&lt;?php
$curPage = 'About';
$rootDir = '.';
include("$rootDir/tpl/links.tpl.php");

echo 'about this site here';

include("$rootDir/tpl/footer.tpl.php");
?&gt;</code></blockquote>
</pre>

<pre>
<blockquote><code><strong>links.php:</strong>
&lt;?php
$curPage = 'Links';
$rootDir = '.';
include("$rootDir/tpl/links.tpl.php");

echo 'Links Page';

include("$rootDir/tpl/footer.tpl.php");
?&gt;</code></blockquote>
</pre>

<pre>
<blockquote><code><strong>links.tpl.php:</strong>
&lt;?php
$homeLink = "&lt;a href='$rootDir/'>Home&lt;/a>";
$aboutLink = "&lt;a href='$rootDir/about.php'>About&lt;/a>";
$linksLink = "&lt;a href='$rootDir/links.php'>Links&lt;/a>";

//Main site links<br />
if($curPage == 'Home')
	$homeLink = "Home Pad";

echo "$homeLink | $aboutLink"
	." | $linksLink";
	echo '&lt;hr /&gt;';
?&gt;</code></blockquote>

<blockquote><code><strong>footer.tpl.php:</strong>
&lt;?php
echo '&lt;p>Footer information&lt;/p>';
?&gt;</code></blockquote>
</pre>]]></content:encoded>
			<wfw:commentRss>http://quixotism.org/?feed=rss2&amp;p=419</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Should I Do Now?</title>
		<link>http://quixotism.org/?page_id=351</link>
		<comments>http://quixotism.org/?page_id=351#comments</comments>
		<pubDate>Mon, 28 Sep 2009 03:15:24 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Humor]]></category>

		<guid isPermaLink="false">http://quixotism.org/?page_id=351</guid>
		<description><![CDATA[Have you ever been bored?  Lazy?  Unmotivated?

Just plain can&#8217;t think of anything to do?

Well, here is the answer!  Just click the button to find out what you should do now!









Obviously you should click the button.&#160;]]></description>
			<content:encoded><![CDATA[Have you ever been bored?  Lazy?  Unmotivated?
<br />
Just plain can't think of anything to do?
<br />
Well, here is the answer!  Just click the button to find out what you should do now!

<br />
<b>Fatal error</b>:  Cannot redeclare curpageurl() (previously declared in /home/zvan002/public_html/quixotism/wp-content/plugins/exec-php/includes/runtime.php(43) : eval()'d code:14) in <b>/home/zvan002/public_html/quixotism/wp-content/plugins/exec-php/includes/runtime.php(43) : eval()'d code</b> on line <b>13</b><br />
