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: Last update with date and time  (Read 2789 times)

0 Members and 1 Guest are viewing this topic.

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Last update with date and time
« on: October 29, 2011, 04:07:56 pm »

Hi,

In the older coppermine (1.3) this worked very well:

$dirname = 'albums/userpics';
echo  "Last picture added :  " . date ("d F Y H:i", filemtime($dirname));

However in coppermine 1.5 there are different sub directories underneath the "userpics" directory

Is there another way to accomplish this ??
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Last update with date and time
« Reply #1 on: October 29, 2011, 08:01:38 pm »

Hi,

I would like to have the Last update with date and time visible on the main screen (maybe in the anycontent.php)

Is there a wat to do this ?

Thanks,

Edward
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Last update with date and time
« Reply #2 on: November 03, 2011, 04:39:48 pm »

Please be more detailed. What do you mean with "last update"? Please also post a link to your gallery according to the board rules. Thanks.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Filemtime issue with CPG 1.5 -- Any ideas ?
« Reply #3 on: November 03, 2011, 05:08:05 pm »

Just query the database to get the latest file addition time:
Quote
SELECT MAX(ctime) FROM cpg15x_pictures
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Re: Last update with date and time
« Reply #4 on: November 03, 2011, 06:34:27 pm »

Hi Andre,

Sorry for this extra topic..

http://forum.coppermine-gallery.net/index.php/topic,73821.0.html

I just added the following to my anycontent.php and it worked with coppermine 1.3.X:

/* $dirname = 'albums/userpics';
echo  "<br>";         
echo  "<font size=1><center>Last picture added :  " . date ("d F Y H:i", filemtime($dirname));
echo " UTC";
echo " <img src=updated.gif align=absmiddle>" . "</font>" . "</center>"; */

However this is not possible due to the user subdirectories underneath "userpics".

So I am looking for another solution.

You were talking about "SELECT MAX(ctime) FROM cpg15x_pictures"
Any thought on how to fit this in the anycontent.php ?

Many Thanks Andre,

Edward

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Last update with date and time
« Reply #5 on: November 04, 2011, 11:53:43 am »

I'm really angry because you constantly disregard our board rules. I'll (again) merge your existing threads that deal with absolutely the same issue. This is the last time I'll answer to your threads, unless you respect our board rules completely.


Back to topic: in your existing code, replace
Code: [Select]
filemtime($dirname)with
Code: [Select]
mysql_result(cpg_db_query("SELECT MAX(ctime) FROM {$CONFIG['TABLE_PICTURES']}"), 0)
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Re: Last update with date and time
« Reply #6 on: November 04, 2011, 02:19:07 pm »

Hi Andre,

You are right I am sorry.
I am very very happy with all your help.

Sorry once more.

I am so happy with the end result.
I was wondering if I could make a small donation for all your help (paypal)

thanks,

Edward
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Last update with date and time
« Reply #7 on: November 04, 2011, 03:10:14 pm »

Please
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.


I'll send you a PM with my PayPal address.
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Re: Last update with date and time
« Reply #8 on: November 04, 2011, 03:48:58 pm »

Thanks......

Edward
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Re: Last update with date and time
« Reply #9 on: November 04, 2011, 10:41:10 pm »

Transfer to paypal done.... :)

Thanks for all your help.
Logged
Pages: [1]   Go Up
 

Page created in 0.036 seconds with 20 queries.