This site presents how to show the latest image on your site.
Probably you are wondering how it works?
This is how its done:
1) It takes RSS feed from site (looking for it at URL which you give) as document with needed data. Im using for it advAJAX lib (an advAJAX 2.0 RC2) oryginally written by Łukasz Lach - http://anakin.us/
2) It parses RSS feed where are all the latest images and takes first from them (the newest one).
3) It looks within document for element with ID equel to:
showImageHereand puts there:
<img src="URLtoImage1" border="0"/><br/><br/><img src="URLtoImage2" border="0"/>...
Now you are thinking "Coooooool but how to do the same at my Pixelpost???".
Solution is easy. All what you need is:
1) Copy this files to your site (click on it using right button of mouse and use option called "Save As"):
advajax.js lib.js rss.php (download it and save as rss.php)2) Using FTP upload this files to some dir at your blog's web accout (i.e. to ftp://yourdomain.com/pixelpost_dir/latestphoto/)
<div id="showImageHere"></div>6) Inside lib.js set the numer of images which you want to show. By default it is set to:
showImages = 5;7) Inside rss.php set URL of feed and cache period. By default it is set to:
$time2expire = 3600; // minimal period is secs after which RSS feed will be refreshed (bt it needs hit of page visitor) $rss_url = 'http://blog.piotrgalas.com/feeds/rss.xml'; //address of feed8) Remember that rss.php needs correct rights to create 2 new files (CHMOD 755 on dir with this script should be enough at the most servers).
This is the result of working script: