November 18, 2009 at 11:03
· Posted in mobile, php, webdev

Image by miss604 via Flickr
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 machine tags extra love for Four Square venues IDs. I’m just saying…
Now how cool would it be to display a little photo on my Foursquare Layar venue detail pages?
Remembering @codepo8‘s execellent talk at the Fronteers conference last week, I realized that this is where the really cool YQL engine comes in really handy.
And indeed, the following query does it all:
select * from flickr.photos.search
where machine_tags="foursquare:venue=132009"
limit 1
Just save the REST command url, wrap it in a little PHP handler and we’re good to go (homework for next time: process the YQL response in XML format with js/e4x and skip the PHP part altogether).
So now you will see a little thumbnail picture for every venue which has a photo tagged on Flickr. There aren’t many yet, but hey, it’s a start!
See it in action in the Foursquare Layar app on your phone (iPhone, Android) or read my announcement for more background information about the foursquare layar app.
Popularity: 5%
Tweet This
Delicious
Reddit This Post
Stumble This Post
Tags: AR, Flickr, foursquare, layar, webdev, yql
Permalink
November 10, 2009 at 23:57
· Posted in cakephp, opensource, php, webdev

Image via Wikipedia
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 10%. There are also a few stray ones: I don’t consider PEAR a framework and the choice “my own” can be disputed as well.
For now there is no clear winner, something I already had that gut feeling 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.
Popularity: 6%
Tweet This
Delicious
Reddit This Post
Stumble This Post
Tags: cakephp, codeigniter, framework, pear, php, symfony, zend
Permalink
June 5, 2009 at 15:44
· Posted in php, wordpress
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 adds the option to use your own blog as url shortening and redirecting service. Think tinyurl.com, is.gd or one of the gazillion alternatives out there.
Now that is really cool. Except it didn’t work for me.
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).
So, a patch (shortened link, noticed?) solved this and all should be set to go now.
Oh and this post is serving as a test post for the Twitter update…
Popularity: 6%
Tweet This
Delicious
Reddit This Post
Stumble This Post
Tags: bit.ly, is.gd, TinyURL, Twitter, wordpress, WordTwit
Permalink
February 24, 2009 at 16:14
· Posted in php, webdev, wordpress

Image by Eric M Martin via Flickr
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 should be called as array reference, array(object, user_func).
This has been reported as issue #9225, read on if you want to fix it for yourself right away…
Read the rest of this entry »
Popularity: 27%
Tweet This
Delicious
Reddit This Post
Stumble This Post
Tags: Atom, bug, php, RSS, wordpress
Permalink
January 6, 2009 at 22:32
· Posted in php, wordpress

Image via CrunchBase
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 ‘utf8‘ (without dash) to ‘utf-8‘ did the trick.
Update Feb 24: my error log shows lots and lots of warnings like these:
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
The right solution seems to remove (comment) the line specifying the DB_CHARSET alltogether:
/** Database Charset to use in creating database tables. */
// define('DB_CHARSET', 'utf8');
Read more about editing wp-config (wordpress.org)…
Popularity: 28%
Tweet This
Delicious
Reddit This Post
Stumble This Post
Tags: Character encoding, charset, database, encoding, UTF-8, utf8, wordpress
Permalink
February 26, 2008 at 12:19
· Posted in cakephp, php, webdev

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’t use this patch, use this instead. I’ll leave the article below for reference.
Cakephp lets you define various kinds of associations between models. The principle is really simple, just define arrays like $hasMany in your main model, where associations with other models are defined.
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.
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 limit field in the model’s definition.
If you’re crafting something really complex, you can define your own SQL query in the finderQuery field. This is very nice, but the trade-of is that the other fields are ignored in the query. And if fields limit and offset are ignored, you no longer get auto pagination.
The patch below fixes this for the current development tree of CakePHP 1.2 (revision 6461).
Read the rest of this entry »
Popularity: 82%
Tweet This
Delicious
Reddit This Post
Stumble This Post
Tags: cakephp, finderQuery, mvc, Nigel McNie, pagination, patch, php
Permalink