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

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

Main Menu

last uploads order by mtime ?

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

Previous topic - Next topic

0 Members and 1 Guest 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