Last Updated Albums Last Updated Albums
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Last Updated Albums

Started by Forgott3n, August 04, 2008, 04:47:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Forgott3n

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.

Joachim Müller

No, as cpg1.4.x doesn't record views per album.

Forgott3n

Do you plan to implement this in future versions?

Αndré

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";

Forgott3n

Thanks so much for that help!