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/)
<script type="text/javascript" src="pixelpost_dir/latestphoto/advajax.js"></script> <script type="text/javascript" src="pixelpost_dir/latestphoto/lib.js"></script>4) Remember to change paths to above files if you are using other then this which I gave here.
<div id="showImageHere"></div>6) Inside lib.js set the numer of images which you want to show and if there should be thumbnails or full size images. By default it is set to:
showImages = 5; // Number of images to show showThumbnail = 1; // Set it to 1 for thumbnails or to 0 for full size image7) 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://piotrgalas.com/projects/latestPhoto3/libeco.nl.rss.feed.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: