coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Forgott3n on August 04, 2008, 04:47:02 AM

Title: Last Updated Albums
Post by: Forgott3n on August 04, 2008, 04:47:02 AM
Hello,

at http://gallery.avrilbandaids.com we've added the most recently update albums to the main page. However the "views" underneath show the views for the image displayed and not for the entire album. Is there a way to determine and show the total amount of views per album and integrate that into the "lastalb" block.

Thank you.
Title: Re: Last Updated Albums
Post by: Joachim Müller on August 04, 2008, 06:59:35 AM
No, as cpg1.4.x doesn't record views per album.
Title: Re: Last Updated Albums
Post by: Forgott3n on August 04, 2008, 07:09:52 AM
Do you plan to implement this in future versions?
Title: Re: Last Updated Albums
Post by: Αndré on August 04, 2008, 09:30:42 AM
Open include/functions.inc.php

Find:
$query = "SELECT *,{$CONFIG['TABLE_ALBUMS']}.title AS title,{$CONFIG['TABLE_ALBUMS']}.aid AS aid FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND approved = 'YES' $META_ALBUM_SET GROUP BY {$CONFIG['TABLE_PICTURES']}.aid ORDER BY {$CONFIG['TABLE_PICTURES']}.ctime DESC $limit";

Replace with:
$query = "SELECT *,{$CONFIG['TABLE_ALBUMS']}.title AS title,{$CONFIG['TABLE_ALBUMS']}.aid AS aid, SUM(hits) AS hits FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND approved = 'YES' $META_ALBUM_SET GROUP BY {$CONFIG['TABLE_PICTURES']}.aid ORDER BY {$CONFIG['TABLE_PICTURES']}.ctime DESC $limit";
Title: Re: Last Updated Albums
Post by: Forgott3n on August 05, 2008, 05:30:07 AM
Thanks so much for that help!