<?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>SRJM.co.uk &#187; PHP</title>
	<atom:link href="http://www.srjm.co.uk/journal/tagged/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.srjm.co.uk</link>
	<description>The online journal of digital artist and web designer Simon R.J. Mutton.</description>
	<lastBuildDate>Fri, 09 Jul 2010 20:56:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>New Site Design Up and Running</title>
		<link>http://www.srjm.co.uk/journal/2009/09/new-site-design-up-and-running/</link>
		<comments>http://www.srjm.co.uk/journal/2009/09/new-site-design-up-and-running/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 09:42:25 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[General Stuff]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Artwork]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Vector]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.srjm.co.uk/?p=651</guid>
		<description><![CDATA[<p>So finally I've switched my website to the new design, with a hefty number of new bits and pieces being added so you'll have to bear with me for a little while as things get sorted out. Some of the bigger changes include integrating twitter (for which I have had an unused account for years) as a sort of microblogging tool, separating my university work from my professional portfolio and integrating a 'Related Posts' system which I have had in mind for a long time but have only just discovered a brilliant plugin that does all the hard work for me.</p>
<p class="alignCentre"><a href="http://www.flickr.com/photos/thanandyr/3944338052/" title="twitter-icons by srjm, on Flickr"><img src="http://farm3.static.flickr.com/2436/3944338052_06eae5aec0.jpg" width="500" height="371" alt="twitter-icons" /></a></p>]]></description>
			<content:encoded><![CDATA[<p>So finally I&#8217;ve switched my website to the new design, with a hefty number of new bits and pieces being added so you&#8217;ll have to bear with me for a little while as things get sorted out. Some of the bigger changes include integrating twitter (for which I have had an unused account for years) as a sort of microblogging tool, separating my university work from my professional portfolio and integrating a &#8216;Related Posts&#8217; system which I have had in mind for a long time but have only just discovered a brilliant plugin that does all the hard work for me.</p>
<p class="alignCentre"><a href="http://www.flickr.com/photos/thanandyr/3944338052/" title="twitter-icons by srjm, on Flickr"><img src="http://farm3.static.flickr.com/2436/3944338052_06eae5aec0.jpg" width="500" height="371" alt="twitter-icons" /></a></p>
<p class="imageCaption">Above is a shot of a couple of the images I&#8217;ve produced for new site features.</p>
<p>You can find that related posts plugin at <a href="http://wordpress.org/extend/plugins/similar-posts/">http://wordpress.org/extend/plugins/similar-posts/</a>. Another plugin by the same authors is one that shows a list of the most recent posts.  In the old design I had this functionality hardcoded into the theme footer but now it can be done with a single line of PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.srjm.co.uk/journal/2009/09/new-site-design-up-and-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP, Adobe PDF and Server Response Headers</title>
		<link>http://www.srjm.co.uk/journal/2009/08/php-adobe-pdf-and-server-response-headers/</link>
		<comments>http://www.srjm.co.uk/journal/2009/08/php-adobe-pdf-and-server-response-headers/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 12:37:42 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.srjm.co.uk/?p=627</guid>
		<description><![CDATA[I&#8217;ve been rather busy lately producing the PHP backend code for a document storage website and when it came to the question of where to actually store the files the answer naturally was somewhere outside of public_html so that control could be limited using the user authentication already available for the PHP pages. This meant [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been rather busy lately producing the PHP backend code for a document storage website and when it came to the question of where to actually store the files the answer naturally was somewhere outside of public_html so that control could be limited using the user authentication already available for the PHP pages. This meant that PHP would have to deliver a response as if the actual file itself was being accessed.</p>
<p>It&#8217;s pretty easy to find how to send alternative headers and a the source data from a PDF file: for example <a href="http://uk3.php.net/manual/en/function.header.php">http://uk3.php.net/manual/en/function.header.php</a> Additionally, there is plenty of information out there if you want to use &#8216;Content-Disposition&#8217; to force the client&#8217;s browser to behave as if the file was a download rather than load Adobe Reader in the window itself.</p>
<p>However this was all fine until we discovered that Adobe Reader&#8217;s usual behaviour of displaying the first page and loading the document as it is being read was broken. This system is intended for some fairly large documents and the browser was choosing to download and cache the entire file before displaying anything. I knew immediately it would be something to do with the headers.</p>
<p>There is very little I could find that expanded on this issue, so using an online tool that can be found at <a href="http://www.askapache.com/online-tools/http-headers-tool/">http://www.askapache.com/online-tools/http-headers-tool/</a> I examined what response would be sent by accessing a PDF file directly from the server. Using this I could replicate the header in PHP and as I guessed, the issue was resolved:</p>
<p><code><br />
header('Accept-Ranges: bytes');<br />
header('Content-Length: '.$filesize);<br />
header('Connection: close');<br />
header('Content-Type: application/pdf');<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.srjm.co.uk/journal/2009/08/php-adobe-pdf-and-server-response-headers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Referrer Message Plugin for WordPress</title>
		<link>http://www.srjm.co.uk/journal/2009/08/referrer-message-plugin-for-wordpress/</link>
		<comments>http://www.srjm.co.uk/journal/2009/08/referrer-message-plugin-for-wordpress/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 19:49:40 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[General Stuff]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.srjm.co.uk/?p=623</guid>
		<description><![CDATA[I was looking through some old del.icio.us tags when clicking on a link brought me to a blog that had implemented a specialised greeting message based on the referer. I know grabbing a referer isn&#8217;t that hard but having never seen it put to this use before I actually felt this was quite clever. A [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking through some old del.icio.us tags when clicking on a link brought me to a blog that had implemented a specialised greeting message based on the referer. I know grabbing a referer isn&#8217;t that hard but having never seen it put to this use before I actually felt this was quite clever. </p>
<p>A link to the plugin: <a href="http://www.phoenixheart.net/wp-plugins/referrer-detector/">http://www.phoenixheart.net/wp-plugins/referrer-detector/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.srjm.co.uk/journal/2009/08/referrer-message-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continued WordPress Post Numbering</title>
		<link>http://www.srjm.co.uk/journal/2009/06/continued-wordpress-post-numbering/</link>
		<comments>http://www.srjm.co.uk/journal/2009/06/continued-wordpress-post-numbering/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 16:31:46 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.srjm.co.uk/?p=612</guid>
		<description><![CDATA[My further experimentation led me to requiring the current number of a post which there is surprisingly little information about, so I ended up working something out from scratch. I&#8217;ve posted it on the wordpress forum in case it proves useful for anyone else: http://wordpress.org/support/topic/245629 Update: Since this is now closed, I have included the [...]]]></description>
			<content:encoded><![CDATA[<p>My further experimentation led me to requiring the current number of a post which there is surprisingly little information about, so I ended up working something out from scratch.</p>
<p>I&#8217;ve posted it on the wordpress forum in case it proves useful for anyone else: <a href="http://wordpress.org/support/topic/245629">http://wordpress.org/support/topic/245629</a></p>
<p><strong>Update:</strong> Since this is now closed, I have included the code I made originally here:</p>
<p><code><br />
function Get_Post_Number($postID){<br />
<span class="oneTab">$temp_query = $wp_query;</span><br />
<span class="oneTab">$postNumberQuery = new WP_Query('orderby=date&#038;posts_per_page=-1');</span><br />
<span class="oneTab">$counter = 1;</span><br />
<span class="oneTab">$postCount = 0;</span><br />
<span class="oneTab">if($postNumberQuery->have_posts()) :</span><br />
<span class="twoTab">while ($postNumberQuery->have_posts()) : $postNumberQuery->the_post();</span><br />
<span class="threeTab">if ($postID == get_the_ID()){</span><br />
<span class="fourTab">$postCount = $counter;</span><br />
<span class="threeTab">} else {</span><br />
<span class="fourTab">$counter++;</span><br />
<span class="threeTab">}</span><br />
<span class="oneTab">endwhile; endif;</span><br />
<span class="oneTab">wp_reset_query();</span><br />
<span class="oneTab">$wp_query = $temp_query;</span><br />
<span class="oneTab">return $postCount;</span><br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.srjm.co.uk/journal/2009/06/continued-wordpress-post-numbering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Post Numbering</title>
		<link>http://www.srjm.co.uk/journal/2009/06/wordpress-post-numbering/</link>
		<comments>http://www.srjm.co.uk/journal/2009/06/wordpress-post-numbering/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 09:48:07 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.srjm.co.uk/?p=608</guid>
		<description><![CDATA[A plugin that will produce similar links to those found at the bottom of a google or flickr results page. http://wordpress.org/extend/plugins/wp-page-numbers/ Unfortunately this wasn&#8217;t quite what I was after, since it works with the existing pagination system of WordPress.]]></description>
			<content:encoded><![CDATA[<p>A plugin that will produce similar links to those found at the bottom of a google or flickr results page.</p>
<p><a href="http://wordpress.org/extend/plugins/wp-page-numbers/">http://wordpress.org/extend/plugins/wp-page-numbers/</a></p>
<p>Unfortunately this wasn&#8217;t quite what I was after, since it works with the existing pagination system of WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.srjm.co.uk/journal/2009/06/wordpress-post-numbering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress and SMF Integration</title>
		<link>http://www.srjm.co.uk/journal/2008/03/wordpress-and-smf-integration/</link>
		<comments>http://www.srjm.co.uk/journal/2008/03/wordpress-and-smf-integration/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 12:14:36 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Work Placement]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.srjm.co.uk/journal/2008/03/wordpress-and-smf-integration/</guid>
		<description><![CDATA[As we continue to develop the Ocean Addict website it was decided that the forum needed to be as robust and powerful as possible so this meant installing additional forum software, in the form of a Simple Machines Forum. Once this was done, clearly there needed to be as much integration for users as possible, [...]]]></description>
			<content:encoded><![CDATA[<p>As we continue to develop the <a href="http://www.oceanaddict.co.uk">Ocean Addict</a> website it was decided that the forum needed to be as robust and powerful as possible so this meant installing additional forum software, in the form of a Simple Machines Forum. Once this was done, clearly there needed to be as much integration for users as possible, from logging in to styling the user interface, so I set about searching for a method of bridging WordPress and SMF.</p>
<p>I quickly found <a href="http://wordpress.org/extend/plugins/wp-smf-a-simplemachines-bridge/">http://wordpress.org/extend/plugins/wp-smf-a-simplemachines-bridge/</a>, which seemed ideal. That is until after diligently following the installation instructions the plugin caused the entire site to break. Fortunately WordPress&#8217;s plugin system can be rescued by simply deleting the offending plugin.</p>
<p>Searching for much longer wielded a solution based on the first. The stuff that can be found at <a href="http://www.earthorbit.com/opensource/">http://www.earthorbit.com/opensource/</a> DOES work and works well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.srjm.co.uk/journal/2008/03/wordpress-and-smf-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Content Management Systems Research</title>
		<link>http://www.srjm.co.uk/journal/2008/03/content-management-systems-research/</link>
		<comments>http://www.srjm.co.uk/journal/2008/03/content-management-systems-research/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 12:28:27 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[General Stuff]]></category>
		<category><![CDATA[Work Placement]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.srjm.co.uk/journal/2008/03/content-management-systems-research/</guid>
		<description><![CDATA[For the Ocean Addict website I have been looking into open source solutions to creating a form of CMS to link together the main features now wanted for the site. An obvious choice might be something like Joomla! or Drupal but we have already got together the blog frontpage and a store, so instead the [...]]]></description>
			<content:encoded><![CDATA[<p>For the Ocean Addict website I have been looking into open source solutions to creating a form of CMS to link together the main features now wanted for the site. An obvious choice might be something like Joomla! or Drupal but we have already got together the blog frontpage and a store, so instead the site is heading for WordPress. I&#8217;ve heard of WP being used before as a CMS, it is known for its flexibility but until now I have never considered using it as anything more as a blog.</p>
<p>An excellent page bringing together a whole range of resources to do just this can be found at:</p>
<p class="alignCentre"><strong><a href="http://www.graphicdesignblog.co.uk/wordpress-as-a-cms-content-management-system/">http://www.graphicdesignblog.co.uk/wordpress-as-a-cms-content-management-system/</a></strong></p>
<p>Before now I have experimented with the <a href="http://www.alexrabe.boelinger.com/wordpress-plugins/nextgen-gallery/">nextgen gallery wordpress system</a> and the <a href="http://www.stuff.yellowswordfish.com/simple-forum/">wordpress simple forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.srjm.co.uk/journal/2008/03/content-management-systems-research/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating breadcrumb links</title>
		<link>http://www.srjm.co.uk/journal/2007/10/creating-breadcrumb-links/</link>
		<comments>http://www.srjm.co.uk/journal/2007/10/creating-breadcrumb-links/#comments</comments>
		<pubDate>Sat, 27 Oct 2007 08:38:55 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[General Stuff]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://srjm.co.uk/journal/2007/10/27/creating-breadcrumb-links/</guid>
		<description><![CDATA[I decided that I would like to create a breadcrumb links bar for the top section of each page of my new website design. A google search brought many many differing ways of achieving this using PHP however none of them seemed to concisely achieve what I needed. So instead I used a few of [...]]]></description>
			<content:encoded><![CDATA[<p>I decided that I would like to create a breadcrumb links bar for the top section of each page of my new website design. A google search brought many many differing ways of achieving this using PHP however none of them seemed to concisely achieve what I needed. So instead I used a few of the most useful examples as a reference and created my own. The following are a good place to start I found, especially the first listed here (although last one I found):</p>
<p><a href="http://www.sillybean.net/archives/452">http://www.sillybean.net/archives/452</a></p>
<p><a href="http://www.zend.com/zend/spotlight/breadcrumb28.php">http://www.zend.com/zend/spotlight/breadcrumb28.php</a></p>
<p><a href="http://gr0w.com/articles/code/php_breadcrumb_links_creator/">http://gr0w.com/articles/code/php_breadcrumb_links_creator/</a></p>
<p>Next comes the CSS for that general area, including my new design&#8217;s main navigation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.srjm.co.uk/journal/2007/10/creating-breadcrumb-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

