coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: ericr23 on September 20, 2007, 11:44:55 PM

Title: Include link when getting entire array?
Post by: ericr23 on September 20, 2007, 11:44:55 PM
This is a question related to the "self-contained slideshow (http://forum.coppermine-gallery.net/index.php?topic=35767.0)".

How would one get the link for each picture in the following code?

<?php
foreach ($data as $row) {
   
$imagename $objCpm->getImageToUse($row['pFilepath'], $row['pFilename'] ,"normal_");
   print 
"Pic[a++]='" $imagename "'\n";
}
?>


Title: Re: Include link when getting entire array?
Post by: ericr23 on September 26, 2007, 03:51:08 PM
With the help of another thread pointing to this page: http://cpmfetch.fistfullofcode.com/features/index.php -- I added the following line to the foreach loop:

$imagepage = "./pix/displayimage.php?pos=-" . $row['pPid'];

So the completed code is:

<?php
$a 
0;
foreach (
$data as $row) {
   
$imagethumb $objCpm->getImageToUse($row['pFilepath'], $row['pFilename'], "thumb_");
   
$imagepage "./pix/displayimage.php?pos=-" $row['pPid'];
   print 
"Pic[" $a "]='<a href=" $imagepage "><img src=./pix/" $imagethumb "></a>'\n";
   
$a $a 1;
}
?>