coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: Fifth Harmony on February 02, 2014, 03:01:06 PM

Title: Show file views under thumbs on home page
Post by: Fifth Harmony on February 02, 2014, 03:01:06 PM
Hello,

I want to show the file views and album views together on the home page of my photo gallery, instead of just the album views. Anyone knows how I can do that?
Title: Re: Show file views under thumbs on home page
Post by: Fifth Harmony on February 02, 2014, 08:09:08 PM
Can anyone help me with this, please?  :D
Title: Re: Show file views under thumbs on home page
Post by: gmc on February 02, 2014, 09:50:02 PM
It's only been a few hours... and though I saw your post, the person I felt could best answer this hasn't been on...

The total hits for pictures in an album isn't saved in one place... For each album, you would need to sum the hits of all the pictures in the album... possibly considering linked pictures as well...
The SQL will be along the lines of:
SELECT SUM(hits) AS totalhits FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '{current_aid}'
(with appropriate variable containing the value of {current_aid}... variable depends on where the code gets added.)
To consider linked pictures, would need to add an OR condition where the keywords field of the picture includes the keyword of the album considering the keyword delimiter character set in config...

And then of course display the results.
The code would go in index.php in function list_albums() to gather the data at least.
I haven't looked to see the desired data could be added to an existing SQL call or not...
Perhaps one of the other devs will add to this as they have time.
Title: Re: Show file views under thumbs on home page
Post by: Αndré on February 03, 2014, 04:15:17 PM
For a start you should decide if you want to include file views of linked pictures or not.
Title: Re: Re: Show file views under thumbs on home page
Post by: Fifth Harmony on February 04, 2014, 03:15:13 PM
Quote from: Αndré on February 03, 2014, 04:15:17 PM
For a start you should decide if you want to include file views of linked pictures or not.

Like this: http://oi58.tinypic.com/120qlb7.jpg


[Edit: attached hotlinked image]
Title: Re: Show file views under thumbs on home page
Post by: Αndré on February 04, 2014, 03:52:30 PM
That doesn't answer my question.
Title: Re: Show file views under thumbs on home page
Post by: Αndré on February 11, 2014, 11:39:37 AM
Solution: http://forum.coppermine-gallery.net/index.php/topic,77176.msg373115.html#msg373115