Member
Member
pischla   2009-05-21, 16:26
#1
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>'
Member
Member
pischla   2009-05-21, 17:09
#2
By the way, I'm on ZenPhoto 1.2.3, php 5.2.9 and MySQL 5.0.32.
Administrator
Administrator
acrylian   2009-05-21, 17:25
#3
The second code does not work because you did not include the image_album_statistics plugin file the same way as the template functions.php file.
Member
Member
pischla   2009-05-21, 17:42
#4
Wow, thanks a lot! I'm a less than newbie when it comes to PHP...
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.