Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: last uploads order by mtime ?  (Read 4424 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.016 seconds with 19 queries.