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: Reduce 'most viewed' filelist  (Read 8952 times)

0 Members and 1 Guest are viewing this topic.

Asobig

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • The Asobig Page
Reduce 'most viewed' filelist
« on: December 31, 2003, 01:44:38 pm »

Is it possible to reduce the number of most viewed files to lets say the top 100.
Now all my files are in de most viewed list (1000 pictures), but i only want to see the top 100.
Logged

Jelem

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Reduce 'most viewed' filelist
« Reply #1 on: January 02, 2004, 11:49:27 am »

Yes, I have the same question.
In addition: is it possible to reduce also the pictures in "last uploads"?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Reduce 'most viewed' filelist
« Reply #2 on: January 02, 2004, 11:55:18 am »

out-of-the-box: no and no. Why does it bother you? They're both meta-albums, no space is wasted, it's just a query...
If you really need it removed you'll have to modify the queries accordingly (I won't look into this because I don't see any sense in this request).

GauGau
Logged

klaws

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 11
Reduce 'most viewed' filelist
« Reply #3 on: January 02, 2004, 01:18:59 pm »

You probally could do it using the "TOP" query function in sql..

i'm sure it would work..

but then again i agree on it doesnt matter if theres a top 100, 1000 or all pictures..
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Reduce 'most viewed' filelist
« Reply #4 on: January 02, 2004, 05:30:26 pm »

You might also look into adding a LIMIT restriction to the SQL query.
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

kanghe

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Reduce 'most viewed' filelist
« Reply #5 on: February 06, 2004, 09:47:26 pm »

I would like to know what query this is, because it does eat a lot of bandwith when somebody chooses the Most Viewed option and there are several thousand thumbnails that have to be shown.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Reduce 'most viewed' filelist
« Reply #6 on: February 06, 2004, 09:53:48 pm »

To reduce the number of pics shown in the last upoads on the front page, just remove the ',2' after 'lastup' in the contents of main page, in config.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Reduce 'most viewed' filelist
« Reply #7 on: February 07, 2004, 01:53:04 am »

The query can be found in /include/functions.inc.php

Find:

Code: [Select]
case 'topn': // Most viewed pictures
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Satrapo

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Reduce 'most viewed' filelist
« Reply #8 on: November 25, 2005, 04:33:01 pm »

If u don't want to alter the query to limit the number of most viewed pics to only one page of thumbs according with your max tabs configuration find

Code: [Select]
       case 'topn': // Most viewed pictures
                if ($ALBUM_SET && $CURRENT_CAT_NAME) {
                        $album_name = $lang_meta_album_names['topn'].' - '. $CURRENT_CAT_NAME;
                } else {
                        $album_name = $lang_meta_album_names['topn'];
                }
                $query ="SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND hits > 0  $ALBUM_SET $keyword";

                $result = db_query($query);
                $nbEnr = mysql_fetch_array($result);
                $count = $nbEnr[0];
and after add

Code: [Select]
                if ($count > $CONFIG['max_tabs']){
                $count = $CONFIG['max_tabs'];
                }

If you want x pages of most viewed pics set a variable and use it in the code
Ex.: For 3 pages of thumbs

$numofpages = (3 * $CONFIG['max_tabs'])

and so the code to add:

Code: [Select]
                if ($count > $numofpages){
                $count = $numofpages;
                }
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 18 queries.