Ok.   I admit, the title is a little misleading, but this week I found a neat little work around to the Groundspeaks limitations of what you can put in a cache listing.  To some this may not seem like much but to me it opened up a while new realm of possibilities.

If you use the image tag in you post and link that image to a php page you can return a different image depending on whatever logic you want.  The most apparant to me is a different image based on times of the day / day of the week.

For example.  In your cache listing you put the following code:

<br /> <img src="puttzy.com/getImage.php" alt="" /><br /> 

That .php page can “do some logic” and return an image based on what ever you want.  All you have to do is on your getImage.php page do something like:

</p><p>$rnd = rand(0,4);<br /> header('content-type: image/gif');<br /> header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');<br /> header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past<br /> header('Pragma: no-cache');</p><p>if ($rnd = 1){<br /> $im = file_get_contents('PathToImage1.gif/png/jpg/ect);<br /> } else if ($rnd = 1){<br /> $im = file_get_contents('PathToImage2.gif/png/jpg/ect);<br /> } else if ($rnd = 2){<br /> $im = file_get_contents('PathToImage3.gif/png/jpg/ect);<br /> } else if ($rnd = 3){<br /> $im = file_get_contents('PathToImage4.gif/png/jpg/ect);<br /> } else {<br /> $im = file_get_contents('PathToImage0.gif/png/jpg/ect);<br /> }<br /> 

This opens up a while world of possibilities!!!

Just think.  Thus backend page can return images based on time and/or day.  It could return 1 image out of a set of 100, 1000.  Whatever.  The logic you lace one the backend gives you a limited, yet actual, way to add code to you listing page.

On a side note…..I am getting closer to hacking up a listing page that may actually allow some javascript.  I doubt it will work but, hey, it would be awesome!!


[Update]This has now been implemented in a few cache listings.  Check out “24 hours of Booty” or “Larry The Leprechaun