Hi,
If I click on 'Last uploads' I get all my 5000 pictures in the result album.
I expected a time range of some days or weeks. Probably configurable by the admin.
This works with my 1.42 as well as the 1.43 online demo.
Bug or feature? I haven't found that issue in the forum so far.
Best regards,
Ralf
Feature definitely ;)
Hmmm. Wouldn't it make sense to set up a number of max days for that result? All pictures is not really the answer to 'last uploaded pictures' ...
Regards,
Ralf
Last Uploaded is meant to show all the photos in descending order of upload date. In your case if you want to limit them then i think you can do so by modifying the code.
Abbas
Ok, thank you very much for your fast response.
I'm not able to write PHP, so probably somebody else find that interesting enough. Or feature list for NG ..
Regards,
Ralf
Ok a quik mod.
Edit include/functions.inc.php
Replace
case 'lastup': // Last uploads
if ($META_ALBUM_SET && $CURRENT_CAT_NAME) {
$album_name = $lang_meta_album_names['lastup'].' - '. $CURRENT_CAT_NAME;
} else {
$album_name = $lang_meta_album_names['lastup'];
}
$query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET";
$result = cpg_db_query($query);
$nbEnr = mysql_fetch_array($result);
$count = $nbEnr[0];
mysql_free_result($result);
//if($select_columns != '*' ) $select_columns .= ',title, caption, owner_id, owner_name, aid';
$select_columns = '*'; //allows building any data into any thumbnail caption
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY pid DESC $limit";
$result = cpg_db_query($query);
with
case 'lastup': // Last uploads
if ($META_ALBUM_SET && $CURRENT_CAT_NAME) {
$album_name = $lang_meta_album_names['lastup'].' - '. $CURRENT_CAT_NAME;
} else {
$album_name = $lang_meta_album_names['lastup'];
}
$days = 5; // Change this to whatever you want
$range = time() - ($days*24*60*60);
$query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND ctime > '$range' $META_ALBUM_SET";
$result = cpg_db_query($query);
$nbEnr = mysql_fetch_array($result);
$count = $nbEnr[0];
mysql_free_result($result);
//if($select_columns != '*' ) $select_columns .= ',title, caption, owner_id, owner_name, aid';
$select_columns = '*'; //allows building any data into any thumbnail caption
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND ctime > '$range' $META_ALBUM_SET ORDER BY pid DESC $limit";
$result = cpg_db_query($query);
In above code change the value of $days to whatever suit you. Photos of last x days will be displayed in Last Uploads where x is the value of $days.
HTH
Abbas
Changed to 14 days, up and running - great!
Thank you very much, this is real support.
Ralf
Abbas, this is great. I have always wanted to make this configurable. One more thing. I would like the Last uploads to list ALBUMS and not the individual pictures. Is that possible? thanks.
lastalb meta album?
thats true. :-[