January 03, 2006

Flickr on your Mobile Phone

One of my favorite features of Flickr was the ability to view your photos on your mobile phone. Unfortunately, ever since Yahoo! bought Flickr last year, this feature has stopped working for all new members and anyone who merged their Flickr ID with their Yahoo! account.

The friendly folks at Flickr promised a quick fix to the problem, but that was nearly six months ago - and there's still no solution. So I've decided to take matters into my own hands :)

Point the web browser on your cell phone to http://m.tylerhall.ws/flickr/. It's as simple as that! You'll be able to browse your and your friend's most recent pictures. You can also watch Everyone's pictures as well :)

For quick access, bookmark http://m.tylerhall.ws/flickr/your_flickr_name on your cellphone so you don't have to login each time.

Enjoy!

Posted by tylerhall at 10:43 AM | Comments (0) | TrackBack

Improved del.icio.us Links

Here's a small script for all you del.icio.us users out there. It improves upon the idea of including your recent links on your website or blog.

Currently, when you use one of the official del.icio.us methods, you can specify the tags you'd like to filter your links on. For example, on the right side of this page I keep a list of my most recent bookmarks about PHP and CSS. The problem with this is that it will "AND" the two tags together - meaning it will only display links which are tagged with both PHP and CSS. What if we want to get links that are tagged PHP or CSS? To my knowledge there's no way to do this, which is why I wrote the following script. (If there is a way, please correct me in the comments below :)

Continue reading "Improved del.icio.us Links"

Posted by tylerhall at 09:54 AM | Comments (1) | TrackBack

December 17, 2005

Creative Timestamps

I was updating my website just now and I added a little bit of PHP at the bottom to get the last modified date of the webpage from the server. That way, I could have an automatic "Page Last Updated on .... " message. For some reason my mind clicked over to Wikipedia, and I came up with this...

<?PHP
list($F, $d, $Y) = explode(" ", date("F d Y", filemtime($_SERVER['SCRIPT_FILENAME'])));
echo "Last Updated <a href='http://en.wikipedia.org/wiki/{$F}_{$d}' title='This day in history'>$F $d, $Y<a/>";
?>

Not only will that give you an automatic "Last Updated" message, but it will also link a page with everything that happened in the news on that day.

Posted by tylerhall at 02:25 AM | Comments (0) | TrackBack

December 13, 2005

Defining CSS Constants with PHP

IT'S PRETTY SIMPLE

I often find myself wishing CSS had constants like most programming languages. For example, at work, we have a specific shade of orange we use all the time. We call it Tricycle Orange. It's #F33500. We also have a magical shade of blue called CM Blue #346FB7.

So, anytime I write a CSS file which uses those colors, I have to type #F33500 or #346FB7. Just between you and me, I already have enough hex numbers floating through my head without having to remember these. Also, what would happen if our designer suddenly decided Tricycle Orange needed to be a few shades darker? I'd have to go through the style-sheets and change every occurence to its new value. Not very fun. Is there a solution?

Of course there is!

Using the magic of PHP we can define constants in our CSS files. That way, if we ever need to change a value, we only have to change it in one place. PHP updates the rest of the file for us - automagically! Here's how it works...

Continue reading "Defining CSS Constants with PHP"

Posted by tylerhall at 09:01 PM | Comments (1) | TrackBack

Include Recent flickr Photos with PHP

Putting your recent flickr photos on your website or blog is a quick and easy way to share them with the world and keep your site looking fresh. flickr gives you two options to do this.

  1. A small Flash movie
  2. Javascript

Both methods have their advantages. The Flash movie is very pretty. It's animated and sure to attract your readers' eye. (Whether or not that's a good thing is up for debate.) The javascript method is quick and dirty and has the added advantage of allowing you to customize the layout using CSS.

However, both ways have a common downfall - they rely on your readers' browser supporting either the Flash plugin or having javascript turned on. Granted, 95% of today's netizens will have at least one of these enabled (if not both), but they have the added problem of relying on the browser to do all the work. (Also, it's worth noting that the html created by flickr javascript is not standards compliant.)

It's my thinking that the server should do most of the heavy lifting. You shouldn't rely on your visitor's browser to do the rendering for you. It may not seem like much, but every extra bit of processing that you push onto the browser can really slow down an older machine or someone who's viewing your site on a handheld device. You want your site to look good and be responsive. Anything less could drive away repeat visitors.

With that said, there's a third alternative - one that doesn't rely on plugins and requires no client-side (browser) processing. By using PHP and a little elbow grease, we can read through the javascript which flickr provides us, pull out the elements we need, and style them to fit any website.

If you're one of those people looking for a quick solution to include on your blog or website, feel free to skip ahead to the finished product. Otherwise, continue reading to see how everything works.

Continue reading "Include Recent flickr Photos with PHP"

Posted by tylerhall at 02:05 PM | Comments (1) | TrackBack