Websites. Wordpress. Genesis.

WordCamp NYC 2009

Picture 1I’m throwing around the idea of possibly making a trip up to NYC for WordCamp in a few weeks.

The sessions are are lined up, there are a ton of great speakers, and many of the characters from #wordpress will be in attendance (*cough* sivel, ansi, jdingman, etc).

Not worried about airfare (Go Southwest! ha) or registration, however I am looking for help on lodging.

There is a hotel within walking distance that has a 15% discount, bringing it down to ~ $210/night. I wanted to see if anyone who was thinking about attending would want to maybe slplit a room.

Alternately, anyone have any other recommendations for places to stay? I’d prefer to not shell out $210 a night by myself unless I must. After all in Texas $210 a night would damn near get you a suite! Stupid inflation. ;)

WordPress parent and sub category IDs

The current project I am working left me needing to access the category ID (parent) and sub category ID for the sidebar.php

I have several sections in the sidebar for posts using is_single() that get the most popular posts, recent posts, etc. The problem using the code below – which works if you don’t deal with sub categories – is it only gets the parent category ID.

 $categories = get_the_category();
 $this_cat_ID = $categories[0]->cat_ID;
 $this_cat_name = $categories[0]->cat_name;
 $this_cat_url = get_category_link($this_cat_ID);

For example:
I have News category that has an ID of 6, a Press Release sub category with the ID of 7, and a TV Coverage sub category with the ID of 8.
The sidebar.php contains a block that displays the most recent posts.
If I am viewing a press release post (single.php) I want to see the the only latest Press Release posts. Using $this_cat_ID, which is the parent category ID, it is going to show all the posts in the News including not only Press Release but also TV Coverage.

It’s easy to get the parent category id as I showed above, and while it isn’t difficult to get the sub category ID (or IDs if you have more than one), most examples I found on the WP.org forums didn’t do what I needed. You need to add a few lines to get the sub cat.

$categories = get_the_category();
 $this_cat_ID = $categories[0]->cat_ID;
 $this_cat_name = $categories[0]->cat_name;
 $this_cat_url = get_category_link($this_cat_ID);
 // get the sub category if we have them
 foreach ($categories as $cat) {
    $parent = $cat->category_parent;
    if ($parent != 0 ){
       $sub_cat_ID = $cat->cat_ID;
       $sub_cat_name = $cat->cat_name;
       $sub_cat_url = get_category_link($sub_cat_ID);
    }
 }

With this code you still have access to the parent category ID but also gain the sub category ID.

All that is left is to just write a quick function that checks to see if there is a sub category, something that contains:

if (!$sub_cat_ID) {
   echo $this_cat_ID;
} else {
   echo $sub_cat_ID;
}

Problem solved! Now viewing a post filed under News will show the most recent News posts, a post filed under Press Coverage will show the most recent Press Coverage posts, and so on.

FYI – this method only works if you are going to have a post in one sub category at a time, otherwise you will have to modify things so the sub category info gets stuck in an array.

Making Gmail and OSX play nice

I’ve been using Gmail IMAP for my jaredatchison.com mail for over a year. Google App for your domain is nothing short of fantastic. You get to use Gmail on your domain, get the use the pretty web gmail interface, and also get to tap into Google’s fine tuned spam filtering.

The downside is when you try to use IMAP instead of POP3. Things get funky – real fast. This is not a application problem, but is because Google IMAP is very non-traditional in the way it handles labels as folders as well as some other quirks.

I love the Gmail web interface, but at the same time I need a stand alone application. I use the OSX address book and need an application that can tap into that. If I want to use the Gmail web interface my only option is to regularly export my address book and import it in Gmail – something I shouldn’t have to do.

That said, I have tried a few mail apps for OSX and figured I would share my results.

Mail.app

I love Apple’s built-in Mail.app and have been using it since I switched to OSX full time over 2 years ago. It’s fast and sexy. Unfortunately it does not play nice with Gmail’s IMAP workings. If you want to use Mail.app be prepared to do a fair amount of searching to figure out the best tricks to get it working sort of working. Mail.app’s downside is handing Gmail’s labels-instead-of-folders method. From my expereince it can get ugly. At one point in time I had a configuration that worked well enough to use, but things such as my Sent folder often got out of sync just ended up causing a nightmare.

mailapp

Have Snow Leopard? Good luck. I made the upgrade to Snow Leopard hoping the newest version of Mail.app improved on things. In reality, it actually got worse. A quick search revealed the new Mail.app is even more difficult to get working with Gmail IMAP. After reading this I decided not to waste more time tricking things to work right and started looking for other options.

Mailplane

If you have used Google Chrome – which means you own a PC since there is still no official Mac release (they say by year end!) – you might have played with the ability to create a “stand alone app”.  This is what Mailplane does but with a plethora of extra features. What extra features?

  • Drag and drop attachments
  • Use multiple Gmail accounts
  • Get new mail notifications (Growl)
  • Send screenshots
  • Enjoy Gmail shortcuts
  • Integrate with OmniFocus

mailplane

If you want a stand-alone app and like the Gmail interface this app is likely for you. I used it heavily for a month (there is a free 30 day demo) and had no problems at all. Ultimately I decided not to use it because, since it is still based on Gmail’s web client, there is no address book integration.

Thunderbird

The last app I tested out, and the one I decided to ultimately stick with (for now) was Mozollia Thunderbird. I’m all for open source and use Firefox, so it seemed logical.

First I tested Thunderbird 2. This is the version you get if you just go to the main website and download. It worked, but wasn’t pretty, seemed very aged, and again – no address book support.

Then I began to Google. What is this? Thunderbird 3 you say? OSX Address Book support? Completely redesigned interface? Works with Gmail? I got excited fast.

tbird3b2_e

Well here I am 2 weeks later happy to report that I am using Thunderbird 3 Beta 4 preview and it’s kicking ass and taking names. Gmail IMAP is working with minimal tweaking. Just download T3 beta 4, setup your account using the Gmail IMAP Thunderbird 2 instructions, and finally tweak a few things to follow the recommended IMAP Thunderbird 2 settings.

Hopefully this might help anyone who has been trying to get a Google IMAP usable in OSX.

New keyboard saves my sanity

Next month (November) marks the 2 year anniversary of “the switch”. It will be 2 years since I retired my PC, bought a Macbook Pro, and starting using OSX full time.

When I bought my original Macbook Pro two years ago I purchased the new sleek low profile Apple keyboard. I liked it so much I got one to use with my iMac at work.

slim and sexy

slim and sexy

After two years of using Apple’s famous slim form keyboard, today I am retiring it. How can I part with such a slender and graceful piece of equipment you might be wondering? It all came down to ergonomics. I love that keyboard, I really do. However having one at home and at work, I was typing on it an easy 10 hour/day. This keyboard design is not accommodating to heavy usage – far from it. By mid day it was just not comfortable – my wrists ached and fingers were sore. I need keys with more resistance. I need a place to put my wrist.

About a week ago I had enough. Clearly Steve didn’t give a shit if his keyboard was made for people who actually use the computer for real work. Appearance over functionality! That is the Apple way isn’t it? Thus I started my quest to find a replacement. I quickly figured out why many people use that slim finger torturer Apple sells: the number of “mac” keyboards (command key, not windows key!) is few and far between.

Regardless of the small selection I was finally able to find a replacement that is working just fine. It’s not even comparable to Apple’s when it comes to comfort. To top it off, it’s a Microsoft keyboard. Did I mention it was dirt cheap? Oh, and it came with a mouse. Yes, really.

new hotness

new hotness

So if you are looking for a solid ergonomic keyboard for your Mac look no further than the Microsoft Wireless Laser Keyboard (and Mouse). The whole combo is $25 bucks off of Amazon.

WordPress 2.8.5 released

WordPress 2.8.5 has been released and is up for download. Nothing exciting to see as it just addresses the exploit that was published this morning plus a few minor things. From the WordPress.org post:

  • A fix for the Trackback Denial-of-Service attack that is currently being seen.
  • Removal of areas within the code where php code in variables was evaluated.
  • Switched the file upload functionality to be whitelisted for all users including Admins.
  • Retiring of the two importers of Tag data from old plugins.

So get your installs up to date by downloading or upgrade in the admin panel!

WordPress trackback exploit found

Around 9am (CST) this morning we were alerted via the wp-hackers mailing list that there is an exploit out that affects the latest version of WordPress, v 2.8.4.

If you want to read more about all the technical stuff you can find the original blog post detailing the exploit here.

I wouldn’t say this is critical since your data is not at risk but anytime someone can put heat on your server it is not good.

No word yet if a patch is going to be released in the form of WordPress 2.8.5. There are a few fixes out already however.

There is a chunk of code you can paste into your theme’s functions.php file.

function ft_stop_trackback_dos_attacks(){
	global $pagenow;
	if ( 'wp-trackback.php' == $pagenow ){
		// DoS attack fix.
		if ( isset($_POST['charset']) ){
			$charset = $_POST['charset'];
			if ( strlen($charset) > 50 ) {  die; }
		}
	}
}
add_action('init','ft_stop_trackback_dos_attacks');

There is also already a fix on trac.

Changing category slug in WPMU

So apparently you can’t change category slugs in WordPress MU. At least not without using phpmyadmin.

If you run into this problem and you don’t have access to phpmyadmin (or don’t want to give users access to it) the Edit Category Slug plugin is your answer. Works flawlessly in WPMU 2.8.4a.

WordPress 2.9 Features

WordPress 2.9 is right around the corner. The fearless and brave have already upgraded to 2.9-rare. I think I’ll wait for the beta to come out before I upgrade, which should be in a week or two.

Anyways, Doug Campbell is one of these people who has to live on the bleeding edge I guess. Actually I have no idea – but he did upgrade his blog to 2.9-rare.

He’s posted a quick article about 2.9 and tacked on a very handy feature list. Probably nothing new if you keep up with WordPress, but a good break down never-the-less.

To summarize what’s new in 2.9:

  • Post thumbnails
  • “trash” status.
  • Image editing (resize, crop, flip)
  • widgets outside the sidebar
  • custom post types
  • better media embeds (think viper’s video quicktags)
  • register_theme_directory() function

You can read a few more details in his write up. WordPress 2.9 is expected to be beta by end of October and hopefully released a month after that.