I've used the album/picture keyword support to link photos to multiple albums.
In some cases, I rarely upload to the album, but regularly add linked photos.
Unfortunately, the album info display makes it appear the album hasn't had any changes (except for the linked count going up - which I doubt a user would remember from their last visit).
Example:
"
6 files, last one added on Nov 08, 2007, 138 linked files, 144 files total" - appearing the album hasn't been updated since 2007.
With a couple of simple changes, I've set the date to the max of last uploaded to album, or max last uploaded date of a linked image.
All changes in index.php - based on 1.5.26 code base - $CONFIG['link_pic_count'] must be set for this to have any effect
For display in a category list (index.php?cat=x)
In function list_albums:
replace
$query = "SELECT count(pid) AS link_pic_count, max(pid) AS link_last_pid "
with
$query = "SELECT count(pid) AS link_pic_count, max(pid) AS link_last_pid, max(ctime) AS link_last_upload " //*GMC - changed to obtain last upload time via max(ctime) of linked photos
and replace (really an insert of second line only)
$alb_stats[$key]['last_pid'] = ($alb_stats[$key]['last_pid'] > $link_stat['link_last_pid']) ? $alb_stats[$key]['last_pid'] : $link_stat['link_last_pid'];
with
$alb_stats[$key]['last_pid'] = ($alb_stats[$key]['last_pid'] > $link_stat['link_last_pid']) ? $alb_stats[$key]['last_pid'] : $link_stat['link_last_pid'];
$alb_stats[$key]['last_upload'] = ($alb_stats[$key]['last_upload'] > $link_stat['link_last_upload']) ? $alb_stats[$key]['last_upload'] : $link_stat['link_last_upload']; //*GMC - update last_upload if linked pic was later...
For display on home page, (index.php) - similar changes - different function...
In function list_cat_albums:
replace
$query = "SELECT count(pid) AS link_pic_count, max(pid) AS link_last_pid "
with
$query = "SELECT count(pid) AS link_pic_count, max(pid) AS link_last_pid, max(ctime) AS link_last_upload " //*GMC - changed to obtain last upload time via max(ctime) of linked photos
and replace (really an insert of second line only)
$catdata['subalbums'][$aid]['last_pid'] = !empty($album['last_pid']) && ($album['last_pid'] > $link_stat['link_last_pid']) ? $album['last_pid'] : $link_stat['link_last_pid'];
with
$catdata['subalbums'][$aid]['last_pid'] = !empty($album['last_pid']) && ($album['last_pid'] > $link_stat['link_last_pid']) ? $album['last_pid'] : $link_stat['link_last_pid'];
$catdata['subalbums'][$aid]['last_upload'] = ($album['last_upload'] > $link_stat['link_last_upload']) ? $album['last_upload'] : $link_stat['link_last_upload']; //*GMC - update last_upload if linked pic was later...
The above alone results in (same album as example above):
"
6 files, last one added on Jan 29, 2013, 138 linked files, 144 files total" - a little misleading in that last add was linked file...
A couple more changes to reformat the message - in same two functions...
In function list_albums:
replace TWICE
(once in 'if' - again in immediately following 'else' - the two occurrences have a one space (insignificant) difference between current strings)
$alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']}, {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "");
with
$alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']}, {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "") . (($count || ($CONFIG['link_pic_count'] && $link_pic_count > 0 )) ? sprintf($lang_list_albums['last_added'], $last_upload_date) : ""); //*GMC reformated message
And again - similar changes - different function...
In function list_cat_albums:
replace TWICE
(once in 'if' - again in immediately following 'else' - the two occurrences have a one space (insignificant) difference between current strings)
$alb_list[$aid]['album_info'] = sprintf($lang_list_albums['n_pictures'], $album['pic_count']) . ($album['pic_count'] ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0) ? sprintf(", {$lang_list_albums['n_link_pictures']}, {$lang_list_albums['total_pictures']}", $link_pic_count, $album['pic_count'] + $link_pic_count) : "");
with
$alb_list[$aid]['album_info'] = sprintf($lang_list_albums['n_pictures'], $album['pic_count']) . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']}, {$lang_list_albums['total_pictures']}", $link_pic_count, $album['pic_count'] + $link_pic_count) : "") . (($album['pic_count'] || ($CONFIG['link_pic_count'] && $link_pic_count > 0 )) ? sprintf($lang_list_albums['last_added'], $last_upload_date) : ""); //*GMC reformated message
This changes the resulting message to read (same album as examples above):
"
6 files, 138 linked files, 244 files total, last one added on Jan 29, 2013"
These changes are in place on
http://greggallery.gmcdesign.com - specifically a view containing 2 albums with linked files:
http://greggallery.gmcdesign.com/index.php?cat=20If acceptable, I would like to suggest these changes be incorporated into the base?
I think it gives a more accurate view of updates to an album the user will see upon viewing.
(Ideally I'd like to see random and last loaded on the category page include linked files as well if $CONFIG['link_pic_count'] is set - but I haven't gotten that far in the code... Perhaps another thread.. looks like updates to function get_pic_data for meta albums 'lastup' and 'random' at least and maybe others if they consider album and/or cat... Any interest from others?..

)
Thanks!