Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Include link when getting entire array?  (Read 4107 times)

0 Members and 1 Guest are viewing this topic.

ericr23

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Include link when getting entire array?
« on: September 20, 2007, 11:44:55 pm »

This is a question related to the "self-contained slideshow".

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

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

« Last Edit: September 21, 2007, 07:03:16 am by GauGau »
Logged

ericr23

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Include link when getting entire array?
« Reply #1 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:

Code: [Select]
$imagepage = "./pix/displayimage.php?pos=-" . $row['pPid'];
So the completed code is:

Code: [Select]
<?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;
}
?>
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.