<?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>Lirae.co.uk &#187; Almost Tutorials</title>
	<atom:link href="http://lirae.co.uk/blog/categories/articles/almost-tutorials/feed" rel="self" type="application/rss+xml" />
	<link>http://lirae.co.uk</link>
	<description>Not for the ordinary</description>
	<lastBuildDate>Sun, 26 Jun 2011 13:37:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How To Install MagpieRSS</title>
		<link>http://lirae.co.uk/blog/entries/how-to-install-magpierss.php</link>
		<comments>http://lirae.co.uk/blog/entries/how-to-install-magpierss.php#comments</comments>
		<pubDate>Fri, 08 Aug 2008 21:27:33 +0000</pubDate>
		<dc:creator>Lirae</dc:creator>
				<category><![CDATA[Almost Tutorials]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Site Stuff]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://lirae.co.uk/?p=709</guid>
		<description><![CDATA[An easy way to understand RSS is to think of an RSS reader as a custom newspaper; you choose who writes the articles in your newspaper. The RSS feed just inserts the &#8220;article&#8221; into your &#8220;newspaper&#8221;. This is a really handy way of keeping up to date with your favourite sites; you just add the [...]]]></description>
			<content:encoded><![CDATA[<p>An easy way to understand <acronym title="Really Simple Syndication">RSS</acronym> is to think of an <acronym title="Really Simple Syndication">RSS</acronym> reader as a custom newspaper; you choose who writes the articles in your newspaper. The <acronym title="Really Simple Syndication">RSS</acronym> feed just inserts the &#8220;article&#8221; into your &#8220;newspaper&#8221;.<br />
This is a really handy way of keeping up to date with your favourite sites; you just add the <acronym title="Uniform Resource Locator">URL</acronym> of the <acronym title="Really Simple Syndication">RSS</acronym> feed into your feed reader.</p>
<p>MagpieRSS basically uses your site as a feed reader. If an <acronym title="Really Simple Syndication">RSS</acronym> feed is just a list of updates from a site, you can use your site to show updates from another site.</p>
<p>To install it, first you need to <a href="http://sourceforge.net/project/showfiles.php?group_id=55691">download MagpieRSS</a><sup>^</sup>.<br />
It&#8217;ll probably download as a .tar.gz file which you probably won&#8217;t be able to open. This doesn&#8217;t matter; you won&#8217;t need to open it anyway. As always, when you&#8217;ve downloaded it, scan it to make sure it&#8217;s virus free.</p>
<p>Upload the .tar.gz file to your root directory. You might as well do this in your cPanel because you&#8217;ll need to use it in a moment anyway.<br />
Once uploaded, use the File Manager in your cPanel and view your root folder (usually called &#8216;Document Root&#8217;).</p>
<div class="center"><img src="/foryou/almosttutorials/magpierss/1.jpg" alt="" /></div>
<p>If you&#8217;re using the fancy file manager, check the checkbox next to the MagpieRSS .tar.gz file. If you&#8217;re using the basic <acronym title="HyperText Markup Language">HTML</acronym> file manager, click on the name of the file.<br />
Click the &#8220;Extract&#8221; button.</p>
<div class="center"><img src="/foryou/almosttutorials/magpierss/2.jpg" alt="" /></div>
<p>You&#8217;ll now find that you&#8217;ve got a new folder, called &#8220;magpierss&#8221;.<br />
You don&#8217;t need to do anything else; it&#8217;s now installed. <img src='http://lirae.co.uk/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://lirae.co.uk/blog/entries/how-to-install-magpierss.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display Last.fm Scrobbles On Your Site</title>
		<link>http://lirae.co.uk/blog/entries/display-lastfm-scrobbles-on-your-site.php</link>
		<comments>http://lirae.co.uk/blog/entries/display-lastfm-scrobbles-on-your-site.php#comments</comments>
		<pubDate>Fri, 08 Aug 2008 20:16:35 +0000</pubDate>
		<dc:creator>Lirae</dc:creator>
				<category><![CDATA[Almost Tutorials]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Site Stuff]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://lirae.co.uk/?p=662</guid>
		<description><![CDATA[Disclaimer: I didn&#8217;t write this script; I&#8217;ve modified David Kadavy&#8217;s TwitBlog script^ to display your Last.fm scrobbles and the time the track was scrobbled. FOR NON-WORDPRESS USERS: Before you can use this on your site, you&#8217;ll need to install MagpieRSS; this script grabs the parsed feed from MagpieRSS and displays it in a visitor-friendly way. [...]]]></description>
			<content:encoded><![CDATA[<p><small><strong>Disclaimer:</strong> I didn&#8217;t write this script; I&#8217;ve modified <a href="http://www.kadavy.net/blog/posts/twitblog-syndicating-twitter-to-my-blog/">David Kadavy&#8217;s TwitBlog script</a><sup>^</sup> to display your Last.fm scrobbles and the time the track was scrobbled.</p>
<p><strong>FOR NON-WORDPRESS USERS:</strong><br />
Before you can use this on your site, you&#8217;ll need to install MagpieRSS; this script grabs the parsed feed from MagpieRSS and displays it in a visitor-friendly way. <img src='http://lirae.co.uk/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' />  (Don&#8217;t know <a href="http://lirae.co.uk/blog/entries/install-magpierss.php">how to install MagpieRSS</a>?)<br />
WordPress users don&#8217;t need to install MagpieRSS. <img src='http://lirae.co.uk/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' /> </small></p>
<p>Download the <a href="/foryou/almosttutorials/last.fm.txt">Last.fm.txt file</a> (right click on the link &raquo; Save As) and open the file in Notepad.</p>
<p>Press Ctrl + G and type in 12 (this will take you to line 12).<br />
Change <code>/home/USER/public_html/magpierss/rss_fetch.inc</code> to the server path where the rss_fetch.inc file is. If you don&#8217;t know where it is, just change <strong>USER</strong> to your cPanel username.<br />
<strong>WordPress comes with MagpieRSS installed, so if you will be using this with WordPress, you will need to point the path to go to</strong> <code>/home/USER/public_html/wp-includes/rss.php</code></p>
<p>Go down to line 16 and change <code>/home/USER/public_html/cache</code> to the server path where <em>your</em> cache directory is. If you don&#8217;t know where it is but you installed MagpieRSS in your root directory, just change <strong>USER</strong> to your cPanel username.</p>
<p>Next, go down to line 19 and change <code>http://ws.audioscrobbler.com/1.0/user/lirae666/recenttracks.rss</code> to the <acronym title="Uniform Resource Locator">URL</acronym> of <em>your</em> Recent Tracks feed. (Unless you want to display what <em>I&#8217;ve</em> been listening to!)<br />
You can find this on your profile, just above the &#8220;Recently Listened Tracks&#8221; list:</p>
<div class="center"><a href="http://lirae.co.uk/foryou/almosttutorials/lastfm/1.jpg"><img src="/foryou/almosttutorials/lastfm/1.jpg" style="width: 400px;" alt="" /></a></div>
<p>Go down to line 22 if you want to change the amount of scrobbles you wish to display on your site. (I think the most amount of scrobbles you can show is 10.)</p>
<p>For now, leave line 25 as it is. This just sets how many hours ahead or behind your server time is, compared to Last.fm&#8217;s server time.<br />
If you find that the times are off, change <strong>+4</strong> to how many hours off the times are.<br />
For example: if the time the track was played is showing up as 9am, when you played it at 11am, change <strong>+4</strong> to <strong>+6</strong>. Similarly, if the time is showing up as 11am, when you played the track at 9am, change <strong>+4</strong> to <strong>+2</strong>.</p>
<p>Now resave the file as &#8220;last.fm.php&#8221; and upload it to the root directory of your site.</p>
<p>To show the list on your site, all you need to do is include the last.fm.php file in your sidebar: <code>&lt;?php include("/home/USER/public_html/last.fm.php");?&gt;</code> (change <strong>USER</strong> to your cPanel username).</p>
]]></content:encoded>
			<wfw:commentRss>http://lirae.co.uk/blog/entries/display-lastfm-scrobbles-on-your-site.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Displaying your recent Flickr photos without using WordPress</title>
		<link>http://lirae.co.uk/blog/entries/displaying-your-recent-flickr-photos-without-using-wordpress.php</link>
		<comments>http://lirae.co.uk/blog/entries/displaying-your-recent-flickr-photos-without-using-wordpress.php#comments</comments>
		<pubDate>Fri, 08 Jun 2007 14:48:48 +0000</pubDate>
		<dc:creator>Lirae</dc:creator>
				<category><![CDATA[Almost Tutorials]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://littleblog.lirae.co.uk/wordpress/?p=104</guid>
		<description><![CDATA[I wanted to &#8216;pull&#8217; my recent Flickr photos^ and display them on my site. All of the scripts I found were actually WordPress (or other blogging tools) plugins. I sort of gave up on the idea until last night, when I joined Twitter^; I wanted to display my twitters on my site. I found a [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to &#8216;pull&#8217; <a href="http://flickr.com/photos/lirae">my recent Flickr photos</a><sup>^</sup> and display them on my site. All of the scripts I found were actually WordPress (or other blogging tools) plugins.</p>
<p>I sort of gave up on the idea until last night, when <a href="http://twitter.com/lirae">I joined Twitter</a><sup>^</sup>; I wanted to display my twitters on my site. I found a JavaScript snippet that would do it for me but it kept killing Internet Explorer, so I kept looking around and found a script called <a href="http://www.kadavy.net/blog/archive/2006/11/my_twitters_are.php" class="broken_link">TwitBlog</a><sup>^</sup>.</p>
<p>TwitBlog requires <a href="http://magpierss.sourceforge.net">Magpie RSS</a><sup>^</sup> to be installed; the script is actually pulling your Twitters from the RSS feed and displaying it in HTML format and the RSS feed is parsed with Magpie RSS. (Don&#8217;t know <a href="http://lirae.co.uk/blog/entries/install-magpierss.php">how to install MagpieRSS</a>?)</p>
<p>I then Googled &#8216;flickr rss parser&#8217; and came across a script called GetFlickrPHP<sup>^</sup> (the link no longer works, so you can download <a href="/foryou/almosttutorials/GetFlickrPHP.txt">a copy of GetFlickrPHP</a> from here), which did the whole &#8216;display in HTML format&#8217; thing for me. <img src='http://lirae.co.uk/wp-includes/images/smilies/wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>To get it working, I had to <a href="http://idgettr.com">find my Flickr ID</a><sup>^</sup> and then modify the variables, near the top of the script. This is what my variables are set to:</p>
<p><code># set what type of tag you're pulling from flickr<br />
# 0 = tag; 1 = user; 2 = group pool<br />
$tagtype = 1;<br />
# set the tag to pull from flickr (tag, user or group pool)<br />
# example: "cats", "44124462494@N01", "circle"<br />
$tag = "46498153@N00";<br />
# set default value for number of pictures to show<br />
# (flickr show maximum of 10 photos in feed)<br />
$num_items = 9;<br />
# set to true to use medium pics, otherwise it uses small<br />
$mediumPics = false;<br />
# set location of Magpie RSS files<br />
# require_once('magpierss/rss_fetch.inc');<br />
# require_once('magpierss/rss_utils.inc');<br />
require_once('/home/user/public_html/magpierss_installed/rss_fetch.inc');<br />
require_once('/home/user/public_html/magpierss_installed/rss_utils.inc');<br />
# use image cache &#038; set location<br />
$useImageCache = false;<br />
$cachePath="http://www.thebishop.net/news/cache/";<br />
$fullPath="/home/tbishop61/www/news/cache/";</code></p>
<p>Easy! <img src='http://lirae.co.uk/wp-includes/images/smilies/grin.gif' alt=':D' class='wp-smiley' />  I just wish someone had done this before me <em>and talked about it</em>!</p>
]]></content:encoded>
			<wfw:commentRss>http://lirae.co.uk/blog/entries/displaying-your-recent-flickr-photos-without-using-wordpress.php/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Stylesheet Switcher</title>
		<link>http://lirae.co.uk/blog/entries/stylesheet-switcher.php</link>
		<comments>http://lirae.co.uk/blog/entries/stylesheet-switcher.php#comments</comments>
		<pubDate>Mon, 01 Jan 2007 21:52:22 +0000</pubDate>
		<dc:creator>Lirae</dc:creator>
				<category><![CDATA[Almost Tutorials]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[Site Stuff]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://lirae.co.uk/?p=736</guid>
		<description><![CDATA[A stylesheet switcher is kind of like skinning your site, except that the only thing that changes is the stylesheet; everything else stays exactly the same. You must already have some knowledge of using &#8220;PHP Includes&#8221;. Getting Ready The first thing you need to do is to set up a new folder in your root [...]]]></description>
			<content:encoded><![CDATA[<p>A stylesheet switcher is kind of like skinning your site, except that the only thing that changes is the stylesheet; everything else stays <em>exactly the same</em>.</p>
<p>You must already have some knowledge of using &#8220;<acronym title="PHP: Hypertext Preprocessor">PHP</acronym> Includes&#8221;.</p>
<h3>Getting Ready</h3>
<p>The first thing you need to do is to set up a new folder in your root directory called &#8220;styles&#8221;. The &#8220;styles&#8221; folder is where all of your different stylesheets should be placed.<br />
When you add new stylesheets, name them &#8220;style1.css&#8221;, &#8220;style2.css&#8221;, &#8220;style3.css&#8221;, etc.</p>
<ul>
<li>root directory
<ul>
<li>styles/
<ul>
<li>style1.css</li>
<li>style2.css</li>
<li>style3.css</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Once you&#8217;ve done this, you can upload the &#8220;styles&#8221; folder (containing your stylesheets and any images) and move onto the next step.</p>
<h3>Coding</h3>
<p>First, we&#8217;ll need to make the file that will control how many styles you have, which style is the default, allow the user to change style, etc.<br />
This file will be called &#8220;styles.php&#8221; and will be uploaded to your <em>root directory</em>.</p>
<p><a href="/foryou/almosttutorials/stylesheetswitcher.txt">Download stylesheetswitcher.txt</a>.</p>
<p>You&#8217;ll only need to edit the first chunk of coding:<br />
<code>$path = &quot;/home/YOURUSERNAME/public_html/styles/&quot;;<br />
$defaultstyle = 2;<br />
$totalstyles = 3;</code></p>
<ul>
<li>Change <strong>YOURUSERNAME</strong> to your site&#8217;s username. Since you already use includes, you should know your site&#8217;s username. <img src='http://lirae.co.uk/wp-includes/images/smilies/wink.gif' alt=';)' class='wp-smiley' /> </li>
<li><strong>$defaultstyle = 2</strong> &#8211; change the number to the number of the style you want to be the default (self explanatory, really).</li>
<li><strong>$totalstyles = 3</strong> &#8211; change this to the number of styles you have&#8230;</li>
</ul>
<p><em>You will not need to edit anything else in that file.</em><br />
Reupload the file now. Please. <img src='http://lirae.co.uk/wp-includes/images/smilies/tongue.gif' alt=':P' class='wp-smiley' /> </p>
<p>Open up your header.php file and add this to the top of the page (<strong>before anything else</strong>):<br />
<code>&lt;?php include(&quot;/home/USERNAME/public_html/styles.php&quot;);&gt;</code></p>
<p>Now replace the &#8220;link&#8221; to your stylesheet with this:<br />
<code>&lt;link rel=&quot;stylesheet&quot; href=&quot;/styles/style&lt;?php print $currentstyle;?&gt;.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;</code></p>
<p>Unless you&#8217;ve screwed up along the way (unlikely since you&#8217;re most definitely not skim reading this, are you?), everything should work perfectly.</p>
<h3>Switching The Stylesheet</h3>
<p>There&#8217;s a reason why &#8220;styles.php&#8221; is included into every page; the visitor can change the style with no preview page crap and they won&#8217;t lose the page they&#8217;re currently on. Woohoo!</p>
<p>Anyway, the link to change the style is &#8220;?switchstyle=[stylenumber]&#8220;.<br />
Example:<br />
<code>&lt;a href="?switchstyle=1"&gt;Name Of Style 1&lt;/a&gt;<br />
&lt;a href="?switchstyle=2"&gt;Name Of Style 2&lt;/a&gt;<br />
&lt;a href="?switchstyle=3"&gt;Name Of Style 3&lt;/a&gt;</code><br />
These links can go on any page since you&#8217;re including the file which switches the stylesheet in the file which is included into every page.</p>
]]></content:encoded>
			<wfw:commentRss>http://lirae.co.uk/blog/entries/stylesheet-switcher.php/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Skinning vs Stylesheet Switcher</title>
		<link>http://lirae.co.uk/blog/entries/skinning-vs-stylesheet-switcher.php</link>
		<comments>http://lirae.co.uk/blog/entries/skinning-vs-stylesheet-switcher.php#comments</comments>
		<pubDate>Mon, 01 Jan 2007 21:51:23 +0000</pubDate>
		<dc:creator>Lirae</dc:creator>
				<category><![CDATA[Almost Tutorials]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://lirae.co.uk/?p=733</guid>
		<description><![CDATA[When I first put them up, I received a lot of criticism on my Div Skinning tutorial and Iframes / Frames Skinning tutorial. It had nothing to do with the code or the method; it was because I was showing people how to skin when they could just use a stylesheet switcher instead. Good point. [...]]]></description>
			<content:encoded><![CDATA[<p>When I first put them up, I received a lot of criticism on my <a href="http://lirae.co.uk/blog/entries/div-skinning.php">Div Skinning tutorial</a> and <a href="http://lirae.co.uk/blog/entries/iframe-skinning.php">Iframes / Frames Skinning tutorial</a>. It had nothing to do with the code or the method; it was because I was showing people how to <em>skin</em> when they could just use a stylesheet switcher instead.</p>
<p>Good point. Except, when I was asked to write the iframe / frame skinning tutorial, it was for someone who wanted to be able to switch between iframes and frames on their site. Something which couldn&#8217;t be done by just changing the <acronym title="Cascading Style Sheets">CSS</acronym>.<br />
Someone else asked me to modify it so they could use the method in their div layouts, which I &#8211; obviously &#8211; did.<br />
And now, I&#8217;ve written up a <a href="http://lirae.co.uk/blog/entries/stylesheet-switcher.php">Stylesheet Switcher tutorial</a>. <img src='http://lirae.co.uk/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If all of your layouts use exactly the same <acronym title="HyperText Markup Language">HTML</acronym>, you should use a <em>stylesheet switcher</em>.<br />
For those of us who change the <acronym title="HyperText Markup Language">HTML</acronym> of our layouts, then we need to <em>skin</em> our sites.</p>
]]></content:encoded>
			<wfw:commentRss>http://lirae.co.uk/blog/entries/skinning-vs-stylesheet-switcher.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iframe Skinning</title>
		<link>http://lirae.co.uk/blog/entries/iframe-skinning.php</link>
		<comments>http://lirae.co.uk/blog/entries/iframe-skinning.php#comments</comments>
		<pubDate>Mon, 01 Jan 2007 21:47:57 +0000</pubDate>
		<dc:creator>Lirae</dc:creator>
				<category><![CDATA[Almost Tutorials]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://lirae.co.uk/?p=729</guid>
		<description><![CDATA[Skinning with PHP is easy; shove in a bit of code here and a bit of code there, make a couple of different layouts and there you have it: a skinned website. You must already have some knowledge of using &#8220;PHP Includes&#8221;. (Skinning is basically the same as using includes, you just have a few [...]]]></description>
			<content:encoded><![CDATA[<p>Skinning with <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> is easy; shove in a bit of code here and a bit of code there, make a couple of different layouts and there you have it: a skinned website.</p>
<p>You must already have some knowledge of using &#8220;<acronym title="PHP: Hypertext Preprocessor">PHP</acronym> Includes&#8221;.<br />
(Skinning is basically the same as using includes, you just have a few extra lines of code, is all.)</p>
<h3>Getting Ready</h3>
<p>The first thing you need to do is to set up a new folder in your root directory called &#8220;skins&#8221;. Inside &#8220;skins&#8221;, add a <em>numbered</em> folder for each different skin you have; if you have 3 skins, the folders will look like this:</p>
<ul>
<li>root directory
<ul>
<li>skins/
<ul>
<li>1/</li>
<li>2/</li>
<li>3/</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Within each numbered folder, you&#8217;ll need to have a &#8220;header.php&#8221;, &#8220;footer.php&#8221;, your stylesheet, the iframes / frame page (the one with all of the codes) and layout-specific images you&#8217;ll be using.</p>
<p>Once you&#8217;ve done this, you can upload the folders and move onto the next step.</p>
<h3>Coding</h3>
<p>First, we&#8217;ll need to make the file which will control how many skins you have, which skin is the default skin, allow the user to change skins, the path to the header.php, footer.php &amp; frames.php files, <acronym title="et cetera">etc</acronym>.<br />
This file will be called &#8220;skins.php&#8221; and will be uploaded to your <em>root directory</em>.</p>
<p><a href="/foryou/almosttutorials/iframeskins.txt">Download iframeskins.txt</a>.</p>
<p>You&#8217;ll only need to edit the first chunk of coding:<br />
<code>$path = "/home/YOURUSERNAME/public_html/skins/";<br />
$header = "/header.php";<br />
$footer = "/footer.php";<br />
$frames = "/frames.php";<br />
$defaultskin = 2;<br />
$totalskins = 3;</code></p>
<ul>
<li>Change <strong>YOURUSERNAME</strong> to your site&#8217;s username. Since you already use includes, you should know your site&#8217;s username. <img src='http://lirae.co.uk/wp-includes/images/smilies/wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>$header, $footer &amp; $frames <em>will not need changing</em>.</li>
<li><strong>$defaultskin = 2</strong> &#8211; change the number to the number of the skin you want to be the default (self explanatory, really).</li>
<li><strong>$totalskins = 3</strong> &#8211; change this to the number of skins you have&#8230;</li>
</ul>
<p><em>You will not need to edit anything else in that file.</em><br />
Reupload the file now. Please. <img src='http://lirae.co.uk/wp-includes/images/smilies/tongue.gif' alt=':P' class='wp-smiley' /> </p>
<p>Go through every single page on your site and replace your header include (the one at the top of every page&#8230;) with this:<br />
<code>&lt;?php<br />
$rootpath = trim(strip_tags($_SERVER['DOCUMENT_ROOT']));<br />
@require("{$rootpath}/skins.php"); @include "$headerfile";<br />
?&gt;</code><br />
What that basically does is grab the server path and makes sure it&#8217;s clean, then <em>requires</em> that the &#8220;/skins.php&#8221; file be included before including the header file.<br />
(If &#8220;/skins.php&#8221; doesn&#8217;t exist, the page will stop loading.)</p>
<p>&#8230;now replace your footer include (the one at the bottom of every page&#8230;) with this code:<br />
<code>&lt;?php @include "$footerfile";?&gt;</code><br />
That just includes the footer file. <img src='http://lirae.co.uk/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You&#8217;ll also need to make a page called &#8220;enter.php&#8221; or something; this page will hold the code for your iframes / frames layout.<br />
Add this code into the page:<br />
<code>&lt;?php $rootpath = trim(strip_tags($_SERVER['DOCUMENT_ROOT']));<br />
@require("{$rootpath}/skins.php"); @include "$framesfile";?&gt;</code><br />
That is all that will be needed in the &#8220;enter.php&#8221; page; the <code>&lt;html&gt; &lt;head&gt; &lt;title&gt; &lt;title&gt; &lt;/head&gt; &lt;body&gt; ... &lt;/body&gt; &lt;/html&gt;</code> tags will be in the frames.php pages. <img src='http://lirae.co.uk/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>{If you want a centered iframes layout, you&#8217;ll need to have the centered iframes code in the &#8220;frames.php&#8221; file [which will be included into the "enter.php" file...] and make a new file in the same folder called something else, like &#8220;iframes.php&#8221;.}</p>
<p>Unless you&#8217;ve screwed up along the way (unlikely since you&#8217;re most definitely not skim reading this, are you?), everything should work perfectly.</p>
<h3>Changing The Skins</h3>
<p>The link to change the skin is &#8220;?switchskin=[skinnumber]&#8220;.<br />
Example:<br />
<code>&lt;a href="?switchskin=1" target="_top"&gt;Name Of Skin 1&lt;/a&gt;<br />
&lt;a href="?switchskin=2" target="_top"&gt;Name Of Skin 2&lt;/a&gt;<br />
&lt;a href="?switchskin=3" target="_top"&gt;Name Of Skin 3&lt;/a&gt;</code><br />
These links should go on your splash page or something; when the user clicks the link, they&#8217;ll be redirected back to the page they just came from&#8230;which might cause some confusion if the links were placed in an in-frame page and then redirected to <em>just</em> that page; no actual layout.</p>
<h3>Miscellaneous</h3>
<p>You can show the visitor which skin they&#8217;re currently using by inserting this snippet wherever you want:<br />
<code>You are currently using skin number &lt;?php print $currentskin;?&gt;!</code></p>
<p>You could also have an image that changes with the skin the person is using:<br />
<code>&lt;img src="http://site.com/skins/&lt;?php print $currentskin;?&gt;/image.gif" alt="short description" /&gt;</code></p>
<p>You could even insert custom layout information in your sidebar (or something):<br />
<code>&lt;?php @include("{$rootpath}/skins/{$currentskin}/info.php");?&gt;</code></p>
<p><strong>You should be aware though</strong> that $_SERVER['DOCUMENT_ROOT'] can be easily spoofed by a nasty visitor (I&#8217;ve also noticed that it refuses to work with AwardSpace.com).<br />
If you&#8217;d rather be safe than sorry, delete this line:<br />
<code>$rootpath = trim(strip_tags($_SERVER['DOCUMENT_ROOT']));</code><br />
and replace:<br />
<code>{$rootpath}</code><br />
with:<br />
<code>/home/YOURUSERNAME/public_html</code><br />
You&#8217;ll need to know your <a href="http://lirae.co.uk/blog/entries/absolute-path.php">absolute path</a> though.</p>
]]></content:encoded>
			<wfw:commentRss>http://lirae.co.uk/blog/entries/iframe-skinning.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Absolute Path</title>
		<link>http://lirae.co.uk/blog/entries/absolute-path.php</link>
		<comments>http://lirae.co.uk/blog/entries/absolute-path.php#comments</comments>
		<pubDate>Mon, 01 Jan 2007 21:44:26 +0000</pubDate>
		<dc:creator>Lirae</dc:creator>
				<category><![CDATA[Almost Tutorials]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://lirae.co.uk/?p=726</guid>
		<description><![CDATA[For some PHP scripts / tutorials, you might need something called an &#8220;absolute path&#8221; or &#8220;server path&#8221;. To find out what your absolute or server path is, just paste the following snippet into a new document, save it as a &#8220;.php&#8221; file, upload it to your site and view that file with your browser. Your [...]]]></description>
			<content:encoded><![CDATA[<p>For some <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> scripts / tutorials, you might need something called an &#8220;absolute path&#8221; or &#8220;server path&#8221;.</p>
<p>To find out what your absolute or server path is, just paste the following snippet into a new document, save it as a &#8220;.php&#8221; file, upload it to your site and view that file with your browser. Your path will be shown on the screen.<br />
<code>&lt;?php print trim(strip_tags($_SERVER['DOCUMENT_ROOT']));?&gt;</code><br />
Make sure you delete the file once you&#8217;ve got your path written down somewhere safe. <img src='http://lirae.co.uk/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://lirae.co.uk/blog/entries/absolute-path.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Div Skinning</title>
		<link>http://lirae.co.uk/blog/entries/div-skinning.php</link>
		<comments>http://lirae.co.uk/blog/entries/div-skinning.php#comments</comments>
		<pubDate>Mon, 01 Jan 2007 21:40:21 +0000</pubDate>
		<dc:creator>Lirae</dc:creator>
				<category><![CDATA[Almost Tutorials]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Help]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://lirae.co.uk/?p=721</guid>
		<description><![CDATA[Skinning with PHP is easy; shove in a bit of code here and a bit of code there, make a couple of different layouts and there you have it: a skinned website. You must already have some knowledge of using &#8220;PHP Includes&#8221;. (Skinning is basically the same as using includes, you just have a few [...]]]></description>
			<content:encoded><![CDATA[<p>Skinning with <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> is easy; shove in a bit of code here and a bit of code there, make a couple of different layouts and there you have it: a skinned website.</p>
<p>You must already have some knowledge of using &#8220;<acronym title="PHP: Hypertext Preprocessor">PHP</acronym> Includes&#8221;.<br />
(Skinning is basically the same as using includes, you just have a few extra lines of code, is all.)</p>
<h3>Getting Ready</h3>
<p>The first thing you need to do is to set up a new folder in your root directory called &#8220;skins&#8221;. Inside &#8220;skins&#8221;, add a <em>numbered</em> folder for each different skin you have; if you have 3 skins, the folders will look like this:</p>
<ul>
<li>root directory
<ul>
<li>skins/
<ul>
<li>1/</li>
<li>2/</li>
<li>3/</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Within each numbered folder, you&#8217;ll need to have a &#8220;header.php&#8221;, &#8220;footer.php&#8221;, your stylesheet and layout-specific images you&#8217;ll be using.</p>
<p>Once you&#8217;ve done this, you can upload the folders and move onto the next step.</p>
<h3>Coding</h3>
<p>First, we&#8217;ll need to make the file which will control how many skins you have, which skin is the default skin, allow the user to change skins, the path to the header.php &amp; footer.php files, <acronym title="et cetera">etc</acronym>.<br />
This file will be called &#8220;skins.php&#8221; and will be uploaded to your <em>root directory</em>.</p>
<p><a href="/foryou/almosttutorials/divskins.txt">Download divskins.txt</a>.</p>
<p>You&#8217;ll only need to edit the first chunk of coding:<br />
<code>$path = "/home/YOURUSERNAME/public_html/skins/";<br />
$header = "/header.php";<br />
$footer = "/footer.php";<br />
$defaultskin = 2;<br />
$totalskins = 3;</code></p>
<ul>
<li>Change <strong>YOURUSERNAME</strong> to your site&#8217;s username. Since you already use includes, you should know your site&#8217;s username. <img src='http://lirae.co.uk/wp-includes/images/smilies/wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>$header and $footer <em>will not need changing</em>.</li>
<li><strong>$defaultskin = 2</strong> &#8211; change the number to the number of the skin you want to be the default (self explanatory, really).</li>
<li><strong>$totalskins = 3</strong> &#8211; change this to the number of skins you have&#8230;</li>
</ul>
<p><em>You will not need to edit anything else in that file.</em><br />
Reupload the file now. Please. <img src='http://lirae.co.uk/wp-includes/images/smilies/tongue.gif' alt=':P' class='wp-smiley' /> </p>
<p>Go through every single page on your site and replace your header include (the one at the top of every page&#8230;) with this:<br />
<code>&lt;?php<br />
$rootpath = trim(strip_tags($_SERVER['DOCUMENT_ROOT']));<br />
@require("{$rootpath}/skins.php"); @include "$headerfile";<br />
?&gt;</code><br />
What that basically does is grab the server path and makes sure it&#8217;s clean, then <em>requires</em> that the &#8220;/skins.php&#8221; file be included before including the header file.<br />
(If &#8220;/skins.php&#8221; doesn&#8217;t exist, the page will stop loading.)</p>
<p>&#8230;now replace your footer include (the one at the bottom of every page&#8230;) with this code:<br />
<code>&lt;?php @include "$footerfile";?&gt;</code><br />
That just includes the footer file. <img src='http://lirae.co.uk/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Unless you&#8217;ve screwed up along the way (unlikely since you&#8217;re most definitely not skim reading this, are you?), everything should work perfectly.</p>
<h3>Changing The Skins</h3>
<p>There&#8217;s a reason why &#8220;skins.php&#8221; is included into every skinned page; the visitor can change the skin with no preview page crap and they won&#8217;t lose the page they&#8217;re currently on. Woohoo!</p>
<p>Anyway, the link to change the skin is &#8220;?switchskin=[skinnumber]&#8220;.<br />
Example:<br />
<code>&lt;a href="?switchskin=1"&gt;Name Of Skin 1&lt;/a&gt;<br />
&lt;a href="?switchskin=2"&gt;Name Of Skin 2&lt;/a&gt;<br />
&lt;a href="?switchskin=3"&gt;Name Of Skin 3&lt;/a&gt;</code><br />
These links can go on any skinned page; the file that allows the visitor to switch the skin is included into every page.</p>
<h3>Miscellaneous</h3>
<p>You can show the visitor which skin they&#8217;re currently using by inserting this snippet wherever you want:<br />
<code>You are currently using skin number &lt;?php print $currentskin;?&gt;!</code></p>
<p>You could also have an image that changes with the skin the person is using:<br />
<code>&lt;img src="http://site.com/skins/&lt;?php print $currentskin;?&gt;/image.gif" alt="short description" /&gt;</code></p>
<p>You could even insert custom layout information in your sidebar (or something):<br />
<code>&lt;?php @include("{$rootpath}/skins/{$currentskin}/info.php");?&gt;</code></p>
<p><strong>You should be aware though</strong> that $_SERVER['DOCUMENT_ROOT'] can be easily spoofed by a nasty visitor (I&#8217;ve also noticed that it refuses to work with AwardSpace.com).<br />
If you&#8217;d rather be safe than sorry, delete this line:<br />
<code>$rootpath = trim(strip_tags($_SERVER['DOCUMENT_ROOT']));</code><br />
and replace:<br />
<code>{$rootpath}</code><br />
with:<br />
<code>/home/YOURUSERNAME/public_html</code><br />
You&#8217;ll need to know your <a href="http://lirae.co.uk/blog/entries/absolute-path.php">absolute path</a> though.</p>
]]></content:encoded>
			<wfw:commentRss>http://lirae.co.uk/blog/entries/div-skinning.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

