1 (edited by Frank H 2005-04-12 16:33)

Topic: Ranking doesn't always generate linear min_posts count in cache

The ranking system can sometimes fail (show wrong rank) if the cache happens to have a scrambled order of the ranks and the minimum posts needed.

To fix, make the query at line 132 in cache.php to be ordered by min_posts, so it will write down the rank cache in correct order smile
(I failed to fix it, got some scrambled output in viewtopic when adding "ORDER BY '.$db->prefix.'min_posts ASC" to that query...)

Re: Ranking doesn't always generate linear min_posts count in cache

Thanks. I'll look into it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Ranking doesn't always generate linear min_posts count in cache

<?php

define('PUN_RANKS_LOADED', 1);

$pun_ranks = array (
  0 => array (
    'id' => '1',
    'rank' => 'Förare utan kontrakt',
    'min_posts' => '0',
  ),
  1 => array (
    'id' => '10',
    'rank' => 'Renault förare',
    'min_posts' => '1250',
  ),
  2 => array (
    'id' => '13',
    'rank' => 'Red Bull förare',
    'min_posts' => '250',
  ),
  3 => array (
    'id' => '3',
    'rank' => 'Minardi förare',
    'min_posts' => '1',
  ),
  4 => array (
    'id' => '4',
    'rank' => 'Jordan förare',
    'min_posts' => '50',
  ),
  5 => array (
    'id' => '5',
    'rank' => 'Toyota förare',
    'min_posts' => '100',
  ),
  6 => array (
    'id' => '7',
    'rank' => 'Sauber förare',
    'min_posts' => '500',
  ),
  7 => array (
    'id' => '8',
    'rank' => 'Williams förare',
    'min_posts' => '1000',
  ),
  8 => array (
    'id' => '9',
    'rank' => 'McLaren förare',
    'min_posts' => '750',
  ),
  9 => array (
    'id' => '11',
    'rank' => 'BAR förare',
    'min_posts' => '1500',
  ),
  10 => array (
    'id' => '12',
    'rank' => 'Ferrari förare',
    'min_posts' => '1750',
  ),
);

?>

just an example of how it looked, everyone above 100 (and under 500) got Toyota förare even though they had passed 250 (same will probably happen after 750 to 1500)

4 (edited by reviewum.com 2005-05-01 03:30)

Re: Ranking doesn't always generate linear min_posts count in cache

Friends,

I'm having the same problem.   I've got 4 Ranks on my inkjet forum: http://www.nifty-stuff.com/forum/

InkJet Forum Newbie 0
InkJet Forum Participator 10
InkJet Guru 25
InkJet Master 50

No matter what number I set "InkJet Master" to, everyone is still a Guru.

Hopefully a fix in the next release.  I'm trying to keep my forum as un-modded as possible.

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Ranking doesn't always generate linear min_posts count in cache

Fixed.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Ranking doesn't always generate linear min_posts count in cache

nice smile

Re: Ranking doesn't always generate linear min_posts count in cache

Yes, REV 194 worked fine now !
Thanks !

Sorry for my french english.
GT4 Club driver France & Forum - Lingerie.

Re: Ranking doesn't always generate linear min_posts count in cache

Okay, I'm an idiot.   Am I to assume the fix is in the newest "release" of this great script?

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Ranking doesn't always generate linear min_posts count in cache

No, when I say fixed, I mean I fixed it in Subversion. Here's what I changed.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Ranking doesn't always generate linear min_posts count in cache

I replaced that function in my 1.2.5 installation (and removed the cachefile), and it works like a charm smile

Re: Ranking doesn't always generate linear min_posts count in cache

Subversion... gotcha.   I made the change to cache.php, but I guess I still need to remove cachefile for it to work?   Can you help a non-programmer out... where is the cachefile how do I remove it?  In the DB or is it an actual file?

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

12 (edited by Smartys 2005-05-09 22:19)

Re: Ranking doesn't always generate linear min_posts count in cache

in the cache folder
delete all the .php files

Edit: Ooh, idea for a plugin smile

13 (edited by reviewum.com 2005-05-09 22:39)

Re: Ranking doesn't always generate linear min_posts count in cache

SWEET!   I had a bit of trepidation to delete php files, but I had faith in the all knowing Samratys!  big_smile

Worked like a charm!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Ranking doesn't always generate linear min_posts count in cache

And I've created a plugin to do it for you smile