OK, this’ll make users of “proper databases” cringe but because MySQL doesn’t support sub-selects you can’t do the most obvious way of selecting records in one table that aren’t in another. Here’s how it’s done, with a clear explanation of why it works!
select po.id
from po left join pn
on po.id=pn.id
where pn.id is null
Unfortunately, I can’t figure out how to filter the second table as I don’t want to select from the whole table, only a subset. Anyone solved this?
WordPress Tags – Use Them!
Someone on #wordpress asked how they could list the number of posts in every category. They were pointed at this page in the support forum. Even though we’re using Smarty as the templating system here, what’s stated there applies here! Add the following parameter to the call to {list_cats}:optioncount=1
ie. {list_cats optioncount=1 optional='0' all='All' sort_column='name'}
There’s a comprehensive list of WordPress Template Tags on the WP Wiki.
It should be the first port of call for anyone looking for help editing their template as the difference between Smarty syntax and PHP isn’t great and is easily learnt once you’ve digested what the template does.
And here are the docs on custom fields. It should be simple to add a Smarty function that’ll display my pic of the day again! (via the support forum)
WP Database Error – edit.php
Mark found a bug in the backend but it’s been discovered already and discussed. I applied my own fix below..
Error:
Warning: join(): Bad arguments. in …/wp-admin/edit.php on line 13
Fix:
if( is_array( $editable ) == false )
$editable = array( "1" );
$editable = join(',', $editable);
On another note, if you can’t post blog entries as anything other than “Draft” or “Private”, then go to Options->Writing and check “May publish articles” for “Newly registered members:”
Now, if only we could set publishing rights to a certain user level, then new users could publish if the admin set their level high enough.
Silent PC guide
Framing a Photo
A frame can really add to a photo – it’s something I haven’t looked at much, but these two photos, Summer Time and Untitled 1 both use whitespace to good effect! It looks like the subjects are bursting to get out of or squeeze into the frame!
RSS Feeds, with Firefox
Simon tried it, so did Kae, now I’m about to try it. Download Firefox and play with the live bookmarks stuff!
Later – Dougal uses Thunderbird to RSS feeds. That’d make more sense for me too. I’m install Thunderbird 0.8 as we speak!
School Days in Mennonite Country
The author has 3 nice photos in this photo essay although his concerns in the last part are something to think about – is it an invasion of privacy and immoral to take these photos? I don’t think so, but I thought the photos could have been much better if the author had been able to photograph the kids from the front instead of shooting their backs and arousing suspicions.
Street photography is almost always difficult and add to that, on a “lonely country road” I can’t imagine any kids who’d stop to have their photograph taken by a stranger..
Foreign Policy: Hating America
Foreign Policy: Hating America
On September 12, 2001, Jean-Marie Colombani, the editor of Le Monde, famously wrote, “Today we are all Americans.” Three years on, it seems that we are all anti-Americans. Hostility to the United States is deeper and broader than at any point in the last 50 years.
(via dangerousmeta)
Online Photo Printing – !Ireland
Here’s a pretty good guide to Online Photo Printing services, but only if you don’t live in Ireland. I covered a few of the Irish outfits a few months ago here. Since then Spectra Photo have increased their prices, but I must check out Bonus Print yet.
Above the Eye of Hurricane Ivan
Wow! This is a dramatic picture of Hurricane Ivan taken from the ISS. Must be a hell of an experience to see such a powerful force of nature from the serene quiet of space!
