Changeset 287


Ignore:
Timestamp:
Jan 30, 2008, 6:59:15 PM (17 years ago)
Author:
maron
Message:

oprava statistic.php

Location:
quests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quests/statistic.php

    r286 r287  
    3737  echo '<tr><th><a href="statistic.php?order=user&amp;desc='.$desc.'">Jméno</a></th>
    3838  <th><a href="statistic.php?order=NumberTranslate&amp;desc='.$desc.'" Title="Poèet pøelo¾ených questù">Pøelo¾ených</a></th>
    39   <th><a href="statistic.php?order=vote&amp;desc='.$desc.'" Title="Prùmìrná známka questù">Prùmìrná známka</a></th>
     39  <th><a href="statistic.php?order=Vote&amp;desc='.$desc.'" Title="Prùmìrná známka questù">Prùmìrná známka</a></th>
    4040  <th><a href="statistic.php?order=GM&amp;desc='.$desc.'">Oprávnìní</a></th>
    4141  <th><a href="statistic.php?order=LastLogin&amp;desc='.$desc.'">Poslední pøipojení</a></th></tr>';
     
    6464     + IFNULL((SELECT sum(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1),0)
    6565     + IFNULL((SELECT sum(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1),0)
    66      ) AS SumVote, (
     66     ) / (
    6767       (SELECT count(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1)
    6868     + (SELECT count(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1)
    6969     + (SELECT count(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1)
    70      ) AS CountText
     70     ) AS Vote
    7171   FROM `user` ORDER BY $order $desc");
    7272   
    7373      while ($Line = mysql_fetch_array($ID)) {
    74      
    75         if ($Line['CountText'] <> 0)
    76           $Vote = $Line['SumVote']/$Line['CountText'];
    77         else $Vote = 0;
    78        
     74             
    7975        if (Licence(1))
    8076          $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>';
     
    8480        echo '<tr><td>'.$Name.'</td>
    8581        <td>'.$Line['NumberTranslate'].'</td>
    86         <td>'.substr($Vote, 0, 4).'</td>
     82        <td>'.substr($Line['Vote'], 0, 4).'</td>
    8783        <td>'.$Moderators[$Line['GM']].'</td>
    8884        <td>'.$Line['LastLogin'].'</td></tr>';
  • quests/user.php

    r286 r287  
    3434     + IFNULL((SELECT sum(Vote) AS Vote FROM `page_text` WHERE User = ".$_GET['user']." AND Complete =1),0)
    3535     + IFNULL((SELECT sum(Vote) AS Vote FROM `npc_text` WHERE User = ".$_GET['user']." AND Complete =1),0)
    36      ) AS SumVote, (
     36     ) / (
    3737       (SELECT count(Vote) AS Vote FROM `quests` WHERE User = ".$_GET['user']." AND Complete =1)
    3838     + (SELECT count(Vote) AS Vote FROM `page_text` WHERE User = ".$_GET['user']." AND Complete =1)
    3939     + (SELECT count(Vote) AS Vote FROM `npc_text` WHERE User = ".$_GET['user']." AND Complete =1)
    40      ) AS CountText
     40     ) AS Vote
    4141   FROM `user` WHERE ID = ".$_GET['user']));
    4242   
    43         if ($LineUser['CountText'] <> 0)
    44           $Vote = $LineUser['SumVote']/$LineUser['CountText'];
    45         else $Vote = 0;
    46 
    4743    echo 'ID: <b>'.$_GET['user'].'</b><br />';
    4844    echo 'Jméno: <b>'.$LineUser['user'].'</b><br />';
     
    5147    echo 'Posledí IP: <b>'.$LineUser['LastIP'].'</b><br />';
    5248    echo 'Poèet pøelo¾ených: <b>'.$LineUser['NumberTranslate'].'</b><br />';
    53     echo 'Prùmìrná známka: <b>'.$Vote.'</b><br />';
     49    echo 'Prùmìrná známka: <b>'.$LineUser['Vote'].'</b><br />';
    5450    echo 'Email: <b>'.$LineUser['Email'].'</b><br />';
    5551    echo '<br>
Note: See TracChangeset for help on using the changeset viewer.