Advanced search  

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

Pages: [1]   Go Down

Author Topic: Show file views under thumbs on home page  (Read 4703 times)

0 Members and 1 Guest are viewing this topic.

Fifth Harmony

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Show file views under thumbs on home page
« 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?
Logged

Fifth Harmony

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Show file views under thumbs on home page
« Reply #1 on: February 02, 2014, 08:09:08 pm »

Can anyone help me with this, please?  :D
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Show file views under thumbs on home page
« Reply #2 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.
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show file views under thumbs on home page
« Reply #3 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.
Logged

Fifth Harmony

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Re: Show file views under thumbs on home page
« Reply #4 on: February 04, 2014, 03:15:13 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]
« Last Edit: February 05, 2014, 11:47:50 am by Αndré »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show file views under thumbs on home page
« Reply #5 on: February 04, 2014, 03:52:30 pm »

That doesn't answer my question.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.