<?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>Squio.blog &#187; php</title>
	<atom:link href="http://squio.nl/tags/webdev/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://squio.nl</link>
	<description>Creative internet development</description>
	<lastBuildDate>Mon, 24 Jan 2011 21:08:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>	<div id='fb-root'></div>
					<script type='text/javascript'>
						window.fbAsyncInit = function()
						{
							FB.init({appId: 139820809411699, status: true, cookie: true, xfbml: true});
						};
						(function()
						{
							var e = document.createElement('script'); e.async = true;
							e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
							document.getElementById('fb-root').appendChild(e);
						}());
					</script>	
						<item>
		<title>Adding Flickr photos to Foursquare using YQL</title>
		<link>http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/</link>
		<comments>http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 10:03:10 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[AR]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[layar]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://squio.nl/?p=531</guid>
		<description><![CDATA[Browsing the updated Foursquare development documents I came across a real nice hidden gem: it appears that the Flickr folks have enabled so called machine tags to associate a photo with a Foursquare venue. The almost hidden quote from the Flickr Developer blog: This is the part where I casually mention that we’ve also added [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div class="wp-caption alignright" style="width: 202px"><a href="http://www.flickr.com/photos/25566432@N00/3894448434"><img class=" " title="Foursquare" src="http://squio.nl/blog/wp-content/2009/11/3894448434_4376f866e9_m.jpg" alt="Foursquare" width="192" height="162" /></a><p class="wp-caption-text">Image by miss604 via Flickr</p></div>
</div>
<p>Browsing the updated <a class="zem_slink" title="Foursquare" rel="homepage" href="http://playfoursquare.com/">Foursquare</a> development documents I came across a real nice hidden gem: it appears that the <a class="zem_slink" title="Flickr" rel="homepage" href="http://flickr.com">Flickr</a> folks have enabled so called <em>machine tags</em> to associate a photo with a Foursquare venue.</p>
<p>The almost hidden <a href="http://code.flickr.com/blog/2009/09/28/thats-maybe-a-bit-too-dorky-even-for-us/">quote from the Flickr Developer blog</a>:</p>
<blockquote><p>This is the part where I casually mention that we’ve also added <a title="Search for Foursquare Venue photos" href="http://www.flickr.com/photos/tags/foursquare:venue=">machine tags extra love for Four Square venues IDs</a>. I’m just saying…</p></blockquote>
<p>Now how cool would it be to display a little photo on my Foursquare Layar venue detail pages?<br />
Remembering <a href="http://twitter.com/codepo8/">@codepo8</a>&#8216;s execellent talk at the Fronteers conference last week, I realized that this is where the really cool <a title="YQL Console" href="http://developer.yahoo.com/yql/console/">YQL engine</a> comes in really handy.</p>
<p>And indeed, the following query does it all:</p>
<pre><a title="Open Query Editor" href="http://developer.yahoo.com/yql/console/?q=select%20*%20from%20flickr.photos.search%20where%20machine_tags%3D%22foursquare%3Avenue%3D132009%22%20limit%201&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys">select * from flickr.photos.search
    where machine_tags="foursquare:venue=132009"
    limit 1</a></pre>
<p>Just save the <a class="zem_slink" title="Representational State Transfer" rel="wikipedia" href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a> command url, wrap it in a little PHP handler and we&#8217;re good to go (homework for next time: process the YQL response in XML format with js/e4x and skip the PHP part altogether).</p>
<p>So now you will see a little thumbnail picture for every venue which has a photo tagged on Flickr. There aren&#8217;t many yet, but hey, it&#8217;s a start!</p>
<p>See it in action in the <a title="Direct link to open Layar on your phone" href="http://m.layar.com/open/foursquare">Foursquare Layar app on your phone (iPhone, Android)</a> or read my announcement for more <a href="http://squio.nl/blog/2009/11/16/announcing-foursquare-for-layar-app/">background information about the foursquare layar app</a>.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Somewhat related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://adactio.com/journal/1617/">Small pieces, loosely joined by machine tags</a> (adactio.com)</li>
<li class="zemanta-article-ul-li"><a href="http://thenextweb.com/appetite/2009/11/05/noticings-foursquare-photo-sharers/">Zee.: Noticings is Foursquare for photo sharers</a> (thenextweb.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.readwriteweb.com/archives/noticings_geotagging_photo_game_powered_by_flickr.php">Noticings: Geotagging Photo Game Powered by Flickr API</a> (readwriteweb.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/2871e662-f49d-4c01-9cee-a14969cfba0c/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=2871e662-f49d-4c01-9cee-a14969cfba0c" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Adding+Flickr+photos+to+Foursquare+using+YQL+http%3A%2F%2Fsquio.nl%2F%3Fp%3D531" title="Post to Twitter"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Adding+Flickr+photos+to+Foursquare+using+YQL+http%3A%2F%2Fsquio.nl%2F%3Fp%3D531" title="Post to Twitter">Tweet This</a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/&amp;title=Adding+Flickr+photos+to+Foursquare+using+YQL" title="Post to Delicious"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/&amp;title=Adding+Flickr+photos+to+Foursquare+using+YQL" title="Post to Delicious">Delicious</a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/&amp;title=Adding+Flickr+photos+to+Foursquare+using+YQL" title="Post to Reddit"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/&amp;title=Adding+Flickr+photos+to+Foursquare+using+YQL" title="Post to Reddit">Reddit This Post</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/&amp;title=Adding+Flickr+photos+to+Foursquare+using+YQL" title="Post to StumbleUpon"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/&amp;title=Adding+Flickr+photos+to+Foursquare+using+YQL" title="Post to StumbleUpon">Stumble This Post</a></p></div><div class='wpfblike' style='height: 40px;'><fb:like href='http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div><img src="http://squio.nl/blog/?ak_action=api_record_view&id=531&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://squio.nl/blog/2009/11/18/adding-flickr-photos-to-foursquare-using-yql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choice of PHP Frameworks</title>
		<link>http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/</link>
		<comments>http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 22:57:59 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://squio.nl/?p=511</guid>
		<description><![CDATA[As of today there is a Tweet Poll running with the question: Which PHP opensource framework do you mostly use? An interesting question because the market of PHP frameworks appears pretty fragmented after 750+ votes are cast. Leading is Zend Framework (does this qualify as Open Source?), followed by Symfony, Cake PHP, CodeIgniter, all around [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div class="wp-caption alignright" style="width: 178px"><a href="http://en.wikipedia.org/wiki/Image:PHP-logo.svg"><img class="  " title="PHP" src="http://squio.nl/blog/wp-content/2009/11/300px-PHP-logo.svg.png" alt="PHP" width="168" height="89" /></a><p class="wp-caption-text">Image via Wikipedia</p></div>
</div>
<p>As of today there is a Tweet Poll running with the question: <a href="http://twtpoll.com/r/lxt2xe">Which PHP opensource framework do you mostly use</a>?<br />
An interesting question because the market of PHP frameworks appears pretty fragmented after 750+ votes are cast. Leading is <a class="zem_slink" title="Zend Framework" rel="homepage" href="http://framework.zend.com/">Zend Framework</a> (does this qualify as Open Source?), followed by <a class="zem_slink" title="Symfony" rel="homepage" href="http://www.symfony-project.org/">Symfony</a>, <a class="zem_slink" title="CakePHP" rel="homepage" href="http://www.cakephp.org">Cake PHP</a>, <a class="zem_slink" title="CodeIgniter" rel="homepage" href="http://codeigniter.com/%20">CodeIgniter</a>, all around 10%. There are also a few stray ones: I don&#8217;t consider <a class="zem_slink" title="PEAR" rel="wikipedia" href="http://en.wikipedia.org/wiki/PEAR">PEAR</a> a framework and the choice &#8220;my own&#8221; can be disputed as well.</p>
<p>For now there is no clear winner, something I already had that <em>gut feeling</em> about. Wonder where this is going to stabilize (and of course, how representative the twitter votes are anyway). See for yourself, the embedded graph below should stay up to date and you may cast your vote if you ike.</p>
<p><script src="http://twtpoll.com/js/badge.js" type="text/javascript"></script> <script src="http://twtpoll.com/badge/?twt=lxt2xe&amp;s=250&amp;b=1&amp;bt=1" type="text/javascript"></script></p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://completeopensource.blogspot.com/2009/08/php-frameworks-comparison-part-1.html">PHP Frameworks Comparison &#8211; Part 1</a> (completeopensource.blogspot.com)</li>
<li class="zemanta-article-ul-li"><a href="http://r.zemanta.com/?u=http%3A//www.infoworld.com/d/developer-world/php-frameworks-square-238%3Fsource%3Drss_infoworld_news&amp;a=8836140&amp;rid=c124d219-2297-436d-93ff-fa65a03e5444&amp;e=43d3d441e00308fdc5878dd34499e174">PHP frameworks square off</a> (infoworld.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.noupe.com/php/discussing-php-frameworks.html">Discussing PHP Frameworks: What, When, Why and Which?</a> (noupe.com)</li>
<li class="zemanta-article-ul-li"><a href="http://woorkup.com/2009/11/17/exploring-php-frameworks-codeigniter/">Exploring PHP Frameworks: CodeIgniter</a> (woorkup.com)</li>
<li class="zemanta-article-ul-li"><a href="http://woorkup.com/2009/10/10/top-best-php-frameworks-to-build-quickly-complex-web-applications/">Top Best PHP Frameworks to build quickly complex web applications</a> (woorkup.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/c124d219-2297-436d-93ff-fa65a03e5444/"><img class="zemanta-pixie-img" style="border: medium none ; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=c124d219-2297-436d-93ff-fa65a03e5444" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Choice+of+PHP+Frameworks+http%3A%2F%2Fsquio.nl%2F%3Fp%3D511" title="Post to Twitter"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Choice+of+PHP+Frameworks+http%3A%2F%2Fsquio.nl%2F%3Fp%3D511" title="Post to Twitter">Tweet This</a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/&amp;title=Choice+of+PHP+Frameworks" title="Post to Delicious"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/&amp;title=Choice+of+PHP+Frameworks" title="Post to Delicious">Delicious</a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/&amp;title=Choice+of+PHP+Frameworks" title="Post to Reddit"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/&amp;title=Choice+of+PHP+Frameworks" title="Post to Reddit">Reddit This Post</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/&amp;title=Choice+of+PHP+Frameworks" title="Post to StumbleUpon"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/&amp;title=Choice+of+PHP+Frameworks" title="Post to StumbleUpon">Stumble This Post</a></p></div><div class='wpfblike' style='height: 40px;'><fb:like href='http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div><img src="http://squio.nl/blog/?ak_action=api_record_view&id=511&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://squio.nl/blog/2009/11/10/choice-of-php-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use your blog as shortened URL service</title>
		<link>http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/</link>
		<comments>http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 14:44:26 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[is.gd]]></category>
		<category><![CDATA[TinyURL]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[WordTwit]]></category>

		<guid isPermaLink="false">http://squio.nl/blog/?p=352</guid>
		<description><![CDATA[Image by Duane Storey via Flickr I just discovered and installed a very nice WordPress plugin, WordTwit. The main purpose of this plugin is to tweet your new blog posts on Twitter, together with a link to the new blog post. So far nothing too shocking new, but the latest version (2.0.x) of the plugin [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 250px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/43626095@N00/3432373067"><img title="WordTwit 2.0" src="http://farm4.static.flickr.com/3345/3432373067_373cc9e18f_m.jpg" alt="WordTwit 2.0" height="185" width="240"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/43626095@N00/3432373067">Duane Storey</a> via Flickr</dd>
</dl>
</div>
</div>
<p>I just discovered and installed a very nice <a class="zem_slink" title="WordPress" rel="homepage" href="http://wordpress.org">WordPress</a> plugin, <a title="You can download WordTwit here" href="http://www.bravenewcode.com/wordtwit/">WordTwit</a>. The main purpose of this plugin is to <em>tweet</em> your new blog posts on <a class="zem_slink" title="Twitter" rel="homepage" href="http://twitter.com">Twitter</a>, together with a link to the new blog post.</p>
<p>So far nothing too shocking new, but the latest version (2.0.x) of the plugin adds the option to use your own blog as <em>url shortening and redirecting service</em>. Think <a class="zem_slink" title="TinyURL" rel="homepage" href="http://www.tinyurl.com">tinyurl.com</a>, <a class="zem_slink" title="is.gd" rel="homepage" href="http://is.gd">is.gd</a> or one of the gazillion alternatives out there.</p>
<p>Now that is really cool. Except it didn&#8217;t work for me.</p>
<p>Turns out that there was a little bug if your blog is not served off the root or your domain, but a sub directory instead (which is /blog in my case).</p>
<p>So, a <a title="Shortened link to patch on vendors site" href="http://squio.nl/w7">patch</a> (shortened link, noticed?) solved this and all should be set to go now.</p>
<p>Oh and this post is serving as a test post for the Twitter update&#8230;</p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/08fcac3f-03b3-4d95-9587-84789d2b71a8/" title="Reblog this post [with Zemanta]"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=08fcac3f-03b3-4d95-9587-84789d2b71a8" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Use+your+blog+as+shortened+URL+service+http%3A%2F%2Fsquio.nl%2F%3Fp%3D352" title="Post to Twitter"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Use+your+blog+as+shortened+URL+service+http%3A%2F%2Fsquio.nl%2F%3Fp%3D352" title="Post to Twitter">Tweet This</a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/&amp;title=Use+your+blog+as+shortened+URL+service" title="Post to Delicious"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/&amp;title=Use+your+blog+as+shortened+URL+service" title="Post to Delicious">Delicious</a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/&amp;title=Use+your+blog+as+shortened+URL+service" title="Post to Reddit"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/&amp;title=Use+your+blog+as+shortened+URL+service" title="Post to Reddit">Reddit This Post</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/&amp;title=Use+your+blog+as+shortened+URL+service" title="Post to StumbleUpon"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/&amp;title=Use+your+blog+as+shortened+URL+service" title="Post to StumbleUpon">Stumble This Post</a></p></div><div class='wpfblike' style='height: 40px;'><fb:like href='http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div><img src="http://squio.nl/blog/?ak_action=api_record_view&id=352&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://squio.nl/blog/2009/06/05/use-your-blog-as-shortened-url-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix for error in WordPress rss feed module</title>
		<link>http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/</link>
		<comments>http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:14:19 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Atom]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://squio.nl/blog/?p=264</guid>
		<description><![CDATA[Using WordPress 2.7.1, there is a problem with the Atom feed export. In the apache error log are many occurrences of these two lines: Bad arguments. in /var/www/.../wp-includes/rss.php on line 175, The first argument, 'map_attrs', should be either NULL or a valid callback The problem appears to be a simple coding error: the callback function [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div class="wp-caption alignright" style="width: 111px"><a href="http://www.flickr.com/photos/11678844@N07/2985330439"><img title="WordPress Pumpkin" src="http://farm4.static.flickr.com/3288/2985330439_fd23744f6c_m.jpg" alt="WordPress Pumpkin" width="101" height="67" /></a><p class="wp-caption-text">Image by Eric M Martin via Flickr</p></div>
</div>
<p>Using <a class="zem_slink" title="WordPress" rel="homepage" href="http://wordpress.org">WordPress 2.7.1</a>, there is a problem with the <a class="zem_slink" title="Atom (standard)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Atom_%28standard%29">Atom feed</a> export.</p>
<p>In the apache error log are many occurrences of these two lines:</p>
<pre style="clear:both">Bad arguments. in /var/www/.../wp-includes/rss.php on line 175,
The first argument, 'map_attrs', should be either NULL or a valid callback</pre>
<p>The problem appears to be a simple coding error: the <a title="PHP documentation for callback" href="http://www.php.net/manual/en/language.pseudo-types.php#language.types.callback">callback function</a> should be called as array reference, <em>array(object, user_func).</em></p>
<p>This has been reported as <a title="Wordpress Trac issue #9225" href="https://core.trac.wordpress.org/ticket/9225">issue #9225</a>, read on if you want to fix it for yourself right away&#8230;</p>
<p><span id="more-264"></span></p>
<p>This patch solves the problem (against trunk, <em>rev. 10641</em>):</p>
<pre class="wiki">Index: rss.php
===================================================================
--- rss.php	(revision 10641)
+++ rss.php	(working copy)
@@ -170,7 +170,7 @@
 		{
 			// if tags are inlined, then flatten
 			$attrs_str = join(' ',
-					array_map('map_attrs',
+					array_map(array($this, 'map_attrs'),
 					array_keys($attrs),
 					array_values($attrs) ) );</pre>
<p>In plain English: open file <em>wp-includes/rss.php,</em> find the line containing &#8216;<em>map_attrs</em>&#8216; and replace this string by <em>array($this, &#8216;map_attrs&#8217;).</em></p>
<p>That&#8217;s all folks!</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/8e181286-09c5-4e5b-9168-45846c03f746/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=8e181286-09c5-4e5b-9168-45846c03f746" alt="Reblog this post [with Zemanta]" /></a></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Fix+for+error+in+WordPress+rss+feed+module+http%3A%2F%2Fsquio.nl%2F%3Fp%3D264" title="Post to Twitter"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Fix+for+error+in+WordPress+rss+feed+module+http%3A%2F%2Fsquio.nl%2F%3Fp%3D264" title="Post to Twitter">Tweet This</a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/&amp;title=Fix+for+error+in+WordPress+rss+feed+module" title="Post to Delicious"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/&amp;title=Fix+for+error+in+WordPress+rss+feed+module" title="Post to Delicious">Delicious</a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/&amp;title=Fix+for+error+in+WordPress+rss+feed+module" title="Post to Reddit"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/&amp;title=Fix+for+error+in+WordPress+rss+feed+module" title="Post to Reddit">Reddit This Post</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/&amp;title=Fix+for+error+in+WordPress+rss+feed+module" title="Post to StumbleUpon"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/&amp;title=Fix+for+error+in+WordPress+rss+feed+module" title="Post to StumbleUpon">Stumble This Post</a></p></div><div class='wpfblike' style='height: 40px;'><fb:like href='http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div><img src="http://squio.nl/blog/?ak_action=api_record_view&id=264&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://squio.nl/blog/2009/02/24/fix-for-error-in-wordpress-rss-feed-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress config &amp; database charset</title>
		<link>http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/</link>
		<comments>http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 21:32:43 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Character encoding]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[UTF-8]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://squio.nl/blog/?p=171</guid>
		<description><![CDATA[As part of upgrading to WordPress 2.7, the character encoding of some existing posts appeared suddenly broken. Turns out that the charset specification from wp-config.php was not interpreted correctly any longer as UTF-8; changing the name from &#8216;utf8&#8216; (without dash) to &#8216;utf-8&#8216; did the trick. Update Feb 24: my error log shows lots and lots [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div class="wp-caption alignright" style="width: 95px"><a href="http://www.crunchbase.com/product/wordpress"><img title="Image representing WordPress as depicted in Cr..." src="http://www.crunchbase.com/assets/images/resized/0001/6548/16548v2-max-450x450.png" alt="Image representing WordPress as depicted in Cr..." width="85" height="82" /></a><p class="wp-caption-text">Image via CrunchBase</p></div>
</div>
<p>As part of upgrading to <a title="Wordpress 2.7 Coltrane" href="http://wordpress.org/development/2008/12/coltrane/">WordPress 2.7</a>, the <a class="zem_slink" title="Character encoding" rel="wikipedia" href="http://en.wikipedia.org/wiki/Character_encoding">character encoding</a> of some existing posts appeared suddenly broken.</p>
<p>Turns out that the charset specification from <code>wp-config.php</code> was not interpreted correctly any longer as <a class="zem_slink" title="UTF-8" rel="wikipedia" href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a>; <span style="text-decoration: line-through;">changing the name from &#8216;<code>utf8</code>&#8216; (without dash) to &#8216;<code>utf-8</code>&#8216; did the trick</span>.</p>
<p><strong>Update Feb 24</strong>: my error log shows lots and lots of warnings like these:</p>
<pre>WordPress database error Unknown character set: 'utf-8' for
  query SET NAMES 'utf-8' made by require, require_once,
  require_once, require_once, require_wp_db, require_once</pre>
<p>The right solution seems to remove (comment) the line specifying the <code>DB_CHARSET</code> alltogether:</p>
<pre>/** Database Charset to use in creating database tables. */
// define('DB_CHARSET', 'utf8');</pre>
<p>Read more about editing <a title="Editing wp-config" href="http://codex.wordpress.org/Editing_wp-config.php">wp-config</a> (wordpress.org)&#8230;</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/8b655181-5cea-4979-99dd-8dd4d63d1c2b/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=8b655181-5cea-4979-99dd-8dd4d63d1c2b" alt="Reblog this post [with Zemanta]" /></a></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=WordPress+config+%26+database+charset+http%3A%2F%2Fsquio.nl%2F%3Fp%3D171" title="Post to Twitter"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=WordPress+config+%26+database+charset+http%3A%2F%2Fsquio.nl%2F%3Fp%3D171" title="Post to Twitter">Tweet This</a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/&amp;title=WordPress+config+%26+database+charset" title="Post to Delicious"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/&amp;title=WordPress+config+%26+database+charset" title="Post to Delicious">Delicious</a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/&amp;title=WordPress+config+%26+database+charset" title="Post to Reddit"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/&amp;title=WordPress+config+%26+database+charset" title="Post to Reddit">Reddit This Post</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/&amp;title=WordPress+config+%26+database+charset" title="Post to StumbleUpon"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/&amp;title=WordPress+config+%26+database+charset" title="Post to StumbleUpon">Stumble This Post</a></p></div><div class='wpfblike' style='height: 40px;'><fb:like href='http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div><img src="http://squio.nl/blog/?ak_action=api_record_view&id=171&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://squio.nl/blog/2009/01/06/wordpress-config-database-charset/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using pagination with CakePHP&#8217;s finderQuery SQL</title>
		<link>http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/</link>
		<comments>http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 10:19:52 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[finderQuery]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[Nigel McNie]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[patch]]></category>

		<guid isPermaLink="false">http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/</guid>
		<description><![CDATA[Update February 2009: this article is now about a year old and deals with an early beta versions of CakePHP 1.2. In the mean time, CakePHP 1.2 has been released with many improvements and great documentation. Please don&#8217;t use this patch, use this instead. I&#8217;ll leave the article below for reference. Cakephp lets you define [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float: right; width: 100px; height: 100px;" src="http://squio.nl/blog/wp-content/2008/02/cake12b.png" alt="Cakephp 1.2" /></p>
<p><strong>Update</strong> February 2009: this article is now about a year old and deals with an early beta versions of <a class="zem_slink" title="CakePHP" rel="homepage" href="http://www.cakephp.org">CakePHP</a> 1.2. In the mean time, CakePHP 1.2 has been released with many improvements and great <a href="http://book.cakephp.org/">documentation</a>. Please don&#8217;t use this <a class="zem_slink" title="Patch (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Patch_%28computing%29">patch</a>, use <a title="Custom Query Pagination" href="http://book.cakephp.org/view/249/Custom-Query-Pagination">this</a> instead. I&#8217;ll leave the article below for reference.</p>
<p>Cakephp lets you define various kinds of associations between models. The principle is really simple, just define arrays like <code>$hasMany</code> in your main model, where associations with other models are defined.</p>
<p>For most purposes this does the trick, most associations are made by convention, but you can  override these as well for e.g. database (foreign-) keys.</p>
<p>From there on, you can use all cake built-in functionality to retrieve model data. One such feature is auto pagination, where the page size is set through the value of the <code>limit</code> field in the model&#8217;s definition.</p>
<p>If you&#8217;re crafting something really complex, you can define your own SQL query in the <code>finderQuery</code> field. This is very nice, but the trade-of is that the other fields are ignored in the query. And if fields <code>limit</code> and <code>offset</code> are ignored, you no longer get auto pagination.</p>
<p>The patch below fixes this for the current development tree of CakePHP 1.2 (revision 6461).<br />
<span id="more-148"></span></p>
<p>This patch inspects the <code>finderQuery</code> SQL and applies the values of the relevant model fields if the SQL does not contain a value for <code>LIMIT</code> and <code>ORDER BY</code>, respectively.</p>
<p>So now you have:</p>
<ul>
<li><code>limit</code> value from model applied, unless LIMIT is defined in <code>finderQuery</code></li>
<li><code>order</code> value from model or application query applied, unless ORDER BY is defined in <code>finderQuery</code></li>
<li><code>offset</code> value from model or application query applied, unless LIMIT is defined in <code>finderQuery</code></li>
</ul>
<p>Patch for <code>/cake/libs/model/datasources/dbo_source.php</code></p>
<p><!-- 	.li1 {background:#f4f4f4;} 	.li2 {background:#ffffff;} 	/* GeSHi (c) Nigel McNie 2004 (<a href="http://qbnz.com/highlighter" rel="nofollow">http://qbnz.com/highlighter</a>) */ .diff .imp {font-weight: bold; color: red;} .diff .kw1 {color: #aaaaaa; font-style: italic;} .diff .kw2 {color: #dd6611;} .diff .re0 {color: #440088;} .diff .re1 {color: #991111;} .diff .re2 {color: #00b000;} .diff .re3 {color: #888822;} .diff .re4 {color: #888822;} .diff .re5 {color: #0011dd;} .diff .re6 {color: #440088;} .diff .re7 {color: #991111;} .diff .re8 {color: #00b000;} .diff .re9 {color: #888822;} --></p>
<div class="pastes">
<div class="body">
<div class="diff" style="overflow: auto; font-family: monospace; width: 100%; white-space: nowrap;">
<ol>
<li class="li1">
<div class="de1">Index: dbo_source.php</div>
</li>
<li class="li2">
<div class="de2">===================================================================</div>
</li>
<li class="li1">
<div class="de1"><span class="re3">&#8212; dbo_source.php  <span class="br0">(</span>revision <span class="nu0">6461</span><span class="br0">)</span></span></div>
</li>
<li class="li2">
<div class="de2"><span class="re4">+++ dbo_source.php  <span class="br0">(</span>working copy<span class="br0">)</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re6">@@ <span class="nu0">-1046</span>,<span class="nu0">7</span> <span class="nu0">+1046</span>,<span class="nu0">19</span> @@</span></div>
</li>
<li class="li2"></li>
<li class="li1">
<div class="de1">if <span class="br0">(</span>$external &amp;&amp; isset<span class="br0">(</span>$assocData<span class="br0">[</span>'finderQuery'<span class="br0">]</span><span class="br0">)</span><span class="br0">)</span> <span class="br0">{</span></div>
</li>
<li class="li2">
<div class="de2">if <span class="br0">(</span>!empty<span class="br0">(</span>$assocData<span class="br0">[</span>'finderQuery'<span class="br0">]</span><span class="br0">)</span><span class="br0">)</span> <span class="br0">{</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re7">-            return $assocData<span class="br0">[</span>'finderQuery'<span class="br0">]</span>;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re8">+            $qry = $assocData<span class="br0">[</span>'finderQuery'<span class="br0">]</span>;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re8">+            // if no ORDER is specified in finderquery, use model definition</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re8">+            if <span class="br0">(</span>!preg_match<span class="br0">(</span>&#8216;/\sORDER\s+BY\s/i&#8217;, $qry<span class="br0">)</span><span class="br0">)</span> <span class="br0">{</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re8">+               $orderData = <span class="br0">(</span>empty<span class="br0">(</span>$queryData<span class="br0">[</span>'order'<span class="br0">]</span><span class="br0">)</span><span class="br0">)</span> ? $assocData<span class="br0">[</span>'order'<span class="br0">]</span> : $queryData<span class="br0">[</span>'order'<span class="br0">]</span>;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re8">+               $qry .= &#8216; &#8216; . $this-&gt;order<span class="br0">(</span>$orderData<span class="br0">)</span>;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re8">+            <span class="br0">}</span></span></div>
</li>
<li class="li2">
<div class="de2"><span class="re8">+            // if no LIMIT/OFFSET is specified in finderquery, use model definition</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re8">+            if <span class="br0">(</span>!preg_match<span class="br0">(</span>&#8216;/\sLIMIT\s/i&#8217;, $qry<span class="br0">)</span><span class="br0">)</span> <span class="br0">{</span></span></div>
</li>
<li class="li2">
<div class="de2"><span class="re8">+               $limitData = <span class="br0">(</span>empty<span class="br0">(</span>$queryData<span class="br0">[</span>'limit'<span class="br0">]</span><span class="br0">)</span><span class="br0">)</span> ? @$assocData<span class="br0">[</span>'limit'<span class="br0">]</span> : $queryData<span class="br0">[</span>'limit'<span class="br0">]</span>;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re8">+               $offsetData = <span class="br0">(</span>empty<span class="br0">(</span>$queryData<span class="br0">[</span>'offset'<span class="br0">]</span><span class="br0">)</span><span class="br0">)</span> ? @$assocData<span class="br0">[</span>'offset'<span class="br0">]</span> : $queryData<span class="br0">[</span>'offset'<span class="br0">]</span>;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re8">+               $qry .= &#8216; &#8216; . $this-&gt;limit<span class="br0">(</span>$limitData, $offsetData<span class="br0">)</span>;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re8">+            <span class="br0">}</span></span></div>
</li>
<li class="li2">
<div class="de2"><span class="re8">+            return $qry;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">}</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">}</span></div>
</li>
<li class="li1"></li>
<li class="li2"></li>
</ol>
</div>
</div>
</div>
<div class="tags"><a href="http://technorati.com/tag/cakephp" rel="tag">cakephp</a> <a href="http://technorati.com/tag/patch" rel="tag"> patch</a> <a href="http://technorati.com/tag/mvc" rel="tag"> mvc</a> <a href="http://technorati.com/tag/php" rel="tag"> php</a> <a href="http://technorati.com/tag/finderQuery" rel="tag"> finderQuery</a> <a href="http://technorati.com/tag/pagination" rel="tag"> pagination</a></div><br />
[ratings]</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/99c0e8ef-9e3b-45e6-a5d9-f3862367c442/"><img class="zemanta-pixie-img" style="border: medium none ; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=99c0e8ef-9e3b-45e6-a5d9-f3862367c442" alt="Reblog this post [with Zemanta]" /></a></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Using+pagination+with+CakePHP%E2%80%99s+finderQuery+SQL+http%3A%2F%2Fsquio.nl%2F%3Fp%3D148" title="Post to Twitter"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Using+pagination+with+CakePHP%E2%80%99s+finderQuery+SQL+http%3A%2F%2Fsquio.nl%2F%3Fp%3D148" title="Post to Twitter">Tweet This</a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/&amp;title=Using+pagination+with+CakePHP%E2%80%99s+finderQuery+SQL" title="Post to Delicious"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/&amp;title=Using+pagination+with+CakePHP%E2%80%99s+finderQuery+SQL" title="Post to Delicious">Delicious</a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/&amp;title=Using+pagination+with+CakePHP%E2%80%99s+finderQuery+SQL" title="Post to Reddit"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/&amp;title=Using+pagination+with+CakePHP%E2%80%99s+finderQuery+SQL" title="Post to Reddit">Reddit This Post</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/&amp;title=Using+pagination+with+CakePHP%E2%80%99s+finderQuery+SQL" title="Post to StumbleUpon"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/&amp;title=Using+pagination+with+CakePHP%E2%80%99s+finderQuery+SQL" title="Post to StumbleUpon">Stumble This Post</a></p></div><div class='wpfblike' style='height: 40px;'><fb:like href='http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div><img src="http://squio.nl/blog/?ak_action=api_record_view&id=148&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://squio.nl/blog/2008/02/26/using-pagination-with-cakephps-finderquery-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cakephp: isAjax weirdness</title>
		<link>http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/</link>
		<comments>http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 11:43:20 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[ajax]]></category>

		<guid isPermaLink="false">http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/</guid>
		<description><![CDATA[Currently, I&#8217;m doing a project in CakePHP. There&#8217;s lots to say about cake, here just a quick note, for myself or for anyone in case you are running into the same problem. Situation: you are using the Ajax helper, which contains a method isAjax() &#8211; returns true if the request was an Ajax request. Typically, [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://squio.nl/blog/wp-content/2008/02/cake12b.png' alt='Cakephp 1.2' style="float:right;width:100px;height:100px" />Currently, I&#8217;m doing a project in CakePHP.</p>
<p>There&#8217;s lots to say about cake, here just a quick note, for myself or for anyone in case you are running into the same problem.</p>
<p>Situation: you are using the Ajax helper, which contains a method <code>isAjax()</code> &#8211; returns <code>true</code> if the request was an Ajax request.</p>
<p>Typically, you use this method inside a view, to conditionally render content for regular/ajax views. Example:</p>
<p><code>...<br />
if (! $ajax->isAjax()) {<br />
  // render general page stuff<br />
}<br />
  // render stuff for both regular- and ajax view<br />
...<br />
</code></p>
<p>My problem was that the <code>isAjax()</code> call never returned true, regardless of ajax/regular request method.</p>
<p>The solution appears to be really simple: you should include the <code>'RequestHandler'</code> component in your controller class. This one took me way too long to figure out! </p>
<p><code><br />
	public $components = array (<br />
		'Auth',<br />
		'Cookie',<br />
		'RequestHandler'<br />
	);<br />
</code></p>
<p><strong>Update</strong> my situation was even worse than described above; I use a redirect between controllers within an Ajax call, something which is officially supported by Cake 1.2. This worked just fine in Safari, but not in Firefox (and Opera) &#8211; these browsers would not load the Ajax view but rather the complete page, almost crashing the server by consuming huge amounts of memory.</p>
<p>Read on&#8230;<span id="more-146"></span></p>
<p>Lots and lots of troubleshooting did not help, after which I tried my last bet: update Cake to the current development build.<br />
And that appeared to be <em>the</em> solution! Not only solves this the Ajax detection problem, the whole application seems to be much more efficient too.</p>
<p>The Cake SVN repository is organised somewhat unconventional. A quick recipe for getting the last development revision&#8230;</p>
<p>The repository is rooted at <a href="https://svn.cakephp.org/repo/">https://svn.cakephp.org/repo/</a>.</p>
<p>There are the common subdirectories, amongst others:</p>
<ul>
<li>branches</li>
<li>tags</li>
<li>trunk</li>
</ul>
<p>In this case, Trunk contains the last released (beta) versions, while branches contain, well, the trunk repository.<br />
So in order to get the current HEAD release, you have to get the source from <a href="https://svn.cakephp.org/repo/branches/1.2.x.x/">/branches/1.2.x.x</a>.</p>
<p>Command line:</p>
<p><code>svn co <a href="https://svn.cakephp.org/repo/branches/1.2.x.x/" rel="nofollow">https://svn.cakephp.org/repo/branches/1.2.x.x/</a></code></p>
<p>I&#8217;m working with revision 6461, highly recommended!</p>
<div class="tags"><a href="http://technorati.com/tag/cakephp" rel="tag">cakephp</a> <a href="http://technorati.com/tag/mvc" rel="tag"> mvc</a> <a href="http://technorati.com/tag/ajax" rel="tag"> ajax</a> <a href="http://technorati.com/tag/isajax" rel="tag"> isajax</a></div><br />
[ratings]</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Cakephp%3A+isAjax+weirdness+http%3A%2F%2Fsquio.nl%2F%3Fp%3D146" title="Post to Twitter"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Cakephp%3A+isAjax+weirdness+http%3A%2F%2Fsquio.nl%2F%3Fp%3D146" title="Post to Twitter">Tweet This</a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/&amp;title=Cakephp%3A+isAjax+weirdness" title="Post to Delicious"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/&amp;title=Cakephp%3A+isAjax+weirdness" title="Post to Delicious">Delicious</a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/&amp;title=Cakephp%3A+isAjax+weirdness" title="Post to Reddit"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/&amp;title=Cakephp%3A+isAjax+weirdness" title="Post to Reddit">Reddit This Post</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/&amp;title=Cakephp%3A+isAjax+weirdness" title="Post to StumbleUpon"><img class="nothumb" src="http://squio.nl/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/&amp;title=Cakephp%3A+isAjax+weirdness" title="Post to StumbleUpon">Stumble This Post</a></p></div><div class='wpfblike' style='height: 40px;'><fb:like href='http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div><img src="http://squio.nl/blog/?ak_action=api_record_view&id=146&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://squio.nl/blog/2008/02/14/cakephp-isajax-weirdness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

