Last update with date and time Last update with date and time
 

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]

Main Menu

Last update with date and time

Started by altenae, October 29, 2011, 04:07:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

altenae

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

altenae

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

Αndré

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.

Αndré

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

altenae

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


Αndré

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
filemtime($dirname)
with
mysql_result(cpg_db_query("SELECT MAX(ctime) FROM {$CONFIG['TABLE_PICTURES']}"), 0)

altenae

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

Αndré

Please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
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.

altenae


altenae

Transfer to paypal done.... :)

Thanks for all your help.