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 uploads order by mtime ?  (Read 4417 times)

0 Members and 1 Guest are viewing this topic.

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
last uploads order by mtime ?
« on: July 01, 2006, 04:15:57 am »

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
« Last Edit: July 01, 2006, 08:03:29 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: last uploads order by mtime ?
« Reply #1 on: July 01, 2006, 04:05:01 pm »

Sorting them by mtime makes no sense, use ctime.
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: last uploads order by mtime ?
« Reply #2 on: July 01, 2006, 07:24:50 pm »

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


« Last Edit: July 01, 2006, 07:34:36 pm by antisa33 »
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.