<?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>dBaines.com</title>
	<atom:link href="http://dbaines.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dbaines.com</link>
	<description>Portfolio and Blog of David Baines, South Australian Web Developer</description>
	<lastBuildDate>Tue, 24 Apr 2012 11:21:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Use the Sickbeard API and PHP to show upcoming season start dates</title>
		<link>http://dbaines.com/blog/archive/use-the-sickbeard-api-and-php-to-show-upcoming-season-start-dates/</link>
		<comments>http://dbaines.com/blog/archive/use-the-sickbeard-api-and-php-to-show-upcoming-season-start-dates/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 02:40:38 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[tv]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sickbeard]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=2025</guid>
		<description><![CDATA[<p>Here's a quick little php script that will print out upcoming season start dates from your <a title="Sickbeard. The Internet PVR." href="http://www.sickbeard.com" target="_blank">Sickbeard</a>.</p>

<p>Make sure you edit the settings at the top of the file to make sure it points to your Sickbeard install.<br />&#160;<br /> <a href="http://dbaines.com/blog/archive/use-the-sickbeard-api-and-php-to-show-upcoming-season-start-dates/" class="read_more">Continue Reading</a></p>]]></description>
			<content:encoded><![CDATA[<p>Here's a quick little php script that will print out upcoming season start dates from your <a title="Sickbeard. The Internet PVR." href="http://www.sickbeard.com" target="_blank">Sickbeard</a>.</p>
<script src='https://gist.github.com/2468423.js'></script>
<p>Make sure you edit the settings at the top of the file to make sure it points to your Sickbeard install.</p>]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/use-the-sickbeard-api-and-php-to-show-upcoming-season-start-dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Usenet Intranet Homepage</title>
		<link>http://dbaines.com/blog/archive/usenet-intranet-homepage/</link>
		<comments>http://dbaines.com/blog/archive/usenet-intranet-homepage/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 05:03:34 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[downloads]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=2016</guid>
		<description><![CDATA[<p>Last weekend I set up a local Ubuntu server on an old PC and migrated my SickBeard, CouchPotato and Headphones over to it. While I was there I installed SABnzbd as well to complete the package.</p>

<p>Yesterday I decided to make a homepage for the server and I figured other people might like to check it out as well, <a title="Usenet Intranet Homepage" href="https://github.com/dbaines/Usenet-Intranet-PHP-Homepage" target="_blank">so I released it on GitHub</a>!</p>
<p>It's a cool little one-pager that has buttons for SickBeard, CouchPotato, Headphones and SABnzbd, details of your current download, your wifi information and a list of TV shows that are coming out today.</p>
<p>It's completely customisable, at the top of the php file is a big array full of various settings you can tinker <br />&#160;<br /> <a href="http://dbaines.com/blog/archive/usenet-intranet-homepage/" class="read_more">Continue Reading</a></p>]]></description>
			<content:encoded><![CDATA[<p>Last weekend I set up a local Ubuntu server on an old PC and migrated my SickBeard, CouchPotato and Headphones over to it. While I was there I installed SABnzbd as well to complete the package.</p>
<figure id="attachment_2017" aria-describedby="figcaption_attachment_2017" style="width: 310px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2012/04/screen1.png"><img class="size-medium wp-image-2017" title="Usenet Intranet Homepage" src="http://dbaines.com/blog/wp-content/uploads/2012/04/screen1-300x164.png" alt="" width="300" height="164" /></a><figcaption id="figcaption_attachment_2017">Screenshot</figcaption></figure>
<p>Yesterday I decided to make a homepage for the server and I figured other people might like to check it out as well, <a title="Usenet Intranet Homepage" href="https://github.com/dbaines/Usenet-Intranet-PHP-Homepage" target="_blank">so I released it on GitHub</a>!</p>
<p>It's a cool little one-pager that has buttons for SickBeard, CouchPotato, Headphones and SABnzbd, details of your current download, your wifi information and a list of TV shows that are coming out today.</p>
<p>It's completely customisable, at the top of the php file is a big array full of various settings you can tinker with.</p>
<p>Old browsers weren't that target audience for this project as it makes use of CSS3 and HTML5 (progress bars!)</p>
<p><a title="Usenet Intranet Homepage" href="https://github.com/dbaines/Usenet-Intranet-PHP-Homepage" target="_blank">Check it out on Github!</a></p>]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/usenet-intranet-homepage/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>DotNetNuke Snippets for SublimeText 2</title>
		<link>http://dbaines.com/blog/archive/dotnetnuke-snippets-for-sublimetext-2/</link>
		<comments>http://dbaines.com/blog/archive/dotnetnuke-snippets-for-sublimetext-2/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 05:05:17 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[downloads]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=1998</guid>
		<description><![CDATA[<p>Do you create DotNetNuke Skins? Do you use <a title="SublimeText 2 - The awesomest editor in ever." href="http://www.sublimetext.com/" target="_blank">SublimeText2</a>? Then <a title="DNN SublimeText 2 Snippets" href="https://github.com/dbaines/DotNetNuke-SublimeText-2-Snippets" target="_blank">these snippets might help save time</a>!</p>
<p>Let me know if you have any requests or suggestions.</p>
<p><strong>Now available in Package Control</strong><br />&#160;<br /> <a href="http://dbaines.com/blog/archive/dotnetnuke-snippets-for-sublimetext-2/" class="read_more">Continue Reading</a></p>]]></description>
			<content:encoded><![CDATA[<p>Do you create DotNetNuke Skins? Do you use <a title="SublimeText 2 - The awesomest editor in ever." href="http://www.sublimetext.com/" target="_blank">SublimeText2</a>? Then <a title="DNN SublimeText 2 Snippets" href="https://github.com/dbaines/DotNetNuke-SublimeText-2-Snippets" target="_blank">these snippets might help save time</a>!</p>
<p>Let me know if you have any requests or suggestions.</p>
<p><strong>Now available in Package Control</strong></p>]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/dotnetnuke-snippets-for-sublimetext-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DotNetNuke Quick Tip: Remove gap between input and button</title>
		<link>http://dbaines.com/blog/archive/dotnetnuke-quick-tip-remove-gap-between-input-and-button/</link>
		<comments>http://dbaines.com/blog/archive/dotnetnuke-quick-tip-remove-gap-between-input-and-button/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 02:24:00 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=1988</guid>
		<description><![CDATA[A quick little tutorial on how to remove a gap between the DNN search skin object.]]></description>
			<content:encoded><![CDATA[<p>If you're working on a DNN skin that requires the search button to be next to the search input you're going to be annoyed by a tiny little gap that likes to insert itself between your elements.</p>
<p>Fear not, though, it's a relatively simple issue to fix!</p>
<p>The file you need to edit is: <code class="inline-code">/admin/Skins/search.ascx</code>.</p>
<p>Inside that file on line 6 you'll find a sneaky little non-breaking space element. Delete that element.</p>
<figure id="attachment_1991" aria-describedby="figcaption_attachment_1991" style="width: 868px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2012/02/gv_nbsp.jpg"><img class="size-full wp-image-1991" title="non-breaking space" src="http://dbaines.com/blog/wp-content/uploads/2012/02/gv_nbsp.jpg" alt="" width="858" height="335" /></a><figcaption id="figcaption_attachment_1991"> non-breaking space</figcaption></figure>
<p>&nbsp;</p>
<p>Save that file and upload it if necessary and you'll notice your search bar goes from:</p>
<figure id="attachment_1989" aria-describedby="figcaption_attachment_1989" style="width: 247px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2012/02/gv_boo.jpg"><img class="size-full wp-image-1989" title="Boo!" src="http://dbaines.com/blog/wp-content/uploads/2012/02/gv_boo.jpg" alt="" width="237" height="67" /></a><figcaption id="figcaption_attachment_1989">Boo!</figcaption></figure>
<p>to:</p>
<figure id="attachment_1992" aria-describedby="figcaption_attachment_1992" style="width: 247px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2012/02/gv_yay.jpg"><img class="size-full wp-image-1992" title="Yay!" src="http://dbaines.com/blog/wp-content/uploads/2012/02/gv_yay.jpg" alt="" width="237" height="67" /></a><figcaption id="figcaption_attachment_1992">Yay!</figcaption></figure>
<span class="message important">It's important to note that this skin file is a core file and there's always the possibility that the file will be replaced or completely changed during an upgrade. </span>]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/dotnetnuke-quick-tip-remove-gap-between-input-and-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dbaines2012 WordPress Theme on Github</title>
		<link>http://dbaines.com/blog/archive/dbaines2012-wordpress-theme-on-github/</link>
		<comments>http://dbaines.com/blog/archive/dbaines2012-wordpress-theme-on-github/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 11:24:09 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[downloads]]></category>
		<category><![CDATA[Free Download]]></category>
		<category><![CDATA[Wordpress Template]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=1965</guid>
		<description><![CDATA[<p>I've done a visual refresh of the WordPress Theme here so I've started a new Github project to separate it from the previous theme.</p>
<p>Like last time, this is a development template and is in no way ready to be used on any website "as is". It's only being shared as a developer resource. If you see something here you like and want to know how it's done then you can download the source and peruse the templates <img src='http://dbaines.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This is the theme being used on this website <strong>right now</strong>. It's like a live demo!</p>
<p><span id="more-1965"></span></p>
<p><br />
<a title="Read the latest version history at GitHub" href="https://github.com/dbaines/dbaines2012-Wordpress-Theme/blob/master/README.md" target="_blank"> Read the latest version history</a>.<br />&#160;<br /> <a href="http://dbaines.com/blog/archive/dbaines2012-wordpress-theme-on-github/" class="read_more">Continue Reading</a></p>]]></description>
			<content:encoded><![CDATA[<span class="message info">Version 2.0 - Last updated 2012-04-01<br />
Looking for help? <a title="dbaines2012 WordPress Theme Wiki" href="https://github.com/dbaines/dbaines2012-Wordpress-Theme/wiki" target="_blank">Try the wiki</a>.</span>
<p>I've done a visual refresh of the WordPress Theme here so I've started a new Github project to separate it from the previous theme.</p>
<p>Like last time, this is a development template and is in no way ready to be used on any website "as is". It's only being shared as a developer resource. If you see something here you like and want to know how it's done then you can download the source and peruse the templates <img src='http://dbaines.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This is the theme being used on this website <strong>right now</strong>. It's like a live demo!</p>
<p><span id="more-1965"></span></p>
<p><h2 class="subheader">Version History</h2><br />
<a title="Read the latest version history at GitHub" href="https://github.com/dbaines/dbaines2012-Wordpress-Theme/blob/master/README.md" target="_blank"> Read the latest version history</a>.</p>
<a href="https://github.com/dbaines/dbaines2012-Wordpress-Theme" class="downloadbtn downloadbtn_star" title="View at GitHub" onClick="javascript: _gaq.push(['_trackPageview', 'dbaines2012 WordPress Theme on Github/View at GitHub']);" target="_blank"><span class="downloadbtn_icon"></span>View at GitHub</a>]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/dbaines2012-wordpress-theme-on-github/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Post Type Art Gallery Tutorial</title>
		<link>http://dbaines.com/blog/archive/wordpress-custom-post-type-art-gallery-tutorial/</link>
		<comments>http://dbaines.com/blog/archive/wordpress-custom-post-type-art-gallery-tutorial/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 05:06:36 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=1920</guid>
		<description><![CDATA[This lengthy tutorial will teach you how to set up a custom post type for an art gallery and implementing the colorbox popups instead of full-post pages, then implementing a custom homepage with a slider of your latest images.]]></description>
			<content:encoded><![CDATA[<p>This is a multi-page post of tutorials that will teach you how to create a custom post type for an art gallery, template it and then implement a custom home page with a slider.</p>
<p>I'll be working with the as-of-writing default template, TwentyEleven, but the steps can really be applied to any skin as long as you acknowledge the dimensions of your website before you start.</p>
<p>This introductory page will act as a guide to break up the tutorial in to easy to digest chunks, so here's a run down of each page and what you will learn:</p>
<h2 class="subheader"><a title="Wordpress Custom Post Type Art Gallery Tutorial - Part 2" href="?page=2">Page Two</a></h2>
<figure id="attachment_1471" aria-describedby="figcaption_attachment_1471" style="width: 601px" class="wp-caption aligncenter"><a href="/blog/wp-content/uploads/2012/01/customposttype.jpg"><img class="size-full wp-image-1471" title="Custom Post Type Settings" src="/blog/wp-content/uploads/2012/01/customposttype.jpg" alt="" width="591" height="398" /></a><figcaption id="figcaption_attachment_1471">Custom Post Type Settings</figcaption></figure>
<ul>
<li>Create an "artwork" custom post type using the Custom Post Type UI plugin</li>
<li>Apply additional image sizes using the Additional Image Sizes plugin</li>
<li>Creating  your first art gallery post</li>
</ul>
<h2 class="subheader"><a title="Wordpress Custom Post Type Art Gallery Tutorial - Part 3" href="?page=3">Page Three</a></h2>
<figure id="attachment_1492" aria-describedby="figcaption_attachment_1492" style="width: 650px" class="wp-caption aligncenter"><a href="/blog/wp-content/uploads/2012/01/stylesadded.jpg"><img class="size-large wp-image-1492" title="Styling Added" src="/blog/wp-content/uploads/2012/01/stylesadded-1024x444.jpg" alt="" width="640" height="277" /></a><figcaption id="figcaption_attachment_1492">Styling Added</figcaption></figure>
<ul>
<li>Creating a template to display your artwork post type as a gallery rather than a series of posts.</li>
</ul>
<h2 class="subheader"><a title="Wordpress Custom Post Type Art Gallery Tutorial - Part 4" href="?page=4">Page Four</a></h2>
<figure id="attachment_1507" aria-describedby="figcaption_attachment_1507" style="width: 310px" class="wp-caption aligncenter"><a href="/blog/wp-content/uploads/2012/01/Colorboxed.jpg"><img class="size-medium wp-image-1507" title="Colorboxed" src="/blog/wp-content/uploads/2012/01/Colorboxed-300x243.jpg" alt="" width="300" height="243" /></a><figcaption id="figcaption_attachment_1507">Colorboxed</figcaption></figure>
<ul>
<li>Implementing Colorbox to display your "full posts" as a popup gallery</li>
</ul>
<h2 class="subheader"><a title="Wordpress Custom Post Type Art Gallery Tutorial - Part 5" href="?page=5">Page Five</a></h2>
<figure id="attachment_1523" aria-describedby="figcaption_attachment_1523" style="width: 650px" class="wp-caption aligncenter"><a href="/blog/wp-content/uploads/2012/01/slidercustomised.jpg"><img class="size-large wp-image-1523" title="Customised the Slider" src="/blog/wp-content/uploads/2012/01/slidercustomised-1024x579.jpg" alt="" width="640" height="361" /></a><figcaption id="figcaption_attachment_1523">Customised the Slider</figcaption></figure>
<ul>
<li>Creating a homepage for your website</li>
<li>Using Sudo Slider to develop a "latest artwork" slider.</li>
</ul>
<h2 class="subheader"><a title="Wordpress Custom Post Type Art Gallery Tutorial - Part 6" href="?page=6">Page Six</a></h2>
<figure id="attachment_1531" aria-describedby="figcaption_attachment_1531" style="width: 650px" class="wp-caption aligncenter"><a href="/blog/wp-content/uploads/2012/01/postmetastyled.jpg"><img class="size-large wp-image-1531" title="Styled titles and dates" src="/blog/wp-content/uploads/2012/01/postmetastyled-1024x475.jpg" alt="" width="640" height="296" /></a><figcaption id="figcaption_attachment_1531">Styled titles and dates</figcaption></figure>
<ul>
<li>Adding titles and dates to your slider and styling</li>
<li>Linking the titles directly to a colorbox popup</li>
</ul>
<h2 class="subheader"><a title="Wordpress Custom Post Type Art Gallery Tutorial - Epilogue" href="?page=7">Epilogue</a></h2>
<ul>
<li>Download final template from Github</li>
<li>Other tutorials to keep going with</li>
</ul>
<p>Ready to get started? Head on over to Part Two.</p>]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/wordpress-custom-post-type-art-gallery-tutorial/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Adding Google +1 Buttons to Colorbox</title>
		<link>http://dbaines.com/blog/archive/adding-google-1-buttons-to-colorbox/</link>
		<comments>http://dbaines.com/blog/archive/adding-google-1-buttons-to-colorbox/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 21:02:21 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[colorbox]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plus one]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=1704</guid>
		<description><![CDATA[A quick run-down with code examples on how to add the google +1 button to your colorbox popups. These can be great if you have a portfolio set up like mine, where each colorbox popup is actually a post.]]></description>
			<content:encoded><![CDATA[<p>Something I've recently enabled in my theme (<a title="dBaines 2011 WordPress Template available at GitHub" href="http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/">available on GitHub</a>!) is Google +1 buttons.</p>
<p>Here I'll detail the steps I took to add the +1 buttons to my artwork and motion portfolio pages.</p>
<p>First you need to understand the logic behind my portfolio. The artwork page is actually a list of WordPress posts that have the <em>post-type</em> of artwork, so each picture has it's own post and it's own permalink. This is essential for the +1 buttons, as they each need to have their own <acronym title="Uniform Resource Locator">URL</acronym> to +1 independent of each other.</p>
<p>If you are using a different <acronym title="Content Management System">CMS</acronym>, just ensure that each image (or whatever you're <a title="Colorbox" href="http://colorpowered.com/colorbox/" target="_blank">colorboxing</a>™) has a unique <acronym title="Uniform Resource Locator">URL</acronym>, even if it's just the <acronym title="Uniform Resource Locator">URL</acronym> of the image itself.</p>
<h2 class="subheader">Step 1: Adding the <acronym title="Uniform Resource Locator">URL</acronym> somewhere that Javascript can access</h2>
<p>In my wordpress loop I needed to add the permalink for the WordPress post, in this case I just used the "data-*" attribute:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;/path/to/image.jpg&quot; data-permalink=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;galleryThumbnail&quot; title=&quot;my really cool image&quot;&gt;</pre></div></figure>
<p>If you're just going to use the <acronym title="Uniform Resource Locator">URL</acronym> of the image you can skip this step, as we can just steal the <acronym title="Uniform Resource Locator">URL</acronym> from the "href" attribute.</p>
<h2 class="subheader">Step 2: The Javascript</h2>
<p>I already had a custom "title" set up in my colorbox call, as I wanted the option for the user to download the image. Here is the script I had originally:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;a.galleryThumbnail&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>colorbox<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
opacity<span style="color: #339933;">:</span> <span style="color:#800080;">0.92</span><span style="color: #339933;">,</span>
scalePhotos<span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
maxHeight<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;90%&quot;</span><span style="color: #339933;">,</span>
maxWidth<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;90%&quot;</span><span style="color: #339933;">,</span>
title<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> title <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> download <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;span id=&quot;cboxDownload&quot;&gt;&lt;a href=&quot;'</span><span style="color: #339933;">+</span>url<span style="color: #339933;">+</span><span style="color: #0000ff;">'&quot; title=&quot;Download This Image&quot;&gt;&lt;strong&gt;Download&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;span id=&quot;cboxTitleLeft&quot;&gt;'</span><span style="color: #339933;">+</span>title<span style="color: #339933;">+</span><span style="color: #0000ff;">'&lt;/span&gt;'</span><span style="color: #339933;">+</span>download<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></figure>
<p>I already have some variables set up in there that's pulling information from the markup. This gives you an idea on how we're going to access the permalink, so let's start the magic!</p>
<h2 class="subheader">The Magic</h2>
<p>We can't just add in the typical &lt;g:plus&gt; tag in the script since it just plain doesn't work. Conveniently, <a title="Google's PlusOne button docs" href="http://code.google.com/apis/+1button/#jsapi" target="_blank">the plus guys have a handy-dandy documentation page</a> that covers just about everything we need to tackle this problem. We need to use the Javascript <acronym title="Application Programming Interface">API</acronym> instead, which is really quite easy.</p>
<p>We need to set up a target element which is as simple as adding an empty element to the return, like so:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;span id=&quot;cboxTitleLeft&quot;&gt;'</span><span style="color: #339933;">+</span>title<span style="color: #339933;">+</span><span style="color: #0000ff;">'&lt;/span&gt;&lt;span id=&quot;cboxGplus&quot;&gt;&lt;/span&gt;'</span><span style="color: #339933;">+</span>download<span style="color: #339933;">;</span></pre></div></figure>
<p>So I've added an empty span with the ID of cboxGplus. Now we want to target that element with the <code class="inline-code">gapi.plusone.render</code> command. At the end of the title function, add a comma after the last curly brace ("}") then add in the colorbox "onComplete" option:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;">&nbsp;
title<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> title <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> download <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;span id=&quot;cboxDownload&quot;&gt;&lt;a href=&quot;'</span><span style="color: #339933;">+</span>url<span style="color: #339933;">+</span><span style="color: #0000ff;">'&quot; title=&quot;Download This Image&quot;&gt;&lt;strong&gt;Download&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;span id=&quot;cboxTitleLeft&quot;&gt;'</span><span style="color: #339933;">+</span>title<span style="color: #339933;">+</span><span style="color: #0000ff;">'&lt;/span&gt;&lt;span id=&quot;cboxGplus&quot;&gt;&lt;/span&gt;'</span><span style="color: #339933;">+</span>download<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
onComplete<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// This is where the plusone magic will happen</span>
<span style="color: #009900;">&#125;</span>
&nbsp;</pre></div></figure>
<p>The onComplete function, funilly enough, will run when the colorbox pop up finishes loading. So once the image has loaded and everything's settled, we'll tell Google to render that button for us. Do it Google! Do it!</p>
<p>Inside the function add the following two lines:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> permalink <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;data-permalink&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
gapi<span style="color: #339933;">.</span>plusone<span style="color: #339933;">.</span>render<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cboxGplus&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;size&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;small&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;count&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;href&quot;</span><span style="color: #339933;">:</span> permalink<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></figure>
<p>The variable is pulling the permalink from the data-permalink attribute. If you're using the full-size image as the <acronym title="Uniform Resource Locator">URL</acronym> to +1 then change the "data-permalink" to "href".</p>
<p>The render command is being triggered for the "cboxGplus" element. It's being rendered as a "small" button, showing the count and the href is being pulled from the permalink variable. Neat-o.</p>
<h2 class="subheader">All together</h2>
<p>So now our complete code looks like this:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;">&nbsp;
title<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> title <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> download <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;span id=&quot;cboxDownload&quot;&gt;&lt;a href=&quot;'</span><span style="color: #339933;">+</span>url<span style="color: #339933;">+</span><span style="color: #0000ff;">'&quot; title=&quot;Download This Image&quot;&gt;&lt;strong&gt;Download&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;span id=&quot;cboxTitleLeft&quot;&gt;'</span><span style="color: #339933;">+</span>title<span style="color: #339933;">+</span><span style="color: #0000ff;">'&lt;/span&gt;&lt;span id=&quot;cboxGplus&quot;&gt;&lt;/span&gt;'</span><span style="color: #339933;">+</span>download<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
onComplete<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// +1 Button</span>
<span style="color: #000000; font-weight: bold;">var</span> permalink <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;data-permalink&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
gapi<span style="color: #339933;">.</span>plusone<span style="color: #339933;">.</span>render<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cboxGplus&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;size&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;small&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;count&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;href&quot;</span><span style="color: #339933;">:</span> permalink<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;</pre></div></figure>
<p>And after some <acronym title="Cascading Style Sheets">CSS</acronym> tweaking, check it out, it's now showing up:<br />
<em>Note: This example has "count" set to false, so the count bubble is hidden.</em></p>
<figure id="attachment_1716" aria-describedby="figcaption_attachment_1716" style="width: 310px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2011/07/plusone-working.jpg"><img class="size-medium wp-image-1716" title="The +1 Button On Colorbox" src="http://dbaines.com/blog/wp-content/uploads/2011/07/plusone-working-300x241.jpg" alt="" width="300" height="241" /></a><figcaption id="figcaption_attachment_1716">The +1 Button On Colorbox</figcaption></figure>
<h2 class="subheader">See it in action</h2>
<p>This is now live on my website, over in either my <a href="/artwork">artwork</a> or <a href="/motion">motion</a> pages. <a title="dBaines 2011 WordPress Template available at GitHub" href="http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/">The source is freely available over at GitHub</a>. The pages you're interested in are:</p>
<ul>
<li>/js/dbaines.js - Do a search for "// Colorboxing Artwork"</li>
<li>/loop.php - Do a search for "/* Artwork */" and look for the <strong>a</strong> tag.</li>
</ul>
<p>Hope that helps, let me know if you have any questions in the comments section below, or <a title="Drop me a line, or a square. Or if you really want to impress me, a trapezoid. Everyone likes those. " href="/about/#contact">drop me a line</a> via email.</p>]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/adding-google-1-buttons-to-colorbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>dbaines2011 WordPress Theme now on Github</title>
		<link>http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/</link>
		<comments>http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 09:26:01 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[downloads]]></category>
		<category><![CDATA[Free Download]]></category>
		<category><![CDATA[Wordpress Template]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=1667</guid>
		<description><![CDATA[<p>I've uploaded <a title="dbaines2011 @ Github" href="https://github.com/dbaines/dbaines2011-Wordpress-Theme" target="_blank">my current WordPress theme as a Github project</a>, freely available for WordPress hackers of the world to dissect and learn from. So if there's anything here that you've seen and thought, "How the hell is he making that happen?" well, now you can find out! Feel free to download, use, dissect, play-with or do nasty, nasty things that you really shouldn't tell anyone about.</p>

<p><span id="more-1667"></span> </p>
<p><strong>Version 1.7 - 2012-01-17</strong></p>
<ul>
<li>FINAL VERSION - Superceded by the 2012 theme.</li>
<li>Re-arranged and styled the author info box at the bottom of loop-single.php, shows up when user has filled out their profile</li>
<li>Styled Author Archives page</li>
<li>Multiple Size Favicon (64, 32, 16)</li>
<li>Added a little "sticky" icon/flag for sticky posts</li>
<li>Switched from </li><br />&#160;<br /> <a href="http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/" class="read_more">Continue Reading</a></ul>]]></description>
			<content:encoded><![CDATA[<span class="message info"><em>FINAL</em> <em>Version 1.7 - Updated: 2012-01-17</em></span>
<p>I've uploaded <a title="dbaines2011 @ Github" href="https://github.com/dbaines/dbaines2011-Wordpress-Theme" target="_blank">my current WordPress theme as a Github project</a>, freely available for WordPress hackers of the world to dissect and learn from. So if there's anything here that you've seen and thought, "How the hell is he making that happen?" well, now you can find out! Feel free to download, use, dissect, play-with or do nasty, nasty things that you really shouldn't tell anyone about.</p>
<span class="message important">This template is no longer being developed. Instead any future updates are being done to the <a title="dbaines2012 WordPress Theme on Github" href="http://dbaines.com/blog/archive/dbaines2012-wordpress-theme-on-github/">dbaines2012 project</a>, also available at Github.</span>
<p><span id="more-1667"></span> <h2 class="subheader">Version History</h2></p>
<p><strong>Version 1.7 - 2012-01-17</strong></p>
<ul>
<li>FINAL VERSION - Superceded by the 2012 theme.</li>
<li>Re-arranged and styled the author info box at the bottom of loop-single.php, shows up when user has filled out their profile</li>
<li>Styled Author Archives page</li>
<li>Multiple Size Favicon (64, 32, 16)</li>
<li>Added a little "sticky" icon/flag for sticky posts</li>
<li>Switched from EasySlider to SudoSlider</li>
<li>Removed left over Google Prettify code</li>
</ul>
<p><strong>Version 1.6 - 2011-08-22</strong></p>
<ul>
<li>Fixed the excessive PRE tags in Geshi causing massive padding everywhere. (This was actually part of the last update, I just forgot to document it)</li>
<li>Minified the customised EasySlider script in plugins.js</li>
<li>Fixed accesskey 2 for about link</li>
<li>Updated download shortcode to open in new window, removed "Download" part of title text so you can use it as a pretty link button instead.</li>
<li>Added "or" between load more button and show pagination</li>
<li>Added some logic to show a disabled load more button if there are no more posts to load</li>
<li>Added an error message if the loadMore button fails to load the next page</li>
<li>Adapted post-icons to allow for multiple icons using some jQuery (dbaines.js)</li>
</ul>
<p><strong>Version 1.5 - 2011-08-21</strong></p>
<ul>
<li>Removed changelog from style.css for older releases. Still available at GitHub and the <acronym title="Uniform Resource Locator">URL</acronym> at the top of the file.</li>
<li>Updated to Modernizr 2.0.6 Custom</li>
<li>Removed border-top for active menu item when using wordpress menus, since custom post types were showing the blog as being active, rather than the correct parent page. Bug in WordPress?</li>
<li>Added custom close button for colorbox</li>
<li>Added a blue hover state to the homepage logo link</li>
<li>Implemented Google Code Prettify to replace GeSHi, but changed back due to quirks of Prettify (namely line number incrementing, copy and paste issues and other things GeSHi does better) - I've left the code in /functions/functions.shortcodes.prettify.php</li>
<li>As a result of the above I've moved the GeSHi stuff in to functions/functions.shortcodes.geshi.php for hot swapping action</li>
<li>Added "Show Pagination" link to the load more posts button. Shows wp-pagenavi links next to the load more button. LoadMoreButton also pulls in the wp-pagenavi from each page so if the user loads a few pages and then shows the pagination, it shows the relevant page as being current.</li>
<li>Fixes to the Load More feature:
<ul>
<li>Functionised&amp;tm; the part of the dbaines.js file that adds colorbox classes to everything so we can call it after the new page has been loaded</li>
<li>Called gapi.plusone.go after a successful load so the google plus buttons are rendered.</li>
<li>Rejiggered the ajax call for the loadMore link to only do one .load() and then cherrypick the things to go to places and what not</li>
</ul>
</li>
<li>Added some accesskeys:
<ul>
<li>0: Takes the user to the new accessibility page</li>
<li>1: Homepage</li>
<li>2: About</li>
<li>3: Blog</li>
<li>4: Portfolio</li>
<li>5: Search</li>
<li>6: Sitemap</li>
<li>9: Contact Page</li>
<li>S: Skip to Content</li>
</ul>
</li>
</ul>
<p><strong>Version 1.4 - 2011-08-04</strong></p>
<ul>
<li>Styled figcaption for codebox</li>
<li>Added aprilfools.css for headache inducing fun come April-time</li>
<li>Added WordPress Option: Google Analytics UA Code</li>
<li>Added WordPress Option: Enable WordPress Menu - Uses a WordPress menu, "Main Menu" as the main navigation instead of the hardcoded links</li>
<li>Added WordPress Option: Replace 'friends' with 'blogroll' links</li>
<li>Added WordPress Option: All posts have thumbnails - includes shiny new generic post-thumbnail.png</li>
<li>Added WordPress Option: <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> Post Loading - Facebook/twitter esque post loading technique</li>
<li>Removed -webkit-appearance from search input</li>
<li>Added Google +1 buttons to search results</li>
<li>Added .2 seconds of transitions (of various vendors) to the top-level nav links for fun and profit</li>
<li>Gave .homepageSlider h2 1px of text shadow blur to fix the shadow being white in chrome 12/13.</li>
<li>Added line-height: 1.5 to p,ul - if it affects too many things I'll specify it to content areas only.</li>
<li>Hardware Acceleration (via the "Magic Bullet" -webkit-transform: translateZ(0);) given to homepage slider and websites slider</li>
<li>Added a "Shortcodes Reference" box in the new post admin page. Super convenient!</li>
<li>Responsive Design changes:
<ul>
<li>Fixed rendering of the search input in Firefox for the mobile design, again. Should stick this time.</li>
<li>Made the artwork portfolio look somewhat nicer on the reponsive design</li>
<li>Changes for the contact form when less than 960px wide</li>
<li>Made the "About me" image centred and styled like the centred images in the blog</li>
</ul>
</li>
</ul>
<p><strong>Version 1.3 - 2011-08-01</strong></p>
<ul>
<li>Fixed search input rendering in Firefox for the mobile display</li>
<li>Added +1 buttons to portfolio colourbox popups (dbaines.js)</li>
<li>Added +1 buttons to websites loop</li>
</ul>
<p><strong>Version 1.2 - 2011-07-31 (double day update!)</strong></p>
<ul>
<li>Fixed the 1.1 date</li>
<li>Figure HTML5 elements for wp-captions</li>
<li>Figure HTML5 elements for tutorial post thumbnails</li>
<li>Figure elements for code blocks, adding caption option to codebox shortcode</li>
<li>HTML5 form fields for comments form</li>
<li>Removed some vendor prefixes for some box shadows and rounded corners as the major browsers now use non-vendor-prefixes.</li>
<li>Fixed some more inconsistent typography</li>
<li>New WordPress Theme Options:
<ul>
<li>Google +1 "count" bubbles on/off</li>
<li>Footer Text</li>
<li>Comments Intro</li>
<li>Laid groundwork for <acronym title="What You See Is What You Get">WYSIWYG</acronym> editors in theme options page, still a bit buggy.</li>
</ul>
</li>
</ul>
<p><strong>Version 1.1 - 2011-07-31</strong></p>
<ul>
<li>Reponsive Design changes for &lt;960 and &lt;600 wide</li>
<li>&lt;600 wide is optimised for mobile devices</li>
<li>Pseudoelement <acronym title="Cascading Style Sheets">CSS</acronym> icons for subsection (dark grey area) and post meta icons</li>
<li>Fixed some inconsistent typography</li>
<li>Added GooglePlus and Forrst Icon to homepage</li>
<li>Plugins.js for minified plugins</li>
<li>jQuery from Google CDN, Updated to 1.6.2</li>
<li>Added rel="me" to links to my profiles on things</li>
<li>Re-arranged functions.php, cleaned up, separated large chunks in to manageable files (ie. functions.shortcodes.php)</li>
<li>Removed Facebook Likes</li>
<li>Added Google +1 Buttons</li>
<li>WordPress Options Page!
<ul>
<li>Google +1 Buttons on/off</li>
</ul>
</li>
<li>Updated login css to reflect changes in WordPress 3.2</li>
</ul>
<p><strong>Version 1.0</strong></p>
<ul>
<li>First Release</li>
</ul>
<a href="https://github.com/dbaines/dbaines2011-Wordpress-Theme" class="downloadbtn downloadbtn_star" title="View at GitHub" onClick="javascript: _gaq.push(['_trackPageview', 'dbaines2011 WordPress Theme now on Github/View at GitHub']);" target="_blank"><span class="downloadbtn_icon"></span>View at GitHub</a>

<a href='http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/db2011-home/' title='Homepage Slider'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/db2011-home-150x150.jpg" class="attachment-thumbnail" alt="Homepage Slider" title="Homepage Slider" /></a>
<a href='http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/db2011-blog/' title='Blog View'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/db2011-blog-150x150.jpg" class="attachment-thumbnail" alt="Blog View" title="Blog View" /></a>
<a href='http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/db2011-portfoliohome/' title='Portfolio Home and Search Options'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/db2011-portfoliohome-150x150.jpg" class="attachment-thumbnail" alt="Portfolio Home and Search Options" title="Portfolio Home and Search Options" /></a>
<a href='http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/db2011-colorbox/' title='Portfolio Colorbox Popup'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/db2011-colorbox-150x150.jpg" class="attachment-thumbnail" alt="Portfolio Colorbox Popup" title="Portfolio Colorbox Popup" /></a>
<a href='http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/db2011-theme-options/' title='Theme Options'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/db2011-theme-options-150x150.jpg" class="attachment-thumbnail" alt="Theme Options" title="Theme Options" /></a>
]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/dbaines2011-wordpress-theme-now-on-github/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Assassin&#8217;s Creed: Brotherhood</title>
		<link>http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/</link>
		<comments>http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 04:09:18 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[assassin's creed]]></category>
		<category><![CDATA[Game Review]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=1609</guid>
		<description><![CDATA[<p>So it's been a while since I've reviewed a game and Assassin's Creed Brotherhood just came out for the PC so I sat down, took some screenshots and wrote down my thoughts.</p>

<p><span id="more-1609"></span>The game takes place directly after Assassin's Creed II. So if you haven't played that one then you're probably going to be lost for the most part at the beginning. It does an okay job of bringing us back up to speed with the overall story which is great.</p>
<p>You start out as any hero would after saving the world. You go around doing mundane things, helping old ladies cross the street and bringing the groceries home for the local hottie. Then everything goes to shit, as I <br />&#160;<br /> <a href="http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/" class="read_more">Continue Reading</a></p>]]></description>
			<content:encoded><![CDATA[<p>So it's been a while since I've reviewed a game and Assassin's Creed Brotherhood just came out for the PC so I sat down, took some screenshots and wrote down my thoughts.</p>
<figure id="attachment_1610" aria-describedby="figcaption_attachment_1610" style="width: 946px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_title.jpg"><img class="size-full wp-image-1610      " title="In the immortal words of the Crystal Method, &quot;That's the name of the game.&quot;" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_title.jpg" alt="" width="936" height="270" /></a><figcaption id="figcaption_attachment_1610">In the immortal words of the Crystal Method, &quot;That&#39;s the name of the game.&quot;</figcaption></figure>
<p><span id="more-1609"></span>The game takes place directly after Assassin's Creed II. So if you haven't played that one then you're probably going to be lost for the most part at the beginning. It does an okay job of bringing us back up to speed with the overall story which is great.</p>
<p>You start out as any hero would after saving the world. You go around doing mundane things, helping old ladies cross the street and bringing the groceries home for the local hottie. Then everything goes to shit, as I guess it had to.</p>
<figure id="attachment_1617" aria-describedby="figcaption_attachment_1617" style="width: 310px" class="wp-caption alignleft"><a href="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_01.jpg"><img class="size-medium wp-image-1617" title="My villiage! It's being attacked! " src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_01-300x168.jpg" alt="" width="300" height="168" /></a><figcaption id="figcaption_attachment_1617">My villiage! It&#39;s being attacked! </figcaption></figure>
<p>By a very common trope you're stripped of your earnings and worldly possessions when the now-bustling village you built in AC2 gets attacked by the Pope's son. What a jerk.</p>
<p>The game takes place in Rome. Just one city, unlike the previous games that would take place in a few different cities with a rather boring overworld to get between them. Personally I kind of liked only being in one city. It made it easier to get around and you very quickly learn the landscape.</p>
<p><div class="clear">&nbsp;</div> <h2 class="subheader" id="bad">The Bad</h2></p>
<p>Unfortunately after a few missions you start to realise the developers really haven't learned from the issues of their previous games.</p>
<p>Just like every other Assassin Creed game, there's just four buttons. That means you get one key to do fifty different things. Thanks, consoles!<br />
Pressing shift may at any time, often disregarding whether you're in high profile mode or not:</p>
<ul>
<li>Climb the nearest building</li>
<li>Hop on the nearest platform/fence</li>
<li>Push somebody</li>
<li>Tackle somebody</li>
<li>Grab somebody</li>
<li>Pick up a weapon</li>
<li>Pick up a dead body</li>
<li>Try and loot a dead body</li>
<li>Climb on a horse</li>
</ul>
<p>It's really a game of dice to see what your character's going to do. This gets very old very quickly.<br />
You're SOL if you want to hop on a horse if you're standing in a field of the recently deceased. There are guards coming at you and all you want to do is high tail it out of there, yet all you can do is pick up dead bodies. Oh the woes of being an assassin.</p>
<figure id="attachment_1623" aria-describedby="figcaption_attachment_1623" style="width: 310px" class="wp-caption alignright"><a href="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_07.jpg"><img class="size-medium wp-image-1623" title="Hot wall-climbing action!" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_07-300x168.jpg" alt="" width="300" height="168" /></a><figcaption id="figcaption_attachment_1623">Hot wall-climbing action!</figcaption></figure>
<p>The camera locks into place when you're in the process of climbing up on to a platform so it breaks any fluidity, since you need to wait for the animation to stop before you can look around for the next platform to hop to. If you try and create a fluid run you really only end up on walls you didn't want to go up or falling on to a street you really weren't aiming for.</p>
<p>Similarly you can't move your mouse through walls. This makes navigating tight corners very slow and painful. Lots of running in to walls and tripping over because I can't see where I'm going. I'm using the keyboard so the only directions I can go is up down left and right and they are all relative to where the mouse is looking, which would be great if I could move the mouse. If I need to move south west and the camera is locked in to place I need to stagger left and down until I can move freely again.</p>
<p>Several times I've had a target locked on and tried to assassinate them only for Ezio to turn around and take out two completely innocent civilians for apparently no reason what so ever. Sometimes you'll leap at your target and take him out, sometimes you'll just kill some civilians.</p>
<p>Jumping distances are thoroughly inconsistent. Sometimes you'll jump massive distances and make it, other times you'll jump a substantially less distance and your character will fail and fall down. I have a feeling this is mostly due to poorly made scripted jumps though. Most of the big ones you can do (in game, not in a cutscene) are done during the core missions. There are quite a few times I've stood and looked around for another way to go because there was no way I'm going to make this jump they want me to do. I know for a fact I've fallen down from smaller distances. In the end I just guess they want me to go that way so I jump and some how miraculously make it.<br />
The most recent example of this is during one of the Leonardo missions I was able to jump an enormous gap between two buildings that had wooden beams poking out between them. I thought for sure I was going to fall down and die but miraculously made it. Straight after that in a Romulus temple I fell down jumping from one chandelier to another. Even though it looked like they were a lot closer than the two beams I jumped between earlier.</p>
<p>Other times simple little jumps just won't happen. For example if I'm sitting on a broken wall of a house and there's a platform below me, no amount or combination of keypresses will get me from where I am to where I want to go. I either need to leap off completely missing my target, tackle somebody or slowly climb down and hop along the pokey-outey bricks to get over there.</p>
<p>All of the standard Assassin's Creed failures that have been around since the first game, and that you'd think they'd iron out by the third game. If you enjoyed the first two games and you didn't mind these issues, you're really going to like this one.</p>
<h2 class="subheader" id="good">The Good</h2>
<p>There are some pretty cool new features though.</p>
<figure id="attachment_1642" aria-describedby="figcaption_attachment_1642" style="width: 310px" class="wp-caption alignright"><a href="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_26.jpg"><img class="size-medium wp-image-1642 " title="Assassin Recruits are fantastic at gangbanging soldiers in dark alleys. " src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_26-300x168.jpg" alt="" width="300" height="168" /></a><figcaption id="figcaption_attachment_1642">Assassin Recruits are fantastic at gangbanging soldiers in dark alleys. </figcaption></figure>
<p>You also now have assassin recruits you can train and call in for  support at any time. High level assassins are awesome, and watching them  come out of nowhere and take out a group of guards is immensely  satisfying.</p>
<p>Hiring a group of mercs and travelling the country-side sicking them on guard patrols is amazingly fun. That are very good fighters too, so hiring a group can often lead to upwards of an hour of killing.</p>
<p>You can now call your horse who will magically appear nearby and crush any civilians that gets between you and itself. I called mine Epona. You can ride your horse throughout Rome and it's a quick way to get around. I'm not sure about everyone else but I specifically went out of my way to run over civilians when I was on my horse.</p>
<p>I'm not sure if it was in AC2, but smoke bombs are fantastic as well. One assassination mission I was perched on a tall column watching the target below chatting with some guards. I threw a smoke bomb at him, dove down and took him out with my hidden blade, stole a horse and took off. The guards had no idea what happened and I didn't get any notoriety. It was so cool.</p>
<p>There are tonnes of missions to do as well, which is great. I think they really learned their lesson from the bad press the got for AC1, for it's lack of missions and mission types. I've been playing for about a week and still have a map full of mission markers.</p>
<p>Like AC2 you can purchase buildings. Instead of just purchasing some buildings in your villiage, you can now purchase a whole bunch of buildings, shops and landmarks located all over Rome. One of the building types you can purchase is a tunnel entrance. You can find several tunnel entrances throughout Rome and when you've purchased them they serve as a quick-travel location.</p>
<figure id="attachment_1621" aria-describedby="figcaption_attachment_1621" style="width: 310px" class="wp-caption alignleft"><a href="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_05.jpg"><img class="size-medium wp-image-1621" title="Burning that mother down." src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_05-300x168.jpg" alt="" width="300" height="168" /></a><figcaption id="figcaption_attachment_1621">Burning that mother down.</figcaption></figure>
<p>Instead of just having look out towers to synchronise the map with, you now also have Borgia towers. These towers have varying areas of influence around them that prevent you from purchasing any buildings in the area. For each tower there is a Borgia captain. Once you kill him you're able to burn that mother down and release the area from the evil Borgian presence. Once liberated the tower that miraculously survived the burnination now turns in to a place where you can manage your assassins.</p>
<p>Not only are there Templar lairs, there are now also Romulan crypts, housing the creepy wolf-skin-wearing Followers of Romulus. Beating all six will unlock an equally creepy new armour set for your lovable little assassin.</p>
<p>Getting to free-play as Desmond in the real world was fun as well. There are a few things you can find outside of the Animus, but for the most part it's an empty sandbox that while cool gets pretty boring.</p>
<p>There's a new Virtual Training mode which I enjoyed. A very Metal Gear Solid VR Training-esque mode that you can use to practice your killing and maiming like any normal person would.</p>
<p>All in all I think the game is highly enjoyable. It has some great new features, a quality story with some much more interesting modern-day chapters than the previous games. The issues I've mentioned are the same issues found in both previous games so if you didn't notice the issues with Assassin's Creed or Assassin's Creed II, or you simply didn't think they were a big deal then you are absolutely going to love this game.</p>
<p>Now enjoy a whole bunch of random screenshots I took while playing:</p>

<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_02/' title='Playing as Desmond'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_02-150x150.jpg" class="attachment-thumbnail" alt="Desmond leads lucy around a spooky crypt while tripping on peyote." title="Playing as Desmond" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_03/' title='VR Training'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_03-150x150.jpg" class="attachment-thumbnail" alt="VR Training" title="VR Training" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_04/' title='Synchronising with Rome. '><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_04-150x150.jpg" class="attachment-thumbnail" alt="Synchronising with Rome." title="Synchronising with Rome." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_06/' title='LOLOLOLOL'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_06-150x150.jpg" class="attachment-thumbnail" alt="Subject 16 is such a troll." title="LOLOLOLOL" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_08/' title='Leaping from a burning Borgia Tower'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_08-150x150.jpg" class="attachment-thumbnail" alt="Leaping from a burning Borgia Tower" title="Leaping from a burning Borgia Tower" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_09/' title='Hidden symbols in the world.'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_09-150x150.jpg" class="attachment-thumbnail" alt="Those glowy symbols hidden in the Animus are back." title="Hidden symbols in the world." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_10/' title='I appear to be glowing. '><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_10-150x150.jpg" class="attachment-thumbnail" alt="This seems perfectly normal." title="I appear to be glowing." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_11/' title='Training up some assassins. '><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_11-150x150.jpg" class="attachment-thumbnail" alt="Training up some assassins." title="Training up some assassins." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_12/' title='Borgia&#039;s influence. '><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_12-150x150.jpg" class="attachment-thumbnail" alt="Borgia&#039;s influence." title="Borgia&#039;s influence." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_28/' title='Steve&#039;s a jerk'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_28-150x150.jpg" class="attachment-thumbnail" alt="Somebody tell Steve he looks like a douche up there." title="Steve&#039;s a jerk" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_13/' title='Trust Leonardo to invent the Cardboard Box.'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_13-150x150.jpg" class="attachment-thumbnail" alt="Hey look, a cardboard box!" title="Trust Leonardo to invent the Cardboard Box." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_14/' title='Woah! Double Assassination! What does it mean?'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_14-150x150.jpg" class="attachment-thumbnail" alt="Woah! Double Assassination! What does it mean?" title="Woah! Double Assassination! What does it mean?" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_15/' title='I appear to be leaking some white lines. What? Stop staring. God!'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_15-150x150.jpg" class="attachment-thumbnail" alt="I&#039;m just chillin&#039; with my friends and some hookers. It&#039;s cool. I&#039;m totally not an assassin." title="I appear to be leaking some white lines. What? Stop staring. God!" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_16/' title='Prince of Persia has my back.'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_16-150x150.jpg" class="attachment-thumbnail" alt="It&#039;s times like these I&#039;m glad Prince of Persia (2008) has my back. Both of him." title="Prince of Persia has my back." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_17/' title='Just restorin&#039; some tunnels. '><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_17-150x150.jpg" class="attachment-thumbnail" alt="SPQR stands for Super Practical Quest Relocater." title="Just restorin&#039; some tunnels." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_18/' title='Action scene!'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_18-150x150.jpg" class="attachment-thumbnail" alt="Action scene!" title="Action scene!" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_19/' title='Groovy specs, man.'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_19-150x150.jpg" class="attachment-thumbnail" alt="I had to take a screenshot of this guy&#039;s groovy specticles." title="Groovy specs, man." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_20/' title='Taking my Mercenaries for their walk. '><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_20-150x150.jpg" class="attachment-thumbnail" alt="Taking my Mercenaries for their walk." title="Taking my Mercenaries for their walk." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_21/' title='Full Synchronisation Objectives'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_21-150x150.jpg" class="attachment-thumbnail" alt="Most missions have bonus objectives to get Full Synchronisation." title="Full Synchronisation Objectives" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_22/' title='Recruits are great. '><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_22-150x150.jpg" class="attachment-thumbnail" alt="My Assassin Recruit takes out a guard from above." title="Recruits are great." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_23/' title='Jump!'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_23-150x150.jpg" class="attachment-thumbnail" alt="You push him. No you. Okay fine, I&#039;ll push him." title="Jump!" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_24/' title='Assadesmondo!'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_24-150x150.jpg" class="attachment-thumbnail" alt="Ezio&#039;s Village in Modern Times" title="Assadesmondo!" /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_25/' title='I&#039;m about to push over that upside-down guy.'><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_25-150x150.jpg" class="attachment-thumbnail" alt="That guy isn&#039;t very good at painting what he sees. Too much imagination." title="I&#039;m about to push over that upside-down guy." /></a>
<a href='http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/dbaines_ac2_27/' title='I realise this is an actual structure in Rome, but it still looks random. '><img width="150" height="150" src="http://dbaines.com/blog/wp-content/uploads/2011/03/dbaines_ac2_27-150x150.jpg" class="attachment-thumbnail" alt="Ah, I see this building was made by the ancient Romgyptians." title="I realise this is an actual structure in Rome, but it still looks random." /></a>
]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/assassins-creed-brotherhood-pc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Zenphoto Option to WordPress Custom Post Type Search</title>
		<link>http://dbaines.com/blog/archive/adding-zenphoto-option-to-wordpress-custom-post-type-search/</link>
		<comments>http://dbaines.com/blog/archive/adding-zenphoto-option-to-wordpress-custom-post-type-search/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 04:45:14 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[zenphoto]]></category>

		<guid isPermaLink="false">http://dbaines.com/?p=1587</guid>
		<description><![CDATA[Following on from my Custom Post Types Search tutorial, we'll add a Zenphoto option that will switch the action and method of the form and the input name if a user clicks on it. ]]></description>
			<content:encoded><![CDATA[<p>This is an add-on tutorial to my previous tutorial, "<a href="http://dbaines.com/blog/archive/wordpress-custom-post-type-multiple-search/">WordPress Custom Post Type Search</a>".</p>
<p>This will walk you through how to add a Zenphoto option, and if the Zenphoto option is clicked, it will show further options to select title, description, tag or filename.</p>
<div class="ddlbox"><a href="/demos/wp_customsearch_zp/" title="View Demo" class="ddlbox_demo">View Demo</a></div>
<h2 class="subheader">Adding the Zenphoto option</h2>
<p>This part is pretty simple. Find your <code class="inline-code">#searchOptions</code> container we set up previously and add in this line:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;radio&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post_type&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;searchOptionsZenphoto&quot;</span> <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;</span>label <span style="color: #b1b100;">for</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;searchOptionsZenphoto&quot;</span><span style="color: #339933;">&gt;</span>Search Zenphoto Only<span style="color: #339933;">&lt;/</span>label<span style="color: #339933;">&gt;</span></pre></div></figure>
<figure id="attachment_1599" aria-describedby="figcaption_attachment_1599" style="width: 356px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2011/03/zenphotooption.jpg"><img class="size-full wp-image-1599" title="The Zenphoto Option" src="http://dbaines.com/blog/wp-content/uploads/2011/03/zenphotooption.jpg" alt="" width="346" height="126" /></a><figcaption id="figcaption_attachment_1599">The Zenphoto Option</figcaption></figure>
<p>Now we have a new option to specifically search Zenphoto only.<br />
Notice I've also removed "Search All" since there's no way to consolidate the results from WordPress and Zenphoto without hacking the search results page to pull down both results. That's a little of scope for today's tutorial.</p>
<h2 class="subheader">jQuery</h2>
<p>Unlike the previous tutorial, the Zenphoto search won't go through WordPress at all, so we'll need to redirect the search to Zenphoto if that option is clicked.</p>
<p>Here's the heavily commented code I put together to do just that:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> thisOption <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Switching Form Types Depending On Which Option Is Selected</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchOptions input[name=post_type]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Throw the ID in to a variable for easy access</span>
thisOption <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// If ZenPhoto is selected...</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>thisOption <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;searchOptionsZenphoto&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Set Zenphoto Form Settings</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#search&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
<span style="color: #3366CC;">&quot;action&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;path/to/zenphoto/page/search/&quot;</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">&quot;method&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;post&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set Zenphoto Input Name</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchMain input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;words&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// If not ZenPhoto (WordPress)</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Set WordPress Form Settings</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form#search&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
<span style="color: #3366CC;">&quot;action&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;path/to/wordpress/&quot;</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">&quot;method&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;get&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set WordPress Input Name</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchMain input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></figure>
<p>So now if we click on "Search Zenphoto Only" it will change the form to search action and method attributes to make it search your Zenphoto install. If we select any of the other options it will switch back to the WordPress settings. It will also modify the input field name since WordPress looks for "s" and Zenphoto looks for "words".</p>
<p>You will need to ensure you change the "action" values to your actual zenphoto and wordpress installs. The Zenphoto action will need "/page/search/" at the end to point to the Zenphoto search page.</p>
<h2 class="subheader">More Zenphoto Options</h2>
<p>By default Zenphoto includes search options of it's own:</p>
<figure id="attachment_1602" aria-describedby="figcaption_attachment_1602" style="width: 345px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2011/03/zenphotoadv_default.jpg"><img class="size-full wp-image-1602" title="Advanced Options" src="http://dbaines.com/blog/wp-content/uploads/2011/03/zenphotoadv_default.jpg" alt="" width="335" height="164" /></a><figcaption id="figcaption_attachment_1602">Advanced Options</figcaption></figure>
<p>So let's try and incorporate that in to our search box.</p>
<p>First add a new section to your search form:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>section id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;searchZPOptions&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_desc&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_desc&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checkbox&quot;</span> checked<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checked&quot;</span>  value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;desc&quot;</span>  <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;</span>label <span style="color: #b1b100;">for</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_desc&quot;</span><span style="color: #339933;">&gt;</span>Search Description<span style="color: #339933;">&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_filename&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_filename&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checkbox&quot;</span> checked<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checked&quot;</span>  value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;filename&quot;</span>  <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;</span>label <span style="color: #b1b100;">for</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_filename&quot;</span><span style="color: #339933;">&gt;</span>Search Folder<span style="color: #339933;">/</span>Filename<span style="color: #339933;">&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_tags&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_tags&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checkbox&quot;</span> checked<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checked&quot;</span>  value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tags&quot;</span>  <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;</span>label <span style="color: #b1b100;">for</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_tags&quot;</span><span style="color: #339933;">&gt;</span>Search Tags<span style="color: #339933;">&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_title&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_title&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checkbox&quot;</span> checked<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checked&quot;</span>  value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;title&quot;</span>  <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;</span>label <span style="color: #b1b100;">for</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SEARCH_title&quot;</span><span style="color: #339933;">&gt;</span>Search Title<span style="color: #339933;">&lt;/</span>label<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>section<span style="color: #339933;">&gt;</span></pre></div></figure>
<p>This code is mostly taken straight from the Zenphoto search form. By default they are all checked, but you can turn them off by removing the <code class="inline-code">checked="checked"</code> attribute.</p>
<p>We'll also add the following to our <acronym title="Cascading Style Sheets">CSS</acronym> to indent it a little to make it look like it's supposed to be apart of the ZenPhoto selection above it, and to hide it by default:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#searchZPOptions</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></figure>
<p>Then add the show/hide functions to your jQuery to show the additional options if a user clicks on the Zenphoto Option:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> thisOption <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Switching Form Types Depending On Which Option Is Selected</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchOptions input[name=post_type]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Throw the ID in to a variable for easy access</span>
thisOption <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// If ZenPhoto is selected...</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>thisOption <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;searchOptionsZenphoto&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Show ZPOptions</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchZPOptions&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set Zenphoto Form Settings</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#search&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
<span style="color: #3366CC;">&quot;action&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;path/to/zenphoto/page/search/&quot;</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">&quot;method&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;post&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set Zenphoto Input Name</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchMain input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;words&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// If not ZenPhoto (WordPress)</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Hide ZPOptions</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchZPOptions&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set WordPress Form Settings</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form#search&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
<span style="color: #3366CC;">&quot;action&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;path/to/wordpress/&quot;</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">&quot;method&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;get&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set WordPress Input Name</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchMain input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></figure>
<p>So now if a user clicks on the Zenphoto option, it not only redirects the form, but also shows the Zenphoto tickboxes.</p>
<figure id="attachment_1601" aria-describedby="figcaption_attachment_1601" style="width: 357px" class="wp-caption aligncenter"><a href="http://dbaines.com/blog/wp-content/uploads/2011/03/zenphotoadv.jpg"><img class="size-full wp-image-1601" title="Advanced Search Options" src="http://dbaines.com/blog/wp-content/uploads/2011/03/zenphotoadv.jpg" alt="" width="347" height="206" /></a><figcaption id="figcaption_attachment_1601">Advanced Search Options</figcaption></figure>
<h2 class="subheader">Cleaning Up After Zenphoto</h2>
<p>Since WordPress uses <code class="inline-code">get</code> to retrieve the search terms, it's also going to send all of Zenphoto's SEARCH_* inputs to the WordPress search page. We can create a function that checks for a WordPress search and then removes those input fields:</p>
<figure class="codeboxFig"><div class="codebox"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Check for Submit press and delete ZenPhoto options from sending if on WordPress</span>
$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#searchsubmit&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>click<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>thisOption <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;searchOptionsZenphoto&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#SEARCH_desc&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>remove<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#SEARCH_filename&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>remove<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#SEARCH_tags&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>remove<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#SEARCH_title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>remove<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></figure>
<p>So now if somebody clicks the submit button, the script will check to see if thisOption has the Zenphoto value. If it doesn't, it's obviously a WordPress search, so we'll go ahead and remove those elements from being sent.</p>
<p>So your whole jQuery script should look something like this:<br />
<figure class="codeboxFig"><div class="codebox"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Show/Hide</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchAnchor&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchOptions&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> thisOption <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Switching Form Types Depending On Which Option Is Selected</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchOptions input[name=post_type]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Throw the ID in to a variable for easy access</span>
thisOption <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// If ZenPhoto is selected...</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>thisOption <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;searchOptionsZenphoto&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Show ZPOptions</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchZPOptions&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set Zenphoto Form Settings</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#search&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
<span style="color: #3366CC;">&quot;action&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;path/to/zenphoto/page/search/&quot;</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">&quot;method&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;post&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set Zenphoto Input Name</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchMain input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;words&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// If not ZenPhoto (WordPress)</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Hide ZPOptions</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchZPOptions&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set WordPress Form Settings</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form#search&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
<span style="color: #3366CC;">&quot;action&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;path/to/wordpress/&quot;</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">&quot;method&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;get&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Set WordPress Input Name</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchMain input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Check for Submit press and delete ZenPhoto options from sending if on WordPress</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#searchsubmit&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>thisOption <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;searchOptionsZenphoto&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#SEARCH_desc&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#SEARCH_filename&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#SEARCH_tags&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#SEARCH_title&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></figure></p>
<p>Check out this demo to see it in action, using my old Zenphoto install I still had lying around on my server:<br />
<div class="ddlbox"><a href="/demos/wp_customsearch_zp/" title="View Demo" class="ddlbox_demo">View Demo</a></div></p>]]></content:encoded>
			<wfw:commentRss>http://dbaines.com/blog/archive/adding-zenphoto-option-to-wordpress-custom-post-type-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.849 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-17 05:45:06 -->
<!-- Compression = gzip -->
