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: Gallery last updated  (Read 4800 times)

0 Members and 1 Guest are viewing this topic.

meek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Gallery last updated
« on: October 13, 2008, 11:15:42 am »

Hi.

I have installed cpmFetch in order to make a "Gallery last updated" feature. I found this post: http://forum.coppermine-gallery.net/index.php/topic,36066.0.html but I still don't know how to do it. I also checked the documentation, but I'm still lost. Do I need to create a new file with this code
Code: [Select]
<html>
<body>
<?php
   
include "./cpmfetch.php";
   
$objCpm = new cpm("/photos");
   
$objCpm->cpm_setReturnType("resultset");
   
$data $objCpm->cpm_viewLastAddedMedia(1,1);
   
$row $data[0];
   
$time date('d-M-Y',$row['pCtime']);
   
$objCpm->cpm_close();
   print 
$time;
?>

</body>
</html>
and include it in my template.html...or?
By the way, the folder name in this line: $objCpm = new cpm("/photos"); - is that the folder of the gallery?

I hope anyone can help me out.

Thanks a lot.

Meek.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Gallery last updated
« Reply #1 on: October 13, 2008, 12:26:50 pm »

cpmFetch is a tool that allows you to display content taken from coppermine on non-coppermine-driven pages.
Logged

meek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Gallery last updated
« Reply #2 on: October 13, 2008, 02:55:29 pm »

I know.
I solved it by saving this code (modified to display a localized date) to a file
Code: [Select]
<?php
   
include($_SERVER['DOCUMENT_ROOT']."/gallery/cpmfetch/cpmfetch.php");
   
$objCpm = new cpm($_SERVER['DOCUMENT_ROOT']."/gallery/cpmfetch/cpmfetch_config.php");
   
$objCpm->cpm_setReturnType("resultset");
   
$data $objCpm->cpm_viewLastAddedMedia(1,1);
   
$row $data[0];
   
/* Set date format to Danish - see www.php.net */
   
setlocale(LC_ALL'da_DK.ISO_8859-1');
   
$time strftime('%d. %B %Y',$row['pCtime']);
   
$objCpm->cpm_close();
   print 
"Last updated"." ".$time;
?>
and linking to it in the Coppermine config as a footer.

Meek.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.