forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: altenae on October 29, 2011, 04:07:56 pm

Title: Last update with date and time
Post by: altenae 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 ??
Title: Last update with date and time
Post by: altenae 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
Title: Re: Last update with date and time
Post by: Αndré 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.
Title: Re: Filemtime issue with CPG 1.5 -- Any ideas ?
Post by: Αndré 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
Title: Re: Last update with date and time
Post by: altenae 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

Title: Re: Last update with date and time
Post by: Αndré 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 (http://forum.coppermine-gallery.net/index.php?index.php/topic,55415.0.html) 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)
Title: Re: Last update with date and time
Post by: altenae 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
Title: Re: Last update with date and time
Post by: Αndré 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.
Title: Re: Last update with date and time
Post by: altenae on November 04, 2011, 03:48:58 pm
Thanks......

Edward
Title: Re: Last update with date and time
Post by: altenae on November 04, 2011, 10:41:10 pm
Transfer to paypal done.... :)

Thanks for all your help.