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: CpmFetch with linked albums  (Read 3822 times)

0 Members and 1 Guest are viewing this topic.

ronny

  • Coppermine novice
  • *
  • Country: 00
  • Offline Offline
  • Posts: 49
CpmFetch with linked albums
« on: January 16, 2008, 02:07:43 am »

I would show the number of images with CpmFetch from a linked album.

Here is the reason why i would do this...
http://www.vwteam.com/galerie/vw_tuning_bilder.php (it is just a test site)

This is my code. First:

Code: [Select]
<? include("./cpmfetch/cpmfetch.php"); ?>
<?php
function album($albumid)
{    
 $objCpm = new cpm('./cpmfetch/cpmfetch_config.php');
 echo '<font class="texts">('$objCpm->cpm_listMediaCountForAlbum ($albumid) ,')</font>';
 $objCpm->cpm_close(); 
}
?>


And then show the number of images with this code:

Code: [Select]
<a href="http://www.vwteam.com/galerie/thumbnails.php?album=84">Aussenansicht</a> <? album(84); ?><br>

It is working fine, but not for linked albums with the feature "album keyword".
Then the number is 0.  :'( The album contains 8 linked pictures.
Logged

ronny

  • Coppermine novice
  • *
  • Country: 00
  • Offline Offline
  • Posts: 49
Re: CpmFetch with linked albums
« Reply #1 on: January 16, 2008, 09:54:02 pm »

Ok i have found a solution. I made it with the search function of coppermine
not with "album keyword" linked images. Here is my code:

Code: [Select]
<? include("./cpmfetch/cpmfetch.php"); ?>
<?php
function anzahl($searchstring)
{    
$objCpm = new cpm('./cpmfetch/cpmfetch_config.php');
echo '<font class="texts">('$objCpm->cpm_listMediaCountfrom ($searchstring) ,')</font>';
$objCpm->cpm_close(); 
}
?>

<?php
function vorschau($randomimage)
{
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewRandomMediaFrom($randomimage,1,1,array("imagewidth" => "100","imagelink" => "none","alttag" => "Tuning-Bilder"));
$objCpm->cpm_close();

?>


And later:

Code: [Select]
<td><? echo vorschau("keyword=vwgolf1aussen"); ?></td>
<td><a href="http://www.vwteam.com/galerie/thumbnails.php?album=search&search=vwgolf1aussen" target="_blank">Aussenansicht</a>
<? echo anzahl("keyword=vwgolf1aussen"); ?><br>
<a href="#">Innenraum vorn</a><br>
<a href="#">Kofferraumausbau</a><br>
<a href="#">Motorraum</a>
</td>

When user click the link also he have always the search= in url when look the images...  :D
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 15 queries.