Gallery last updated Gallery last updated
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Gallery last updated

Started by meek, October 13, 2008, 11:15:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

meek

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<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.

Joachim Müller

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

meek

I know.
I solved it by saving this code (modified to display a localized date) to a file<?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.