Changeset 102
- Timestamp:
- Feb 18, 2009, 7:47:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/download.php
r98 r102 3 3 session_start(); 4 4 5 if(!array_key_exists('ExportSetting', $_SESSION)) 6 $_SESSION['ExportSetting'] = $_COOKIE['ExportSetting']; 5 if(!array_key_exists('ExportSetting', $_SESSION)) 6 if(array_key_exists('ExportSetting', $_COOKIE)) 7 $_SESSION['ExportSetting'] = $_COOKIE['ExportSetting']; 8 else $_SESSION['ExportSetting'] = array(); 7 9 8 10 setcookie('ExportSetting', $_SESSION['ExportSetting']); … … 266 268 </script>'); 267 269 echo('<form name="ListUser" action="?action=parameters" method="post">'); 268 $Query = 'SELECT T.user, T.ID, T.TranslatedCount FROM (SELECT user, ID, ('; 270 271 $Columns = ''; 272 $Joins = ''; 269 273 foreach($TranslationTree as $Group) 270 274 if($Group['TablePrefix'] != '') 271 $Query .= '(SELECT COUNT(*) FROM '.$Group['TablePrefix'].' WHERE (user = user.ID) AND (Complete = 1) AND (Language <> 0)) + '; 272 $Query .= ' 0) AS TranslatedCount FROM `user` ORDER BY user) AS T WHERE T.TranslatedCount > 0 ORDER BY T.TranslatedCount DESC'; 273 //echo($Query); 274 $ID = $Database->SQLCommand($Query); 275 275 { 276 $Columns .= 'COALESCE(T'.$Group['Id'].'.Count, 0) + '; 277 $Joins .= ' LEFT JOIN (SELECT User, COUNT(User) as Count FROM `'.$Group['TablePrefix'].'` WHERE (Complete = 1) AND (Language <> 0) GROUP BY User) as T'.$Group['Id'].' ON user.ID=T'.$Group['Id'].'.User'; 278 } 279 280 $Query = 'SELECT T.ID, T.TranslatedCount, T.user FROM (SELECT user.ID, user.user, ('.substr($Columns, 0, -3).') as TranslatedCount FROM `user`'.$Joins.') AS T WHERE T.TranslatedCount > 0 ORDER BY T.TranslatedCount DESC'; 281 $ID = $Database->SQLCommand($Query); 282 276 283 // Rebuild user order list 277 284 $Users = array(); 278 while($Line = mysql_fetch_a rray($ID)) $Users[$Line['ID']] = $Line;285 while($Line = mysql_fetch_assoc($ID)) $Users[$Line['ID']] = $Line; 279 286 $UsersOrder = explode(',', $ExportSetting['users-order']); 280 287 foreach($Users as $User)
Note:
See TracChangeset
for help on using the changeset viewer.