<?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>A Tasty Pixel » Blog &#187; PHP</title>
	<atom:link href="http://atastypixel.com/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://atastypixel.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 16 May 2012 11:07:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>I ♥ Alfred: Code execution extensions</title>
		<link>http://atastypixel.com/blog/i-%e2%99%a5-alfred-code-execution-extensions/</link>
		<comments>http://atastypixel.com/blog/i-%e2%99%a5-alfred-code-execution-extensions/#comments</comments>
		<pubDate>Wed, 02 May 2012 13:01:12 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Alfred]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Utility]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2517</guid>
		<description><![CDATA[I&#8217;m a really big fan of Alfred, and lately I&#8217;ve found it really useful for running tiny little snippets of code &#8212; whether it&#8217;s to quickly URL decode a string, or remind myself of how C integer-to-float conversion behaves, I find myself using these little extensions I put together quite frequently. Here&#8217;re two extensions I [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://atastypixel.com/blog/wp-content/uploads/2012/05/extension.png" alt="Extension" title="extension.png" border="0" width="256" height="256" style="float:right;" class="alignright" />I&#8217;m a really big fan of <a href="http://alfredapp.com/">Alfred</a>, and lately I&#8217;ve found it really useful for running tiny little snippets of code &#8212; whether it&#8217;s to quickly URL decode a string, or remind myself of how C integer-to-float conversion behaves, I find myself using these little extensions I put together quite frequently.</p>

<p>Here&#8217;re two extensions I use to run PHP code (one which just executes it and shows the result in Growl, and one which copies the result to the clipboard), and an extension that runs a snippet of C code. Of course, it wouldn&#8217;t take much to make extensions for many other languages, too.</p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2012/05/Execute-PHP-Code.alfredextension" title="Execute PHP Code.alfredextension" alt="Execute PHP Code">Execute PHP Code.alfredextension</a></p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2012/05/Execute-PHP-Code-Copy-Result1.alfredextension" title="Execute PHP Code, Copy Result.alfredextension" alt="Execute PHP Code Copy Result">Execute PHP Code, Copy Result.alfredextension</a></p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2012/05/Run-C-code.alfredextension" title="Run C code.alfredextension" alt="Run C code">Run C code.alfredextension</a></p>

<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2012/05/Screen-Shot-2012-05-02-at-14.56.55.png" alt="Screen Shot 2012 05 02 at 14 56 55" title="Screen Shot 2012-05-02 at 14.56.55.png" border="0" width="400" height="117" /></p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2517" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/i-%e2%99%a5-alfred-code-execution-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping blog visitors by showing meaningful search results in WordPress</title>
		<link>http://atastypixel.com/blog/keeping-blog-visitors-by-showing-meaningful-search-results-in-wordpress/</link>
		<comments>http://atastypixel.com/blog/keeping-blog-visitors-by-showing-meaningful-search-results-in-wordpress/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 14:43:45 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=1927</guid>
		<description><![CDATA[By default, Wordpress will show you full, confusing posts when searching.  Keep your visitors happy by providing contextual search results like a proper search engine.  This post explains how to do it, in just a few minutes.]]></description>
			<content:encoded><![CDATA[<p>I recently became disgruntled with the way my blogs displayed search results.  By default, WordPress blogs will show searched posts exactly as they might appear on an index or archives page: Typically as an extract, or perhaps even as the full entry.</p>

<p>This doesn&#8217;t help at all if you&#8217;re looking for something in particular &#8211; It&#8217;s a much better idea to show the post within the context of the search query, as real search engines do.</p>

<p>See it in practice <a href="http://atastypixel.com/blog/?s=talkie">here</a>.</p>

<p>This is a fairly easy thing to actually get working in WordPress.  It&#8217;ll take just a couple of minutes, and will make a big difference to blog visitors.  Here&#8217;s how I did it.</p>

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

<h2>Creating a search result page</h2>

<p>If your theme doesn&#8217;t already have one, you&#8217;ll need to construct a template within your theme that WordPress will use for search results.  By default, WordPress will use your <code>index.php</code> template, so that&#8217;s usually a good place to start with, for normal themes.</p>

<p>Duplicate <code>index.php</code>, and call it <code>search.php</code>.</p>

<p>If you already have a <code>search.php</code>, you&#8217;re all set.</p>

<h3>A note about theme engines</h3>

<p>A special case here is for theme engines like Thematic (which I use for this blog).  For Thematic, it&#8217;s a matter of un-hooking the provided search &#8216;loop&#8217; from within your child theme, and replacing it with your own.</p>

<p>In my case, with a Thematic child theme, this takes place within <code>functions.php</code>.  First, one needs an &#8216;init&#8217; action, to remove the existing hooks.</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mytheme_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   remove_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thematic_searchloop'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thematic_search_loop'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">...</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mytheme_init'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<p>Then, it needs a replacement function to perform the search result loop:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">function mytheme_search_loop() {
  while ( have_posts() ) : the_post(); ?&gt;
&nbsp;
    &lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> thematic_post_class<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> thematic_postheader<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;div class=&quot;entry-content&quot;&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> thematic_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* We will replace this next */</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
      &lt;/div&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> thematic_postfooter<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;/div&gt;&lt;!-- .post --&gt;
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">...</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thematic_searchloop'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mytheme_search_loop'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<h2>Some smarts to show context</h2>

<p>What I did was replace the content of each post displayed with some code that constructs and displays some context around the search terms found in the post.</p>

<p>In your <code>search.php</code> (or your search loop function, if you&#8217;re using a theme engine), look for the line that inserts the post content.  Chances are, it&#8217;ll look something like <code>&lt;?php the_content('Keep reading'); ?&gt;</code>.  In the case of the Thematic child theme above, it&#8217;s <code>&lt;php thematic_content(); ?&gt;</code>.</p>

<p>Delete that line, and replace it with the following (here&#8217;s a <a href="http://atastypixel.com/blog/wp-content/uploads/2010/06/search_snippet.txt" title="search_snippet.txt">plain-text version</a>, if that&#8217;s easier):</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: #666666; font-style: italic;">// Configuration</span>
<span style="color: #000088;">$max_length</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">400</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Max length in characters</span>
<span style="color: #000088;">$min_padding</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Min length in characters of the context to place around found search terms</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Load content as plain text</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>post_password_required<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/<span style="color: #000099; font-weight: bold;">\r</span>?<span style="color: #000099; font-weight: bold;">\n</span>/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'@&lt;\s*(p|br\s*/?)\s*&gt;@'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_content</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Search content for terms</span>
<span style="color: #000088;">$terms</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_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;">'search_terms'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\/'</span><span style="color: #339933;">,</span> <span style="color: #990000;">join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$terms</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #339933;">,</span> PREG_OFFSET_CAPTURE<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$padding</span> <span style="color: #339933;">=</span> <span style="color: #990000;">max</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$min_padding</span><span style="color: #339933;">,</span> <span style="color: #000088;">$max_length</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">*</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Construct extract containing context for each term</span>
  <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$last_offset</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$match</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #339933;">,</span> <span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$match</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$start</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$offset</span><span style="color: #339933;">-</span><span style="color: #000088;">$padding</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$end</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$offset</span><span style="color: #339933;">+</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #000088;">$padding</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Preserve whole words</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$start</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/[A-Za-z0-9\'&quot;-]/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$start</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$start</span><span style="color: #339933;">--;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$end</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/[A-Za-z0-9\'&quot;-]/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$end</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$end</span><span style="color: #339933;">++;</span>
    <span style="color: #000088;">$start</span> <span style="color: #339933;">=</span> <span style="color: #990000;">max</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$start</span><span style="color: #339933;">,</span> <span style="color: #000088;">$last_offset</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$context</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$start</span><span style="color: #339933;">,</span> <span style="color: #000088;">$end</span><span style="color: #339933;">-</span><span style="color: #000088;">$start</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$start</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$last_offset</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$context</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'...'</span><span style="color: #339933;">.</span><span style="color: #000088;">$context</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$context</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$last_offset</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$end</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$last_offset</span> <span style="color: #339933;">!=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$max_length</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$end</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$max_length</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$end</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/[A-Za-z0-9\'&quot;-]/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$end</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$end</span><span style="color: #339933;">--;</span>
  <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$end</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Highlight matches</span>
<span style="color: #000088;">$context</span> <span style="color: #339933;">=</span> <span style="color: #990000;">nl2br</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\/'</span><span style="color: #339933;">,</span> <span style="color: #990000;">join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$terms</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;strong&gt;$0&lt;/strong&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</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>
&nbsp;
&lt;p class=&quot;search_result_context&quot;&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$context</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/p&gt;
&lt;p&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;Read this entry&lt;/a&gt;
&lt;/p&gt;</pre></div></div>


<p>Save, and search for something on your blog &#8212; you should see contextual search results, now.</p>

<h2>One final tweak: Results per page</h2>

<p>WordPress has a setting for the number of posts to show per page.  You may want to use a different number of <em>search results</em> per page, given that each result is now shorter than a full post.</p>

<p>To override this &#8216;posts per page&#8217; setting, you&#8217;ll want to find the line just before the search loop.  It&#8217;ll probably look like <code>&lt;?php if (have_posts()) : ?&gt;</code>, or, if your theme doesn&#8217;t bother with that part, <code>&lt;?php while ( have_posts() ) : the_post(); ?&gt;</code>.</p>

<p>Before that line, insert the following:</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: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span> <span style="color: #000088;">$v</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query_vars</span><span style="color: #339933;">;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'posts_per_page'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> query_posts<span style="color: #009900;">&#40;</span><span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<p>This will take the current query (including the search phrase, page number, etc.), add a &#8216;posts per page&#8217; parameter, then pass it back to WordPress&#8217;s query engine.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1927" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/keeping-blog-visitors-by-showing-meaningful-search-results-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sort your Flickr photostream</title>
		<link>http://atastypixel.com/blog/sort-your-flickr-photostream/</link>
		<comments>http://atastypixel.com/blog/sort-your-flickr-photostream/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 02:33:58 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webapps]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2009/06/08/sort-your-flickr-photostream/</guid>
		<description><![CDATA[A tool to sort your Flickr photostream by the date your photos were taken.  This sets the 'posted' date of all of your photos to the 'taken' date.]]></description>
			<content:encoded><![CDATA[<p>Flickr has a limitation that your photostream is ordered by the date you uploaded your photos, and this order can&#8217;t be changed.  If you&#8217;ve done a big import of photos &#8211; say, from iPhoto &#8211; then they could show up in your photostream in any order.</p>

<p>There&#8217;s been some <a href="http://www.flickr.com/help/forum/22354/">talk</a> about the issue, with one suggested solution being to manually set the &#8216;posted&#8217; date of every photo to the &#8216;taken&#8217; date.  A <a href="http://www.h4ppy.com/h4ppier-photos.php">utility</a> exists to do this, but it has some major limitations, including a difficult user interface and limitation that causes the process to fail if you have any photos that were taken before the date you set up your Flickr account.</p>

<p>So, I&#8217;ve made a <a href="http://sortmyphotostream.michael.tyson.id.au">utility</a> specifically for sorting a Flickr photostream.  It should be fairly user friendly, and provides the ability to backup and restore your photo metadata, in case you ever want to revert.</p>

<p>Check it out here: <a href="http://sortmyphotostream.michael.tyson.id.au">SortMyPhotostream</a></p>

<p><img src="http://atastypixel.com/blog/wp-content/uploads/2009/06/200906081230.jpg" width="350" height="250" alt="200906081230.jpg" title="200906081230.jpg" class="noframe aligncenter polaroid rotation" /></p>

<p>Leave a comment below if it&#8217;s useful to you.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1638" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/sort-your-flickr-photostream/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Flickrpress: WordPress Flickr widget</title>
		<link>http://atastypixel.com/blog/wordpress/plugins/flickrpress/</link>
		<comments>http://atastypixel.com/blog/wordpress/plugins/flickrpress/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 06:32:26 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2009/06/05/flickrbox-wordpress-flickr-widget/</guid>
		<description><![CDATA[Flickrpress is a widget to display items from Flickr in the sidebar.  Supports Flickr RSS, photostream, multiple photosets, favorites, filtering by tag and displaying random photos.]]></description>
			<content:encoded><![CDATA[<p><a href="http://atastypixel.com/blog/wp-content/uploads/2010/01/screenshot-1.png" rel="lightbox[1635]"><img src="http://atastypixel.com/blog/wp-content/uploads/2010/01/screenshot-1-tm.jpg" width="134" height="300" alt="Flickrpress screenshot" class="alignright" /></a>Flickrpress is a widget/shortcode function to display items from Flickr in the sidebar or within pages and posts.  This widget supports:</p>

<ul>
<li>Flickr RSS feeds</li>
<li>Photostream</li>
<li>Filtering by tag</li>
<li>One or more photosets</li>
<li>Favorites</li>
<li>Displaying random items</li>
</ul>

<p>Other features:</p>

<ul>
<li>Choose from three different thumbnail types</li>
<li>Lightbox/Thickbox are supported</li>
<li>Data is cached locally to lower server load</li>
<li>Secure Flickr API used, to eliminate the risk of damage to your server, unlike some other Flickr widgets</li>
<li>Flickrpress is a multi-widget, so you can use more than one instance (e.g., one in your sidebar, one in your footer)</li>
<li>Use as a shortcode to insert into posts and pages &#8212; multiple instances supported in the one entry</li>
</ul>

<p>Flickrpress uses the excellent phpFlickr library.
<span id="more-1635"></span></p>

<hr />

<p style="margin-left: 30px;"><b>My latest project:</b></p>

<p><a href="http://cartographer-app.com"><img src="http://atastypixel.com/blog/wp-content/uploads/2010/11/Cartographer-Banner.jpg" width="576" height="193" alt="The Cartographer banner" class="aligncenter" /></a></p>

<hr />

<h2>Download</h2>

<p>Download Flickrpress at the <a href="http://wordpress.org/extend/plugins/flickrpress">WordPress site</a>.</p>

<p>If you like Flickrpress, please consider buying one of my <a href="http://atastypixel.com/products">products</a>.</p>

<h2>Installation</h2>

<ol>
<li>Unzip the package, and upload <code>flickrpress</code> to the <code>/wp-content/plugins/</code> directory</li>
<li>Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress</li>
<li>Add the &#8216;Flickr Widget&#8217; to your sidebar and configure, or see the &#8216;Shortcodes&#8217; section for information on use in pages and posts</li>
</ol>

<p>If you wish to use content from anything but an RSS feed, you will need a Flickr API key.  This can be obtained
from <a href="http://www.flickr.com/services/api/keys/apply">Flickr</a></p>

<p>If you wish to use Lightbox, you must first install the <a href="http://stimuli.ca/lightbox/">Lightbox plugin</a>.</p>

<h2>Shortcode</h2>

<p>Shortcodes are snippets of text that can be inserted into pages and posts.  These snippets are replaced by various generated content.
Flickrpress provides a &#8216;flickrpress&#8217; shortcode to display images from Flickr within a page/post.</p>

<p>Available parameters:</p>

<table>
 <tr><td><tt>type       </tt></td><td> One of: &#8216;rss&#8217;, &#8216;photostream&#8217;, &#8216;sets&#8217;, &#8216;favorites&#8217;</td></tr>
 <tr><td><tt>url        </tt></td><td> URL for RSS feed</td></tr>
 <tr><td><tt>api_key    </tt></td><td> API Key for types other than RSS</td></tr>
 <tr><td><tt>account    </tt></td><td> Account name, email or ID</td></tr>
 <tr><td><tt>sets       </tt></td><td> Comma-separated list of photoset titles</td></tr>
 <tr><td><tt>tags       </tt></td><td> Comma-separated list of tags to filter by (for photostream view)</td></tr>
 <tr><td><tt>view       </tt></td><td> One of: &#8216;squares&#8217; (view as squares), &#8216;proportional&#8217; (proportional thumbnails) , &#8216;large&#8217; (large thumbnails)</td></tr>
 <tr><td><tt>count      </tt></td><td> Number of thumbnails to display</td></tr>
 <tr><td><tt>paging     </tt></td><td> &#8216;true&#8217; to show page navigation, to move back and forward through pages of images (implemented using AJAX)</td></tr>
 <tr><td><tt>random     </tt></td><td> &#8216;true&#8217; to display randomly</td></tr>
 <tr><td><tt>lightbox   </tt></td><td> &#8216;true&#8217; to use Lightbox</td></tr>
 <tr><td><tt>columns    </tt></td><td> Number of columns of images to display</td></tr>
</table>

<p>Example:</p>

<pre><code>  [flickrpress type="photostream" api_key="xxxxxxxxxxxxxxxxxxxxxx" account="michaeltyson" count="30" paging="true" lightbox="true"]
</code></pre>

<h2>Styling</h2>

<p>Flickrpress comes with CSS styling, but if you wish to modify its appearance, such as adding frame borders, simply style the 
&#8220;<code>flickrpress-container</code>&#8221; class.  See <code>style.css</code> for more.</p>

<h2>FAQ</h2>

<h3>I&#8217;m seeing &#8220;Flickr is currently unavailable&#8221; messages</h3>

<blockquote>
  <p>You may have an incorrect setting: To see the actual error message, open your server&#8217;s error log and look for Flickrpress messages.  How you do that depends on your host – on mine, Site5, the error log appears in the WordPress folder; on others, you access it through a web interface). If you can’t get to it, open up the file <code>includes/interface.php</code> in the plugin’s folder, and change <code>error_log</code> on line 22 to <code>echo</code> – then any messages will be printed to the screen.  You&#8217;ll want to change it back afterwards so your visitors don&#8217;t see those messages.</p>
</blockquote>

<h2>Changelog</h2>

<h3>1.0.2</h3>

<ul>
<li>Added Thickbox support</li>
<li>Compatibility fix for PHP 4</li>
</ul>

<h3>1.0.1</h3>

<ul>
<li>Bugfix in navigation javascript encountered when Lightbox isn&#8217;t installed</li>
</ul>

<h3>1.0</h3>

<ul>
<li>Implemented AJAX-based navigation through pages of images</li>
<li>Added shortcode documentation</li>
<li>Caching for shortcode and php calls</li>
<li>Removed &#8216;css&#8217; option in favour of always including CSS</li>
<li>Fixed conflict between shortcode and widget versions</li>
<li>Fixed bug in loading all photostream items</li>
</ul>

<h3>0.3.2</h3>

<ul>
<li>Fixed a warning when using shortcode</li>
</ul>

<h3>0.3.1</h3>

<ul>
<li>Fixed a packaging snafu</li>
</ul>

<h3>0.3</h3>

<ul>
<li>Support for use outside of sidebar</li>
</ul>

<h3>0.2.1</h3>

<ul>
<li>Bugfix for displaying random favourites</li>
</ul>

<h3>0.2</h3>

<ul>
<li>Now able to be styled as described in http://www.webdesignerwall.com/tutorials/css-decorative-gallery/. See style.css for more info.</li>
</ul>

<h3>0.1.1</h3>

<ul>
<li>Bugfix for when only 1 random image shown</li>
</ul>

<h3>0.1</h3>

<ul>
<li>Initial release</li>
</ul>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1635" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/wordpress/plugins/flickrpress/feed/</wfw:commentRss>
		<slash:comments>270</slash:comments>
		</item>
		<item>
		<title>Links for May 21st through June 2nd</title>
		<link>http://atastypixel.com/blog/links-may-21st-june-2nd/</link>
		<comments>http://atastypixel.com/blog/links-may-21st-june-2nd/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 07:01:25 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Lifestyle]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=1613</guid>
		<description><![CDATA[Links for May 21st through June 2nd: 49 Decent Virtual Assistant &#38; Personal Outsourcing Resources PHP: Display Adobe PSD files on a web page &#34;Any webdesigner know the PSD filetype, which is the Adobe Photoshop format. PSDs have a lot of great features, as such as layers, but they can&#8217;t being read by a browser. [...]]]></description>
			<content:encoded><![CDATA[<p>Links for May 21st through June 2nd:</p>

<ul class="delicious-bookmarks">
<li><a href="http://thegrowinglife.com/2008/04/49-decent-virtual-assistant-personal-outsourcing-resources/">49 Decent Virtual Assistant &amp; Personal Outsourcing Resources</a> </li>
<li><a href="http://www.catswhocode.com/blog/php-display-adobe-psd-files-on-a-web-page">PHP: Display Adobe PSD files on a web page</a> &quot;Any webdesigner know the PSD filetype, which is the Adobe Photoshop format. PSDs have a lot of great features, as such as layers, but they can&rsquo;t being read by a browser. Unless you use this great PHP class!&quot;</li>
<li><a href="http://www.iconfinder.net/">Iconfinder &#8211; Icon Search Made Easy</a> </li>
<li><a href="http://www.typetester.org/">Typetester &ndash; Compare fonts for the screen</a> </li>
<li><a href="http://www.kennettnet.co.uk/code/knappguide/">KNAppGuide</a> KNAppGuide is a Cocoa framework for embedding &ldquo;guides&rdquo; into your application, visually inspired by Apple Guide from the System 7 and 8 era</li>

</ul>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1613" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/links-may-21st-june-2nd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Private Tags WordPress Plugin</title>
		<link>http://atastypixel.com/blog/wordpress/plugins/private-tags/</link>
		<comments>http://atastypixel.com/blog/wordpress/plugins/private-tags/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 09:23:17 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2009/04/10/private-tags-wordpress-plugin/</guid>
		<description><![CDATA[The &#8220;Private Tags&#8221; WordPress plugin allows users to specify a list of tags or categories to keep hidden from the public &#8211; all posts within the specified tags/categories, and the tags/categories themselves, will not be visible to anyone but the original author. Alternatively, in &#8216;inclusive&#8217; mode specify a list of tags/categories to make public &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>The &#8220;Private Tags&#8221; WordPress plugin allows users to specify a list of tags or categories to keep hidden from the public &#8211; all posts within the specified tags/categories, and the tags/categories themselves, will not be visible to anyone but the original author.</p>

<p>Alternatively, in &#8216;inclusive&#8217; mode specify a list of tags/categories to make public &#8211; all other tags/categories will remain hidden.</p>

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

<h2>Download</h2>

<p>Download the Private Tags plugin at the <a href="http://wordpress.org/extend/plugins/private-tags/">WordPress plugin page</a></p>

<p>If you like Private Tags, please consider buying one of my <a href="http://atastypixel.com/products">products</a>.</p>

<h3>Installation</h3>

<ol>
<li>Unzip the package, and upload <code>private-tags</code> to the <code>/wp-content/plugins/</code> directory</li>
<li>Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress</li>
<li>Visit &#8216;Private Tags&#8217; settings underneath WordPress settings to configure</li>
</ol>

<h3>Changes</h3>

<p><em>0.1</em> &#8211; Initial release</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1586" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/wordpress/plugins/private-tags/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Sneak preview of my new web framework Michaelangelo</title>
		<link>http://atastypixel.com/blog/sneak-preview-of-my-new-web-framework-michaelangelo/</link>
		<comments>http://atastypixel.com/blog/sneak-preview-of-my-new-web-framework-michaelangelo/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 14:39:22 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2009/03/28/sneak-preview-of-my-new-web-framework-michaelangelo/</guid>
		<description><![CDATA[I&#8217;ve been working on a new web framework which provides image theming &#8211; a little like what Elegant Grunge does with its image frames, but much more sophisticated. For example: This is a PHP framework that uses the common GD library to manipulate images. It&#8217;s main interface is a content filter &#8211; give it HTML, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a new web framework which provides image theming &#8211; a little like what <a href="http://atastypixel.com/blog/wordpress/themes/elegant-grunge">Elegant Grunge</a> does with its image frames, but much more sophisticated.</p>

<p>For example:
<img src="http://atastypixel.com/blog/wp-content/uploads/2009/03/boathouse.jpg" width="400" height="206" alt="boathouse.jpg" title="boathouse.jpg" class="aligncenter sticky-tape tape-corners noframe" /></p>

<p><img src="http://atastypixel.com/blog/wp-content/uploads/2009/03/city.jpg" width="400" alt="A dynamic caption" title="A dynamic caption" class="aligncenter polaroid rotation frame-title noframe" /></p>

<p><img src="http://atastypixel.com/blog/wp-content/uploads/2009/03/thailand.jpg" width="171" height="300" alt="thailand.jpg" title="thailand.jpg" class="alignright wood-frame noframe" /></p>

<p>This is a PHP framework that uses the common GD library to manipulate images.</p>

<p>It&#8217;s main interface is a content filter &#8211; give it HTML, containing images, and it will return the same HTML modified so that the images are now the converted versions, according to their &#8216;class&#8217; attributes, with appropriate width/height attributes, etc.  This makes it super easy to work with.</p>

<p>It stands alone, but it is also going to be a WordPress plugin (as you can see on this site, it&#8217;s already operational), a Joomla plugin, and I&#8217;m considering establishing a web service too, so those who don&#8217;t have adequate software on their server can still use it.</p>

<p><img src="http://atastypixel.com/blog/wp-content/uploads/2009/03/img-1773.jpg" width="300" height="200" alt="IMG_1773.jpg" title="IMG_1773.jpg" class="aligncenter wood-frame noframe" /></p>

<p>It has a plugin-based architecture so anyone can add new &#8216;themes&#8217; (<em>props to my partner Katherine for that beautiful wooden frame, by the way</em>).  I&#8217;m going to also implement a simple XML-based plugin schema, and possibly an interface to it, so that it&#8217;s easy to do so.  I&#8217;m planning a &#8216;community&#8217; style directory site to host contributed styles.</p>

<p>The base frame rendering code is such that it is trivially easy to add a new &#8216;theme&#8217;.  It extracts segments from a single frame image, and handles seamless tiling to make the frame the right dimensions, so you don&#8217;t even have to worry about overlapping regions.</p>

<p>I will release it soon, after adding a little more content &#8211; keep your eyes peeled.</p>

<p>For now, check out the <a href="http://atastypixel.com/blog/wp-content/plugins/michaelangelo/Michaelangelo/Sample">Michaelangelo showcase</a>, which gives an idea of the different styles, and contains an interactive sampler to play with styles (<em>IE users should stop being IE users to view this</em>).</p>

<p>Doing my bit to beautify the web.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1566" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/sneak-preview-of-my-new-web-framework-michaelangelo/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Facebook News Feed RSS</title>
		<link>http://atastypixel.com/blog/facebook-news-feed-rss/</link>
		<comments>http://atastypixel.com/blog/facebook-news-feed-rss/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 22:26:13 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2009/02/19/facebook-news-feed-rss/</guid>
		<description><![CDATA[A PHP script to crawl the Facebook news items and create an RSS feed from them]]></description>
			<content:encoded><![CDATA[<p>Tired of either logging into Facebook frequently, or being entirely oblivious to friends&#8217; activities, I was searching for a way to view the Facebook front page news feed as RSS, so I could load it into my news reader and forget about it.</p>

<p><a href="http://blog.nemik.net/2006/09/06/facebook-news-feed-rss/">&#8216;Nemik&#8217;</a> has created such a thing and kindly made it available.  It was a bit elderly, and didn&#8217;t work with the new Facebook, so I jazzed it up a bit.</p>

<p>Put it on a webserver, configure it, and access the URL to view the RSS feed. Probably a very good idea to provide <a href="http://www.google.com/search?hl=en&amp;q=htaccess%20password&amp;btnG=Search&amp;meta=">password protection</a>, as well.</p>

<p>Use at your own risk, and Facebook, please don&#8217;t sue me.</p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2009/02/facebook-rss.zip" title="facebook-rss.zip">Download the script here</a></p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1439" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/facebook-news-feed-rss/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Links for December 29th through January 28th</title>
		<link>http://atastypixel.com/blog/links-december-29th-january-28th/</link>
		<comments>http://atastypixel.com/blog/links-december-29th-january-28th/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 03:00:38 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2009/01/29/links-%datestart-january-28th/</guid>
		<description><![CDATA[These are my links for December 29th through January 28th:

<ul>
<li><a href="http://photoshopfrenzy.com/?p=94">Dramatic Gritty Effect</a> In this tutorial we&#8217;re going to show you how to add a dramatic, gritty, bronzed effect to your images.</li>
<li><a href="http://propel.phpdb.org/trac/">Propel</a> Propel is an Object-Relational Mapping (ORM) framework for PHP5. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data.</li>
<li><a href="http://www.whatsmypass.com/?p=415">The Top 500 Worst Passwords of All Time</a> Passwords to try when I desperately need to get onto a locked Wifi network for some reason. Don&#39;t tell anybody.</li>
<li><a href="http://rss.timegenie.com/foreign_exchange_rates_forex">Foreign Exchange Rates (FOREX) XML Feed or CSV Feed</a> Free for commercial or non-commercial use, updated daily, XML/CSV format</li>
<li><a href="http://www.mobileorchard.com/9-places-to-publicize-your-iphone-app/">10 Places To Publicize Your iPhone App</a> A list of iPhone App review/gallery sites</li>

</ul>]]></description>
			<content:encoded><![CDATA[<p>Links for December 29th through January 28th:</p>

<ul class="delicious-bookmarks">
    <li><a href="http://photoshopfrenzy.com/?p=94">Dramatic Gritty Effect</a> In this tutorial we’re going to show you how to add a dramatic, gritty, bronzed effect to your images.</li>
    <li><a href="http://propel.phpdb.org/trac/">Propel</a> Propel is an Object-Relational Mapping (ORM) framework for PHP5. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data.</li>
    <li><a href="http://www.whatsmypass.com/?p=415">The Top 500 Worst Passwords of All Time</a> Passwords to try when I desperately need to get onto a locked Wifi network for some reason. Don&#8217;t tell anybody.</li>
    <li><a href="http://rss.timegenie.com/foreign_exchange_rates_forex">Foreign Exchange Rates (FOREX) XML Feed or CSV Feed</a> Free for commercial or non-commercial use, updated daily, XML/CSV format</li>
    <li><a href="http://www.mobileorchard.com/9-places-to-publicize-your-iphone-app/">10 Places To Publicize Your iPhone App</a> A list of iPhone App review/gallery sites</li>
</ul>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1326" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/links-december-29th-january-28th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elegant Grunge 1.0 released</title>
		<link>http://atastypixel.com/blog/elegant-grunge-10-released/</link>
		<comments>http://atastypixel.com/blog/elegant-grunge-10-released/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 11:12:06 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2008/12/29/elegant-grunge-10-released/</guid>
		<description><![CDATA[A significant update to my WordPress theme, Elegant Grunge, has been released. New features and fixes include: Configurable sidebars! Choose from no sidebar, a sidebar on the right (the standard layout), or a double sidebar on the right! Support for WP 2.7 paginated and threaded comments Support for a custom header image &#8211; just enter [...]]]></description>
			<content:encoded><![CDATA[<p>A significant update to my WordPress theme, <a href="http://atastypixel.com/blog/wordpress/themes/elegant-grunge/">Elegant Grunge</a>, has been released. New features and fixes include:</p>

<ul>
<li>Configurable sidebars! Choose from no sidebar, a sidebar on the right (the standard layout), or a double sidebar on the right!</li>
<li>Support for WP 2.7 paginated and threaded comments</li>
<li>Support for a custom header image &#8211; just enter a URL to an image, typically a transparent PNG, and it will appear in the header instead of the text (SEO friendly)</li>
<li>Some bug, compatibility and i18n fixes</li>
</ul>

<p>&lt;</p>

<p>p>Note: If you have problems with this theme, please post your question at the <a href="http://wordpress.org/tags/elegant-grunge">WordPress forums</a>.  Please don&#8217;t contact me directly, as I don&#8217;t have the resources to help you.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1249" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/elegant-grunge-10-released/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>RSS aggregation for PHP</title>
		<link>http://atastypixel.com/blog/php-rss-aggregator/</link>
		<comments>http://atastypixel.com/blog/php-rss-aggregator/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 14:44:16 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2008/11/27/rss-aggregation-for-php/</guid>
		<description><![CDATA[I have written a mechanism in PHP that can take several RSS feeds, filter and manipulate them, and re-display them in either RSS or straight HTML. This can also manipulate content (through the preg_replace function, and configurable per-feed), such as removing names from Twitter entries. I&#8217;m using it on loopyapp.com to show all relevant items [...]]]></description>
			<content:encoded><![CDATA[<p>I have written a mechanism in PHP that can take several RSS feeds, filter and manipulate them, and re-display them in either RSS or straight HTML.</p>

<p>This can also manipulate content (through the <em>preg_replace</em> function, and configurable per-feed), such as removing names from Twitter entries.  I&#8217;m using it on <a href="http://loopyapp.com">loopyapp.com</a> to show all relevant items from both this blog and my Twitter feed automatically, as an alternative to creating a separate blog.  I&#8217;m also using it on <a href="http://atastypixel.com/blog/aggregate/rss.php">this blog</a>, to incorporate blog entries and Twitter postings.</p>

<p>It uses the <a href="http://magpierss.sourceforge.net/">MagpieRSS</a> RSS parser for PHP, which provides some nice functionality, including caching.</p>

<p>Here&#8217;s the code: <a href="http://atastypixel.com/blog/wp-content/uploads/2009/03/aggregate.zip" title="aggregate.zip">aggregate.zip</a>
</p>

<p>To use it, unzip it to somewhere in your webroot, then edit <em>aggregate.php</em> and possibly <em>rss.php</em> to set your configuration.  Make sure that either the aggregate directory is writable, or create a &#8216;cache&#8217; directory within and make that writeable, to enable caching.  Point your web browser to the <em>rss.php</em> file to immediately view an RSS feed aggregating your supplied feeds. To add a link to the RSS from a website, add it in the header:</p>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;RSS Feed&quot; href=&quot;http://mysite.com/aggregate/rss.php&quot; /&gt;</pre></div></div>


<p>To include content in a website, the provided <tt>render_aggregate_items</tt> function will do most of the work, or you can write your own rendering code. You just have to include the file, use the functions to obtain and draw the content, and then provide your own CSS styling.  Example:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;items&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;aggregate.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
render_aggregate_items<span style="color: #009900;">&#40;</span>aggregate_items<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;/div&gt;</pre></div></div>


<p>A more comprehensive example is in <em>sample.php</em>.</p>

<p>The code is GPL, so use it however you want &#8211; keep the header comments there, though.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1191" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/php-rss-aggregator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Links for November 13th through November 17th</title>
		<link>http://atastypixel.com/blog/?p=1145</link>
		<comments>http://atastypixel.com/blog/?p=1145#comments</comments>
		<pubDate>Mon, 17 Nov 2008 01:28:21 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Geocoding]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Location]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=1145</guid>
		<description><![CDATA[Links for November 13th through November 17th: How to Price Your iPhone App out of Existence Write-up on the dangers of pricing an iPhone app too low, and the need to &#39;correct&#39; the market Open Radar Community-driven, open Apple bug reports Free Australian Postcode location data &#34;&#8230;Both the original CSV is available zipped below and [...]]]></description>
			<content:encoded><![CDATA[<p>Links for November 13th through November 17th:</p>

<ul class="delicious-bookmarks">
<li><a href="http://www.losingfight.com/blog/2008/11/15/how-to-price-your-iphone-app-out-of-existence/">How to Price Your iPhone App out of Existence</a> Write-up on the dangers of pricing an iPhone app too low, and the need to &#39;correct&#39; the market</li>
<li><a href="http://openradar.appspot.com/">Open Radar</a> Community-driven, open Apple bug reports</li>
<li><a href="http://www.corra.com.au/support/downloads/">Free Australian Postcode location data</a> &quot;&#8230;Both the original CSV is available zipped below and contains Postcode, Suburb, Latitude and Longitude, a MySQL dump of the data is also available in a Zip file below. You can also download the PHP functions we coded to interface with the MySQL database. Simply call the postcode_dist() function with the two postcodes as shown in the example and you&#39;ll have a result in Kilometers returned quite quickly, these functions are freely available under the BSD licence.&quot;</li>
</ul>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1145" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/?p=1145/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A OS X service to encode HTML characters</title>
		<link>http://atastypixel.com/blog/a-os-x-service-to-encode-html-characters/</link>
		<comments>http://atastypixel.com/blog/a-os-x-service-to-encode-html-characters/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 02:08:13 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2008/11/14/a-os-x-service-to-encode-html-characters/</guid>
		<description><![CDATA[I find myself frequently writing HTML code in comment forms which support use of HTML formatting, which means that I have to encode the html entities if I want them to show up (as in representing '&#62;' with '&#38;gt;', for example).  ...  I used the always-useful  ThisService  app with a short PHP script which does a  htmlspecialchars()  on whatever's passed to it, to create a OS X service called 'Encode HTML'.]]></description>
			<content:encoded><![CDATA[<p>I find myself frequently writing HTML code in comment forms which support use of HTML formatting, which means that I have to encode the html entities if I want them to show up (as in representing &#8216;&gt;&#8217; with &#8216;&amp;gt;&#8217;, for example).</p>

<p>This gets rather tiresome, particularly if there&#8217;s a fair chunk of text to encode by hand.</p>

<p>I used the always-useful <a href="http://wafflesoftware.net/thisservice/">ThisService</a> app with a short PHP script which does a <em>htmlspecialchars()</em> on whatever&#8217;s passed to it, to create a OS X service called &#8216;<a href="http://atastypixel.com/blog/wp-content/uploads/2008/11/encodehtmlservice.zip" title="EncodeHtml.service.zip">Encode HTML</a>&#8216;. Put it in your <i>Library/Services</i> directory, possibly log out and back in again, and you&#8217;ll be set.</p>

<p>Select the text to encode, click the system menu, Services, Encode HTML, and it&#8217;ll be automatically encoded in place.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1158" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/a-os-x-service-to-encode-html-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some useful mini-plugins for WordPress</title>
		<link>http://atastypixel.com/blog/some-useful-mini-plugins-for-wordpress/</link>
		<comments>http://atastypixel.com/blog/some-useful-mini-plugins-for-wordpress/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 00:06:47 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2008/10/18/some-useful-mini-plugins-for-wordpress/</guid>
		<description><![CDATA[Three simple Wordpress plugins that provide shortcode-based functionality: Simple Google adsense insertion, a FLV media player, and a music list with flash players.]]></description>
			<content:encoded><![CDATA[<p>Originally for my own use, I put together a couple of WordPress plugins, which I thought I&#8217;d make available in case they were useful to anyone else.</p>

<h3>Google AdSense shortcode</h3>

<p>This is the simplest plugin, which provides an &#8216;adsense&#8217; shortcode to output a Google ad. To use it, use Google&#8217;s tools to create the ad, then paste it into the php file where indicated, then put <tt>{adsense}</tt> <small>(replace the curly braces with square brackets)</small> in posts/pages where you want the ad to appear (remove the spaces around the square brackets).</p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2008/10/adsensephp.zip" title="adsense.php.zip">adsense.php.zip</a></p>

<p>And now for a demo + shameless attempt at monetization:</p>

<p></p>

<h3>Media player</h3>

<p>This one is useful if you occasionally post a video file on your blog, and host it locally. If you use video more frequently, there are plugins that probably are more suited, but I personally didn&#8217;t want the overhead, and I wanted to store videos in the standard upload locations, instead of having a separate repository, which seems to be what other plugins do.</p>

<p>This one uses the <a href="http://www.jeroenwijering.com/?item=JW_FLV_Player">JW FLV player</a>, provided in the plugin. Use something like:</p>

<p><tt>{media source="http://my.site.com/path/to/video.flv" width="400" height="308" preview="http://my.site.com/path/to/preview.jpg"}</tt><br /></p>

<p><span style="line-height: 16px;"><small>(replace the curly braces with square brackets)</small><br /></span></p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2008/10/mediaplayer.zip" title="mediaplayer.zip">mediaplayer.zip</a></p>

<p>I used this just the other day on a post demonstrating the <a href="http://atastypixel.com/blog/2008/10/13/rpea-mapping-algorithm-clip/">output of the simulator I&#8217;ve written for my PhD</a>.</p>

<h3>Music player</h3>

<p>This is the plugin that renders the content for my <a href="http://atastypixel.com/blog/music">music</a> page, as well as providing mini-players for other posts. Give it a path to a directory, and it will display all mp3 files in that directory with flash players based on the <a href="http://musicplayer.sourceforge.net/">XSPF Web Music Player</a>. Recently-added mp3 files will be marked as &#8216;New&#8217;. Use something like:</p>

<p><tt>{musiclist path="path/to/my/music"}</tt><br /></p>

<p><small>(replace the curly braces with square brackets; add optional nolink=&#8221;true&#8221; parameter to avoid linking to the mp3 files from their titles)</small><br /></p>

<p>For just one track, use:</p>

<p><tt>{audio source="path/to/audio.mp3"}</tt></p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2008/11/musicplayer.zip" title="musicplayer.zip">musicplayer.zip</a></p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=972" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/some-useful-mini-plugins-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Twitter posting lists with images</title>
		<link>http://atastypixel.com/blog/wordpress/plugins/twinkle-twitpic-twitter/</link>
		<comments>http://atastypixel.com/blog/wordpress/plugins/twinkle-twitpic-twitter/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 03:02:29 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/2008/10/16/twitter-posting-lists-with-images/</guid>
		<description><![CDATA[A Wordpress plugin to display recent Twitter updates, with images from Twinkle or Twitpic displayed inline. Also includes the core PHP class to be used in other systems.]]></description>
			<content:encoded><![CDATA[<p><img class="small" style="float: right;" title="200810161358.jpg" src="http://atastypixel.com/blog/wp-content/uploads/2008/10/200810161358.jpg" alt="200810161358.jpg" width="200" height="196" /></p>

<p><a href="http://atastypixel.com/blog/2008/09/08/adding-twinkle-to-twitter-posting-lists/">Recently</a> I released some code to discover and embed Twinkle images linked from Twitter postings, and released a modification to Ricardo González&#8217;s <a href="http://rick.jinlabs.com/code/twitter/">Twitter for WordPress</a> plugin which uses it.</p>

<p>I&#8217;ve now implemented support for Twitpic as well.</p>

<p>Grab the modified WordPress plugin here:</p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2009/09/twitter-for-wordpress-plus-images-v0.2.6.zip" title="twitter-for-wordpress-plus-images-v0.2.6.zip">twitter-for-wordpress-plus-images-v0.2.6.zip</a></p>

<p><em>After installation, add the widget and make sure &#8216;Discover images&#8217; is ticked.</em></p>

<p>For non-Wordpress users, the base code is also available here:</p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2009/09/TwitterImageUtil.class.php-v0.2.6.zip" title="TwitterImageUtil.class.php-v0.2.6.zip">TwitterImageUtil.class.php-v0.2.6.zip</a></p>

<p>Include it in your twitter list source code, and use it as a filter for the message content. Something like:</p>

<blockquote style="font-size: 0.8em;"><tt>$message = TwitterImageUtil::processContent($message, $mysql_database_handle);</tt></blockquote>

<p>Some configuration is possible – see the header comments for more details.</p>

<p>The code will create a thumbnail of the image, and store it locally. It&#8217;ll also cache the results in a MySQL database for speed. It supports Lightbox, too – just supply the relevant flag to turn it on.</p>

<h3>Updates</h3>

<ul>
<li>Version 0.2.6: Bugfix for posts with both images and @mentions</li>
<li>Version 0.2.5: Bugfix from prior version, plus compatibility fix for Twitpic changes</li>
<li>Version 0.2.4: Updated to match Twitter for WordPress v1.9.2: Compatibility fix for WP 2.7</li>
<li>Version 0.2.3: Another update, chasing the moving target that is Twitpic</li>
<li>Version 0.2.2: Updated to match Twitpic&#8217;s new image storage using Amazon S3.</li>
</ul>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=958" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/wordpress/plugins/twinkle-twitpic-twitter/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

