{{indexmenu_n>20}} ====== Zufallsbilder (Template) ====== === Zeigt die Bilder zufällig neu sortiert aus einem Bilderset der CPs Bilder
; this is formatted like WIN.INI
; please: do not use comments for value lines
; settings will overwrite CP settings
;width = 100
;height = 100
;col = 1
;zoom = 1
;crop = 0
;space = 10
;lightbox = 1
;nocaption = 0
; 0 = no center, 1 = horizontal/vertical, 2 = horizontal, 3 = vertical
;center_image = 0
[TITLE]{TITLE}
[/TITLE]
[SUBTITLE]{SUBTITLE}
[/SUBTITLE]
[TEXT]{TEXT}[/TEXT]
[PHP]
// CUSTOM Input ================
$my_max_count = 0; // Max count of images for output, 0 = all
// =============================
$my_images = array();
$my_counter = -1;
$my_counter++;
$my_images[$my_counter][0] = '{IMAGE}'; // complete html string with image
$my_images[$my_counter][1] = '{IMGID}'; // image-id
echo ''.LF;
if (!empty($my_images) ) {
shuffle($my_images); // new sort
if ($my_max_count) { // Max count available?
if ($my_max_count <= count($my_images)) {
$temp_array = $my_images;
$my_images = array_slice($temp_array, 0, $my_max_count); // new random sort order
unset ($temp_array);
}
}
foreach ($my_images as $key=>$value) {
echo ''.LF; // ID
echo ' '.$my_images[$key][0].LF; // thumb and zoom images
echo ''.LF; // End imageEntry and ID
}
}
else
{ // ************* Please insert your fallback image *************
echo '
';
}
echo ''.LF; // End imageEntryRandom
unset ($my_images);
unset ($my_counter);
unset ($my_max_count);
[/PHP]
\\