coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: tarentaise on July 24, 2011, 06:22:54 PM

Title: retrieve the last five albums published
Post by: tarentaise on July 24, 2011, 06:22:54 PM
hello,

sorry for my English was not very good.

cpmfetch I use with my Coppermine (version 1.4.25) to display on a page the last five albums released. For this I use the following code:
<?php
  
//chemin d'accs au script cpmfetch
  
include "mediatheque/cpmfetch/cpmfetch.php";
  
//chemin d'accs  cpmfetch_config
  
$objCpm = new cpm("mediatheque/cpmfetch/cpmfetch_config.php");
  
//affichage des 5 derniers albums mis à jour
  
$objCpm->cpm_viewLastUpdatedAlbumsFrom("cat=2,3,4,5,6,7,8,9,10",
  
//sur 1 ligne
  
$rows 1,
  
//sur 5 colonnes
  
$columns 5,
  
//options d'affichage des vignettes : 65 pixels de haut, affichage de la date de mise en place, style de la vignette, style des cellules du tableau, lien vers l'album, affichage du nom de l'album dans le ALT et le TITLE de l'image
  
$options = array("imageattributes" => array("height" => "65"), "subtitle" => "Le {{pCtimeFormatted}}""imagestyle" => "img_mediatheque""cellstyle" => "tab_mediatheque""imagelink" => "album""alttag" => "{{cName}} : {{aTitle}}",
  
//style du tableau : largeur 100%
  
$styleguide = array("tableattributes" => array("width" => "450"))));
  
//fermeture du script cpmfetch
  
$objCpm->cpm_close();
?>


It's going very well and gives me a picture of a row and five columns.
<table  >
<tr>
<td class="tab_mediatheque"><a href="http://www.url_site/mediatheque/thumbnails.php?album=104"  ><img  src="http://www.url_site/mediatheque/albums/Photos-Videos/20110718/thumb_7-08-24.jpg" class="img_mediatheque" alt="Actu : Titre1" title="Actu : Titre1" height="65"   /></a><br /><br />Le 18-Jul-2011</td>
<td class="tab_mediatheque"><a href="http://www.url_site/mediatheque/thumbnails.php?album=103"  ><img  src="http://www.url_site/mediatheque/albums/Actu/14_juillet_2011/thumb_07_14_112.jpg" class="img_mediatheque" alt="Actu : Titre 2" title="Actu : Titre 2" height="65"   /></a><br /><br />Le 15-Jul-2011</td>
<td class="tab_mediatheque"><a href="http://www.url_site/mediatheque/thumbnails.php?album=102"  ><img  src="http://www.url_site/mediatheque/albums/Actu/trail2011/thumb_07_12_111.jpg" class="img_mediatheque" alt="Actu : Titre 3" title="Actu : Titre 3" height="65"   /></a><br /><br />Le 12-Jul-2011</td>
<td class="tab_mediatheque"><a href="http://www.url_site/mediatheque/thumbnails.php?album=101"  ><img  src="http://www.url_site/mediatheque/albums/Photos-Videos/20110704/thumb_6-29-82.jpg" class="img_mediatheque" alt="Actu : Titre 4" title="Actu : Titre 4" height="65"   /></a><br /><br />Le 04-Jul-2011</td>
<td class="tab_mediatheque"><a href="http://www.url_site/mediatheque/thumbnails.php?album=100"  ><img  src="http://www.url_site/mediatheque/albums/Actu/med2011/thumb_5_026_017.jpg" class="img_mediatheque" alt="Actu : Titre 5" title="Actu : Titre 5" height="65"   /></a><br /><br />Le 27-May-2011</td>
</tr>
</table>


I am now trying to change the code to display almost the same thing but put the result into an array so that it gives this:
<img src="../../../mediatheque/albums/Photos-Videos/20110718/thumb_7-08-24.jpg" longdesc="http://www.url_site/mediatheque/thumbnails.php?album=104" height="99" alt="Actu : Titre 1" />
<img src="../../../mediatheque/albums/Actu/14_juillet_2011/thumb_07_14_002.jpg" longdesc="http://www.url_site/mediatheque/thumbnails.php?album=103" height="99" alt="Actu : Titre 2" />
<img src="../../../mediatheque/albums/Actu/trail2011/thumb_07_12_002.jpg" longdesc="http://www.url_site/mediatheque/thumbnails.php?album=102" height="99" alt="Actu : Titre 3" />
<img src="../../../mediatheque/albums/Photos-Videos/20110704/thumb_6-29-102.jpg" longdesc="http://www.url_site/mediatheque/thumbnails.php?album=101" height="99" alt="Actu : Titre 4" />
<img src="../../../mediatheque/albums/Actu/medichos2011/thumb_5_026_001.jpg" longdesc="http://www.url_site/mediatheque/thumbnails.php?album=100" height="99" alt="Actu : Titre 5" />


In advance thank you
Title: Re: retrieve the last five albums published
Post by: Joe Carver on July 24, 2011, 11:33:24 PM
Sorry, but CPG 1.4.x is not supported since 2010-12.

Please upgrade to CPG 1.5.12 and search for the CPMFetch thread before returning.
Title: Re: retrieve the last five albums published
Post by: tarentaise on July 25, 2011, 06:45:03 PM
ok thank you