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: Limit the number of pictures displayed in the "most viewed" and "top rated"  (Read 4234 times)

0 Members and 1 Guest are viewing this topic.

T3rry

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36

currently i have 16 pages of photos displayed in the "most viewed" area, is there a way to make it so it only displays say the 40 (1 page on my settings) most viewed files.
« Last Edit: November 10, 2004, 09:38:49 pm by TranzNDance »
Logged

Nibbler

  • Guest

Find the relevent sql query and add LIMIT 40 to it. I can't advise specific code changes to 1.2 any longer.
Logged

T3rry

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36

unfortunatly i dont have the knowlegde to do this, can anybody else help?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149

You should upgrade to the latest version. Especially if you are going to modify your files, why work with outdated ones?
Logged

T3rry

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36

sorry i just checked and i do have 1.3.2 my mistake sorry, i thought i had installed 1.2 because the new version did not work with the shopping cart system i intended to use... mods could you please move this to the appropreate area?
Logged

Nibbler

  • Guest

Changes are in functions.inc.php, find:

Code: [Select]
$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];

change to

Code: [Select]
$count = 40;
and

Code: [Select]
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND hits > 0 $ALBUM_SET $keyword ORDER BY hits DESC, filename  $limit");
to

Code: [Select]
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND hits > 0 $ALBUM_SET $keyword ORDER BY hits DESC, filename LIMIT 40");
That's for most viewed - it is almost the same for all meta albums.
Logged

T3rry

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36

will try that, thanks



EDIT: worked flawlessly, thank you very much
« Last Edit: November 10, 2004, 09:17:20 pm by T3rry »
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.