last uploads order by mtime ? last uploads order by mtime ?
 

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 uploads order by mtime ?

Started by antisa33, July 01, 2006, 04:15:57 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

antisa33

Hello
I have done a script and now i need to sort my lastuploads files by date (the new one before).
I know it is in include/funtions.inc.php in
"case 'lastup': // Last uploads"
Now it is ordered by "pid", how to change, and to sort by date ?
i have
if($select_columns != '*' ) $select_columns .= ',title, caption, owner_id, owner_name, aid';
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY pid DESC $limit");

i tried with mtime

if($select_columns != '*' ) $select_columns .= ',title, caption, owner_id, owner_name, aid, mtime';
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY mtime DESC $limit");
but it is not ok  ???
What is the real code ?
Thanks

Nibbler

Sorting them by mtime makes no sense, use ctime.

antisa33

#2
Thanks for the reply.
So i need to sort by ctime.
Please can you tell me how to have the ctime of today :
something like that :
$date = date("Y-m-d");
$time = date("H:i:s");
$ctime = ??

I found !

It is

$ctime=time();

Thank you very much for help
Bye