Show file views under thumbs on home page Show file views under thumbs on home page
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Show file views under thumbs on home page

Started by Fifth Harmony, February 02, 2014, 03:01:06 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Fifth Harmony

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?

Fifth Harmony


gmc

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.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Αndré

For a start you should decide if you want to include file views of linked pictures or not.

Fifth Harmony

#4
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]

Αndré