Advanced search  


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.

Pages: [1]   Go Down

Author Topic: retrieve the last five albums published  (Read 3889 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
retrieve the last five albums published
« on: July 24, 2011, 06:22:54 pm »


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:
Code: [Select]
//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
//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

It's going very well and gives me a picture of a row and five columns.
Code: [Select]
<table  >
<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>

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:
Code: [Select]
<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

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1510
  • aka 'i-imagine'
    • Home Page
Re: retrieve the last five albums published
« Reply #1 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.


  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: retrieve the last five albums published
« Reply #2 on: July 25, 2011, 06:45:03 pm »

ok thank you
Pages: [1]   Go Up

Page created in 0.113 seconds with 21 queries.