Changeset 303 for trunk/export/index.php
- Timestamp:
- Jan 4, 2010, 10:57:57 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/index.php
r299 r303 167 167 } 168 168 169 $Columns = '';170 $Joins = '';171 foreach($TranslationTree as $Group)172 if($Group['TablePrefix'] != '')173 {174 $Columns .= 'COALESCE(T'.$Group['Id'].'.Count, 0) + ';175 $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';176 }177 $Query = 'SELECT (@I := @I + 1) AS Sequence2, ExportUser.Sequence, T.ID, T.TranslatedCount, T.user, T.XP FROM (SELECT user.ID, user.user, user.XP, ('.substr($Columns, 0, -3).') as TranslatedCount FROM `user`'.$Joins.') AS T';178 $Query .=' LEFT JOIN ExportUser ON ExportUser.Export = '.$_GET['ExportId'].' AND ExportUser.User=T.ID';179 $Query .=' WHERE T.TranslatedCount > 0 ORDER BY COALESCE(Sequence, 100)';180 181 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');182 $DbRow = mysql_fetch_row($DbResult);183 $PageList = GetPageList($DbRow[0]);184 185 169 $TableColumns = array( 186 170 array('Name' => 'user', 'Title' => 'Jméno'), … … 191 175 ); 192 176 $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1); 177 178 $Columns = ''; 179 $Joins = ''; 180 foreach($TranslationTree as $Group) 181 if($Group['TablePrefix'] != '') 182 { 183 $Columns .= 'COALESCE(T'.$Group['Id'].'.Count, 0) + '; 184 $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'; 185 } 186 $Query = 'SELECT (@I := @I + 1) AS Sequence2, TT.* FROM (SELECT ExportUser.Sequence, T.ID, T.TranslatedCount, T.user, T.XP FROM (SELECT user.ID, user.user, user.XP, ('.substr($Columns, 0, -3).') as TranslatedCount FROM `user`'.$Joins.') AS T'; 187 $Query .=' LEFT JOIN ExportUser ON ExportUser.Export = '.$_GET['ExportId'].' AND ExportUser.User=T.ID'; 188 $Query .=' WHERE T.TranslatedCount > 0 ORDER BY COALESCE(ExportUser.Sequence, 100000000), '.substr($Order['SQL'], 10).') AS TT'; 189 190 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X'); 191 $DbRow = mysql_fetch_row($DbResult); 192 $PageList = GetPageList($DbRow[0]); 193 193 194 echo('<form action="?Action=View&ExportId='.$_GET['ExportId'].'&Operation=Save" method="post">'); 194 195 echo('<h3>Překladatelé</h3>'); … … 212 213 <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User['user'].'</a></td> 213 214 <td>'.$User['TranslatedCount'].'</td> 214 <td><img src="'.$Config['Web']['TempFolder']. $User['user'].'/level.png" alt="Úroveň uživatele" /></td>215 <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User['user'].'/level.png" alt="Úroveň uživatele" /></td> 215 216 <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>'); 216 217 }
Note:
See TracChangeset
for help on using the changeset viewer.