Hi!
I'm trying to put some thumbs from my gallery on the index page of my website and have been searching the forum high and low for a solution. My latest test involves a test.php page in the root folder and my gallery is in a folder named "gallery" below that. I have used the following code for testing and while the random full size image does show on the page the rest does not.
'<?php
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'gallery');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
header ('Content-Type: text/html; charset=' . getOption('charset'));
?>
<html>
<head>
<title>Test Index</title>
</head>
<body>
[strong]The code below works like a charm:[/strong]
<?php
$randomImage = getRandomImages();
$randomImageURL = getURL($randomImage);
echo "
<img src='". $randomImage->getSizedImage(getOption('image_size')) . "'
alt=\"random image\"\n" . $randomImage->getTitle() . '" />';
?>
[strong]This code does not work:[/strong]
<?php
$images = getImageStatistic(4, "latest");
foreach ($images as $image) {
echo "";
$imageURL = getURL($image);
echo '<a href="'.$imageURL.'" title=" ' .
$image->getTitle() . '"><img src="' .
$image->getCustomImage(null, 100, 100, null, null, null, null, true) .
'" alt="' . $image->getTitle() . "\"/>";
echo "";
}?>
</body>
</html>'
Comments