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: Displaying the date coppermine was last updated on the frontpage  (Read 9952 times)

0 Members and 1 Guest are viewing this topic.

colinmann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Displaying the date coppermine was last updated on the frontpage
« on: September 10, 2006, 07:59:51 pm »

Sorry,

This is driving me wild. The plugin looks great, but I've got a question: how can I display, on the front page of my site, when the gallery was last updated? There must be an easy way, but I can't see it anywhere. All I want is it in the format "09 September 2006" or however.

Thanks in advance,
Cheers, Colin
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Displaying the date coppermine was last updated on the frontpage
« Reply #1 on: September 10, 2006, 09:10:01 pm »

Sorry,

This is driving me wild. The plugin looks great, but I've got a question: how can I display, on the front page of my site, when the gallery was last updated? There must be an easy way, but I can't see it anywhere. All I want is it in the format "09 September 2006" or however.

Thanks in advance,
Cheers, Colin

For now, you would have to retrieve the last added photo and draw the date field from it and format it however you wanted to.

Something like:

$objCpm->cpm_setReturnType("resultset");
$data = $objCpm->cpm_viewLastAddedMedia(1,1);
$row = $data[0];
$time = date(,'d-M-Y',$row['pCtime']);

print $time;

Well something like that anyway...  YMMV, I did not try it, but it should work






Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

colinmann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Displaying the date coppermine was last updated on the frontpage
« Reply #2 on: September 10, 2006, 09:58:54 pm »

Hi, sorry - but why does this page: http://www.colinmann.com/photos/plugins/cpmfetch/cftest.php give this error:

Fatal error: Cannot instantiate non-existent class: cpm in /home/cjmann/public_html/photos/plugins/cpmfetch/cftest.php on line 6

Thanks
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Displaying the date coppermine was last updated on the frontpage
« Reply #3 on: September 10, 2006, 10:58:33 pm »

Hi, sorry - but why does this page: http://www.colinmann.com/photos/plugins/cpmfetch/cftest.php give this error:

Fatal error: Cannot instantiate non-existent class: cpm in /home/cjmann/public_html/photos/plugins/cpmfetch/cftest.php on line 6

Thanks

Normally something like that is due to a bad path in the include statement for cpmfetch... but since the cpmfetch.php is probably in the same directory, that does not make much sense.  Did you upload everything into that directory?



Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

colinmann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Displaying the date coppermine was last updated on the frontpage
« Reply #4 on: September 10, 2006, 11:05:49 pm »

Normally something like that is due to a bad path in the include statement for cpmfetch... but since the cpmfetch.php is probably in the same directory, that does not make much sense.  Did you upload everything into that directory?

yes I did, everything is uploaded into www.colinmann.com/photos/plugins/cpmfetch/

Any ideas? Thanks in advance :)
Logged

colinmann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Displaying the date coppermine was last updated on the frontpage
« Reply #5 on: September 10, 2006, 11:20:45 pm »

By the way - the contents of the file is as follows:

<html>
<body>

<?php
   include "http://www.colinmann.com/photos/plugins/cpmfetch/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>

Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Displaying the date coppermine was last updated on the frontpage
« Reply #6 on: September 11, 2006, 03:27:31 am »

By the way - the contents of the file is as follows:

<html>
<body>
<?php
   include "http://www.colinmann.com/photos/plugins/cpmfetch/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>



try not using the url for the include file...

If you are in the same directory use this
include "./cpmfetch.php";

Some web servers may not allow the loading by url thing...

I am confused... you said this is cftest.php, but I don't have this sort of stuff in my test file.
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

colinmann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Displaying the date coppermine was last updated on the frontpage
« Reply #7 on: September 11, 2006, 09:09:09 am »

Some web servers may not allow the loading by url thing...

You're right there, thanks

I am confused... you said this is cftest.php, but I don't have this sort of stuff in my test file.

Yeah, sorry, I was being lazy & didn't change the filename ;) All works now though, feel free to check out www.colinmann.com :-)

Thanks again for your help!! Really, thanks :-)
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Displaying the date coppermine was last updated on the frontpage
« Reply #8 on: September 11, 2006, 05:39:34 pm »

Yeah, sorry, I was being lazy & didn't change the filename ;) All works now though, feel free to check out www.colinmann.com :-)

So is it that little updated thing on the front page from cpmfetch?
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.