Changeset 286 for quests/statistic.php
- Timestamp:
- Jan 30, 2008, 6:43:37 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/statistic.php
r280 r286 36 36 37 37 echo '<tr><th><a href="statistic.php?order=user&desc='.$desc.'">Jméno</a></th> 38 <th><a href="statistic.php?order=NumberTranslate&desc='.$desc.'" Title="Poèet pøeloených questù">Pøel. Q.</a></th> 39 <th><a href="statistic.php?order=NumberTranslateNPC&desc='.$desc.'" Title="Poèet pøeloených NPC_textù">Pøel. N.</a></th> 40 <th><a href="statistic.php?order=vote&desc='.$desc.'" Title="Prùmìrná známka questù">Z. Q</a></th> 41 <th><a href="statistic.php?order=voteNPC&desc='.$desc.'" Title="Prùmìrná známka NPC_text">Z. N.</a></th> 38 <th><a href="statistic.php?order=NumberTranslate&desc='.$desc.'" Title="Poèet pøelo¾ených questù">Pøelo¾ených</a></th> 39 <th><a href="statistic.php?order=vote&desc='.$desc.'" Title="Prùmìrná známka questù">Prùmìrná známka</a></th> 42 40 <th><a href="statistic.php?order=GM&desc='.$desc.'">Oprávnìní</a></th> 43 41 <th><a href="statistic.php?order=LastLogin&desc='.$desc.'">Poslední pøipojení</a></th></tr>'; 44 42 45 $ID = $Database->SQLCommand("SELECT user,Email,LastLogin,GM, 46 (SELECT count(*) FROM `quests` WHERE User = user.id AND User <> 0) as NumberTranslate, 47 (SELECT count(*) FROM `npc_text` WHERE User = user.id AND User <> 0) as NumberTranslateNPC, 48 (SELECT avg(vote) FROM `quests` WHERE User = user.id AND Complete = 1) as vote, 49 (SELECT avg(Vote) FROM `npc_text` WHERE User = user.id AND Complete = 1) as voteNPC 43 /* 44 SELECT user, LastLogin, GM, ( 45 (SELECT count(*) FROM `quests` WHERE User = user.ID AND User <> 0 AND Complete = 1) + 46 (SELECT count(*) FROM `npc_text` WHERE User = user.ID AND User <> 0 AND Complete = 1) + 47 (SELECT count(*) FROM `page_text` WHERE User = user.ID AND User <> 0 AND Complete = 1) 48 ) as NumberTranslate, ( 49 SELECT IFNULL((SELECT AVG(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1),0) 50 + IFNULL((SELECT AVG(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1),0) 51 + IFNULL((SELECT AVG(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1),0) 52 ) /3 AS Vote 53 FROM `user` 54 55 */ 56 57 $ID = $Database->SQLCommand(" 58 SELECT ID,user, LastLogin, GM, ( 59 (SELECT count(*) FROM `quests` WHERE User = user.ID AND User <> 0 AND Complete = 1) + 60 (SELECT count(*) FROM `npc_text` WHERE User = user.ID AND User <> 0 AND Complete = 1) + 61 (SELECT count(*) FROM `page_text` WHERE User = user.ID AND User <> 0 AND Complete = 1) 62 ) as NumberTranslate, ( 63 IFNULL((SELECT sum(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1),0) 64 + IFNULL((SELECT sum(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1),0) 65 + IFNULL((SELECT sum(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1),0) 66 ) AS SumVote, ( 67 (SELECT count(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1) 68 + (SELECT count(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1) 69 + (SELECT count(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1) 70 ) AS CountText 50 71 FROM `user` ORDER BY $order $desc"); 51 while ($Line = mysql_fetch_array($ID)) 52 echo '<tr><td>'.$Line['user'].'</td> 72 73 while ($Line = mysql_fetch_array($ID)) { 74 75 if ($Line['CountText'] <> 0) 76 $Vote = $Line['SumVote']/$Line['CountText']; 77 else $Vote = 0; 78 79 if (Licence(1)) 80 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>'; 81 else 82 $Name = $Line['user']; 83 84 echo '<tr><td>'.$Name.'</td> 53 85 <td>'.$Line['NumberTranslate'].'</td> 54 <td>'.$Line['NumberTranslateNPC'].'</td> 55 <td>'.substr($Line['vote'], 0, 4).'</td> 56 <td>'.substr($Line['voteNPC'], 0, 4).'</td> 86 <td>'.substr($Vote, 0, 4).'</td> 57 87 <td>'.$Moderators[$Line['GM']].'</td> 58 88 <td>'.$Line['LastLogin'].'</td></tr>'; 59 89 90 } 60 91 61 92 echo '</table>';
Note:
See TracChangeset
for help on using the changeset viewer.