Reduce 'most viewed' filelist Reduce 'most viewed' filelist
 

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

Reduce 'most viewed' filelist

Started by Asobig, December 31, 2003, 01:44:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Asobig

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.

Jelem

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

Joachim Müller

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

klaws

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..

hyperion

You might also look into adding a LIMIT restriction to the SQL query.
"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://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

kanghe

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.

Casper

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.
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

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

Find:

case 'topn': // Most viewed pictures
"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://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Satrapo

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


       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


                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:


                if ($count > $numofpages){
                $count = $numofpages;
                }