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: cpm_viewTopRatedMediaFrom issue  (Read 4402 times)

0 Members and 1 Guest are viewing this topic.

Bash

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
cpm_viewTopRatedMediaFrom issue
« on: December 05, 2009, 04:43:07 pm »

This is the code I'm using on the page (I'm using cpmfetch about 3 times on the page):

Code: [Select]
<?php
  $objCpm 
= new cpm("renders/cpmfetch/cpmfetch_config.php");
 
$objCpm->cpm_viewTopRatedMediaFrom ("",1,3,$options);
  
$objCpm->cpm_close(); 
?>

Here's the site: link (go to 'top rated renders' box down the page).

Really don't understand how it's choosing the images, although they do have 5/5 votes but the ones that show up should be the same as the ones on the top rated page on coppermine: link

Don't seem to be restricted by category, and I thought the cpmfetch code is supposed to choose the top rated AND most voted when using the function?

(Note: I used to use an older version of cpmfetch can't remember which, but upon upgrading to the latest stable version this function stopped working now. Could it be conflicting with other cpm fetch codes that I have on the page?)

Thanks in advance,
Logged

Bash

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: cpm_viewTopRatedMediaFrom issue
« Reply #1 on: December 05, 2009, 04:47:10 pm »

sorry can't find the edit button above, here are the correct links:

my site: link
top rated page: link
Logged

Nibbler

  • Guest
Re: cpm_viewTopRatedMediaFrom issue
« Reply #2 on: December 05, 2009, 05:05:52 pm »

Modify cpmfetch to calculate the top rated pics in the same manner as Coppermine.

Edit cpmfetch_dao.php

Code: [Select]
. " ORDER BY p.pic_rating DESC LIMIT 0,$count";

Change to

Code: [Select]
. " ORDER BY p.pic_rating DESC, p.votes DESC, p.pid DESC LIMIT 0,$count";
Logged

Bash

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: cpm_viewTopRatedMediaFrom issue
« Reply #3 on: December 05, 2009, 06:29:05 pm »

Used to be this:

Code: [Select]
ORDER BY p.pic_rating DESC LIMIT 0,$count
changed it to what you said, and the images are still the same

Here are the other cpmfetch codes I have on the page in case they're conflicting, in the same order:

Code: [Select]
<?php
  
include "renders/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("renders/cpmfetch/cpmfetch_config.php");
 
$objCpm->cpm_formatStats ("There are currently <b>%f</b> renders in the gallery");
?>

Code: [Select]
<?php
$options 
= array( 'linkstyle' => 'img_link''tablestyle' => 'lren_tb');
 
$objCpm->cpm_viewLastAddedMedia(14$options);
?>

Code: [Select]
<?php
  $objCpm 
= new cpm("renders/cpmfetch/cpmfetch_config.php");
 
$objCpm->cpm_viewTopRatedMediaFrom ("",1,3,$options);
  
$objCpm->cpm_close(); 
?>
Logged

Bash

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: cpm_viewTopRatedMediaFrom issue
« Reply #4 on: December 05, 2009, 06:31:18 pm »

Oh hang on, for some reason the changes weren't saved the first time. Changed it again and it's working now. Thanks a bunch
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.