Gravatar Wrapper Class
View Single Post
01-09-2008, 03:34 AM
La Vida es Sueño
Join Date: Sep 2007
I actually decided to work on version 1.1 which contains a cache built in. It recognises the avatar sizes, and will download a fresh copy from the Gravatar server when the current avatar expires. This can easily be changed by opening up the
file and modifying the class constant at the top. It is currently set at 5 days.
There are only a couple of additions to the above code that you need to concern yourself with - one of which is you now have to include 2 files. I've separated the classes into 2 classes to make them more manageable. The
file shows you how to include the second file, but it's nothing complicated in the least:
The functionality still performs exactly the same as version 1.0 above. There is a directory called
which should be writeable, so don't forget to set the correct permissions on that. Typically 777.
Last but not least, for the more technically minded, I have added an exception for if the cache class is not
. An exception will be thrown if it isn't to save on any problems. As you shouldn't see this error unless you drastically modify the script, there's really no need to put the class instantiation and method calls in a
try and catch block
, but it's entirely up to you.
(1.4 KB, 281 views)
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Last edited by Wildhoney : 01-09-2008 at
The Following User Says Thank You to Wildhoney For This Useful Post:
View Public Profile
Send a private message to Wildhoney
Visit Wildhoney's homepage!
Find More Posts by Wildhoney