ryarwood
12/17/2012 - 10:13 PM

Random image start

Random image start

<?php

$imgString = "/images/elements/gallery-{url_title}-";
$imgGallery = range(1, {community-gallery} + 1);
$i = $start = mt_rand(1, {community-gallery});
do {
    if ($i != 0) {
      echo '<img src="'.$imgString.$i.'.jpg" width="730" height="340" />';
    }
    $i = ($i + 1) % count($imgGallery);
} while ($i != $start);

?>