<?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>mitcho.com &#187; WordPress Planet</title>
	<atom:link href="http://mitcho.com/blog/tag/wordpress-planet/feed/" rel="self" type="application/rss+xml" />
	<link>http://mitcho.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 19:14:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Spring is for Speaking: JSConf, WordCamp SF, IACL</title>
		<link>http://mitcho.com/blog/projects/spring-is-for-speaking/</link>
		<comments>http://mitcho.com/blog/projects/spring-is-for-speaking/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 04:37:04 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[Boston]]></category>
		<category><![CDATA[Chinese language]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[harvard]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jetpack]]></category>
		<category><![CDATA[linguistics]]></category>
		<category><![CDATA[Mandarin]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[San Francisco]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[Washington D.C.]]></category>
		<category><![CDATA[WordCamp]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3448</guid>
		<description><![CDATA[I recently confirmed three different very exciting speaking gigs which I&#8217;ll be doing this spring: JSConf.us: I&#8217;ll be putting my Mozilla Jetpack Ambassador hat on to represent Mozilla Labs&#8217; Jetpack project at the premier Javascript conference in North America, JSConf.us, which this year will be April 17-18 in Washington D.C. and has a pirate theme.1 [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='Permanent Link: WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/life/travel/linguistics-in-%e5%98%89%e7%be%a9/' rel='bookmark' title='Permanent Link: Linguistics in 嘉義'>Linguistics in 嘉義</a></li>
<li><a href='http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/' rel='bookmark' title='Permanent Link: Mashing up the browser in Maine'>Mashing up the browser in Maine</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently confirmed three different very exciting speaking gigs which I&#8217;ll be doing this spring:</p>

<p><span id="more-3448"></span></p>

<p><strong>JSConf.us</strong>:</p>

<p>I&#8217;ll be putting my Mozilla Jetpack Ambassador hat on to represent Mozilla Labs&#8217; <a href="https://jetpack.mozillalabs.com/">Jetpack project</a> at the premier Javascript conference in North America, <a href="http://jsconf.us/2010/">JSConf.us</a>, which this year will be April 17-18 in Washington D.C. and has a pirate theme.<sup id="fnref:2"><a href="#fn:2" rel="footnote">1</a></sup> I&#8217;ll be giving a short talk in the main session and will also lead a hands-on Jetpack workshop in the hacker lounge. I&#8217;ve heard that JSConf is a lot of fun and I&#8217;m really looking forward to it! <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><strong>WordCamp San Francisco</strong>:</p>

<p>I&#8217;m honored to have been invited to give a talk at <a href="http://2010.sf.wordcamp.org/">WordCamp San Francisco 2010</a>. WordCamps are community-organized events for the <a href="http://wordpress.org">WordPress</a> community, and the San Francisco WordCamp is the original and biggest. WordCamp SF will be at the Mission Bay Conference Center on May 1st. <a href="https://2010.sf.wordcamp.org/tickets/">Tickets available</a>.</p>

<p>My talk is tentatively titled &#8220;Abstract Your Code.&#8221;<sup id="fnref:1"><a href="#fn:1" rel="footnote">2</a></sup> WordPress is a great platform to build amazing content-rich applications on, and many of us have written new functionality in the form of plugins. I hope to encourage developers to make their code more portable and reusable after the project is done—or, ideally, to even start with abstraction in mind—to add to the &#8220;life&#8221; of the code and to consider then open-sourcing that functionality.</p>

<p>Hope to see you there!</p>

<p><strong>International Association of Chinese Linguistics (IACL) 18</strong>:</p>

<p>Finally, I&#8217;m thrilled to say that I got a paper accepted to the <a href="http://www.fas.harvard.edu/~iacl18/Site/index.html">annual meeting of the International Association of Chinese Linguistics</a> which this year is at Harvard on May 20-22. IACL is <em>the</em> big conference for Chinese linguistics, with about <a href="http://www.fas.harvard.edu/~IACL18/AcceptList.pdf">180 papers presenting</a>. I&#8217;ll be presenting <em>Two</em> Only<em>s in Mandarin Chinese</em>, my recent work on the formal syntax/semantics of two <em>only</em> words in Chinese: <em>zhǐ</em> (只) and <em>éryǐ</em> (而已). I&#8217;ve put up <a href="http://mitcho.com/academic/handout-20100226.pdf">a handout</a> of some of this material in work-in-progress form which I recently presented at <a href="http://people.fas.harvard.edu/~nicolae/SNEWS_2010/Welcome.html">SNEWS</a>.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:2">
<p>I&#8217;ll <a href="http://beijinghuar.com">fit right in</a>.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:1">
<p>Sexier title suggestions welcome.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='Permanent Link: WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/life/travel/linguistics-in-%e5%98%89%e7%be%a9/' rel='bookmark' title='Permanent Link: Linguistics in 嘉義'>Linguistics in 嘉義</a></li>
<li><a href='http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/' rel='bookmark' title='Permanent Link: Mashing up the browser in Maine'>Mashing up the browser in Maine</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/spring-is-for-speaking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extending WordPress talk at the Boston WordPress Meetup</title>
		<link>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/</link>
		<comments>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:40:19 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[HookPress]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2959</guid>
		<description><![CDATA[Yesterday I gave a talk at the Boston WordPress Meetup. The Boston WordPress Meetup meets monthly at the Microsoft Cambridge Research Center which is a fantastic venue right on the Charles river. Last night we got to be up on the 10th floor which has a great view of Boston right over the river. There [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='Permanent Link: WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='Permanent Link: HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Permanent Link: Jetpacking in Boston'>Jetpacking in Boston</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Yesterday I <a href="http://www.meetup.com/boston-wordpress-meetup/calendar/11378229/">gave a talk</a> at the <a href="http://www.meetup.com/boston-wordpress-meetup/">Boston WordPress Meetup</a>. The Boston WordPress Meetup meets monthly at the Microsoft Cambridge Research Center which is a fantastic venue right on the Charles river. Last night we got to be up on the 10th floor which has a great view of Boston right over the river. There was pretty good turnout, with about thirty or fourty people there.</p>

<p>My talk was a general introduction to WordPress plugin development, beginning with the concepts of <a href="http://codex.wordpress.org/Plugin_API/Action_Reference">actions</a> and <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">filters</a>, and concluding with a description of <a href="http://mitcho.com/code/hookpress/">HookPress</a>, my new plugin which enables <a href="http://webhooks.org">webhooks</a> in WordPress. Here are the slides:</p>

<p><span id="more-2959"></span></p>

<div style="width:425px;text-align:left" id="__ss_2084487"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/mitcho/extending-wordpress-with-webhooks" title="Extending WordPress with (Web)Hooks">Extending WordPress with (Web)Hooks</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=extendingwordpress-090928155439-phpapp01&#038;rel=0&#038;stripped_title=extending-wordpress-with-webhooks" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=extendingwordpress-090928155439-phpapp01&#038;rel=0&#038;stripped_title=extending-wordpress-with-webhooks" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/mitcho">Michael Yoshitaka Erlewine</a>.</div></div>

<p>The talk included some live coding which is always dangerous, but it all went off without a hitch.</p>

<p><a href="http://twitter.com/kurteng">Kurt Eng</a> was kind enough to get video of the talk as well which hopefully we&#8217;ll get up on <a href="http://wordpress.tv">wordpress.tv</a> in the near future. Bryan also sent me a link with some <a href="http://www.flickr.com/photos/76505157@N00/">photos on Flickr</a>.</p>

<p>Thank you to all who attended<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> and of course to Microsoft who provided the venue and food! The Boston WordPress Meetup is a great community and I hope to keep supporting it and its activities.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>For anyone who attended, I would greatly appreciate feedback on the talk <a href="http://speakerrate.com/talks/1470-extending-wordpress-with-web-hooks">at SpeakerRate</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='Permanent Link: WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='Permanent Link: HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Permanent Link: Jetpacking in Boston'>Jetpacking in Boston</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HookPress: Webhooks for WordPress</title>
		<link>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/</link>
		<comments>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 02:23:25 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[mashups]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[webhooks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2672</guid>
		<description><![CDATA[I recently have spent a little time putting together a new WordPress plugin called HookPress. HookPress lets you add webhooks to WordPress, letting you easily develop push notifications or extend WordPress in languages other than PHP. WordPress itself is built on a powerful plugin API which provides actions and filters. Actions correspond to events, so [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Permanent Link: Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Permanent Link: Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently have spent a little time putting together a new WordPress plugin called HookPress. <a href="http://wordpress.org/extend/plugins/hookpress/">HookPress</a> lets you add <a href="http://webhooks.org">webhooks</a> to WordPress, letting you easily develop push notifications or extend WordPress in languages other than PHP.</p>

<p>WordPress itself is built on a <a href="http://codex.wordpress.org/Plugin_API">powerful plugin API</a> which provides <a href="http://codex.wordpress.org/Plugin_API/Action_Reference"><strong>actions</strong></a> and <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference"><strong>filters</strong></a>. Actions correspond to events, so you can set a webhook to fire when a post is published or a comment is made.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> Filters let you modify some text when it is saved or displayed, so you can have your external webhook script reformat some text or insert some other content dynamically. Not all actions and filters are supported at this time, but I will continue to add more in.</p>

<p>There&#8217;s a <a href="http://upcoming.yahoo.com/event/4049111">webhooks meetup in San Francisco</a> today but I unfortunately left SF this morning, so I created a video which will be played there as a lightning talk. A demo of both types of webhooks are in the video as well.</p>

<p><object width="649" height="365"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5905102&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5905102&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="649" height="365"></embed></object></p>

<p><a href="http://vimeo.com/5905102">HookPress: add webhooks to WordPress</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>I&#8217;m really excited by this very simple but potentially high-impact plugin. I&#8217;d love to get your comments and feedback on this new plugin and hope to hear how you&#8217;re using HookPress!</p>

<p>ADDENDUM: Please also <a href="http://twitter.com/hookpress/">follow HookPress on twitter</a>!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>My friend Abi actually has already blogged about <a href="http://blog.abi.sh/2009/tweeting-your-blog-with-hookpress/">HookPress and how it can be used to tweet on post publication</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Permanent Link: Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Permanent Link: Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Matt Mullenweg recommends YARPP on Tekzilla!</title>
		<link>http://mitcho.com/blog/link/matt-mullenweg-recommends-yarpp-on-tekzilla/</link>
		<comments>http://mitcho.com/blog/link/matt-mullenweg-recommends-yarpp-on-tekzilla/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 08:13:13 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[link]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Tekzilla]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2240</guid>
		<description><![CDATA[A new user of my WordPress plugin tipped me off to a recent Tekzilla segment where WordPress founder Matt Mullenweg recommended Yet Another Related Posts Plugin as one of his personal favorite WordPress plugins. Thanks Matt! ^^ Related posts:Yet Another Related Posts Plugin 2.0 Using Templates with YARPP 3 Keep up with Yet Another Related [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yarpp-3-templates/' rel='bookmark' title='Permanent Link: Using Templates with YARPP 3'>Using Templates with YARPP 3</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><embed class="rev3PlayerEmbed" type="application/x-shockwave-flash" src="http://revision3.com/player-v2887" allowFullScreen="true" allowScriptAccess="always" width="650" height="365" flashvars="startTime=1114&#038;endTime=1166" /></p>

<p>A new user of my <a href="http://wordpress.org">WordPress</a> plugin tipped me off to a recent <a href="http://revision3.com/tekzilla">Tekzilla</a> segment where WordPress founder <a href="http://en.wikipedia.org/wiki/Matt Mullenweg">Matt Mullenweg</a> recommended <a href="/code/yarpp">Yet Another Related Posts Plugin</a> as one of his personal favorite WordPress plugins. Thanks Matt! ^^</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yarpp-3-templates/' rel='bookmark' title='Permanent Link: Using Templates with YARPP 3'>Using Templates with YARPP 3</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/link/matt-mullenweg-recommends-yarpp-on-tekzilla/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fixing Geshi on line 2132</title>
		<link>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/</link>
		<comments>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 15:15:44 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[geshi]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2233</guid>
		<description><![CDATA[I recently noticed that some of my blog posts, most notably my Templates in YARPP 3 article, was producing a PHP error: Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?&#60; at offset 3 in /&#8230;/html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2132 This seemed to be coming from the version 1.0.8.4 version of Geshi I had installed. A [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently noticed that some of my blog posts, most notably my <a href="http://mitcho.com/blog/projects/yarpp-3-templates/">Templates in YARPP 3</a> article, was producing a PHP error:</p>

<blockquote>
  <p><b>Warning:</b> preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?&lt; at offset 3 in <b>/&#8230;/html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on <b>line 2132</b></p>
</blockquote>

<p>This seemed to be coming from the version 1.0.8.4 version of Geshi I had installed. A quick <a href="http://www.google.com/search?q=geshi+line+2132">google search for &#8220;geshi line 2132&#8221;</a> gives you over a thousand errors, so this seems to be common issue. <a href="http://qbnz.com/highlighter/">Geshi</a> is a fabulous and popular syntax highlighter and is the core component of the <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax plugin</a> for WordPress.</p>

<p>I did some digging around and realized that the issue was with the compilation of this monstrosity of a regular expression, used (as far as I can tell) to identify PHP code snippets, for example the &lt;?php &#8230;&#160;?&gt; keywords:</p>


<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">/(?&lt;start&gt;&lt;\\?(?&gt;php\b)?)(?:
(?&gt;[^\&quot;'?\\/&lt;]+)|
\\?(?!&gt;)|
(?&gt;'(?&gt;[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|
(?&gt;\&quot;(?&gt;[^\&quot;\\\\]|\\\\\&quot;|\\\\\\\\|\\\\)*\&quot;)|
(?&gt;\\/\\*(?&gt;[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|
\\/\\/(?&gt;.*?$)|
\\/(?=[^*\\/])|
&lt;(?!&lt;&lt;)|
&lt;&lt;&lt;(?&lt;phpdoc&gt;\w+)\s.*?\s\k&lt;phpdoc&gt;
)*(?&lt;end&gt;\\?&gt;|\Z)/sm</pre></div></div>


<p>Not knowing exactly where to start in diagnosing this crazy expression, I simply disabled those &#8220;script delimiters&#8221; in the <code>geshi/php.php</code> file. The sections I commented out are lines 1080-1101. Now the script delimiters like <code>&amp;lt;?php</code> don&#8217;t get highlighted nicely, but I feel that&#8217;s a small price to pay for eliminating these errors. <a href="http://wordpress.org/support/topic/274864">Another solution for the WP-Syntax users</a> seems to be to downgrade to 0.9.4. Hopefully in the near future an update to Geshi will come out which fixes this issue once and for all.</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Using Templates with YARPP 3</title>
		<link>http://mitcho.com/blog/projects/yarpp-3-templates/</link>
		<comments>http://mitcho.com/blog/projects/yarpp-3-templates/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 13:26:38 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>
		<category><![CDATA[Yet Another Photoblog]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1270</guid>
		<description><![CDATA[In this blog post I describe features in YARPP version 3.0. From those of you who were testing the beta, YARPP templates now go in your theme, and they must be of the form yarpp-template-&#8230;.php. If you have a YARPP support question not directly related to the templating feature, please use the YARPP support forums. [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><em>In this blog post I describe features in <a href="http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.3.0.zip">YARPP version 3.0</a>.</em> <strong>From those of you who were testing the beta, YARPP templates now go in your theme, and they must be of the form <code>yarpp-template-</code>&#8230;<code>.php</code>.</strong></p>

<p><strong>If you have a YARPP support question not directly related to the templating feature, please use <a href="http://wordpress.org/tags/yet-another-related-posts-plugin">the YARPP support forums</a>.</strong></p>

<p>Version 3 of <a href="http://mitcho.com/code/yarpp">Yet Another Related Posts Plugin</a> is a major rewrite which adds two new powerful features: caching and templating. Today I&#8217;m going to show you how you can use <em>templates</em> to customize the look of your related posts output.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>Previously with YARPP you were relatively limited in the ways you could present related posts. You were able to set some HTML tags to wrap your posts in and choose how much of an excerpt (if any) to display. This limited interface worked great for many users&#8212;indeed, these options still exists in YARPP 3.0. However, there&#8217;s also a new option for those of you who want to put your PHP skills to work and have complete control over your related posts display. The option will let you choose any files in the <code>templates</code> subdirectory of YARPP.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/01/e38394e382afe38381e383a3-1.png" alt="templates interface" title="templates interface" width="410" height="163" class="alignnone size-full wp-image-1273" /></p>

<p><span id="more-1270"></span></p>

<h3>The structure of a YARPP template</h3>

<p>Let&#8217;s take a look inside the example template, included with YARPP 3 (<code>yarpp-template-example.php</code>):</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;h3&gt;Related Posts&lt;/h3&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$related_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;ol&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$related_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$related_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><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>
	&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<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>&lt;/a&gt;&lt;/li&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ol&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;No related posts.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


<p>There are two basic parts to this (and most all) YARPP template: (a) what you display when there are related posts and (b) what you display when there aren&#8217;t. We make this switch with the conditional on line 6. If there are related posts, we introduce an ordered list and use the <code>while</code> loop to loop over all the related posts. For each post, we use the snippet <code>$related_query-&gt;the_post();</code> to load the appropriate post data, then print the line item.</p>

<p>You&#8217;ll notice that we&#8217;re using familiar template tags here such as <code>the_permalink()</code> and <code>the_title()</code>. If you&#8217;ve ever had to tweak or build a WordPress theme before, you&#8217;ll immediately feel at home. I&#8217;ll touch on this again later.</p>

<h3>The power of PHP</h3>

<p>One big advantage of this new templating system is that you can control exactly how the posts are listed, breaking out of all of the previous structural limitations. For example, in the <code>template-list.php</code> template, we put the information for each related post in an array and then concatenate the strings with <code>implode</code>. This way, we produce a comma-separated list for our readers without any stray commas before or after the list, which was impossible until now.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000088;">$postsArray</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$related_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$related_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$postsArray</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; rel=&quot;bookmark&quot;&gt;'</span><span style="color: #339933;">.</span>get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span><span style="color: #000088;">$postsArray</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// print out a list of the related items, separated by commas</span></pre></td></tr></table></div>


<p>You can also run any arbitrary PHP in the template file—even roll another WP_Query, as in the case of <code>template-random.php</code>, where a random post is returned when there are no related posts.</p>

<h3>Familiar template tags</h3>

<p>As mentioned before, the tags we use in these YARPP templates are the same as the template tags used in any WordPress template. In fact, any WordPress <a href="http://codex.wordpress.org/Template_Tags">template tag</a> will work in the YARPP <a href="http://codex.wordpress.org/The_Loop">Loop</a>. You can use these template tags to display the excerpt, the post date, the comment count, or even some custom metadata. I&#8217;ve also written two special template tags which only work within a YARPP Loop: <code>the_score()</code> and <code>get_the_score()</code>. As you may expect, this will print or return the match score of that particular related post.</p>

<p>In addition, template tags from other plugins will also work. For an example, take a look at the <code>yarpp-template-photoblog.php</code> file:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$related_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$related_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><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>
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'yapb_is_photoblog_post'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>yapb_is_photoblog_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> yapb_get_thumbnail<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>&lt;/a&gt;&lt;/li&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


<p>In this template&#8217;s YARPP Loop, we use some template tags introduced by the <a href="http://wordpress.org/extend/plugins/yet-another-photoblog/">Yet Another Photoblog</a> plugin. If you have the Yet Another Photoblog plugin installed, you can use this template to display thumbnails of related posts in lieu of the titles. Notice that here we&#8217;re checking first whether each related post is indeed a photo post or not using <code>yapb_is_photoblog_post()</code> and then using the Yet Another Photoblog <code>yapb_get_thumbnail()</code> template tag to get the location of the thumbnail.</p>

<p>Templating in YARPP 3.0 enables the blog admin to uber-customize their related posts display using the lingua franca of PHP and <a href="http://codex.wordpress.org/Template_Tags">template tags</a>. Feel free to comment here with ideas, comments, and of course links to your YARPP-powered blogs. I look forward to seeing what the WordPress community does with this new feature!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>For those of you interested in the WP and SQL voodoo used to make this happen, I&#8217;ve posted <a href="http://mitcho.com/blog/how-to/external-orders-in-wordpress-queries/">a more technical article</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/yarpp-3-templates/feed/</wfw:commentRss>
		<slash:comments>107</slash:comments>
		</item>
		<item>
		<title>This is what a release looks like</title>
		<link>http://mitcho.com/blog/projects/release-downloads/</link>
		<comments>http://mitcho.com/blog/projects/release-downloads/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 12:55:04 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[metablog]]></category>
		<category><![CDATA[observation]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[Mint]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1157</guid>
		<description><![CDATA[This is what the latest release (2.1.6) of my Yet Another Related Posts Plugin looked like under Mint, using my WordPress plugin downloads pepper, which in turn gets its data from wordpress.org: It&#8217;s always interesting to see these release spikes in download traffic. Note that this release was on the Wednesday but that was during [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/link/matt-mullenweg-recommends-yarpp-on-tekzilla/' rel='bookmark' title='Permanent Link: Matt Mullenweg recommends YARPP on Tekzilla!'>Matt Mullenweg recommends YARPP on Tekzilla!</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This is what the latest release (2.1.6) of my <a href="/code/yarpp">Yet Another Related Posts Plugin</a> looked like under <a href="http://www.haveamint.com/">Mint</a>, using my WordPress plugin downloads pepper, which in turn gets its data from <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/stats/">wordpress.org</a>:</p>

<p><img src="/blog/wp-content/uploads/2008/12/mint-wordpress-downloads.png" alt="" title="YARPP downloads 2.1.6" /></p>

<p>It&#8217;s always interesting to see these release spikes in download traffic. Note that this release was on the Wednesday but that was during the day, so Wednesday&#8217;s traffic is still higher than the normal ~300/day level, while the big peak (by day) is on Thursday. Too bad wordpress.org doesn&#8217;t give me hourly stats, though I guess that would be a little ridiculous.</p>

<p>YARPP is just about at that 35k download mark. I&#8217;m looking forward to the next release. ^^</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/link/matt-mullenweg-recommends-yarpp-on-tekzilla/' rel='bookmark' title='Permanent Link: Matt Mullenweg recommends YARPP on Tekzilla!'>Matt Mullenweg recommends YARPP on Tekzilla!</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/release-downloads/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>External orders in WordPress queries</title>
		<link>http://mitcho.com/blog/how-to/external-orders-in-wordpress-queries/</link>
		<comments>http://mitcho.com/blog/how-to/external-orders-in-wordpress-queries/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 15:34:40 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[query_posts]]></category>
		<category><![CDATA[ranking]]></category>
		<category><![CDATA[suggestions]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[WP_Query]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1102</guid>
		<description><![CDATA[The advanced WordPress user is intimately familiar with query_posts, the function which controls which posts are displayed in &#8220;The Loop.&#8221; query_posts gives plugin and theme writers the ability to display only posts written in Janary (query_posts("monthnum=1")) or disallow posts from a certain category (query_posts("cat=-529")1). One of the parameters you can set here is orderby which [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>The advanced WordPress user is intimately familiar with <a href="http://codex.wordpress.org/Template_Tags/query_posts"><code>query_posts</code></a>, the function which controls which posts are displayed in &#8220;The Loop.&#8221; <code>query_posts</code> gives plugin and theme writers the ability to display only posts written in Janary (<code>query_posts("monthnum=1")</code>) or disallow posts from a certain category (<code>query_posts("cat=-529")</code><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>). One of the parameters you can set here is <code>orderby</code> which affects the ordering of the posts returned, with allowed values such as <code>author</code>, <code>date</code>, or <code>title</code>. But what if you want to order your posts in some other order, defined outside of your <code>wp_posts</code> table? Here I&#8217;m going to lay out some thoughts on rolling your own external ordering source for WordPress queries.</p>

<p>In order to introduce an external ordering source, we need to do four things:
1. create the external ordering source,
2. hook up (read &#8220;<code>join</code>&#8221;) the external ordering source
3. make sure we use that order, and
4. make it play nice. ^^</p>

<p>By the way, I&#8217;m going to assume you, dear reader, are PHP-savvy, proficient in MySQL, and already know a little about WordPress. This how-to is not for the PHPhobic.</p>

<p><span id="more-1102"></span></p>

<h3>The ordering source</h3>

<p>For this example, suppose we want to display posts by order of &#8220;interestingness.&#8221; We&#8217;ll just create a table called <code>wp_interestingness</code> with two columns, <code>ID</code> and <code>interestingness</code> and populate it with some data. We&#8217;ll even be nice to our database by making sure the <code>ID</code> is the primary key. Easy.</p>

<h3>Hook up the external ordering source</h3>

<p>When you run a query through <code>query_posts()</code> (or use <code>WP_Query</code>&#8217;s <code>query</code> method<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>), what it&#8217;s doing is taking your special request and translating it into a MySQL statement. This means a query like <code>"monthnum=1"</code> is turned into <code>SELECT ... wp_posts.* FROM wp_posts WHERE 1=1 AND MONTH(wp_posts.post_date)='1' ...</code>. Every different query introduces something new to the basic <code>SELECT</code> command—in this case, the <code>AND MONTH(wp_posts.post_date)='1'</code>.</p>

<p>We first want to introduce the <code>interestingness</code> for each post and that means <code>join</code>ing the new table into the query. We&#8217;ll do this using the <code>posts_join</code> <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">filter</a>. This filter lets you add a <code>join</code> statement to the MySQL request.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_join'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_join_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_join_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$arg</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; natural join wp_interestingness &quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<p>Note that here we&#8217;re using <code>natural join</code> as <code>wp_posts</code> and <code>wp_interestingness</code> have only one key in common, <code>ID</code>, and that&#8217;s exactly the column we want to join them on.</p>

<h3>Use the new order</h3>

<p>Now that we&#8217;ve <code>join</code>ed <code>wp_interestingness</code> in, we can refer to <code>wp_interestingness.interestingness</code> in our query. Note now that, by default, an <code>$wpdb-&gt;posts.post_date</code> will be used to order the posts. We&#8217;ll use another filter here; this time <code>posts_orderby</code>, to patch this part of the query. We&#8217;ll search for the default <code>ORDER BY</code> value and replace it with our own <code>interestingness</code>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_orderby'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_orderby_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_orderby_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$arg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span>.post_date&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp_interestingness.interestingness&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<p>By the way, you can now check the resulting MySQL query by <code>echo</code>ing <code>$wp_query-&gt;request</code>. (If you&#8217;re using the <code>WP_Query</code> method I advocated below in footnote (2), you&#8217;ll of course have to change <code>$wp_query</code> to the <code>WP_Query</code> object you&#8217;re using.)</p>

<h3>Learn to play nice ^^</h3>

<p>The instructions above do indeed work, but they also cause some major breakdowns in other functions of your blog. Why? That&#8217;s because the current code will edit your queries for every instance of The Loop: your index page, your archives, and your RSS feeds. You probably only want to search by interestingness in certain situations. What we need is a way to tell our (admittedly stupid) <code>my_join_filter</code> and <code>my_orderby_filter</code> when they should apply their <code>interestingness</code> magic and when they shouldn&#8217;t. There are several ways to set up such a system but here I&#8217;ll lay out one that I feel is particularly elegant. We&#8217;ll set it up so you can actually use <code>query_posts("orderby=interestingness")</code> and it&#8217;ll know what you&#8217;re talking about.</p>

<p>One of the first things that happens in <code>query_posts</code>—indeed, way before even the <code>posts_join</code> and <code>posts_orderby</code> filters—is an action hook called <code>parse_query</code>. This lets us look at the initial state of the <code>WP_Query</code> object as it starts to run. In particular, we can look at the <code>orderby</code> query variable and see if we want to order by <code>interestingness</code>. If we do, we&#8217;ll set a global variable called <code>$use_interestingness_flag</code> to be <code>true</code>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'parse_query'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'set_use_interestingness_flag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> set_use_interestingness_flag<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$use_interestingness_flag</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query_vars</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'orderby'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'interestingness'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$yarpp_score_override</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">else</span>
		<span style="color: #000088;">$yarpp_score_override</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<p>Now we just have to edit our filters so they only run when <code>$use_interestingness_flag == true</code>. We also will make sure to turn the flag back off in <code>my_orderby_filter</code>, as it&#8217;s our last filter to run during each query. It&#8217;s just like putting the seat back down after using a unisex bathroom.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup></p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_join'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_join_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_join_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$use_interestingness_flag</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$use_interestingness_flag</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$arg</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; natural join wp_interestingness &quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_orderby'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_orderby_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_orderby_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">,</span> <span style="color: #000088;">$use_interestingness_flag</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$use_interestingness_flag</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$arg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span>.post_date&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp_interestingness.interestingness&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$use_interestingness_flag</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<p>This method has a great advantage as you can just set it up once and invoke it whenever you want, even together with other parameters, without any additional code. For example, you can try <code>query_posts("monthnum=1&amp;orderby=interestingness")</code> or <code>query_posts("cat=-529&amp;orderby=interestingness")</code>.</p>

<h3>Conclusion</h3>

<p>Adding an external ordering source to your WordPress post queries can be relatively straightforward if you understand what <code>query_posts</code> does and take advantage of its <a href="http://codex.wordpress.org/Plugin_API">hooks</a>. This tutorial can also serve as the basis for many other patches to <code>WP_Query</code>, not just the <code>orderby</code> parameter. To better understand the way WordPress builds its MySQL queries and the many <code>posts_*</code> filters which you can take advantage of, go to the source: <code>wp-includes/query.php</code>. Finally, you can use the special <code>parse_query</code> hook and global variables as flags to only apply the filters when necessary.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>This, incidentally, is precisely what I do to hide, by default, <a href="http://twitter.com/mitchoyoshitaka/">my tweets</a> in my <code>index.php</code> and <code>archives.php</code>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>If you&#8217;re going to get serious about rolling your WordPress queries I highly recommend you follow <a href="http://weblogtoolscollection.com/archives/2008/04/13/define-your-own-wordpress-loop-using-wp_query/">Mark Ghosh&#8217;s advice</a> on initializing another object of the <code>WP_Query</code> class and using the <code>query</code> method, rather than just using the global <code>query_posts</code> function.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>The perceptive reader will note that we are still searching for the string <code>"$wpdb-&gt;posts.post_date"</code> in <code>my_orderby_filter</code>, instead of something like <code>"$wpdb-&gt;posts.interestingness"</code>. That&#8217;s because the <code>orderby</code> value of <code>interestingness</code> is not one of the allowed <code>orderby</code> values (search for <code>$allowed_keys</code> in <code>wp-includes/query.php</code> to see the list). Thus the MySQL <code>ORDER BY</code> value is set to the default of <code>"$wpdb-&gt;posts.post_date"</code> before it gets to the <code>posts_orderby</code> filter. Now you know.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/how-to/external-orders-in-wordpress-queries/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Yet Another Related Posts Plugin 2.0</title>
		<link>http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/</link>
		<comments>http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 15:06:06 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=521</guid>
		<description><![CDATA[Yet Another Related Posts Plugin 2.0.5 16&#160;kb - zip Well, it&#8217;s been a while since I updated my plugin YARPP&#8212;in my humble opinion the best related posts plugin for WordPress. ^^ Today I release version 2.0, incorporating a number of important requests and bug fixes: New algorithm which considers tags and categories, by frequent request [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="files">
<div class="file zip">
<a href="http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.2.0.5.zip">Yet Another Related Posts Plugin 2.0.5</a><br />
<span class="specs">16&#160;kb - zip</span>
</div>
</div>

<p>Well, it&#8217;s been a while since I updated my plugin <a href="http://mitcho.com/code/yarpp/">YARPP</a>&#8212;in my humble opinion the best related posts plugin for <a href="http://www.wordpress.org">WordPress</a>. ^^ Today I release <a href="http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.2.0.zip">version 2.0</a>, incorporating a number of important requests and bug fixes:</p>

<ul>
<li>New algorithm which considers tags and categories, by frequent request</li>
<li>Order by score, date, or title, <a href="http://wordpress.org/support/topic/158459">by request</a></li>
<li>Excluding certain tags or categories, <a href="http://wordpress.org/support/topic/161263">by request</a></li>
<li>Sample output displayed in the options screen</li>
<li>Bugfix: <a href="http://wordpress.org/support/topic/155034?replies=5">an excerpt length bug</a></li>
<li>Bugfix: now compatible with the following plugins:

<ul>
<li>diggZEt</li>
<li>WP-Syntax</li>
<li>Viper&#8217;s Video Quicktags</li>
<li>WP-CodeBox</li>
<li>WP shortcodes</li>
</ul></li>
</ul>

<p>Check out the <a href="http://mitcho.com/code/yarpp/">Yet Another Related Posts Plugin page on this site</a>, <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/">the page on wordpress.org</a>, or <a href="http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.2.0.zip">download it directly now</a>!</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Markdown for WordPress and bbPress</title>
		<link>http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/</link>
		<comments>http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/#comments</comments>
		<pubDate>Wed, 21 May 2008 14:07:28 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[bbPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Markdown]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=274</guid>
		<description><![CDATA[Markdown for WordPress and bbPress 1.0 30&#160;kb - zip I like many others am a big fan of John Gruber&#8217;s Markdown, a simple typesetting spec for entering text in a clean, legible plain-text fashion and outputting to (X)HTML. Michel Fortin did the fabulous job of porting the Markdown engine to PHP, making it a plugin [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Permanent Link: Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='Permanent Link: HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
<li><a href='http://mitcho.com/blog/life/travel/scav-hunt/' rel='bookmark' title='Permanent Link: Scav Hunt!'>Scav Hunt!</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="files">
<div class="file zip">
<a href="http://downloads.wordpress.org/plugin/markdown-for-wordpress-and-bbpress.1.0.zip">Markdown for WordPress and bbPress 1.0</a><br />
<span class="specs">30&#160;kb - zip</span>
</div>
</div>

<p>I like many others am a big fan of John Gruber&#8217;s <a href="http://daringfireball.net/projects/markdown/">Markdown</a>, a simple typesetting spec for entering text in a clean, legible plain-text fashion and outputting to (X)HTML. <a href="http://michelf.com/projects/php-markdown/">Michel Fortin</a> did the fabulous job of porting the Markdown engine to PHP, making it a plugin for <a href="http://wordpress.org/">WordPress</a>, <a href="http://www.bblog.com/">bBlog</a>, and <a href="http://textpattern.com/">TextPattern</a>.</p>

<p>I&#8217;ve been using Markdown for all my blog posts here. Recently, though, I was in charge of a <a href="http://www.bbpress.org">bbPress</a> bulletin board (the &#8220;less is more&#8221; sister project to WordPress) for the Shoreland <a href="http://mitcho.com/blog/2008/05/08/scav-hunt/">Scav Hunt team</a>, and wanted to use Markdown formatting there. And <a href="http://bbpress.org/forums/topic/markdown">I wasn&#8217;t the only one wanting to do this</a>.</p>

<p>With some experimenting and research into the filters in the bbPress text flow (different than <a href="http://michelf.com/weblog/2005/wordpress-text-flow-vs-markdown/">the WordPress one</a>), I was able to make Markdown work in bbPress. This involved adding a special bbPress plugin wrapper to Michel Fortin&#8217;s <a href="http://bbpress.org/forums/topic/markdown/extra/">PHP Markdown Extra</a>. I&#8217;ve rereleased this plugin as <strong>Markdown for WordPress and bbPress</strong>, available at both <a href="http://wordpress.org/extend/plugins/markdown-for-wordpress-and-bbpress/">wordpress.org</a> and <a href="http://bbpress.org/plugins/topic/markdown-for-wordpress-and-bbpress/">bbpress.org</a>. Enjoy!</p>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Permanent Link: Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='Permanent Link: HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
<li><a href='http://mitcho.com/blog/life/travel/scav-hunt/' rel='bookmark' title='Permanent Link: Scav Hunt!'>Scav Hunt!</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifiying WordPress plugin activation behavior</title>
		<link>http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/</link>
		<comments>http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 10:39:22 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[observation]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/2008/01/05/modifiying-wordpress-plugin-activation-behavior/</guid>
		<description><![CDATA[As I continue to work on and debug Yet Another Related Posts Plugin and WP-Smartdate, I&#8217;ve come across an issue where plugin activation fails, but I get no useful error message. When I try to activate the plugin, I am redirected to a url of the type /plugins.php?error=true&#38;plugin=...&#38;_error_nonce=.... This redirect just gives me the plugins [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Permanent Link: Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/' rel='bookmark' title='Permanent Link: Fixing Geshi on line 2132'>Fixing Geshi on line 2132</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>As I continue to work on and debug <a href="http://mitcho.com/blog/2007/12/29/yet-another-related-posts-plugin/">Yet Another Related Posts Plugin</a> and <a href="http://mitcho.com/blog/2007/11/27/introducing-smartdate/">WP-Smartdate</a>, I&#8217;ve come across an issue where plugin activation fails, but I get no useful error message.</p>

<p>When I try to activate the plugin, I am redirected to a url of the type <code>/plugins.php?error=true&amp;plugin=...&amp;_error_nonce=...</code>. This redirect just gives me the plugins control panel with my plugin still disactivated, and with no useful error message.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> This apparently is an issue with the Plugin Protection mechanism introduced in WP 2.2. <a href="http://wordpress.org/support/topic/118418">A quick fix (hack) is available on the WP forums.</a></p>

<p>Here&#8217;s hoping this helps some people scratching their heads, and that this behavior is reconsidered/fixed in future releases.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Apparently some people get a message like &#8220;Plugin could not be activated because it triggered a fatal error.&#8221;&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Permanent Link: Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/' rel='bookmark' title='Permanent Link: Fixing Geshi on line 2132'>Fixing Geshi on line 2132</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet Another Related Posts Plugin</title>
		<link>http://mitcho.com/blog/projects/yet-another-related-posts-plugin/</link>
		<comments>http://mitcho.com/blog/projects/yet-another-related-posts-plugin/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 13:49:20 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[metablog]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[threshold]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/2007/12/29/yet-another-related-posts-plugin/</guid>
		<description><![CDATA[UPDATE: This posting is now outdated&#8230; for the latest information on YARPP, please visit YARPP&#8217;s very own page on my site, or its page on wordpress.org. If you have questions, please submit on the wordpress.org forum. Thanks! Description Today I&#8217;m releasing Yet Another Related Posts Plugin (YARPP1) 1.0 for WordPress. It&#8217;s the result of some [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/yarpp-3-templates/' rel='bookmark' title='Permanent Link: Using Templates with YARPP 3'>Using Templates with YARPP 3</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h3>UPDATE:</h3>

<p>This posting is now outdated&#8230; for the latest information on YARPP, please visit <a href="/code/yarpp/">YARPP&#8217;s very own page</a> on my site, or <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin">its page on <code>wordpress.org</code></a>. If you have questions, please submit on <a href="http://wordpress.org/tags/yet-another-related-posts-plugin">the <code>wordpress.org</code> forum</a>. Thanks!</p>

<h3>Description</h3>

<p>Today I&#8217;m releasing Yet Another Related Posts Plugin (YARPP<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>) 1.0 for <a href="http://www.wordpress.org">WordPress</a>. It&#8217;s the result of some tinkering with <a href="http://peter.mapledesign.co.uk/weblog/archives/wordpress-related-posts-plugin">Peter Bowyer&#8217;s version</a> of <a href="http://wasabi.pbwiki.com/Related%20Entries">Alexander Malov &amp; Mike Lu&#8217;s Related Entries plugin</a>. Modifications made include:</p>

<ol>
<li><em>Limiting by a threshold</em>: Peter Bowyer did the great work of making the algorithm use <a href="http://en.wikipedia.org/wiki/mysql">mysql</a>&#8217;s <a href="http://dev.mysql.com/doc/en/Fulltext_Search.html">fulltext search</a> score to identify related posts. But it currently just displayed, for example, the top 5 most &#8220;relevant&#8221; entries, even if some of them weren&#8217;t at all similar. Now you can set a threshold limit<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> for relevance, and you get more related posts if there are more related posts and less if there are less. Ha!</li>
<li><em>Being a better plugin citizen</em>: now it doesn&#8217;t require the user to click some sketchy button to <code>alter</code> the database and enable a <code>fulltext key</code>. Using <a href="http://codex.wordpress.org/Function_Reference/register_activation_hook"><code>register_activation_hook</code></a>, it does it automagically on plugin activation. Just install and go!</li>
<li><em>Miscellany</em>: a nicer options screen, displaying the fulltext match score on output for admins, an option to allow related posts from the future, a couple bug fixes, etc.</li>
</ol>

<h3>Installation</h3>

<p>Just put it in your <code>/wp-content/plugins/</code> directory, activate, and then drop the <code>related_posts</code> function in your <a href="http://codex.wordpress.org/The_Loop">WP loop</a>. Change any options in the Related Posts (YARPP) Options pane in Admin > Plugins.</p>

<p>You can override any options in an individual instance of <code>related_posts</code> using the following syntax:</p>

<blockquote>
  <p>`related_posts(limit, threshold, before title, after title, show excerpt, len, before excerpt, after excerpt, show pass posts, past only, show score);</p>
</blockquote>

<p>Most of these should be self-explanatory. They&#8217;re also in the same order as the options on the YARPP Options pane.</p>

<p>Example: <code>related_posts(10, null, 'title: ')</code> changes the maximum related posts number to 10, keeps the default threshold from the Options pane, and adds <code>title:</code> to the beginning of every title.</p>

<p>There&#8217;s also a <code>related_posts_exist)</code> function. It has three optional arguments to override the defaults: a threshold, the past only boolean, and the show password-protected posts boolean.</p>

<h3>Examples</h3>

<p>For a barebones setup, just drop <code>&lt;?php related_posts(); ?&gt;</code> right after <code>&lt;?php the_content() ?&gt;</code>.</p>

<p>On my own blog I use the following code with <code>&lt;li&gt;</code> and <code>&lt;/li&gt;</code> as the before/after entry options:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>related_posts_exist<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;Related posts:
&lt;ol&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> related_posts<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>
&lt;/ol&gt;
&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;No related posts.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<h3>Coming soon (probably)</h3>

<ol>
<li>Incorporation of tags and categories in the algorithm. I&#8217;ve gotten the code working, but I still need to think about what the most natural algorithm would be for weighing these factors against the mysql fulltext score currently used (and works pretty well, I must say).</li>
<li>Um, something else! Let me know if you have any suggestions for improvement. ^^</li>
</ol>

<h3>Version log</h3>

<p>1.0   Initial upload (20071229)</p>

<p>1.0.1 Bugfix: 1.0 assumed you had Markdown installed (20070105)</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Pronounced &#8220;yarp!&#8221;, kind of like this, but maybe with a little more joy:<br /><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/7cOuGJMRORw&#038;rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/7cOuGJMRORw&#038;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Did you know that threshold has only two h&#8217;s!? I&#8217;m incensed and just went through and replaced all the instances of <code>threshhold</code> in my code. It&#8217;s really not a thresh-hold!?&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/yarpp-3-templates/' rel='bookmark' title='Permanent Link: Using Templates with YARPP 3'>Using Templates with YARPP 3</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/yet-another-related-posts-plugin/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Introducing Smartdate</title>
		<link>http://mitcho.com/blog/projects/introducing-smartdate/</link>
		<comments>http://mitcho.com/blog/projects/introducing-smartdate/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 12:47:04 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[metablog]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[smartdate]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/2007/11/27/introducing-smartdate/</guid>
		<description><![CDATA[I recently have been working on a WordPress plugin called WP-Smartdate and I&#8217;m happy to say that it is hosted at wordpress.org starting today. As some people have noticed, my blog recently has included little links on word like &#8220;yesterday,&#8221; with a machine readable version of the date reference (called a &#8220;microformat&#8221; in the biz). [...]


Related posts:<ol><li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently have been working on a <a href="http://www.wordpress.org">WordPress</a> plugin called WP-Smartdate and I&#8217;m happy to say that it is <a href="http://wordpress.org/extend/plugins/wp-smartdate/">hosted at wordpress.org</a> starting today. As some people have noticed, my blog recently has included little links on word like &#8220;yesterday,&#8221; with a machine readable version of the date reference (called a &#8220;<a href="http://microformats.org/">microformat</a>&#8221; in the biz). Download the plugin and get started!</p>

<div class="files">
<div class="file zip">
<a href="http://downloads.wordpress.org/plugin/wp-smartdate.0.1.zip">WP-Smartdate 0.1</a><br />
<span class="specs">4&#160;kb - zip</span>
</div>
</div>

<p>This blog post describes release 0.1&#8230; For the latest description, check out the <a href="http://wordpress.org/extend/plugins/wp-smartdate/">WP-Smartdate plugin page</a> or <a href="http://mitcho.com/code">mitcho.com/code</a>.</p>

<p>Please comment! I would love to hear your feedback on the plugin.</p>

<h2>Description</h2>

<p>WP-Smartdate looks for <em>relative date expressions</em> in your blog posts, such as &#8220;tomorrow,&#8221; &#8220;this coming Monday,&#8221; &#8220;last Friday,&#8221; and adds the date reference (like &#8220;2007-11-26&#8221;) as a machine-readable <a href="http://microformats.org/wiki/datetime-design-pattern">microformat</a>.</p>

<h3>Why Smartdate?</h3>

<p>WP-Smartdate was created for three simple audiences:</p>

<ol>
<li><em>For the machine:</em> While many professional information retrieval algorithms go far beyond the scope of this program, smartdate helps the process along by adding machine-readable tags to relative date expressions.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> In addition, these machine tags, in turn, help the human: a search on Google for &#8220;November 7th, 2007,&#8221; for example, will not pull up a document talking about &#8220;yesterday,&#8221; written on the 8th, but it will pull up the smartdate output of <code>2007-11-07</code>.</li>
<li><em>For the human reader:</em> Blog posts are often written in the &#8220;now,&#8221; using relative time expressions without concern for how the text will be read in the future. WP-Smartdate makes such posts easier to read and comprehend temporally<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>.</li>
<li><em>For <a href="http://mitcho.com">me</a></em>: Because I think this sort of thing is fun!</li>
</ol>

<h3>A typology of smartdate date expressions</h3>

<p>The following types of expressions are resolved with respect to the speech time&#8212;in WP-Smartdate&#8217;s case, the blog post date.</p>

<ol>
<li><em>simple references</em>: &#8220;yesterday,&#8221; &#8220;today,&#8221; &#8220;tomorrow,&#8221;</li>
<li><em>next/last <abbr title="day of the week">DOTW</abbr> expressions</em>: &#8220;next Friday,&#8221; &#8220;this past Sunday,&#8221; &#8220;this Monday&#8221;</li>
</ol>

<h3>For the future</h3>

<ul>
<li><em>static dates</em>: &#8220;January 1st, 2007&#8221;</li>
<li><em>duration shift expressions</em>: &#8220;5 days ago,&#8221; &#8220;fourscore and seven years ago&#8221;</li>
<li><em>day of the week shifts</em>: &#8220;2 Fridays ago&#8221;</li>
<li>clean up the code!</li>
</ul>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>One could argue that relative dates are a perfect place to use the <code>abbr</code> tag, as they are a sort of natural-language shortcut for more static temporal expressions. In fact, WP-Smartdate&#8217;s output also follows the <a href="http://microformats.org/wiki/datetime-design-pattern">datetime microformat design pattern draft</a> with two caveats:
1. Unfortunately, the datetime <a href="http://microformats.org/wiki/semantic-class-names">semantic class</a> has not yet been set as the standard is a draft. WP-Smartdate uses <code>datetime</code>. See the <a href="http://microformats.org/wiki/rest/datatypes#Proposal">Date and Time datatype proposal</a> for more information.
2. The <a href="http://microformats.org/wiki/rest/datatypes#Proposal">current recommendation for datetime</a> pushes for following the <a href="http://www.w3.org/TR/NOTE-datetime">W3C datetime profile</a>, which does not support the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO-8601 time interval</a> specification, which <del>is</del> will be used by WP-Smartdate.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Even though <a href="http://www.smackthemouse.com/20040108">the <code>abbr</code> tag should only be used for machine reading</a>.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>


<p>Related posts:<ol><li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Permanent Link: Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Permanent Link: Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Permanent Link: Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/introducing-smartdate/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
