Article Category Archive

Twenty20 cricket in Australia

Twenty20 is all the rage in the cricketing world. The popularity of the shortest form of the game as exploded in recent years, thanks mostly to its faster, more action-packed style and the shorter game time. The ‘length’ of test matches and even traditional 50-over one-day games does still put off many people, but T20 which is all over and done with in three hours is perhaps more accessible to the masses.

Twenty20 is all the rage in the cricketing world. The popularity of the shortest form of the game has exploded in recent years, thanks mostly to its faster, more action-packed style and the shorter game time. The ‘length’ of test matches and even traditional 50-over one-day games does still put off many people, but T20 which is all over and done within three hours is perhaps more accessible to the masses.

Cricket Australia are now looking at changing things up in relation to the domestic cricket landscape. They’ve already announced a new 45-over split-innings concept for the forthcoming domestic one-day season (originally, the change was just going to be trialled in a few games, but now it encompassing the whole season), and now they’ve all but confirmed that the current 6-team Big Bash T20 tournament will make way for a new 8-team competition starting in the 2011-12 season. What changes might this bring? Who knows, but I’ve got more than a few suggestions…

Only cricket lovers, or the curious, really need to continue reading.
» Continue reading “Twenty20 cricket in Australia”

Article 15 Aug 2010 0 comments
·•·

Custom Shortlinks for WordPress

I was lucky and managed to get my hands on a neat little .co domain, djr.co, and I decided that since it is now the shortest domain that I own that I’d first put it to use for the short links on my blog, and as my own personal url shortener.

I was lucky and managed to get my hands on a neat little .co domain, djr.co, and I decided that since it is now the shortest domain that I own that I’d first put it to use for the short links on my blog, and as my own personal url shortener.

The (really) short version

  • I’ve set up Lessn to take care of the personal url shortener side of things
  • And I’m using a simple combination of a WordPress filter function and an .htaccess/index.php redirection combo to handle the shortlinks for my blog.

The long version (for those who want more info)

Personal URL shortener

For the general url shortener there a few different options floating around, but I didn’t need anything super fancy with graphs and counters and all that stuff, I just wanted something simple and easy to setup — and most importantly something that worked. So I went with Shaun Inman’s nice little Lessn script and its working great.

Summary — if you want to set up your own url shortener using your own domain, then give Lessn a go. It is dead simple to setup.

Custom WordPress ‘shortlinks’

As of version 3.0, WordPress now come with a built in function called ‘wp_get_shortlink’ which, as you can probably guess, returns a ‘shortlink’ for the relevant post/page.

By default these ‘shortlinks’ take the form of http://deanjrobinson.com/?p=1345 — which also happens to be the default post links if you don’t have pretty permalinks set up, I’ll explain why this point is important shortly.

Getting djr.co ready for redirection

The first thing I needed to do was to set up things on djr.co and make sure it was working as I expected.

I had considered using the api built into Lessn to auto generate a shortlink when I publish a post, I even found a plugin that would have done it for me pretty easily, however I rules this out for a couple of reasons:

  • It would have meant adding additional meta data fields against posts — not necessarily a bad thing, but also not really necessary for my needs
  • I would have had to either modify my templates to output the new short links, or create a filter to take care of it for me
  • And the main reason was that I wanted ‘shortlinks’ to be available for all my old posts as well — without me having to go back and generate them.

The ‘solution’ I decided on is essentially a really stripped back version of Lessn — without the need to call off to the Lessn database etc because our WP posts already have unique ids which we can use for the redirection. More specifically it just two files a .htaccess file and an index.php file.

First, the .htaccess file, this is exactly the same as the one from Lessn.

This takes the url, eg. http://djr.co/m/1345, and passes it to
http://djr.co/m/index.php?token=1345 ready for the redirection.

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond	%{REQUEST_FILENAME}	!-d
  RewriteCond	%{REQUEST_FILENAME}	!-f
  RewriteRule	(.*) index.php?token=$1	[QSA,L]
</IfModule>

You might be curious as to why I haven’t just redirected it to my primary url using the htaccess, I’ll get to that in a sec.

Second, the simple index.php

This is based on the index.php file from Lessn, but cut down to just what I needed for my blog redirection. That means no need to call any of the Lessn includes, or make any database queries, just grab the id and redirect it off to my blog.

If no ‘token’ is passed though the page will simply return a 404. The two reasons for using this index.php file to handle the actual redirect are so that I can clean up the token (using strip_tags) just in case someone tries something nasty, and so that I can check that the token is numeric (using is_numeric) — this is because WordPress post/page IDs are only numeric, so any other values obviously aren’t going to work anyway.

This is what the cut-down, modified index.php file looks like. You’ll notice that the url format for the ‘Header Location’ matches the default WordPress ‘shortlink’ format I mentioned above. This is because no matter how you have your pretty permalinks set up, these default links will always work.

<?php

if (!empty($_GET['token'])) {
  $id = strip_tags($_GET['token']);
  if(is_numeric($id)) {
    header($_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently');
    header('Location:http://deanjrobinson.com/?p='.$id);
    exit();
  }
}

header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
header('Status:404');
die('404 Not Found');

?>

Getting WordPress to use these custom shortlinks

To get this working, all I needed to do was add a really simple ‘filter’ to the functions.php file in my current theme.

I’m using a filter so that I can continue to use the built-in ‘wp_get_shortlink’ function that is available in WordPress (since 3.0). This function can be used something like this:

<a href="<?php echo wp_get_shortlink(); ?>" title="ShortURL for this post">Short URL</a>

By running the filter over the standard function not only do I not have to update any of my theme templates, I will also be able to retrieve my custom short url by using the “Get Shortlink” button that has been added to the create/edit post screen in the WordPress admin, just below the post title.

<?php

function my_custom_shortlink_filter() {
  global $post;
  return 'http://djr.co/m/'.$post->ID;
}
add_filter('get_shortlink','my_custom_shortlink_filter');

?>

Best of all, because the shortlinks are based on the unique post ids (which every post has) the shortlinks will instantly work for all my posts going right back to the beginning of this blog without me needing to change anything else. Yay.

Article 23 Jul 2010 1 comment
·•·

Fluency Admin 2.3 now available

Now compatible with WordPress 3.0. I’ve also added more customisation options including iPad friendly menus, and the ability to turn on/off hover menus and hot keys as needed.

Fluency Admin 2.3 now available

Fluency 2.3 is a recommended upgrade for all Fluency users who’ve already upgraded to WordPress 3.0 (which was released earlier this week). Included in this update, in addition to WP3.0 support, are fixes for a number of small issues that were pointed out by users over the past 6 months, and a few additional options to ‘fine-tune’ how you use Fluency.

Well, what are you waiting for? Read more about the updates here, or head to your admin panel to upgrade/install Fleucny 2.3 (of course, you can also jump straight over to WordPress.org to grab the download from there too.)

As always, if you spot a bug or something I’ve missed please let me know. The best place for you to do so is in my help forums, or, if you prefer, in the WordPress.org support forums.

·•·

Hahlo 4.2 — Now iPad friendly

Not that it iPad friendly wasn’t before, in fact Hahlo ran perfectly fine on the iPad, but with that extra screen space available it would be silly to not make use of it, wouldn’t it? All up it isn’t a massive update, but some good bits and pieces have been thrown in.

Not that it iPad friendly wasn’t before, in fact Hahlo ran perfectly fine on the iPad, but with that extra screen space available it would be silly to not make use of it, wouldn’t it? All up it isn’t a massive update, but some good bits and pieces have been thrown in.

Hahlo 4.2 - Now iPad friendly

What’s New

  • iPad specific changes
    • Custom landscape layout with menu visible on the left (see screenshot above)
    • Portrait mode retains the ‘traditional’ Hahlo overlay menu accessed from the ‘menu’ button in the header.
    • Slightly larger navigation tabs
    • Bigger maps (640×480) on the geo-location pages
    • Custom iPad startup image when you add Hahlo to your home screen
    • New 72px home screen icon for the iPad
  • Added ‘Retweeted by’ links (similar to ‘in reply to’) to all three retweet timelines
    • These allow you to quickly see who else has retweeted that specific tweet
    • Currently shows a maximum of 10 users (I may increase this in the future)
  • Added all three retweet timelines to the menu (Retweeted to Me, Retweeted by Me, Retweets of Me)
  • Using Twitter provided location data (for locations in the US), other locations are still using the google Maps API.
  • Added link on geo-location pages to open the current location in Google Maps (will work on iPhone and iPad)

Bug Fixes

  • Fixed a link parsing bug where links that omitted http:// would be linked incorrectly, this has now been fixed for links that begin with www but still omit http://
Article 31 May 2010 0 comments
·•·

Internet Explorer Nein!

I love Internet Explorer. I equally love sticking red-hot pokers in my eyes and sliding bamboo splinters underneath my finger nails.

I love Internet Explorer. I equally love sticking red-hot pokers in my eyes and sliding bamboo splinters underneath my finger nails.

Perhaps you missed the announcement about the IE9 ‘platform preview’, if that’s the case, then jump over to the IE Blog and have a read about what they’re doing to bring things up to where everyone else was three years ago.

All IE users are either not fans of the internet or work for some mindless corporation which insists on installing IE6 on their work machines because they have some antiquated internal application that requires IE6 to function. That is a very sweeping generalisation, and I don’t really care, I can say this because IE users won’t see this paragraph unless they actually highlight the text in their inferior browsers. I was going to hide this whole article, but that seemed like too much effort for a quick thrill. (spoiler alert: I’ve used rgba for the text colour.)

This is also my 500th post on this blog, so it’s only fitting that its a rant. Let’s go.

My eyes, it burns, it burns…

Acid will do that. But with a diluted 55/100 score thus far in the Acid3 test it is more likely to fizz and tingle than actually burn. Safari 4 gets perfect 100/100, and Firefox 3.6 94/100. Long way to go guys, maybe start boasting once you hits the 90’s… not the 50’s.
» Continue reading “Internet Explorer Nein!”

Article 17 Mar 2010 9 comments
·•·

Enabling Twitter avatars within BuddyPress

First up, the first step in this process is to install the Twit Connect plugin which you can do by following these instructions, then you can proceed with enabling Twitter avatars.

First up, the first step in this process is to install the Twit Connect plugin which you can do by following these instructions, then you can proceed with enabling Twitter avatars.

This is just a quick filter that I wrote while I was setting up help.deanjrobinson.com last week after I discovered that the twitter avatars weren’t working because of a different function/filter being used by BuddyPress.

I make no claims that this additional function is perfect, but I haven’t come across any problems with it yet, and I only knocked it together quickly. If you find anything wrong with it, or have any suggestions as to how it could be improved/simplified please let me know.

This new function based on one of the original functions that comes with the Twit Connect plugin which enables twitter avatars on regular WordPress blogs, just a with a few tweaks.

What you need to do is add the following code to the functions.php in your current BuddyPress theme. You can download a plain text copy of this function here (it’ll probably more reliable than copy-and-pasting from this page). Remember to backup your functions.php file before making any changes… just in case.

UPDATE: Appears some people who added this function the functions.php file in the default BuddyPress theme were seeing some error messages (I have not yet been able to recreate this error, but more than one user has reported it). Ideally you shouldn’t be modifying the default BP theme directly, you should be doing it via a child theme (find out how), so this code should be then added to the functions.php in your child theme.

7th March, UPDATE I’ve updated the function below (and the downloadable version above) to use http://tweetimag.es for the static twitter avatar URLs, it looks like it might a more reliable/consistent service.

<?php

 function bp_twc_get_avatar($avatar, $id_or_email='') {
  global $comment, $twc_user_login_suffix;

  if(is_object($comment)) {
   $user_id = $comment->user_id;
  }

  if (is_object($id_or_email)) {
   $user_id = $id_or_email->user_id;
  }

  if (is_array($id_or_email)) {
   if ($id_or_email['object']=='user') {
    $user_id = $id_or_email['item_id'];
   }
  }

  if (get_usermeta($user_id, 'twcid')) {
   $user_info = get_userdata($user_id);
   $twav_suffix = '';

   if ( $id_or_email['width'] ) {
    $twav_size = $id_or_email['width'];
    if( $twav_size < 32 ) {
     $twav_suffix = 'm';
    } else if ( $twav_suffix < 64 ) {
     $twav_suffix = 'n';
    } else {
     $twav_suffix = 'b';
    }
   } else if ( 'full' == $id_or_email['type'] ) {
    $twav_size = BP_AVATAR_FULL_WIDTH;
    $twav_suffix = 'b';
   } else if ( 'thumb' == $id_or_email['type'] ) {
    $twav_size = BP_AVATAR_THUMB_WIDTH;
    $twav_suffix = 'n';
   }

   $out = 'http://img.tweetimag.es/i/'. str_replace($twc_user_login_suffix,"",$user_info->user_login) . '_' .$twav_suffix;

   $avatar = "<img alt='Twitter Avatar' src='{$out}' class='avatar avatar-{$twav_size}' height='{$twav_size}' width='{$twav_size}' />";
   return $avatar;

  } else {
   return $avatar;
  }

 }

 // Check if Twit Connect exists (since its without it this function is pointless)
 if( function_exists( 'twit_connect' ) ) {

  add_filter( 'bp_core_fetch_avatar', 'bp_twc_get_avatar',10,4);

 }

?>

Show me the original version

I will add an explanation of what its doing if people are interested/curious.

·•·

Want Help? Come get some!

I’ve grown tired of doing support via blog comments or emails, so it’s time for a change. Introducing HELP! my new BuddyPress powered support site. You can now get support for all my WordPress plugins and themes, plus Hahlo, nextga.me (once its finished.…) and other projects all in one spot.

I’ve grown tired of doing support via blog comments or emails, so it’s time for a change. Introducing HELP! my new BuddyPress powered support site. You can now get support for all my WordPress plugins and themes, plus Hahlo, nextga.me (once its finished.…) and other projects all in one spot.

Want Help? Come get some!

In the past I’ve had trouble finding a “good” solution for support. I’ve tried various forum packages, with each being abandoned because they were either insufficient or superfluous to my needs… that and every forum I’ve run has been hit by low-life spammers selling v1agr4 or offering to transfer $99,000,000,000 to me from their Nigerian bank account.

Following these ‘failures’ I tried hosted solutions like GetSatisfaction and UserVoice, again they didn’t really meet my needs, and I found that I was still left fielding support questions in blog comments and via email. In the case of support for Hahlo I stuck pretty strongly to GetSatisfaction (even if I didn’t check it as often as I probably should have). Recently GetSatisfaction have announced changes to their pricing plans, which ultimately means the free account (which I’ve been using) would appear that its losing a bunch of the more useful features. I should clarify that this change isn’t the only reason I’m moving away from GetSatisfaction, the main reason is that I wanted something I had more control over, and that I could also use for supporting my WordPress Plugins and Themes etc.

» Continue reading “Want Help? Come get some!”

Article 24 Feb 2010 3 comments
·•·

So they called it the iPad.

We’ve waited so long for it but in the end, and as cool as it is, if I find it just a little meh but at the same time I want one does that make me a bad person?

We’ve waited so long for it but in the end, and as cool as it is, if I find it just a little meh but at the same time I want one does that make me a bad person? Sure, I had hoped for something in-between the iPhone and a MacBook, in terms of size that is exactly what it is. But, I’ll be honest my first impression was that “it’s just a giant iPod Touch” (or iPod Touch 3GXL…)

It is running what is basically the iPhone OS, with slightly bigger icons, and plenty of space between them on the home screen. I mean plenty. A small child could thump their paw down on the screen an only hit one app. It has the general iPhone feel (flick/pinch/swipe etc) to the interface, with the exception of the OS X style dock, also with really spaced out icons (I wonder how many you can actually put on it?).

Great Good So-So
Price point
Design
Speed
No Flash
Delicious Library… err, I mean iBooks
It runs iPhone apps (including those you already own)
Tech specs — seem pretty good for the price
Redesigned core apps
Claimed battery life
The Bezel
The way iPhone apps run
No Camera
Additional cost for 3G
The name. iPad? hmm…

» Continue reading “So they called it the iPad.”

Article 28 Jan 2010 7 comments
·•·

To retweet or not to retweet

Yesterday I launched Hahlo 4.1 and one of the changes was the switch from to old-style ‘RT’ retweets over to the new twitter retweet api. Unfortunately this seems to have upset a few people, not necessarily because I’ve added support for the new api but because I chose not to maintain the old-style RTs as well. This is a tale of why.

Yesterday I launched Hahlo 4.1 and one of the changes was the switch from to old-style ‘RT’ retweets over to the new twitter retweet api. Unfortunately this seems to have upset a few people, not necessarily because I’ve added support for the new api but because I chose not to maintain the old-style RTs as well. This is a tale of why.

To retweet or not to retweet - a tale of good vs. evil

Keep in mind this falls into the category of “people can use twitter however the hell they want”, you’re allowed to disagree, just don’t be a knob about it.

The Hahlo side of the things

Hahlo is about moving forward, not backwards, if I were not interested in keeping up with the new feature additions to twitter (and the api) then Hahlo probably wouldn’t still be in active development. Also maintaining two different methods for retweeting means more work on my side making sure they both continue working, having an ‘RT’ button which performs different functions for different people is not only illogical, but would very quickly become a pain to support. Also, please remember I don’t get paid anything to work on or support Hahlo, I do that because I’m a nice guy.

The twitter side of things

Those who’ve used Hahlo will see that I’ve tried to match the same ‘flow’ as on twitter.com. For example, you click ‘retweet’ and you’re asked to confirm that you’d like to retweet this tweet to your followers. Not everyone likes the new-style retweets, but then not everyone like change. But changes happens, deal with it.

Evan Williams wrote a great post on why retweets work the way that they work on twitter.com, if you haven’t read it I strongly suggest you do.

The “retweets annoy me” side of things

There is a reason I never added retweets to Hahlo prior to version 4, I don’t (or didn’t to be more precise) like them. And then when I did add them, I also added an ‘hide all retweets’ option. This is why, and if you disagree (likely) I’d like to hear (constructively) why that is. Lets try a common example to illustrate my point.

» Continue reading “To retweet or not to retweet”

Article 24 Dec 2009 3 comments
·•·

New WordPress theme: Dear Diary

Dear Diary is a super simplistic theme for WordPress. It is best suited to a basic journal or diary where content is king and the theme should stay mostly out of your way.

Dear Diary is a super simplistic theme for WordPress. It is best suited to a basic journal or diary where content is king and the theme should stay mostly out of your way.

deardiaryheader

What’s it great for?

With its ruled-notepad styling Dear Diary is perfect for a simple online journal or diary. Of course you can still posts images and videos etc, but simple text is what Dear Diary does best. You can check out a full live preview here.

» Continue reading “New WordPress theme: Dear Diary”

Article 24 Oct 2009 2 comments
·•·
twitter was not updated. | lastfm was not updated. |