CpmFetch with linked albums CpmFetch with linked albums
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

CpmFetch with linked albums

Started by ronny, January 16, 2008, 02:07:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ronny

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.

ronny

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