Latest (x) image in block
<?php
/*
* Used with image.module
* Tested with Drupal 4.6.x
* To modify change the value of $number to
* the number of images that you wish to show
*/
$number = 1;
$thumbs = 0;
while ($thumbs<$number) {
$images = (image_get_latest($count = 1, 0));
print l(image_display($images[0], 'block'),'node/'.$images[0]->nid, array(), null, null, FALSE, TRUE);
$thumbs++;
}
?>Modified from http://drupal.org/node/53987

Latest x Images (Drupal 5.x)
<?php
$numImage = 5;
$images = image_get_latest($numImage);
for($i=0;$i<count($images);$i++) {
echo l(image_display($images[$i], 'thumbnail'), 'node/'. $images[$i]->nid, array(), NULL, NULL, FALSE, TRUE);
}
?>
This works fine on Drupal 5.x
Vinay Yadav
PHP / Drupal Specialist
http://www.vinayras.com
And for drupal6
And for drupal6
<?php
$numImage = 3;
$images = image_get_random($numImage);
//$images = image_get_latest($numImage);
for($i=0;$i<count($images);$i++) {
echo l(image_display($images[$i], 'thumbnail'), 'node/'. $images[$i]->nid, array('html' => TRUE));
}
?>
change numImage for the amount of images
to switch between random and latest: uncomment the line that says "image_get_latest" for the latest images ...
Http://www.reloadmedia.com