coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: ronny on January 16, 2008, 02:07:43 AM

Title: CpmFetch with linked albums
Post by: ronny 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:


<? 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:


<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.
Title: Re: CpmFetch with linked albums
Post by: ronny 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:


<? 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:


<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