Changeset 303
- Timestamp:
- Jan 4, 2010, 10:57:57 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 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 } -
trunk/includes/global.php
r302 r303 323 323 324 324 echo('</td></tr>'); 325 if($Config['Web']['ShowRuntimeInfo'] == true) echo('<tr><td colspan="3" style="text-align: center;">Doba generování: '.$ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B </td></tr>');325 if($Config['Web']['ShowRuntimeInfo'] == true) echo('<tr><td colspan="3" style="text-align: center;">Doba generování: '.$ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B <a href="http://validator.w3.org/check?uri='.htmlentities('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?'.$_SERVER['QUERY_STRING']).'">HTML validator</a></td></tr>'); 326 326 echo('</table>'. 327 327 '</body>'. -
trunk/registrace.php
r302 r303 68 68 <td><select name="Team"><option value="0">Žádného</option> 69 69 '); 70 $ID = $Database->SQLCommand('SELECT ` name`, `Id` FROM `Team`');70 $ID = $Database->SQLCommand('SELECT `Name`, `Id` FROM `Team`'); 71 71 while($Line = mysql_fetch_assoc($ID)) 72 72 { -
trunk/sql/updates/302.sql
r302 r303 1 1 ALTER TABLE `team` ADD `URL` VARCHAR( 255 ) NOT NULL ; 2 2 ALTER TABLE `team` CHANGE `ID` `Id` INT( 11 ) NOT NULL AUTO_INCREMENT ; 3 LTER TABLE `team` CHANGE `name` `Name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL;3 ALTER TABLE `team` CHANGE `name` `Name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL; 4 4 ALTER TABLE `team` CHANGE `description` `Description` TEXT CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL ; 5 5 -
trunk/team.php
r302 r303 185 185 $Team = mysql_fetch_assoc($Database->SQLCommand('SELECT *, (SELECT count(*) FROM `user` WHERE `team` = `Team`.`Id`) as `NumberUser`, (SELECT SUM('.substr($Columns, 0, -3).') FROM user '.$Joins.' WHERE `team` = `Team`.`Id`) as `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id'])); 186 186 $DbResult = $Database->SQLCommand('SELECT user FROM user WHERE ID='.$Team['Leader']); 187 if(mysql_num_rows($DbResult) > 0) $Leader = mysql_fetch_assoc($DbResult); 188 else $Leader = ''; 187 if(mysql_num_rows($DbResult) > 0) 188 { 189 $Leader = mysql_fetch_assoc($DbResult); 190 $Leader = $Leader['user']; 191 } else $Leader = ''; 189 192 190 193 echo('<strong>Překladatelský tým '.$Team['Name'].'</strong><br />'.
Note:
See TracChangeset
for help on using the changeset viewer.