forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: meek 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<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.
-
cpmFetch is a tool that allows you to display content taken from coppermine on non-coppermine-driven pages.
-
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.