Page 3 of 3

Re: [PLUGIN] Fufi Widgets 0.2

Posted: 28 May 2013, 09:33
by Niros
Thank you very much.

Re: [PLUGIN] Fufi Widgets 0.2

Posted: 05 Jun 2013, 16:15
by Kegulf
Hi all :)

Was not sure where to write this, but I'm assuming since it's a part of Fufi, it should be here :p

On WnLs Obstacle servers, we have had a problem since the start of the server, and the other day I realized what the problem acctually is xD So in the Stats windows in the scorescreen (TopRanks, TopDons, MostHours and so on), the TopRanks, displays the information backwards making the 1st place 49.x instead of me, and I have a record avrage of 10 or 15 :p I can take a screen shot if needed.

I have tried to find out where to edit it, but the only place I find the part "TopRanks" is in fufi_widgets_aseco.xml and fufi_widgets_xaseco.xml, and sadly, there are no possibility for me to quickfix it.

Any ideas?

Best Regards

Re: [PLUGIN] Fufi Widgets 0.2

Posted: 05 Jun 2013, 23:45
by Kegulf
Kegulf wrote:I have tried to find out where to edit it, but the only place I find the part "TopRanks" is in fufi_widgets_aseco.xml and fufi_widgets_xaseco.xml, and sadly, there are no possibility for me to quickfix it.
kremsy wrote:They are called scoreboard lists in the fufi widgets xaseco
Hehe, I have looked there, and tried to fix it, but there is no possiblities for me to fix it, as I see it :P

Code: Select all

      <list>
        <title>Top Ranks</title>
        <content>TopRanks</content>
        <x>45</x>
        <y>29</y>
        <width>18</width>
        <entrycount>5</entrycount>
      </list>
Taken from Fufi_widgets_xaseco.xml

There is nothing I can change there to make it work :p
It's showing the ranks in opposite way, because it thinks the higher the number, the better the rank, but that is wrong :P

Edit:

I think this has to be edited:

Code: Select all

  function getTopRanksList($limit=50){
    $query = 'SELECT p.Login, p.NickName, r.avg FROM players p LEFT JOIN rs_rank r ON (p.Id=r.PlayerId) WHERE r.avg != 0 order by r.avg DESC LIMIT '.$limit;
    $res = mysql_query($query);
    $rankings = array();
    while ($row = mysql_fetch_object($res)) {
      $player = new CTUPlayer($row->NickName, $row->Login);
      $ranking['player'] = $player;
      $ranking['score'] = round($row->avg/1000) / 10;
      if ($ranking['score'] == round($ranking['score'])) $ranking['score'] = $ranking['score'].'.0';
      $rankings[] = $ranking;
    }
    return $rankings;
Taken from plugin.fufi.widgets.php
Line 2242
I'm not good enough at programming to do this yet xD So any ideas?

Re: [PLUGIN] Fufi Widgets 0.2

Posted: 06 Jun 2013, 08:49
by Kegulf
kremsy wrote:I fixed that already some weeks ago for the next release, sorry now I got what you mean, simply write

$query = 'SELECT p.Login, p.NickName, r.avg FROM players p LEFT JOIN rs_rank r ON (p.Id=r.PlayerId) WHERE r.avg != 0 order by r.avg ASC LIMIT '.$limit;

instead of

$query = 'SELECT p.Login, p.NickName, r.avg FROM players p LEFT JOIN rs_rank r ON (p.Id=r.PlayerId) WHERE r.avg != 0 order by r.avg DESC LIMIT '.$limit;

DESC->ASC

OMG I tried everything, except that xD changed from LEFT to RIGHT, "r.avg !=" "r.avg ==" I was angry and desperate xD


WORKED <3 THANK YOU :p That has been bugging me for 2 months now xD

Re: [PLUGIN] Fufi Widgets 0.2

Posted: 06 Jun 2013, 08:57
by Kegulf
kremsy wrote:I have to say sorry that this fix hasn't been changed in the release yet.

I made some more changes, but nothing you can feel about it, I will send it today to maniac-twister and hope that he releases it soon ;).

Not really a big problem though :) Just for apperances sake :p