Changeset 816 for trunk/Modules/User/UserList.php
- Timestamp:
- Feb 22, 2015, 11:20:50 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UserList.php
r637 r816 5 5 class PageUserList extends Page 6 6 { 7 8 9 10 11 12 13 14 15 16 17 18 19 20 } else $SearchQuery = ''; 7 function Show() 8 { 9 $this->Title = T('Translators'); 10 ImgLevelUpdate(); 11 12 $Output = ''; 13 if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; 14 else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; 15 if(array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = ''; 16 if($_SESSION['search'] != '') 17 { 18 $SearchQuery = ' AND (`User`.`Name` LIKE "%'.$_SESSION['search'].'%")'; 19 $Output .= '<div><a href="?search=">'.sprintf(T('Disable filter "%s"'), $_SESSION['search']).'</a></div>'; 20 } else $SearchQuery = ''; 21 21 22 22 $TeamFilter = ''; 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 $Output .= $Order['Output']; 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 } 23 if(array_key_exists('team', $_GET)) 24 { 25 $TeamId = $_GET['team'] * 1; 26 $DbResult = $this->Database->select('Team', 'Name', 'Id='.$TeamId); 27 if($DbResult->num_rows > 0) 28 { 29 $Team = $DbResult->fetch_assoc(); 30 $Output .= '<h3>'.sprintf(T('Users in team %s'), $Team['Name']).'</h3>'; 31 $TeamFilter = ' AND (`Team`='.$_GET['team'].')'; 32 } else { 33 $Output .= ShowMessage(sprintf(T('Team %d not found'), $TeamId), MESSAGE_CRITICAL); 34 } 35 } else 36 { 37 $Output .= '<h3>'.T('User list').'</h3>'; 38 } 39 40 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `User` WHERE 1'.$SearchQuery.$TeamFilter); 41 $DbRow = $DbResult->fetch_row(); 42 $PageList = GetPageList($DbRow[0]); 43 44 $Output .= $PageList['Output']. 45 '<table class="BaseTable">'; 46 47 $TableColumns = array( 48 array('Name' => 'Name', 'Title' => T('Name')), 49 array('Name' => 'TranslatedCount', 'Title' => T('Translated count')), 50 array('Name' => 'XP', 'Title' => T('Level')), 51 array('Name' => 'XP', 'Title' => T('Experience')), 52 //array('Name' => 'GM', 'Title' => T('GM')), 53 array('Name' => 'LastLogin', 'Title' => T('Last logged in')), 54 array('Name' => 'RegistrationTime', 'Title' => T('Registration time')), 55 ); 56 $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1); 57 $Output .= $Order['Output']; 58 59 $Query = 'SELECT `User`.`ID`, `User`.`Name`, `LastLogin`, `GM`, `XP`, `TranslatedCount`, `RegistrationTime` '. 60 'FROM `User` '. 61 'LEFT JOIN `UserTrace` ON `UserTrace`.`User` = `User`.`Id` '. 62 'WHERE 1'.$SearchQuery.$TeamFilter.$Order['SQL'].$PageList['SQLLimit']; 63 64 $DbResult = $this->Database->query($Query); 65 while($Line = $DbResult->fetch_assoc()) 66 { 67 $XP = GetLevelMinMax($Line['XP']); 68 $Output .= '<tr><td><a href="user.php?user='.$Line['ID'].'">'.$Line['Name'].'</a></td>'. 69 '<td style="text-align: center;"><a href="TranslationList.php?user='.$Line['ID'].'&group=0&state=2" title="Zobrazit Všechny jeho přeložené texty">'.$Line['TranslatedCount'].'</a></td>'. 70 '<td>'.$XP['Level'].'</td>'. 71 '<td>'.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'</td>'. 72 //<td>'.$Moderators[$Line['GM']].'</td> 73 '<td>'.HumanDate($Line['LastLogin']).'</td>'. 74 '<td>'.HumanDate($Line['RegistrationTime']).'</td></tr>'; 75 } 76 $Output .= '</table>'. 77 $PageList['Output']; 78 79 return($Output); 80 } 81 81 }
Note:
See TracChangeset
for help on using the changeset viewer.