<?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>Kisekae World</title>
	<atom:link href="http://www.wmiles.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wmiles.com</link>
	<description>An innovation by William Miles</description>
	<lastBuildDate>Mon, 07 May 2012 15:36:17 +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>Sturgeon King (Elf)</title>
		<link>http://www.wmiles.com/2012/05/sturgeon-king-elf</link>
		<comments>http://www.wmiles.com/2012/05/sturgeon-king-elf#comments</comments>
		<pubDate>Sun, 06 May 2012 16:23:52 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Resin Work in Progress]]></category>
		<category><![CDATA[Balance of the Nine Skies]]></category>
		<category><![CDATA[Sturgeon King]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=3254</guid>
		<description><![CDATA[<p>Hello everyone!  It&#8217;s now early May and I have been making some progress towards finishing this model.  I have started the two figures.  One is an elf girl and the other is a human girl.  The elf girl is now mostly finished, except for the final touch ups when everything is  assembled.  I want [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone!  It&#8217;s now early May and I have been making some progress towards finishing this model.  I have started the two figures.  One is an elf girl and the other is a human girl.  The elf girl is now mostly finished, except for the final touch ups when everything is  assembled.  I want to try and complete the whole Sturgeon King model by the end of May as there is a local model contest coming up and this can be my entry.</p>
<p>In the progress picture that follow you will see that I have added a little sparkle on the elf girl&#8217;s chest and navel.  A darker flesh tone paint had been layered in the cleavage area and under the arms, and the sparkle was applied as part of the shading process by mixing my medium tone acrylic flesh paint with a white pearl.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3268" title="Dsx04584" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsx04584.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>The next picture shows more of the early shading.   I have layered darker colors in the spine and underarms of the torso and under the knee and in the ankle of the leg.  Light shadows also play a part in providing color variation.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3255" title="Dsc04587" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04587.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>The elf ears are slightly darker and a pink over spray has been applied to the cheeks.  I wanted to add some color and break the monotony of a single flesh tone as can be seen in the background of the very first picture.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3262" title="Dsc04680" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04680.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3261" title="Dsc04679" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04679.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>I have also made some progress with the elf body.  I used Daler Rowney pearl ink paints for the bikini.  I like these paints because  I find that they provide a wonderful depth to the pearl effect.  The trim is an acrylic silver from Tamiya.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3259" title="Dsc04594" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04594.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3260" title="Dsc04601" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04601.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>These pictures show the pink pearl I used as a contrast color to the bikini.  I also used Alclad II chrome for the bracelet and anklet, and the fingernails are also chrome.  The Alclad chrome is backed by a gloss black and you can see where I have used this as a contrast for the bracelet by applying the chrome to only the bracelet beads.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3263" title="Dsc04681" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04681.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3264" title="Dsc04684" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04684.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>The elf girl has a transparent collar around her neck.  I plan to paint the bottom part of this opaque with a bronze or gold metallic color so as to look like cloth.  Tamiya clear blue was applied and then over coated with Future clear acrylic.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3265" title="Dsc04685" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04685.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>With the other figure, the girl&#8217;s skirt is a colorful orange and brown.  The piece at the back looks like the cloth and seems to be reasonably coarse, which is nice as I certainly do not want to sand all the crevasses smooth.   But, I did want the color variations to be quite distinct.  This was fun to paint!  The piece is not yet finished as the trim still needs to be applied, but we can see how this will look when it is all done.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3256" title="Dsc04588" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04588.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3257" title="Dsc04590" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04590.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3258" title="Dsc04591" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04591.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>The last two pictures show some initial work on the human girl.  Her hat has been painted with Alclad II dull aluminum for a metallic effect.  I also expect to put a little color into the swirls and wash some black into the lines.   I am also  starting work on her torso.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3266" title="Dsc04686" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04686.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3267" title="Dsc04687" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04687.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>This is where I am at.  I&#8217;m happy, it&#8217;s coming, so please keep the faith as I expect to show more work in a week!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2012/05/sturgeon-king-elf/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.wmiles.com/wordpress/wp-content/uploads/2012/05/Dsc04593_Feature.jpg" length="4539" type="image/jpg" />	</item>
		<item>
		<title>Sturgeon King (Seat)</title>
		<link>http://www.wmiles.com/2012/04/sturgeon-king-seat</link>
		<comments>http://www.wmiles.com/2012/04/sturgeon-king-seat#comments</comments>
		<pubDate>Tue, 17 Apr 2012 01:57:09 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Resin Work in Progress]]></category>
		<category><![CDATA[Balance of the Nine Skies]]></category>
		<category><![CDATA[Sturgeon King]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=3236</guid>
		<description><![CDATA[<p>Back in December when I finished the Sturgeon King serpent I had thought to be able to show you some work on the mushroom seat.  Well, here we are in April and I finally have found some time and motivation to continue work on this fine model by PKking.</p> <p>So, here are some pictures!</p> [...]]]></description>
			<content:encoded><![CDATA[<p>Back in December when I finished the Sturgeon King serpent I had thought to be able to show you some work on the mushroom seat.  Well, here we are in April and I finally have found some time and motivation to continue work on this fine model by PKking.</p>
<p>So, here are some pictures!</p>
<p><img class="aligncenter size-full wp-image-3237" title="Dsc04578a" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/04/Dsc04578a.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>I finished this piece in a brown, earthy tone, as I think this will blend with the base that the figures will sit upon.  The mushroom seat (is there a better name for this?)  is mostly finished with Tamiya and Alclad metallics.  I had originally used a Tamiya titanium silver base coat for this, but the silver color didn&#8217;t really work as I thought it was too similar to the serpent&#8217;s metallic wing.  So I shaded the front and top of the seat with Tamiya bronze, and then put Alclad II copper on the top to introduce a more metallic red color shading. The Alclad copper also provides a better metallic depth and reflection to the piece.</p>
<p>The back of the mushroom seat was not darkened with the bronze, but instead the silver base was colored with Alclad II green to blue prismatic paint.  This gives a generally green metallic over tint to the piece that can transition to a darker blue depending on how you look at it.  The same prismatic paint was also applied to the top of the seat and this is what is giving the varied shades and slight reflective sparkle to the piece.</p>
<p>Alclad II pale gold was lightly sprayed on some of the textured swirls in the piece to bring them out.</p>
<p>All in all, I&#8217;m happy with the result.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3238" title="Dsc04571a" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/04/Dsc04571a.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3239" title="Dsc04566a" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/04/Dsc04566a.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3240" title="Dsc04565a" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/04/Dsc04565a.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3241" title="Dsc04570a" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/04/Dsc04570a.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3242" title="Dsc04574a" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/04/Dsc04574a.jpg" alt="" width="600" height="402" /></p>
<p>&nbsp;</p>
<p>As you can see in the last photo I now have the figures primed.  The next step is to start to paint and assemble them.  I have some well needed vacation time coming up over the next little while, so hopefully I can show more progress without another lengthy wait!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2012/04/sturgeon-king-seat/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.wmiles.com/wordpress/wp-content/uploads/2012/04/Dsc04562-Featured-Image.jpg" length="6484" type="image/jpg" />	</item>
		<item>
		<title>Las Vegas Boulevard</title>
		<link>http://www.wmiles.com/2012/03/las-vegas-boulevard</link>
		<comments>http://www.wmiles.com/2012/03/las-vegas-boulevard#comments</comments>
		<pubDate>Fri, 30 Mar 2012 21:08:29 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Personal Essays]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=3064</guid>
		<description><![CDATA[<p>I recently had an opportunity to attend a conference in Las Vegas and I thought to share a few pictures of my walk down the Las Vegas strip. The hotels and shopping are quite remarkable. Click on any image to see the full gallery.</p> <p>Note, after posting this I noticed that many of the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had an opportunity to attend a conference in Las Vegas and I thought to share a few pictures of my walk down the Las Vegas strip. The hotels and shopping are quite remarkable. Click on any image to see the full <a href="http://www.wmiles.com/v/nevada/lasvegas">gallery</a>.</p>
<p>Note, after posting this I noticed that many of the building pictures suffered from perspective distortion.  It is something that happens when pictures are taken of tall buildings where they are not being viewed &#8216;square on&#8217;.  This distortion can be corrected with post-processing tools.  I have corrected a few noticably distorted pictures in this set.</p>
<p>&nbsp;</p>
<table class="aligncenter" style="width: 100%;" border="0" cellspacing="0" cellpadding="5" align="center">
<tbody>
<tr>
<td colspan="2">
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04529 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/10010-2/Dsc04529.jpg" width="600" height="401" id="IFid20" class="ImageFrame_None" title="Las Vegas" alt="Dsc04529"/></a></div></td></tr></table></div>
<p style="text-align: center;">Now, where would we be without the Vegas show girls?</p>
</td>
</tr>
<tr>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04442 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9841-2/Dsc04442.jpg" width="300" height="201" id="IFid21" class="ImageFrame_None" title="Las Vegas" alt="Dsc04442"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04443 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9845-2/Dsc04443.jpg" width="300" height="201" id="IFid22" class="ImageFrame_None" title="Las Vegas" alt="Dsc04443"/></a></div></td></tr></table></div>
</td>
</tr>
<tr>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04448 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9857-2/Dsc04448.jpg" width="300" height="201" id="IFid23" class="ImageFrame_None" title="Las Vegas" alt="Dsc04448"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04451 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9869-2/Dsc04451.jpg" width="300" height="201" id="IFid24" class="ImageFrame_None" title="Las Vegas" alt="Dsc04451"/></a></div></td></tr></table></div>
</td>
</tr>
<tr>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" DSC04450 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/11088-2/DSC04450.JPG" width="300" height="210" id="IFid25" class="ImageFrame_None" title="Las Vegas" alt="DSC04450"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04456 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9885-2/Dsc04456.jpg" width="300" height="201" id="IFid26" class="ImageFrame_None" title="Las Vegas" alt="Dsc04456"/></a></div></td></tr></table></div>
</td>
</tr>
<tr>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" DSC04474 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/11096-2/DSC04474.JPG" width="300" height="201" id="IFid27" class="ImageFrame_None" title="Las Vegas" alt="DSC04474"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04477 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9933-2/Dsc04477.jpg" width="300" height="201" id="IFid28" class="ImageFrame_None" title="Las Vegas" alt="Dsc04477"/></a></div></td></tr></table></div>
</td>
</tr>
<tr>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04476 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9929-2/Dsc04476.jpg" width="300" height="201" id="IFid29" class="ImageFrame_None" title="Las Vegas" alt="Dsc04476"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04494 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9941-2/Dsc04494.jpg" width="300" height="201" id="IFid30" class="ImageFrame_None" title="Las Vegas" alt="Dsc04494"/></a></div></td></tr></table></div>
</td>
</tr>
<tr>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" DSC04498 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/11108-2/DSC04498.JPG" width="300" height="201" id="IFid31" class="ImageFrame_None" title="Las Vegas" alt="DSC04498"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04502 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9953-2/Dsc04502.jpg" width="300" height="201" id="IFid32" class="ImageFrame_None" title="Las Vegas" alt="Dsc04502"/></a></div></td></tr></table></div>
</td>
</tr>
<tr>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" DSC04475 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/11100-2/DSC04475.JPG" width="300" height="201" id="IFid33" class="ImageFrame_None" title="Las Vegas" alt="DSC04475"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04509 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/9965-2/Dsc04509.jpg" width="300" height="201" id="IFid34" class="ImageFrame_None" title="Las Vegas" alt="Dsc04509"/></a></div></td></tr></table></div>
</td>
</tr>
<tr>
<td>
<div class="g2image_centeredt"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04532 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/10017-2/Dsc04532.jpg" width="300" height="201" id="IFid35" class="ImageFrame_None" title="Las Vegas" alt="Dsc04532"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04535 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/10021-2/Dsc04535.jpg" width="300" height="201" id="IFid36" class="ImageFrame_None" title="Las Vegas" alt="Dsc04535"/></a></div></td></tr></table></div>
</td>
</tr>
<tr>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04544 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/10045-2/Dsc04544.jpg" width="300" height="201" id="IFid37" class="ImageFrame_None" title="Las Vegas" alt="Dsc04544"/></a></div></td></tr></table></div>
</td>
<td>
<div class="g2image_centered"><table align="center" cellspacing="0" cellpadding="0"><tr><td><div class="wpg2tag-image"><a href="http://www.wmiles.com/v/nevada/lasvegas"  title=" Dsc04555 " rev="http://www.wmiles.com/v/nevada/lasvegas" ><img src="http://www.wmiles.com/gallery2/d/10065-2/Dsc04555.jpg" width="300" height="201" id="IFid38" class="ImageFrame_None" title="Las Vegas" alt="Dsc04555"/></a></div></td></tr></table></div>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2012/03/las-vegas-boulevard/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>W3TC Cache Preload or Cache Prime</title>
		<link>http://www.wmiles.com/2012/03/w3tc-cache-preload</link>
		<comments>http://www.wmiles.com/2012/03/w3tc-cache-preload#comments</comments>
		<pubDate>Sun, 04 Mar 2012 19:37:11 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Website Customization]]></category>
		<category><![CDATA[w3tc]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=2686</guid>
		<description><![CDATA[<p>W3TC Total Cache is a WordPress plugin for page caching of WordPress sites.  Release version 0.9.2.4 has four faults in the cache preload function that prevent successful operation of this feature.  This post provides code corrections for these faults.  One additional fault that can result in failure to process URL redirection for page requests is also fixed. </p>
<p>This post also introduces new features to ensure that pages are primed only when required; it provides an enhancement for visible monitoring and tracing cache preload activities; and it enables setting different cache retention times depending on the page URL.</p>
<p>This post applies to both basic mode and enhanced mode disk caching.  Cache priming has been primarily tested for basic mode disk caching.</p>
<p>&nbsp;</p>
<h3>Index</h3>
<p>This post has 4 pages.  Page navigation is at the bottom of each page.</p>
<p>Page 1.  Describes the known faults or bugs in W3TC Total Cache version 0.9.2.4 preload function.</p>
<p>Page 2.  Describes a feature enhancement to enable setting of specific page cache expiry times.</p>
<p>Page 3.  Describes a feature enhancement to allow administrator control and monitoring of prime activities.</p>
<p>Page 4.  Describes a feature enhancement to prime only uncached and valid pages.</p>
<p>&nbsp;</p>
<h3> Download</h3>
<p>A full download of W3TC Total Cache version 0.9.2.4 with corrected source code as shown is available <a title="W3TC Total Cache 0.9.2.4" href="http://www.wmiles.com/cgi-bin/load.pl?/js/w3-total-cache.zip">here</a>.</p>
<p>&nbsp;</p>
<h3>Introduction</h3>
<p>Cache preload, also known as cache priming, is a caching feature to ensure that a page is always ready and stored in cache.  Cached pages improve site performance.  Preloading of cached pages ensures that any initial access to a page will respond as quickly as repeat access to a page.</p>
<p>W3TC cache preload operates as a background activity scheduled by the WordPress cron function.  The priming activity is invoked only after the cron time expires and the WordPress site is accessed.  This means that once the cron time expires the next prime activity runs only after the site is next accessed.</p>
<p>When the prime activity runs it will preload a specified number of pages.  Before preloading any pages it schedules a new instance of the preload activity on the WordPress cron timer.  Therefore, as the prime activity is executing while the next activity is waiting, it is necessary to ensure that the cron timer wait time is longer than the execution time of the prime activity.  Typically, the W3TC update interval or cron wait time should be in the order of 5 or 10 minutes, and the pages processed per interval should be around 10 or 20 so that the total page access time for all pages should be less than a minute or two.</p>
<p>&nbsp;</p>
<h3>Fault 1</h3>
<p>In <code>PgCacheAdmin.php</code> the function &#8216;w3_url_format&#8217; is called prior to initiating the HTTP request to load the page. The existing code does not include a reference to the location of this function for dynamic linking to the function definition. This means that the execution silently fails after the next periodic scheduling of the prime function. Page priming will appear to be operating, events will be queued, but no cache files will ever be loaded. The missing statement is shown in a different color.</p>
<p>&nbsp;</p>
<h4>w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Prime cache
     *
     * @param integer $start
     * @return void
     */
    function prime($start = 0) {
.
.
.
        /**
         * Make HTTP requests and prime cache
         */
        require_once W3TC_INC_DIR . '/functions/http.php';
       	<span style="color: #993300;">require_once W3TC_INC_DIR . '/functions/url.php';</span>

        foreach ($queue as $url) {
            $url = w3_url_format($url, array('w3tc_preload' =&gt; 1));

            w3_http_get($url);
        }
.
.
.</pre>
</div>
<p>&nbsp;</p>
<h3>Fault 2</h3>
<p>The second problem with the released implementation is that the &#8216;w3_url_format&#8217; function adds the query string &#8216;w3tc_preload = 1&#8242; to the page URL. In many cases the W3TC implementation may be configured to not cache URLs with query strings, thus the requested page will never be cached. </p>
<p>One solution to this fault is to remove the query string from URL wherever it may cause incorrect behaviour. Page caching is determined in function <code>PgCache.php</code>, in two places. One is in function &#8216;process()&#8217; where the page request is examined for caching, and the other is in function &#8216;_can_cache()&#8217; where the URL is examined for a query string. The requred statements to eliminate the query string are shown in a different color.</p>
<h4>w3-total-cache/lib/W3/PgCache.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Do cache logic
     */
    function process() {
.
.
.
        if ($this-&gt;_caching &amp;&amp; !$this-&gt;_enhanced_mode) {
            $cache = &amp; $this-&gt;_get_cache();

            /**
             * Remove preload query string on URL to cache
             */
            <span style="color: #993300;">$this-&gt;_request_uri = preg_replace('~[\?\&amp;]w3tc_preload.*~i', '', $this-&gt;_request_uri);</span>

            $mobile_group = $this-&gt;_get_mobile_group();
            $referrer_group = $this-&gt;_get_referrer_group();
            $encryption = $this-&gt;_get_encryption();
            $compression = $this-&gt;_get_compression();
            $raw = !$compression;
            $this-&gt;_page_key = $this-&gt;_get_page_key($this-&gt;_request_uri, $mobile_group, $referrer_group, $encryption, $compression);
.
.
.
    /**
     * Checks if can we do cache logic
     *
     * @return boolean
     */
    function _can_cache() {
.
.
.
        /**
         * Skip if there is query in the request uri
         */
        <span style="color: #993300;">$uri = preg_replace('~[\?\&amp;]w3tc_preload.*~i', '', $this-&gt;_request_uri);</span>
        if (!$this-&gt;_config-&gt;get_boolean('pgcache.cache.query') &amp;&amp; strstr(<span style="color: #993300;">$uri</span>, '?') !== false) {
            $this-&gt;cache_reject_reason = 'Requested URI contains query';

            return false;
        }
.
.
.</pre>
</div>
<p>&nbsp;</p>
<h3>Fault 3</h3>
<p>The third fault with the released code relates to the &#8216;w3_http_get($url)&#8217; function call shown above. This function is defined in <code>w3-total-cache/inc/functions/http.php</code> and it calls a more general &#8216;w3_http_request&#8217; function that calls a WordPress function to get the requested page. However, the &#8216;w3_http_request&#8217; function sets a &#8216;W3TC_POWERED_BY&#8217; user agent which is subsequently recognized in &#8216;PgCache.php&#8217; as a rejected user agent for caching.</p>
<p>What this means is that any request to cache a page will return an unprocessed or non-minimized page. This can reduce the effect of page caching and results in unprocessed text being stored for the cached page. This unprocessed text is not minimized and does not include W3TC information and is different than what is cached under normal operating conditions.</p>
<p>A solution to this problem is to ensure that the call to &#8216;w3_http_request&#8217; overrides the &#8216;W3TC_POWERED_BY&#8217; user agent. The corrected code is shown below.</p>
<p>&nbsp;</p>
<h4>w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Prime cache
     *
     * @param integer $start
     * @return void
     */
    function prime($start = 0) {
.
.
.
        /**
         * Make HTTP requests and prime cache
         */
        require_once W3TC_INC_DIR . '/functions/http.php';
       	<span style="color: #993300;">require_once W3TC_INC_DIR . '/functions/url.php';</span>

        foreach ($queue as $url) {
            $url = w3_url_format($url, array('w3tc_preload' =&gt; 1));

            <span style="color: #993300;">$result = w3_http_get($url, array('user-agent' =&gt; ''));</span>

        }
.
.
.</pre>
</div>
<p>&nbsp;</p>
<h3>Fault 4</h3>
<p>The fourth fault relates to the &#8216;function prime($start = 0)&#8217; parameter in the prime function shown above. The W3TC cache preload feature is designed to load sets of pages from URLs in a prioritized Google sitemap. The start parameter is a starting index into the sitemap list of URLs to prime. It is intended to identify the start of the next group of pages to be preloaded.</p>
<p>Due to the parameter omission in &#8216;w3-total-cache/lib/W3/Plugin/PgCache.php&#8217; the start parameter is never being passed to the prime() function. Thus, by default, the start value is always being initialized to zero. This means that the prime function can never process all the required pages in the sitemap and if it actually ran as intended it would instead always reprocess only the first selected set of pages. The missing parameter is shown in a different color.</p>
<p>&nbsp;</p>
<h4>w3-total-cache/lib/W3/Plugin/PgCache.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Prime cache
     *
     * @param integer $start
     * @return void
     */
    function prime($start = 0) {
        $this-&gt;get_admin()-&gt;prime(<span style="color: #993300;">$start</span>);
    }
.
.
.</pre>
</div>
<p>&nbsp;</p>
<h3>CURL Redirection Fault</h3>
<p>Sites that are hosted on servers that use CURL when safe mode or open_basedir is enabled can experience URL redirection failure when trying to prime a page. Fortunately, a workaround for the CURL problem is known. This workaround must be included in the W3TC &#8216;w3_http_get()&#8217; function to capture any WordPress redirection failure to recover from the problem. If this is not done then primed URLs in the sitemap that redirect may not successfully load. A WordPress &#8216;Too many redirects&#8217; error may occur.</p>
<p>&nbsp;</p>
<h4>w3-total-cache/inc/functions/http.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Sends HTTP GET request
     *
     * @param string $url
     * @param array $args
     * @return array|WP_Error
     */
    function w3_http_get($url, $args = array()) {
        $args = array_merge($args, array(
            'method' =&gt; 'GET'
        ));

        <span style="color: #993300;">$result =</span> w3_http_request($url, $args);

        <span style="color: #993300;">// If server uses cURL and has open_basedir set then redirection may not work
        if ( is_wp_error($result) &amp;&amp; stripos($result-&gt;get_error_message(),'Too many redirects') !== false) {
            if (!ini_get('safe_mode') &amp;&amp; !ini_get('open_basedir')) {
                return $result;
            }
            if ( function_exists( 'curl_init' ) &amp;&amp; function_exists( 'curl_exec' ) ) {
                $result = w3_curl($url, $args);
            }
        }
        return $result;
    } 

    /**
     * Sends HTTP GET request with cURL
     *
     * @param string $url
     * @param $args array
     * @return array|WP_Error
     */
    function w3_curl($url, $args = array()) {
        $args = array_merge(array( 'redirection' =&gt; 5 ), $args);
        $ch = curl_init($url);
        curl_setopt ($ch, CURLOPT_URL, $url); 

        //follow on location problems
        $syn = w3_curl_redir_exec($ch, $args);
        curl_close($ch);
        return $syn;
    } 

    /**
     * Redirects HTTP GET request with cURL when safe_mode or open_basedir is enabled
     *
     * @param string $url
     * @param $args array
     * @return array|WP_Error
     *
     * courtesy of http://au.php.net/manual/ro/function.curl-setopt.php#71313
     */
    function w3_curl_redir_exec($ch, $args) {
	$defaults = array(
		'method' => 'GET', 'timeout' => 5,
		'redirection' => 5, 'httpversion' => '1.0'
	);

	$r = wp_parse_args( $args, $defaults );
	if ( $r['redirection']-- <= 0 ) {
		return new WP_Error('http_request_failed', __('W3 Too many redirects.'));
	}

	$timeout = (int) ceil( $r['timeout'] );
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout );
	curl_setopt($ch, CURLOPT_TIMEOUT, $timeout );
	curl_setopt($ch, CURLOPT_HEADER, true);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$data = curl_exec($ch);

	list($header, $body) = explode("\n\r", $data, 2);
	$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

	if ($http_code == 301 || $http_code == 302) {
		$matches = array();
		preg_match('/Location:(.*?)\n/', $header, $matches);
		$url = @parse_url(trim(array_pop($matches)));

		if (!$url) {
			//couldn't process the url to redirect to
			return new WP_Error('http_request_failed', __('W3 Redirect malformed URL'));
		}

		$last_url = parse_url(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
		if (!$url['scheme'])
			$url['scheme'] = $last_url['scheme'];
		if (!$url['host'])
			$url['host'] = $last_url['host'];
		if (!$url['path'])
			$url['path'] = $last_url['path'];
		$new_url = $url['scheme'] . '://' . $url['host'] . $url['path'] . ($url['query']?'?'.$url['query']:'');

		curl_setopt($ch, CURLOPT_URL, $new_url);
		return w3_curl_redir_exec($ch,$r);
	}

	$response = array();
	$response['code'] = $http_code;
	$response['message'] = get_status_header_desc($response['code']);
	return array( 'headers' => array(), 'body' => $body, 'response' => $response, 'cookies' => array() );
    }</span>
.
.
.</pre>
</div>
]]></description>
			<content:encoded><![CDATA[<p>W3TC Total Cache is a WordPress plugin for page caching of WordPress sites.  Release version 0.9.2.4 has four faults in the cache preload function that prevent successful operation of this feature.  This post provides code corrections for these faults.  One additional fault that can result in failure to process URL redirection for page requests is also fixed. </p>
<p>This post also introduces new features to ensure that pages are primed only when required; it provides an enhancement for visible monitoring and tracing cache preload activities; and it enables setting different cache retention times depending on the page URL.</p>
<p>This post applies to both basic mode and enhanced mode disk caching.  Cache priming has been primarily tested for basic mode disk caching.</p>
<p>&nbsp;</p>
<h3>Index</h3>
<p>This post has 4 pages.  Page navigation is at the bottom of each page.</p>
<p>Page 1.  Describes the known faults or bugs in W3TC Total Cache version 0.9.2.4 preload function.</p>
<p>Page 2.  Describes a feature enhancement to enable setting of specific page cache expiry times.</p>
<p>Page 3.  Describes a feature enhancement to allow administrator control and monitoring of prime activities.</p>
<p>Page 4.  Describes a feature enhancement to prime only uncached and valid pages.</p>
<p>&nbsp;</p>
<h3> Download</h3>
<p>A full download of W3TC Total Cache version 0.9.2.4 with corrected source code as shown is available <a title="W3TC Total Cache 0.9.2.4" href="http://www.wmiles.com/cgi-bin/load.pl?/js/w3-total-cache.zip">here</a>.</p>
<p>&nbsp;</p>
<h3>Introduction</h3>
<p>Cache preload, also known as cache priming, is a caching feature to ensure that a page is always ready and stored in cache.  Cached pages improve site performance.  Preloading of cached pages ensures that any initial access to a page will respond as quickly as repeat access to a page.</p>
<p>W3TC cache preload operates as a background activity scheduled by the WordPress cron function.  The priming activity is invoked only after the cron time expires and the WordPress site is accessed.  This means that once the cron time expires the next prime activity runs only after the site is next accessed.</p>
<p>When the prime activity runs it will preload a specified number of pages.  Before preloading any pages it schedules a new instance of the preload activity on the WordPress cron timer.  Therefore, as the prime activity is executing while the next activity is waiting, it is necessary to ensure that the cron timer wait time is longer than the execution time of the prime activity.  Typically, the W3TC update interval or cron wait time should be in the order of 5 or 10 minutes, and the pages processed per interval should be around 10 or 20 so that the total page access time for all pages should be less than a minute or two.</p>
<p>&nbsp;</p>
<h3>Fault 1</h3>
<p>In <code>PgCacheAdmin.php</code> the function &#8216;w3_url_format&#8217; is called prior to initiating the HTTP request to load the page. The existing code does not include a reference to the location of this function for dynamic linking to the function definition. This means that the execution silently fails after the next periodic scheduling of the prime function. Page priming will appear to be operating, events will be queued, but no cache files will ever be loaded. The missing statement is shown in a different color.</p>
<p>&nbsp;</p>
<h4>w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Prime cache
     *
     * @param integer $start
     * @return void
     */
    function prime($start = 0) {
.
.
.
        /**
         * Make HTTP requests and prime cache
         */
        require_once W3TC_INC_DIR . '/functions/http.php';
       	<span style="color: #993300;">require_once W3TC_INC_DIR . '/functions/url.php';</span>

        foreach ($queue as $url) {
            $url = w3_url_format($url, array('w3tc_preload' =&gt; 1));

            w3_http_get($url);
        }
.
.
.</pre>
</div>
<p>&nbsp;</p>
<h3>Fault 2</h3>
<p>The second problem with the released implementation is that the &#8216;w3_url_format&#8217; function adds the query string &#8216;w3tc_preload = 1&#8242; to the page URL. In many cases the W3TC implementation may be configured to not cache URLs with query strings, thus the requested page will never be cached. </p>
<p>One solution to this fault is to remove the query string from URL wherever it may cause incorrect behaviour. Page caching is determined in function <code>PgCache.php</code>, in two places. One is in function &#8216;process()&#8217; where the page request is examined for caching, and the other is in function &#8216;_can_cache()&#8217; where the URL is examined for a query string. The requred statements to eliminate the query string are shown in a different color.</p>
<h4>w3-total-cache/lib/W3/PgCache.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Do cache logic
     */
    function process() {
.
.
.
        if ($this-&gt;_caching &amp;&amp; !$this-&gt;_enhanced_mode) {
            $cache = &amp; $this-&gt;_get_cache();

            /**
             * Remove preload query string on URL to cache
             */
            <span style="color: #993300;">$this-&gt;_request_uri = preg_replace('~[\?\&amp;]w3tc_preload.*~i', '', $this-&gt;_request_uri);</span>

            $mobile_group = $this-&gt;_get_mobile_group();
            $referrer_group = $this-&gt;_get_referrer_group();
            $encryption = $this-&gt;_get_encryption();
            $compression = $this-&gt;_get_compression();
            $raw = !$compression;
            $this-&gt;_page_key = $this-&gt;_get_page_key($this-&gt;_request_uri, $mobile_group, $referrer_group, $encryption, $compression);
.
.
.
    /**
     * Checks if can we do cache logic
     *
     * @return boolean
     */
    function _can_cache() {
.
.
.
        /**
         * Skip if there is query in the request uri
         */
        <span style="color: #993300;">$uri = preg_replace('~[\?\&amp;]w3tc_preload.*~i', '', $this-&gt;_request_uri);</span>
        if (!$this-&gt;_config-&gt;get_boolean('pgcache.cache.query') &amp;&amp; strstr(<span style="color: #993300;">$uri</span>, '?') !== false) {
            $this-&gt;cache_reject_reason = 'Requested URI contains query';

            return false;
        }
.
.
.</pre>
</div>
<p>&nbsp;</p>
<h3>Fault 3</h3>
<p>The third fault with the released code relates to the &#8216;w3_http_get($url)&#8217; function call shown above. This function is defined in <code>w3-total-cache/inc/functions/http.php</code> and it calls a more general &#8216;w3_http_request&#8217; function that calls a WordPress function to get the requested page. However, the &#8216;w3_http_request&#8217; function sets a &#8216;W3TC_POWERED_BY&#8217; user agent which is subsequently recognized in &#8216;PgCache.php&#8217; as a rejected user agent for caching.</p>
<p>What this means is that any request to cache a page will return an unprocessed or non-minimized page. This can reduce the effect of page caching and results in unprocessed text being stored for the cached page. This unprocessed text is not minimized and does not include W3TC information and is different than what is cached under normal operating conditions.</p>
<p>A solution to this problem is to ensure that the call to &#8216;w3_http_request&#8217; overrides the &#8216;W3TC_POWERED_BY&#8217; user agent. The corrected code is shown below.</p>
<p>&nbsp;</p>
<h4>w3-total-cache/lib/W3/Plugin/PgCacheAdmin.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Prime cache
     *
     * @param integer $start
     * @return void
     */
    function prime($start = 0) {
.
.
.
        /**
         * Make HTTP requests and prime cache
         */
        require_once W3TC_INC_DIR . '/functions/http.php';
       	<span style="color: #993300;">require_once W3TC_INC_DIR . '/functions/url.php';</span>

        foreach ($queue as $url) {
            $url = w3_url_format($url, array('w3tc_preload' =&gt; 1));

            <span style="color: #993300;">$result = w3_http_get($url, array('user-agent' =&gt; ''));</span>

        }
.
.
.</pre>
</div>
<p>&nbsp;</p>
<h3>Fault 4</h3>
<p>The fourth fault relates to the &#8216;function prime($start = 0)&#8217; parameter in the prime function shown above. The W3TC cache preload feature is designed to load sets of pages from URLs in a prioritized Google sitemap. The start parameter is a starting index into the sitemap list of URLs to prime. It is intended to identify the start of the next group of pages to be preloaded.</p>
<p>Due to the parameter omission in &#8216;w3-total-cache/lib/W3/Plugin/PgCache.php&#8217; the start parameter is never being passed to the prime() function. Thus, by default, the start value is always being initialized to zero. This means that the prime function can never process all the required pages in the sitemap and if it actually ran as intended it would instead always reprocess only the first selected set of pages. The missing parameter is shown in a different color.</p>
<p>&nbsp;</p>
<h4>w3-total-cache/lib/W3/Plugin/PgCache.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Prime cache
     *
     * @param integer $start
     * @return void
     */
    function prime($start = 0) {
        $this-&gt;get_admin()-&gt;prime(<span style="color: #993300;">$start</span>);
    }
.
.
.</pre>
</div>
<p>&nbsp;</p>
<h3>CURL Redirection Fault</h3>
<p>Sites that are hosted on servers that use CURL when safe mode or open_basedir is enabled can experience URL redirection failure when trying to prime a page. Fortunately, a workaround for the CURL problem is known. This workaround must be included in the W3TC &#8216;w3_http_get()&#8217; function to capture any WordPress redirection failure to recover from the problem. If this is not done then primed URLs in the sitemap that redirect may not successfully load. A WordPress &#8216;Too many redirects&#8217; error may occur.</p>
<p>&nbsp;</p>
<h4>w3-total-cache/inc/functions/http.php</h4>
<div class="textblock">
<pre>.
.
.
    /**
     * Sends HTTP GET request
     *
     * @param string $url
     * @param array $args
     * @return array|WP_Error
     */
    function w3_http_get($url, $args = array()) {
        $args = array_merge($args, array(
            'method' =&gt; 'GET'
        ));

        <span style="color: #993300;">$result =</span> w3_http_request($url, $args);

        <span style="color: #993300;">// If server uses cURL and has open_basedir set then redirection may not work
        if ( is_wp_error($result) &amp;&amp; stripos($result-&gt;get_error_message(),'Too many redirects') !== false) {
            if (!ini_get('safe_mode') &amp;&amp; !ini_get('open_basedir')) {
                return $result;
            }
            if ( function_exists( 'curl_init' ) &amp;&amp; function_exists( 'curl_exec' ) ) {
                $result = w3_curl($url, $args);
            }
        }
        return $result;
    } 

    /**
     * Sends HTTP GET request with cURL
     *
     * @param string $url
     * @param $args array
     * @return array|WP_Error
     */
    function w3_curl($url, $args = array()) {
        $args = array_merge(array( 'redirection' =&gt; 5 ), $args);
        $ch = curl_init($url);
        curl_setopt ($ch, CURLOPT_URL, $url); 

        //follow on location problems
        $syn = w3_curl_redir_exec($ch, $args);
        curl_close($ch);
        return $syn;
    } 

    /**
     * Redirects HTTP GET request with cURL when safe_mode or open_basedir is enabled
     *
     * @param string $url
     * @param $args array
     * @return array|WP_Error
     *
     * courtesy of http://au.php.net/manual/ro/function.curl-setopt.php#71313
     */
    function w3_curl_redir_exec($ch, $args) {
	$defaults = array(
		'method' => 'GET', 'timeout' => 5,
		'redirection' => 5, 'httpversion' => '1.0'
	);

	$r = wp_parse_args( $args, $defaults );
	if ( $r['redirection']-- <= 0 ) {
		return new WP_Error('http_request_failed', __('W3 Too many redirects.'));
	}

	$timeout = (int) ceil( $r['timeout'] );
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout );
	curl_setopt($ch, CURLOPT_TIMEOUT, $timeout );
	curl_setopt($ch, CURLOPT_HEADER, true);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$data = curl_exec($ch);

	list($header, $body) = explode("\n\r", $data, 2);
	$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

	if ($http_code == 301 || $http_code == 302) {
		$matches = array();
		preg_match('/Location:(.*?)\n/', $header, $matches);
		$url = @parse_url(trim(array_pop($matches)));

		if (!$url) {
			//couldn't process the url to redirect to
			return new WP_Error('http_request_failed', __('W3 Redirect malformed URL'));
		}

		$last_url = parse_url(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
		if (!$url['scheme'])
			$url['scheme'] = $last_url['scheme'];
		if (!$url['host'])
			$url['host'] = $last_url['host'];
		if (!$url['path'])
			$url['path'] = $last_url['path'];
		$new_url = $url['scheme'] . '://' . $url['host'] . $url['path'] . ($url['query']?'?'.$url['query']:'');

		curl_setopt($ch, CURLOPT_URL, $new_url);
		return w3_curl_redir_exec($ch,$r);
	}

	$response = array();
	$response['code'] = $http_code;
	$response['message'] = get_status_header_desc($response['code']);
	return array( 'headers' => array(), 'body' => $body, 'response' => $response, 'cookies' => array() );
    }</span>
.
.
.</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2012/03/w3tc-cache-preload/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<enclosure url="http://www.wmiles.com/wordpress/wp-content/uploads/2012/03/page_expiry-150x45.png" length="3611" type="image/jpg" />	</item>
		<item>
		<title>PKking Nine Balances &#8211; Nie Long</title>
		<link>http://www.wmiles.com/2012/01/pkking-nine-balances-nie-long</link>
		<comments>http://www.wmiles.com/2012/01/pkking-nine-balances-nie-long#comments</comments>
		<pubDate>Sat, 28 Jan 2012 21:11:19 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Resin Figures and Anime]]></category>
		<category><![CDATA[Nie Long]]></category>
		<category><![CDATA[PKking]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=2645</guid>
		<description><![CDATA[<p>In addition to PKking&#8217;s new pictures for his Wu Yan sculpt, he also released new color pictures for his Nie Long work. At the moment I have no plans to acquire this work, but I do want to share this with you. PKking&#8217;s work is exceptional.</p> <p>To view the sculptor&#8217;s work see PKking&#8217;s website. [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to PKking&#8217;s new pictures for his <a title="PKking Wu Yan" href="http://www.wmiles.com/2012/01/pkking-nine-balances-wu-yan-2">Wu Yan</a> sculpt, he also released new color pictures for his Nie Long work. At the moment I have no plans to acquire this work, but I do want to share this with you. PKking&#8217;s work is exceptional.</p>
<p>To view the sculptor&#8217;s work see <a title="PKking's website" href="http://www.wretch.cc/album/pkking636178" target="_blank">PKking&#8217;s website</a>. Or, take a look at the pictures that I have on hand here in the <a title="Gallery" href="http://www.wmiles.com/v/resinbuild">Gallery</a>. Send me a <a title="Contact" href="http://www.wmiles.com/contact">note</a> if you want contact information to order his work. Pictures are posted with permission.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-large wp-image-2654" title="P1200998 複製" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/P1200998-複製1-492x600.jpg" alt="" width="492" height="600" /></p>
<p><img class="aligncenter size-large wp-image-2655" title="P1210016 複製" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/P1210016-複製-450x600.jpg" alt="" width="450" height="600" /></p>
<p><img class="aligncenter size-large wp-image-2652" title="P1210027 複製" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/P1210027-複製-450x600.jpg" alt="" width="450" height="600" /></p>
<p><img class="aligncenter size-large wp-image-2651" title="P1210021 複製" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/P1210021-複製-600x450.jpg" alt="" width="600" height="450" /></p>
<p><img class="aligncenter size-large wp-image-2656" title="P1210041 複製" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/P1210041-複製-600x450.jpg" alt="" width="600" height="450" /></p>
<p><img class="aligncenter size-large wp-image-2646" title="P1200959 複製" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/P1200959-複製-450x600.jpg" alt="" width="450" height="600" /></p>
<p><img class="aligncenter size-large wp-image-2647" title="P1200961 複製" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/P1200961-複製-450x600.jpg" alt="" width="450" height="600" /></p>
<p><img class="aligncenter size-large wp-image-2648" title="P1200962 複製" src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/P1200962-複製-450x600.jpg" alt="" width="450" height="600" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2012/01/pkking-nine-balances-nie-long/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/nie-long-feature.jpg" length="9492" type="image/jpg" />	</item>
		<item>
		<title>SOPA and PIPA Thoughts</title>
		<link>http://www.wmiles.com/2012/01/sopa-and-pipa-thoughts</link>
		<comments>http://www.wmiles.com/2012/01/sopa-and-pipa-thoughts#comments</comments>
		<pubDate>Wed, 18 Jan 2012 20:30:23 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Personal Essays]]></category>
		<category><![CDATA[pipa]]></category>
		<category><![CDATA[sopa]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=2617</guid>
		<description><![CDATA[<p>January 18, 2012, is a worldwide protest against two copyright and intellectual property acts before the American Congress. One act is SOPA (Stop Onine Piracy Act) and the other is PIPA (Protect IP Act). These acts seek to place restrictions on websites that copy and redistribute various copyright material and other documents that are [...]]]></description>
			<content:encoded><![CDATA[<p>January 18, 2012, is a worldwide protest against two copyright and intellectual property acts before the American Congress.  One act is SOPA (Stop Onine Piracy Act) and the other is PIPA (Protect IP Act).  These acts seek to place restrictions on websites that copy and redistribute various copyright material and other documents that are posted online.  It has been said that these bills put the burden on website owners to police user-contributed material and call for the unnecessary blocking of entire sites. </p>
<p>Wikipedia, Google, WordPress, and many other global sites that offer services in this space are concerned that these bills will constrain or control the freedom to innovate and post material on the Internet.  They are asking for people in the US to write their congressman and oppose these bills.</p>
<p>I am of a mixed mind.  On one side I agree that this sort of legislation does change the freedom of the Internet and can limit innovation and creativity.  On the other hand, those who create content and other products deserve to receive fair value for their work.  The copyright problem does need to be addressed.  Work is not free just because it was produced and published and made available to consumers or put on the Internet.</p>
<p>I am careful that almost all material posted on Kisekae World is my own work, or I have permission to copy and post other people&#8217;s work on my site.  I do access or link to other people&#8217;s work on YouTube and elsewhere.  I do hyperlink to other sites.  I do share my work and support the free exchange of information and content.  I do benefit from other people&#8217;s work.</p>
<p>But, I don&#8217;t necessarily agree that music is free to share to all, or that movies should be free, or that software should be free.  I do think that if you post your work publicly then you do allow people to view and access your work and use it in derivative work with proper attribution.  How you enable this access is your choice.  How you allow derivative use is your choice.  How you get compensated for your work is up to you.  It is up to you to protect your property.  </p>
<p>I create content.  I write software and I create models and I create photographs of my models.  I publish my work on Kisekae World.  As an author and creator I do not want my work used without proper attribution.  But, as a creator I may be in the minority with respect to this protest.  </p>
<p>SOPA and PIPA are perhaps wrong.  The musicians and movie makers and other people who publish works must take action to protect their property.  Others should not have to police this for them.  This legislation may not be the way.  But the copyright problem does need to be addressed.  </p>
<p><em>William Miles</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2012/01/sopa-and-pipa-thoughts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PKking Nine Balances &#8211; Wu Yan (2)</title>
		<link>http://www.wmiles.com/2012/01/pkking-nine-balances-wu-yan-2</link>
		<comments>http://www.wmiles.com/2012/01/pkking-nine-balances-wu-yan-2#comments</comments>
		<pubDate>Sat, 14 Jan 2012 03:00:56 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Resin Figures and Anime]]></category>
		<category><![CDATA[PKking]]></category>
		<category><![CDATA[Wu Yan]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=2569</guid>
		<description><![CDATA[<p>PKking has just finished assembling his Wu Yan model and has released some color pictures. His work is truly exceptional and I certainly look forward to building my copy of this model in the next year or two. </p> <p>To view the sculptor&#8217;s work see PKking&#8217;s website. Send me a note if you want [...]]]></description>
			<content:encoded><![CDATA[<p>PKking has just finished assembling his Wu Yan model and has released some color pictures.  His work is truly exceptional and I certainly look forward to building my copy of this model in the next year or two.  </p>
<p>To view the sculptor&#8217;s work see <a href="http://www.wretch.cc/album/pkking636178" title="PKking's website" target="_blank">PKking&#8217;s website</a>. Send me a <a href="http://www.wmiles.com/contact" title="Contact">note</a> if you want contact information to order his work.  Pictures are posted with permission.</p>
<p>&nbsp;</p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-01-408x600.jpg" alt="" title="pkking 九天衡-閰武-01" width="408" height="600" class="aligncenter size-large wp-image-2573" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-02-418x600.jpg" alt="" title="pkking 九天衡-閰武-02" width="418" height="600" class="aligncenter size-large wp-image-2574" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-03-413x600.jpg" alt="" title="pkking 九天衡-閰武-03" width="413" height="600" class="aligncenter size-large wp-image-2575" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-04-409x600.jpg" alt="" title="pkking 九天衡-閰武-04" width="409" height="600" class="aligncenter size-large wp-image-2576" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-05-398x600.jpg" alt="" title="pkking 九天衡-閰武-05" width="398" height="600" class="aligncenter size-large wp-image-2577" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-06-398x600.jpg" alt="" title="pkking 九天衡-閰武-06" width="398" height="600" class="aligncenter size-large wp-image-2578" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-07-398x600.jpg" alt="" title="pkking 九天衡-閰武-07" width="398" height="600" class="aligncenter size-large wp-image-2579" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-08-380x600.jpg" alt="" title="pkking 九天衡-閰武-08" width="380" height="600" class="aligncenter size-large wp-image-2580" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-10-398x600.jpg" alt="" title="pkking 九天衡-閰武-10" width="398" height="600" class="aligncenter size-large wp-image-2571" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2012/01/pkking-nine-balances-wu-yan-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.wmiles.com/wordpress/wp-content/uploads/2012/01/pkking-九天衡-閰武-11-150x99.jpg" length="8687" type="image/jpg" />	</item>
		<item>
		<title>Hackers or Gremlins</title>
		<link>http://www.wmiles.com/2012/01/hackers-or-gremlins</link>
		<comments>http://www.wmiles.com/2012/01/hackers-or-gremlins#comments</comments>
		<pubDate>Tue, 03 Jan 2012 00:08:16 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Website Customization]]></category>
		<category><![CDATA[Gallery2]]></category>
		<category><![CDATA[Gallery3]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=2540</guid>
		<description><![CDATA[<p>Happy New Year! Well, 2012 has begun with a bang. Shortly after noon on January 2 all my Gallery 2 data was trashed unexpectedly. Now, this is either hackers, or someone doing something on my hosted web service site, or some unseen glitch in the Gallery 2 software. </p> <p>This must be a sign [...]]]></description>
			<content:encoded><![CDATA[<p>Happy New Year!  Well, 2012 has begun with a bang.  Shortly after noon on January 2 all my Gallery 2 data was trashed unexpectedly.  Now, this is either hackers, or someone doing something on my hosted web service site, or some unseen glitch in the Gallery 2 software. </p>
<p>This must be a sign that I need to spend some time to upgrade to Gallery 3.  I has been planning to rebuild my Gallery implementation anyway, so this is not necessarily all bad.  I want to centralize on a standard maximum image size and reload the albumns.  </p>
<p>It&#8217;s time to do this.  Please be patient as this work begins.  Page caching is off for the moment so performance may suffer.</p>
<p>&nbsp;</p>
<p><span style="color: #c00000;">January 3, 2012:</span> Gallery 3 is not installing.  It fails with a 500 server error code attempting to run the install script.  The Apache version on my hosting service is version 2.0.52 and Gallery 3 requires Apache 2.2.  This may be the issue.</p>
<p>Gallery 2 is being reinstalled.  Let&#8217;s just think of this as a major engine overhall.</p>
<p>&nbsp;</p>
<p><span style="color: #c00000;">January 4, 2012:</span> I found this in the Gallery2 security section while doing some research yesterday.</p>
<blockquote><p>A shared webserver that runs all PHP scripts under the same generic user and not under the specific account&#8217;s user can only be secured in a limited way.</p>
<p>Reality check: Most shared webhosting plans fall into the above category and we hear from incidents like a Gallery 2 that was somehow deleted over night only very rarely, maybe once a year. So it isn&#8217;t as bad as it sounds. The chance being on a webhost with a malicious customer should be really small. </p></blockquote>
<p>&nbsp;</p>
<p><span style="color: #c00000;">January 6, 2012:</span> All the China photos, Utah photos, and PKking resin model construction photos are restored.  One benefit of this work is that all images now contain EXIF information and will have consistent display sizes.  One liability of this restoration is that all descriptions and keyword tags for the images have been lost.  I will try to recover descriptive inforormation for the gallery folders.</p>
<p>&nbsp;</p>
<p><span style="color: #c00000;">January 8, 2012:</span> Resin model photographs are being restored.  Please be patient.  </p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2012/01/hackers-or-gremlins/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gallery2 MiniSlideShow Performance Cache</title>
		<link>http://www.wmiles.com/2011/12/gallery2-minislideshow-performance-cache</link>
		<comments>http://www.wmiles.com/2011/12/gallery2-minislideshow-performance-cache#comments</comments>
		<pubDate>Thu, 29 Dec 2011 20:25:55 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Website Customization]]></category>
		<category><![CDATA[Gallery2]]></category>
		<category><![CDATA[WPG2]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=2469</guid>
		<description><![CDATA[MiniSlideShow is an interesting Flash plugin to display Gallery2 images on your website. One problem with this slide show is that generating an RSS feed takes time. The generation delay impacts the start of the slideshow, particularly if the slideshow is included as a sidebar block on every Gallery page or embedded application page. This can be particularly noticable if the feed contains many images. Each display of a new page results is a new invokation of the slideshow and this results in a new initialization of the RSS feed. One way to mitigate the feed generation performance loss is to cache the generated RSS feed XML text. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flashyourweb.com/staticpages/index.php?page=TheMiniSlideShow" title="MiniSlideSHow" target="_blank">MiniSlideShow</a> is an interesting Flash plugin to display Gallery2 images on your website.  It uses an XML RSS feed to access Gallery2 albums.  It also uses Gallery2 to return the correct size image resolution for embedded slideshows.  MiniSlideShow is being used in the sidebars on Kisekae World.</p>
<p>One problem with this solution is that generating an RSS feed takes time.  The generation delay impacts the start of the slideshow, particularly if the slideshow is included as a sidebar block on every Gallery page or embedded application page.  This can be particularly noticable if the feed contains many images.  Each display of a new page results is a new invokation of the slideshow and this results in a new initialization of the RSS feed.</p>
<p>One way to mitigate the feed generation performance loss is to cache the generated RSS feed XML text.  For example, if the album feed has been previously generated and saved then it can be referenced on a new page load without the overhead of regenerating the RSS feed.  This can provide some performance relief.</p>
<p>Gallery2 provides disk caching services as part of its core module.  I have modified the <code>xml()</code> function in <code>mediaRSS.php</code> distributed with MiniSlideShow to use the Gallery2 cache functions.  The code assumes that a new &#8216;minislideshow&#8217; module has been installed as a Gallery2 module as described further below.  For caching, the Gallery2 itemId is used as the cache key, and each cached RSS text entity will expire after 3600 seconds (1 hour).  All new lines inserted into the function are shown in a different color.</p>
<p>&nbsp;</p>
<h4>mediaRss.php</h4>
<div class="textblock">
<pre>
&lt;?php
// +---------------------------------------------------------------------------+
// |  E2  XML Audio/Video Player/Minislideshow for Gallery2                    |
// +---------------------------------------------------------------------------+
// | mediaRss.php     [v.3.0.0]                                                |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2009 Wayne Patterson [suprsidr@flashyourweb.com]            |
// +---------------------------------------------------------------------------+
// |                                                                           |
// | This program is free software; you can redistribute it and/or             |
// | modify it under the terms of the GNU General Public License               |
// | as published by the Free Software Foundation; either version 2            |
// | of the License, or (at your option) any later version.                    |
// |                                                                           |
// | This program is distributed in the hope that it will be useful,           |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
// | GNU General Public License for more details.                              |
// |                                                                           |
// | You should have received a copy of the GNU General Public License         |
// | along with this program; if not, write to the Free Software Foundation,   |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//

.
. [snipped code]
.

    function xml() {
	init();
	global $gallery, $userId, $count;

<span style="color: #993300;">
	// Determine cache item
	if (isset ($_REQUEST['g2_itemId'])) {
	    $cacheId = $_REQUEST['g2_itemId'];
	} else if (isset ($_REQUEST['g2_albumId'])) {
	    $cacheId = $_REQUEST['g2_albumId'];
	} else {
		$cacheId = getRoot() ;
	}

	// Retrieve cache item if not expired
	if (isset($cacheId)) {
		$expire = 3600;
		$cacheMsg = "\n";
		$cachePathInfo = array('type' => 'module-data',
			   'module' => 'minislideshow',
			   'itemId' => $cacheId);
		list ($xmltime, $xmldata) =
			GalleryDataCache::getFromDisk($cachePathInfo);
		if (isset($xmltime) &#038;&#038; isset($xmldata)) {
			$vm = $gallery->getPhpVm();
			$cacbeTime = date('U', $vm->time());
			$diff = (int)$cacbeTime - (int)$xmltime;
			$expiretime = (int)$xmltime + $expire;
			if ($diff < $expire) {
				$xmldata .= "\nRetrieved itemId " . $cacheId . " at " . $cacbeTime . " that was cached at " . $xmltime
					. " and will expire at " . $expiretime;
				echo $xmldata;
				return;
			} else {
				$cacheMsg .= "Cache expired, item cached at " . $xmltime . ", current time " . $cacbeTime
					. ", item expired at " . $expiretime . "\n" ;
			}
		} else {
			$cacheMsg .= "Cache not found, itemId " . $cacheId . "\n";
		}
	}
</span>

	$title = '';
	$recursive = '';
	if (!$userId) {
	    $userId = $gallery->getActiveUserId();
	}
	if (!$userId) {
	    list($ret,$userId) = GalleryCoreApi::getAnonymousUserId();
	}
	if (isset ($_REQUEST['mode'])) {
	    $mode = $_REQUEST['mode'];
	}else{
		$mode = '';
	}
	if (isset ($_REQUEST['g2_itemId'])) {
	    $g2_itemId = $_REQUEST['g2_itemId'];
	    list ($ret, $item) = GalleryCoreApi::loadEntitiesById($g2_itemId, 'GalleryAlbumItem');
	    if ($ret) {
	        print "Error loading initial item:" . $ret->getAsHtml();
	    }
	    $title = getTitle($item);
	}else{
	    $title = "Gallery2 MediaRss";
	}
	if (isset ($_REQUEST['g2_view'])) {
	    $g2_view = $_REQUEST['g2_view'];
	}
	if (isset ($_REQUEST['mime'])) {
	    $mime = $_REQUEST['mime'];
	}
	if (isset ($_REQUEST['recursive'])) {
	    $recursive = $_REQUEST['recursive'];
	}
	if(isset ($_REQUEST['limit'])){
		global $limit;
		$limit = $_REQUEST['limit'];
	}
	$xml = '';
	$count = 0;
	$urlGenerator =&#038; $gallery->getUrlGenerator();
	$link = $urlGenerator->generateUrl(array(), array('forceFullUrl' => true));
	$vm = $gallery->getPhpVm();
	list ($ret, $language) = GalleryTranslator::getDefaultLanguageCode( );
	if ($ret) {
	    $language = "en-us";
	}
	if (!$vm->headers_sent()) {
	    $vm->header('Content-Type: application/rss+xml; charset=UTF-8');
	}
	echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\n";
	$xml .= "&lt;rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss/\"&gt;\n";
	$xml .= "    &lt;channel&gt;\n";
	$xml .= "        &lt;title&gt;" . cdata($title) . "&lt;/title&gt;\n";
	$xml .= "        &lt;link&gt;" . $link . "&lt;/link&gt;\n";
	$xml .= "        &lt;description&gt;" . cdata($title) . "&lt;/description&gt;\n";
	$xml .= "        &lt;language&gt;" .$language. "&lt;/language&gt;\n";
	$xml .= "        &lt;generator&gt;FlashYourWeb MediaRSS Generator v3.0.0&lt;/generator&gt;\n";
	$xml .= "        &lt;lastBuildDate&gt;" . date('r', $vm->time()) . "&lt;/lastBuildDate&gt;\n";
	$xml .= "        &lt;ttl&gt;120&lt;/ttl&gt;\n";
	if(isset($g2_itemId)){
		$xml .= getAlbumList ($g2_itemId);
	}else{
		$xml .= getAlbumList (getRoot());
	}
	switch ($mode) {
	    case 'dynamic':
	        switch ($g2_view) {
	            case 'dynamicalbum.UpdatesAlbum':
	                $xml .= getDynamicChildIds($userId);
	            break;
	            case 'dynamicalbum.PopularAlbum':
	                $xml .= getDynamicChildIds($userId, 'views', 'viewCount', ORDER_DESCENDING, 'GalleryItemAttributesMap', 'itemId');
	            break;
	            case 'dynamicalbum.RandomAlbum':
	                $xml .= getDynamicChildIds($userId, 'random', 'random', ORDER_ASCENDING, null, 'id');
	            break;
	            case 'keyalbum.KeywordAlbum':
	            	$xml .= getKeywordChildIds($userId, $g2_keyword=null);
	            break;
	            case 'tags.VirtualAlbum':
	                $xml .= getTagChildIds($userId, $g2_tagName=null);
	            break;
	            default:
	            $xml .= getDynamicChildIds($userId);
	        }
	    break;
	    case 'search':
	        $xml .= getSearchItems($g2_itemId, $mime);
	    break;
	    case 'simple':
	        $xml .= itemListDisplay();
	    break;
	    default:
	        if(isset($g2_itemId) &#038;&#038; $recursive){
	            $xml .= getItemsRecursive ($g2_itemId);
	        }else if(isset($g2_itemId)){
	            $xml .= getItems($g2_itemId);
	        }else{
	            $xml .= getItems(getRoot());
	        }
	}

	$xml .= "    &lt;/channel&gt;\n";
	$xml .= "&lt;/rss&gt;";

<span style="color: #993300;">
	// Cache item for future access
	if (isset($cacheId)) {
		$cachePath = GalleryDataCache::getCachePath($cachePathInfo);
		if (isset($cachePath)) {
			$xmltime = date('U', $vm->time());
			GalleryDataCache::putToDisk($cachePathInfo, $dataToCache = array($xmltime, $xml));
			$xml .= $cacheMsg;
			$xml .= "Cache itemId " . $cacheId . " at " . $xmltime . " to " . $cachePath;
		}
	}
</span>

	echo $xml;
    }
xml();
?&gt;
</pre>
</div>
<p>&nbsp;</p>
<p>For the above solution to work there must be a &#8216;/g2data/cache/module/minislideshow&#8217; directory on your web server.  This is where Gallery2 stores the cached files.  If this directory does not exist or disk caching is not possible then the cache modifications will fail silently.  To determine if caching is functioning you need to examine the source code for the XML feed.  Cache message text is inserted in the document following the RSS directives.  The following three feeds below will show cache information if you use your browser to display the source text.</p>
<ul>
<li><a href="http://www.wmiles.com/gallery2/mediaRss.php?mode=dynamic&#038;g2_view=dynamicalbum.RandomAlbum&#038;g2_albumId=7" title="Kisekae World Gallery RSS Feed" target="_blank">Gallery Feed</a></li>
<li><a href="http://www.wmiles.com/gallery2/mediaRss.php?mode=dynamic&#038;g2_view=dynamicalbum.RandomAlbum&#038;g2_albumId=21930" title="Resin Figure Model Gallery RSS Feed" target="_blank">Resin Figure Model Gallery Feed</a></li>
<li><a href="http://www.wmiles.com/gallery2/mediaRss.php?mode=dynamic&#038;g2_view=dynamicalbum.RandomAlbum&#038;g2_albumId=3576" title="Ruri Hoshino Gallery RSS Feed" target="_blank">Ruri Hoshino Gallery Feed</a></li>
</ul>
<p>Example:</p>
<pre>
Cache expired, item cached at 1325184690, current time 1325189988, item expired at 1325188290
Cache itemId 3576 at 1325189988 to /home/g2data/cache/module/minislideshow/3/5/3576.dat
</pre>
<p>&nbsp;</p>
<h3>Installation</h3>
<p>The MiniSlideShow has been packaged as a rudimentary Gallery2 module so that it can be included in the Gallery2 sidebar block.  Download the <a href="http://www.wmiles.com/cgi-bin/load.pl?/js/minislideshow.zip" title="MiniSlideShow Gallery2 Module">MiniSlideShow Gallery2 Module</a> and copy the &#8216;minislideshow&#8217; directory to your Gallery2 modules folder.  </p>
<p>The packaged module doesn&#8217;t install the MiniSlideShow function for you.  It does include the modified &#8216;mediaRSS.php&#8217; file shown above and the required &#8216;minislideshow.swf&#8217; and &#8216;swfobject.js&#8217; files released with MiniSlideShow.  Copy these files to your Gallery2 home directory on your web server.</p>
<p>You need to edit the &#8216;MiniSlideShow.tpl&#8217; block template file found in the &#8216;minislideshow/templates/blocks&#8217; directory.  See below. Change the reference URLs to refer to your Gallery2 URL of your &#8216;mediaRSS.php&#8217; and the &#8216;minislideshow.swf&#8217; files.  You should also ensure that the &#8216;swfobject.js&#8217; file is included in the &lt;head&gt; section of your pages with &lt;script type=&#8221;text/javascript&#8221;&nbsp;src=&#8221;http://www.yoursite.com/swfobject.js&#8221;&gt;&lt;/script&gt;</p>
<p>&nbsp;</p>
<h4>MiniSlideShowBlock.tpl</h4>
<div class="textblock">
<pre>
{*
 * $Revision: 1.5 $
 * If you want to customize this file, do not edit it directly since future upgrades
 * may overwrite it.  Instead, copy it into a new directory called "local" and edit that
 * version.  Gallery will look for that file first and use it if it exists.
 *}

&lt;div id="slideshow" style="margin: 10px 10px 15px 0px; padding: 5px; border-style:solid; border-width:1px; background: #ffffff; text-align: center;"&gt;

{if $theme.pageType == 'album'}
	{if !empty($theme.item.title)} &lt;span style="color: #800000; font-weight: bold;"&gt;{$theme.item.title|markup}&lt;/span&gt;&lt;br /&gt; {/if} Slide Show &lt;br /&gt;
{/if}
{if $theme.pageType == 'photo'}
	{if !empty($theme.parent.title)} &lt;span style="color: #800000; font-weight: bold;"&gt;{$theme.parent.title|markup}&lt;/span&gt;&lt;br /&gt; {/if} Slide Show &lt;br /&gt;
{/if}

&lt;div id="g2slidecontainer" style="height: 160px;"&gt;
 &lt;div id="g2slideplayer"&gt;
    You need Flash Player and JavaScript enabled to view this item.
 &lt;/div&gt;
&lt;/div&gt;

&lt;script type="text/javascript"&gt;
    var attributes = {ldelim}
      id: 'mini',
      name: 'movie'
    {rdelim};
    var params = {ldelim}
      menu: 'false',
      wmode: 'transparent',
      allowscriptaccess: 'always',
      allowfullscreen: 'true'
    {rdelim};
    var flashvars = {ldelim}
{if $theme.pageType == 'album'}
      <span style="color: #993300;">xmlUrl: 'http://www.yoursite.com/gallery2/mediaRss.php?mode=dynamic%26g2_view=dynamicalbum.RandomAlbum%26g2_albumId={$theme.item.id}',</span>
{/if}
{if $theme.pageType == 'photo'}
      <span style="color: #993300;">xmlUrl: 'http://www.yoursite.com/gallery2/mediaRss.php?mode=dynamic%26g2_view=dynamicalbum.RandomAlbum%26g2_albumId={$theme.parent.id}',</span>
{/if}
      shuffle: 'true',
      showDropShadow: 'true',
      delay: 3,
      useFull: 'true',
      showControls: 'always',
      roundedMask: 'true'
    {rdelim};
    <span style="color: #993300;">swfobject.embedSWF("http://www.yoursite.com/gallery2/minislideshow.swf", "g2slideplayer", "160", "160", "9.0.115.0", null, flashvars, params, attributes);</span>
&lt;/script&gt;
&lt;/div&gt;
</pre>
</div>
<p>&nbsp;</p>
<p>As a Gallery2 administrator you can install the &#8216;minislideshow&#8217; plugin.  The installation process should create the Gallery2 module cache directory for you.  If you want to include the slideshow in your Gallery2 theme add the &#8216;minislideshow&#8217; as a sidebar block.  If you want to view the slideshow from an external application such as WordPress, simply create a text widget with code similar to the template file above.</p>
<p>&nbsp;</p>
<h4>WordPress Text Widget</h4>
<div class="textblock">
<pre>
&lt;div id="slideshow" style="margin: 10px 10px 15px 0px; padding: 5px; border-style:none; background: #ffffff; text-align: center;"&gt;
&lt;span style="color: #800000; font-weight: bold;"&gt;Resin Figure Models&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 0.8em; font-family: Verdana,Arial,Helvetica,sans-serif;"&gt;Slide Show &lt;/span&gt;&lt;br /&gt;

&lt;div id="g2slidecontainer" style="height: 160px;"&gt;
 &lt;div id="g2slideplayer"&gt;
    You need Flash Player and JavaScript enabled to view this item.
 &lt;/div&gt;
&lt;/div&gt;

&lt;script type="text/javascript"&gt;
    var attributes = {
      id: 'mini',
      name: 'movie'
    };
    var params = {
      menu: 'false',
      wmode: 'transparent',
      allowscriptaccess: 'always',
      allowfullscreen: 'true'
    };
    var flashvars = {
      <span style="color: #993300;">xmlUrl: 'http://www.yoursite.com/gallery2/mediaRss.php?mode=dynamic%26g2_view=dynamicalbum.RandomAlbum%26g2_albumId=21930',</span>
      shuffle: 'true',
      showDropShadow: 'true',
      delay: 3,
      useFull: 'true',
      showControls: 'always',
      roundedMask: 'true'
   };
    <span style="color: #993300;">swfobject.embedSWF("http://www.yoursite.com/gallery2/minislideshow.swf", "g2slideplayer", "160", "160", "9.0.115.0", null, flashvars, params, attributes);</span>
&lt;/script&gt;
&lt;/div&gt;
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2011/12/gallery2-minislideshow-performance-cache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sturgeon King (Serpent 2)</title>
		<link>http://www.wmiles.com/2011/12/sturgeon-king-serpent-2</link>
		<comments>http://www.wmiles.com/2011/12/sturgeon-king-serpent-2#comments</comments>
		<pubDate>Sun, 18 Dec 2011 04:44:52 +0000</pubDate>
		<dc:creator>William Miles</dc:creator>
				<category><![CDATA[Resin Work in Progress]]></category>
		<category><![CDATA[Balance of the Nine Skies]]></category>
		<category><![CDATA[Sturgeon King]]></category>

		<guid isPermaLink="false">http://www.wmiles.com/?p=2424</guid>
		<description><![CDATA[<p>Well, it is now mid-December, and as promised I have finished the serpent on the Sturgeon King model. I sprayed some green to blue Alclad II prismatic paint along the belly of the serpent to add some additional shading and texture. The Alclad II prismatic paints have an interesting effect whereby they change color [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it is now mid-December, and as promised I have finished the serpent on the Sturgeon King model.  I sprayed some green to blue Alclad II prismatic paint along the belly of the serpent to add some additional shading and texture.  The Alclad II prismatic paints have an interesting effect whereby they change color a bit depending on the angle at which you are looking at the model.  You should be able to see the slight green tint reflecting off the scales in some of the pictures.  </p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03512a.jpg" alt="" title="Dsc03512a" width="600" height="402" class="aligncenter size-full wp-image-2425" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03521a.jpg" alt="" title="Dsc03521a" width="600" height="402" class="aligncenter size-full wp-image-2426" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03525a.jpg" alt="" title="Dsc03525a" width="600" height="402" class="aligncenter size-full wp-image-2427" /> </p>
<p>&nbsp;</p>
<p>The following pictures are some close-ups of the serpent&#8217;s face.  The creature has little beady eyes that I presume just had to be red, and a number of tiny little teeth just waiting to bite something.  I washed some black enamel into the nose lines to draw this feature out, and also into the spirals in the things in the head that I had famously tried to paint in a copper color.  I also added a little more purple pearlescent color to the scales on the top of the head as I thought this color should continue on from the back.  There is a little gold enamel trim in the ear wings, and the two antenna on the head were done in the Alclad gold oversprayed with white pearl as I did with the wings.  </p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03515a.jpg" alt="" title="Dsc03515a" width="600" height="402" class="aligncenter size-full wp-image-2430" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03519a.jpg" alt="" title="Dsc03519a" width="600" height="402" class="aligncenter size-full wp-image-2431" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03508a.jpg" alt="" title="Dsc03508a" width="600" height="402" class="aligncenter size-full wp-image-2429" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03506a.jpg" alt="" title="Dsc03506a" width="600" height="402" class="aligncenter size-full wp-image-2432" /></p>
<p><img src="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03507a.jpg" alt="" title="Dsc03507a" width="600" height="402" class="aligncenter size-full wp-image-2428" /></p>
<p>&nbsp;</p>
<p>There you go.  The serpent is done.</p>
<p>My next posting should be in a week or two.  We&#8217;re into the holiday season now and I have some time off work, so I should be able to find more time to continue working on this model.  My plan is to start work on the mushroom seat (if that is what we call it).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wmiles.com/2011/12/sturgeon-king-serpent-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.wmiles.com/wordpress/wp-content/uploads/2011/12/Dsc03512-Featured-Image.jpg" length="4620" type="image/jpg" />	</item>
	</channel>
</rss>

<!-- Served from: www.wmiles.com @ 2012-05-19 18:36:12 by W3 Total Cache -->
