Quote:
Originally Posted by Opserty
Are you going to be fetching the images (or image data) from a database? If so you just use it as a standard while() loop. Like this:
PHP Code:
$counter = 0; // Starting counter
while($imgstuff = $db->fetch_array($imgquery))
{
eval('$eic_imagebits .= "' . fetch_template('eic_imagebits') . '";');
// ...
if($counter == 4) // That counts as 5 images
{
$eic_imagebits .= '<br />'; // Insert Line Break
$counter = 0; // Reset counter
}
else
{
$counter++; // Increment counter
}
}
|
There's nothing being pulled from the database, just pulling from two settings in the admincp - the total number of images to be shown and the number of images to display per line ($number_of_images_to_show) and ($numx).
--------------- Added [DATE]1212946799[/DATE] at [TIME]1212946799[/TIME] ---------------
Basically put this is what I'm aiming for it to do .. trust me, this is in basic terms!
If there are 10 images to be displayed and every 5 images, it needs to insert a line break.
So it counts out 5 images, then inserts a line break, to display the final 5 images.
Both the amount of images and the number per line are defined in the admincp.