<?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>Chris&#039; Blog &#187; Site</title>
	<atom:link href="http://www.cs278.org/blog/category/technology/network/site/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cs278.org/blog</link>
	<description>“A metal loving, web developing, open source contributor.”</description>
	<lastBuildDate>Sun, 03 Apr 2011 14:36:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress archives</title>
		<link>http://www.cs278.org/blog/2009/03/03/wordpress-archives/</link>
		<comments>http://www.cs278.org/blog/2009/03/03/wordpress-archives/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 05:11:32 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Site]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[mods]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/?p=451</guid>
		<description><![CDATA[I&#8217;ve been running my blog since late 2005 as such my archives had been getting a little bit unwieldy in the sidebar and stretching the page to extraordinary heights. I&#8217;ve reduced this clutter with some very small changes. First I &#8230; <a href="http://www.cs278.org/blog/2009/03/03/wordpress-archives/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been running my blog since <a href="http://www.cs278.org/blog/2005/12/07/welcome/">late 2005</a> as such my archives had been getting a little bit unwieldy in the sidebar and stretching the page to extraordinary heights. I&#8217;ve reduced this clutter with some very small changes. First I dug around only to find out that WordPress doesn&#8217;t support fetching the monthly archives for one year, so I had to apply some filter foomongery. I discovered somebody else has done <a href="http://www.misthaven.org.uk/blog/2009/01/11/filtering-archives/" rel="external">something similar</a>, not quite as nice personally but it works.<br />
<span id="more-451"></span><br />
First I created a filter in my WordPress installation and added it.</p>
<pre>function getarchives_filter($where, $args)
{
	if (isset($args['year']))
	{
		$where .= ' AND YEAR(post_date) = ' . intval($args['year']);
	}
	return $where;
}
add_filter('getarchives_where', 'getarchives_filter', 10, 2);
</pre>
<p>Now the <a href="http://codex.wordpress.org/Template_Tags/wp_get_archives" rel="external"><code>wp_get_archives()</code></a> function supports a year parameter which restricts results to one particular year. Next we modify the sidebar to make use of this additional argument. Here is an example of the correct call to make:</p>
<pre>&lt;?php wp_get_archives('type=monthly&amp;year=' . get_the_time('Y', reset($GLOBALS['posts'])); ?&gt;</pre>
<p>This code also works properly when viewing the archives of a particular year, the months outputted change to the currently viewed year.</p>
<p>I have changed my own sidebar code to use this:</p>
<pre>
&lt;li&gt;&lt;h2&gt;Archives&lt;/h2&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;Months&lt;/strong&gt;
            &lt;ul&gt;
                    &lt;?php
                    // Use the current date when viewing a page, not the pages year
                    $year = (is_page()) ? date('Y') : get_the_time('Y', reset($GLOBALS['posts']));

                    wp_get_archives('type=monthly&amp;limit=12&amp;year[]=' . $year . (!is_archive() ? '&amp;year[]=' . ($year - 1) : ''));
                    ?&gt;
            &lt;/ul&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;Years&lt;/strong&gt;
            &lt;ul&gt;
                    &lt;?php wp_get_archives('type=yearly'); ?&gt;
            &lt;/ul&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
&lt;/li&gt;
</pre>
<p class="note"><strong>Updated 31/01/2010:</strong> Paul spotted a bug, the code used the date of the last post displayed on the page rather than the first.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2009/03/03/wordpress-archives/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Three Years Old</title>
		<link>http://www.cs278.org/blog/2008/12/07/three-years-old/</link>
		<comments>http://www.cs278.org/blog/2008/12/07/three-years-old/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 14:42:18 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Site]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/?p=434</guid>
		<description><![CDATA[I know I started this blog in December 2005 but I wasn&#8217;t quite sure when, so I took a nose and it turns out it was December 7th which means this blog is three years old today. In three years &#8230; <a href="http://www.cs278.org/blog/2008/12/07/three-years-old/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I know I started this blog in <a href="http://www.cs278.org/blog/2005/12/">December 2005</a> but I wasn&#8217;t quite sure when, so I took a nose and it turns out it was <a href="http://www.cs278.org/blog/2005/12/07/welcome/">December 7<sup>th</sup></a> which means this blog is three years old today. In three years I have written 316 entries (including this one) which is an average of 8 a month which is pretty good, and I&#8217;ve never missed a month. <img src='http://www.cs278.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2008/12/07/three-years-old/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Home</title>
		<link>http://www.cs278.org/blog/2008/11/30/new-home/</link>
		<comments>http://www.cs278.org/blog/2008/11/30/new-home/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 16:16:12 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/?p=409</guid>
		<description><![CDATA[My blog has a new home on a VPS hosted by Host Europe shared between me and a friend. It has a nice lean installation of Debian Lenny, running a variety of low profile or tuned applications to provide various &#8230; <a href="http://www.cs278.org/blog/2008/11/30/new-home/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My blog has a new home on a VPS hosted by <a href="http://www.hosteurope.de/" rel="external">Host Europe</a> shared between me and a <a href="http://nokarma.org/" rel="friend">friend</a>. It has a nice lean installation of Debian Lenny, running a variety of low profile or tuned applications to provide various services. We also have another 50MiB of free memory to play with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2008/11/30/new-home/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Upgrade</title>
		<link>http://www.cs278.org/blog/2008/03/30/wordpress-upgrade-4/</link>
		<comments>http://www.cs278.org/blog/2008/03/30/wordpress-upgrade-4/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 20:53:47 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Site]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/?p=356</guid>
		<description><![CDATA[I am currently enjoying the visual refresh WordPress has been given in version 2.5. Its quite cool.]]></description>
			<content:encoded><![CDATA[<p>I am currently enjoying the visual refresh <a href="http://www.wordpress.org/" rel="external">WordPress</a> has been given in version 2.5. Its quite cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2008/03/30/wordpress-upgrade-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Christmas</title>
		<link>http://www.cs278.org/blog/2007/12/25/christmas/</link>
		<comments>http://www.cs278.org/blog/2007/12/25/christmas/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 11:16:55 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Site]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/2007/12/25/christmas/</guid>
		<description><![CDATA[Merry humbug to everyone who believes that some bloke called Jesus was born 2007 years ago today, Merry Christmas to others who joins in the madness just because its &#8216;easier&#8217; that way. Christmas is overly commercialised nowadays and has lost &#8230; <a href="http://www.cs278.org/blog/2007/12/25/christmas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Merry humbug to everyone who believes that some bloke called Jesus was <a href="http://www.lolcatbible.com/index.php?title=Luke_2" rel="external">born</a> 2007 years ago today, Merry Christmas to others who joins in the madness just because its &#8216;easier&#8217; that way. Christmas is overly commercialised nowadays and has lost its religious meaning, boo-hoo. Any how it is two years since I <a href="http://www.cs278.org/blog/2005/12/07/welcome/">started</a> this little blog as a trash can for the crap that accumulates in my head, although apparently some of it is useful to others. Enjoy the festive period, as it means a lack of work and academia for some variable period, in my case 4 weeks. *grins*</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2007/12/25/christmas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgraded</title>
		<link>http://www.cs278.org/blog/2007/10/20/upgraded/</link>
		<comments>http://www.cs278.org/blog/2007/10/20/upgraded/#comments</comments>
		<pubDate>Sat, 20 Oct 2007 14:56:34 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Site]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/2007/10/20/upgraded/</guid>
		<description><![CDATA[I just upgraded this blog using a Subversion patch, seems to be working ok, will keep and eye out for any 404s see if I missed any new files and the like. I also started to burn my feed.]]></description>
			<content:encoded><![CDATA[<p>I just upgraded this blog using a Subversion patch, seems to be working ok, will keep and eye out for any 404s see if I missed any new files and the like. I also started to <a href="http://www.feedburner.com/" rel="external">burn</a> my <a href="http://www.cs278.org/blog/feed/">feed</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2007/10/20/upgraded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabled Akismet, comments held for moderation.</title>
		<link>http://www.cs278.org/blog/2007/09/25/disabled-akismet-comments-held-for-moderation/</link>
		<comments>http://www.cs278.org/blog/2007/09/25/disabled-akismet-comments-held-for-moderation/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 23:42:55 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/2007/09/25/disabled-akismet-comments-held-for-moderation/</guid>
		<description><![CDATA[I have made the decision to disable Akismet, after reading some hype about the new WordPress 2.3&#8242;s plugin version check API, which turned out to be negative but reveals something interesting with regards to Akismet. The following code is taken &#8230; <a href="http://www.cs278.org/blog/2007/09/25/disabled-akismet-comments-held-for-moderation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have made the decision to disable Akismet, after reading some hype about the new WordPress 2.3&#8242;s plugin version check API, which turned out to be negative but reveals something interesting with regards to Akismet. The following code is taken from the official Akismet plugin for Wordpres.</p>
<pre>        $ignore = array( 'HTTP_COOKIE' );

        foreach ( $_SERVER as $key => $value )
                if ( !in_array( $key, $ignore ) )
                        $comment["$key"] = $value;

        $query_string = '';
        foreach ( $comment as $key => $data )
                $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&#038;';

        $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);</pre>
<p>The bit that worries me is the use of <var>$_SERVER</var>, the only item from this array not sent is <var>HTTP_COOKIE</var>, fair enough. But why do you need to know the full paths to the files on my server and other server environment variables Akismet? I do not have a problem with sending data to Akismet, just not this data!</p>
<p><a href="http://groups.google.com/group/wp-hackers/browse_thread/thread/bdced7524fa79a18/2d4e69fb46a6a947" rel="external">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2007/09/25/disabled-akismet-comments-held-for-moderation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Upgraded</title>
		<link>http://www.cs278.org/blog/2007/08/19/wordpress-upgraded/</link>
		<comments>http://www.cs278.org/blog/2007/08/19/wordpress-upgraded/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 16:09:03 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Site]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/2007/08/19/wordpress-upgraded/</guid>
		<description><![CDATA[I have upgraded to WordPress 2.2.2, again using a patch. I have put together a page on patches for the benefit of others.]]></description>
			<content:encoded><![CDATA[<p>I have upgraded to WordPress 2.2.2, again using a patch. I have put together a <a href="/blog/wordpress-patches/">page</a> on patches for the benefit of others.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2007/08/19/wordpress-upgraded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AWOL</title>
		<link>http://www.cs278.org/blog/2007/08/19/awol/</link>
		<comments>http://www.cs278.org/blog/2007/08/19/awol/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 15:38:51 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[University]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/2007/08/19/awol/</guid>
		<description><![CDATA[I have been away from my blog for quite a while, general laziness on my behalf. I&#8217;ve been fairly &#8216;busy&#8217; by my own standards working part time, doing some project work, playing games, sleeping and socialising. My summer is panning &#8230; <a href="http://www.cs278.org/blog/2007/08/19/awol/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been away from my blog for quite a while, general laziness on my behalf. I&#8217;ve been fairly &#8216;busy&#8217; by my own standards working part time, doing some project work, playing games, sleeping and socialising. My summer is panning out quite nicely, and I am now wanting to return to Exeter for my second year, the sooner the better. I am just about to apply the WordPress upgrade that has been released in my absence, and reading the dumper truck load of e-mails that I have received. Fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2007/08/19/awol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Painless Upgrade</title>
		<link>http://www.cs278.org/blog/2007/06/24/another-painless-upgrade/</link>
		<comments>http://www.cs278.org/blog/2007/06/24/another-painless-upgrade/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 17:13:17 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Site]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.cs278.org/blog/2007/06/24/another-painless-upgrade/</guid>
		<description><![CDATA[I don&#8217;t get people who moan about upgrading web software, I suspect these are all fairly dumb people who do not have or know how to use terminal access to their server. I just upgraded WordPress from 2.2 to 2.2.1 &#8230; <a href="http://www.cs278.org/blog/2007/06/24/another-painless-upgrade/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t get people who moan about upgrading web software, I suspect these are all fairly dumb people who do not have or know how to use terminal access to their server. I just upgraded WordPress from 2.2 to 2.2.1 in 5 minutes, <a href="http://static.cs278.org/patches/wordpress/wordpress-2.2_2.2.1.diff">patch</a> for anyone else like me with brains.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cs278.org/blog/2007/06/24/another-painless-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

