Changeset 321
Legend:
- Unmodified
- Added
- Removed
-
trunk/TranslationList.php
r316 r321 45 45 function Nontranslated() 46 46 { 47 global $GroupId, $Table, $BuildNumber_max; 48 49 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 50 <a title="Zde můžete začít překládat" href="?group='.$GroupId.'&action=selection">Nepřeložené texty</a> - > 51 <strong>Vypsání nepřeložených textů s limitem na stránku</strong><br /><br />'); 52 53 WriteQuests('SELECT * FROM '.$Table.' AS items WHERE (items.Language = 0) AND 54 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd = "'.$BuildNumber_max.'")'); 47 global $GroupId, $Table; 48 49 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> '. 50 '<a title="Zde můžete začít překládat" href="?group='.$GroupId.'&action=selection">Nepřeložené texty</a> - > '. 51 '<strong>Vypsání nepřeložených textů s limitem na stránku</strong><br /><br />'); 52 53 WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0) AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.`entry` = `items`.`entry`) )'); 55 54 } 56 55 … … 62 61 63 62 //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1) 64 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT Name FROM connexionWHERE `Id` = '.$_SESSION['connexion_id']));63 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT `Name` FROM `connexion` WHERE `Id` = '.$_SESSION['connexion_id'])); 65 64 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 66 65 <a title="Zde je seznam souvislostí" href="?group='.$GroupId.'&action=connexion">Souvislosti</a> - > 67 66 <strong>Vypsání souvislostí ze skupiny '.$Line['Name'].'</strong><br /><br />'); 68 67 69 WriteQuests('SELECT *, (SELECT sub.User FROM '.$Table.' as sub WHERE sub.entry = '.$Table.'.entry AND Language <> 0 LIMIT 1) as UserID, (SELECT user.user FROM user WHERE user.id = UserID) AS UserName FROM '.$Table.' WHERE Language = 0 AND entry IN(SELECT entry FROM connexion_item WHERE connexion = '.$_SESSION['connexion_id'].') AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd= "'.$BuildNumber_max.'"');68 WriteQuests('SELECT *, (SELECT `sub`.`User` FROM `'.$Table.'` AS `sub` WHERE (`sub`.`entry` = `'.$Table.'`.`entry`) AND (`Language` <> 0) LIMIT 1) AS `UserID`, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `UserID`) AS `UserName` FROM `'.$Table.'` WHERE (`Language` = 0) AND (`entry` IN(SELECT `entry` FROM `connexion_item` WHERE `connexion` = '.$_SESSION['connexion_id'].') AND `VersionEnd` = "'.$BuildNumber_max.'" AND `VersionEnd` = "'.$BuildNumber_max.'"'); 70 69 } 71 70 … … 80 79 echo('<table class="BaseTable"><tr><th>Pořadové číslo</th><th>Název</th>'); 81 80 echo('</tr>'); 82 $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE 81 $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE `Group` = '.$GroupId); 83 82 while($Line = mysql_fetch_assoc($ID)) 84 83 { … … 342 341 if(array_key_exists('action', $_GET)) $Action = $_GET['action']; else $Action = ''; 343 342 344 $ID = mysql_fetch_row($Database->SQLCommand('SELECT max(VersionEnd) FROM '.$TranslationTree[$GroupId]['TablePrefix'])); 343 $DbResult = $Database->SQLCommand('SELECT MAX(`VersionEnd`) FROM `'.$TranslationTree[$GroupId]['TablePrefix'].'`'); 344 $ID = mysql_fetch_row($DbResult); 345 345 $BuildNumber_max = $ID[0]; 346 346 -
trunk/form.php
r320 r321 13 13 $TextID = $_GET['ID'] * 1; 14 14 15 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM '.$Table.' Where ID = '.$TextID)); 15 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID); 16 $Line = mysql_fetch_assoc($DbResult); 16 17 if(!$Line) die('Překlad nenalezen.'); 17 18 18 $LineAJ = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE Language = 0 AND entry = '.$Line['entry'].' AND VersionEnd = '.$Line['VersionEnd'].' LIMIT 1')); 19 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `Language` = 0 AND `entry` = '.$Line['entry'].' AND `VersionEnd` = '.$Line['VersionEnd'].' LIMIT 1'); 20 $LineAJ = mysql_fetch_assoc($DbResult); 19 21 if(!$Line) die('Anglický originál k překladu nenalezen.'); 20 22 21 23 $User = @$_SESSION['User']; 22 $IDUser = $Database->SQLCommand('SELECT * FROM user WHERE id= '.$Line['User']);24 $IDUser = $Database->SQLCommand('SELECT * FROM `user` WHERE `id` = '.$Line['User']); 23 25 $LineUser = mysql_fetch_array($IDUser); 24 26 25 27 echo('Skupina: <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />'); 26 28 27 if(($Line['Language'] <> 0) and ($LineUser['user'] <> '')) echo('Přeložil: <strong>'.$LineUser['user'].'</strong> <br />'); 29 if(($Line['Language'] <> 0) and ($LineUser['user'] <> '')) 30 echo('Přeložil: <strong>'.$LineUser['user'].'</strong> <br />'); 28 31 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID'])) 29 32 { 30 $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT Language,VersionStart,VersionEnd FROM '.$Table.' Where ID= '.$Line['Take']));33 $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take'])); 31 34 // echo $Language['Language'].' '.$Line['Take']; 32 35 if($Language['Language'] <> 0) … … 38 41 if($Line['Complete'] == 1) echo(' <b>Hotov</b>'); 39 42 else echo(' <b> Uložen v rozepsaných</b> '); 40 } else 41 { 42 echo(' <b>Anglická, původní verze</b> '); 43 } 43 } else echo(' <b>Anglická, původní verze</b> '); 44 44 45 echo('<br />'); 45 echo 46 echo('Verze: <b>'.GetVersionWOW($Line['VersionStart']).' - '.GetVersionWOW($Line['VersionEnd'].'</b>')); 46 47 echo('<br />'); 47 48 48 $version = mysql_fetch_array($Database->SQLCommand('SELECT count(*) FROM '.$Table.' Where entry = '.$Line['entry'].' AND Language <> 0')); 49 if ($version['count(*)'] > 0) 49 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE `entry` = '.$Line['entry'].' AND `Language` <> 0'); 50 $Version = mysql_fetch_row($DbResult); 51 $Version = $Version[0]; 52 if($Version > 0) 50 53 { 51 echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line['entry'].'">Počet verzí: <strong>'.$ version['count(*)'].'</strong></a>54 echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line['entry'].'">Počet verzí: <strong>'.$Version.'</strong></a> 52 55 <input type="hidden" name="group" value="'.$GroupId.'" /> 53 56 <input type="hidden" name="entry" value="'.$Line['entry'].'" /> … … 56 59 <option value="-1">Vyberte text k porovnání</option> 57 60 <option value="-1">Zobrazit/porovnat všechny</option>'); 58 $DataID = $Database->SQLCommand('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User FROM '.$Table.' WHERE (entry = '.$Line['entry'].') AND (ID<> '.$Line['ID'].')');59 60 61 $DataID = $Database->SQLCommand('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE (`entry` = '.$Line['entry'].') AND (`ID` <> '.$Line['ID'].')'); 62 while($version = mysql_fetch_array($DataID)) 63 { 61 64 if ($version['ID'] == $Line['Take']) echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$version['User'].' (převzato)</option>'); 62 else { 63 if (0 == $version['Language']) $version['User'] = 'Předloha'; 64 echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$version['User'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>'); 65 else 66 { 67 if($version['Language'] == 0) $version['User'] = 'Předloha'; 68 echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['User'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>'); 69 } 65 70 } 66 } 67 echo('</select></form>'); 71 echo('</select></form>'); 68 72 } else 69 73 { 70 echo('<a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line['entry'].'">Počet verzí: <strong>'.$version['count(*)'].'</strong></a>');74 echo('<a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line['entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>'); 71 75 } 72 76 … … 75 79 if(Licence(LICENCE_USER)) 76 80 { 77 if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo 81 if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo('<a href="dictionary.php?group='.$GroupId.'&ID='.$LineAJ['ID'].'" target="_blank" title="Zobrazit přeložené názvy věci, postav, a herních objektů k tomuto překladu">Vyhledat v názvech</a>'); 78 82 echo(' <input type="submit" value="Uložit do rozepsaných" name="save" title="Klikněte na uložit pro pozdější dokončení překladu" /> 79 83 <input type="submit" value="Dokončeno" name="End" title="Klikněte na Dokončeno jesli jsou všechny texty hotové a chcete již publikovat" /> '); 80 FollowingTran($TextID,$Table,$GroupId, True); FollowingTran($TextID,$Table,$GroupId); 81 } 84 FollowingTran($TextID, $Table, $GroupId, true); 85 FollowingTran($TextID, $Table, $GroupId); 86 } 82 87 83 88 if($TranslationTree[$GroupId]['WowheadName'] != '') 84 $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName']. 85 '='.$LineAJ['entry'].'">'.$LineAJ['entry'].'</a>'; 89 $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ['entry'].'">'.$LineAJ['entry'].'</a>'; 86 90 else $WowheadLink = $LineAJ['entry']; 87 91 … … 103 107 else if($_SESSION['UserID'] != '') 104 108 { 105 $IDUser = $Database->SQLCommand('SELECT * FROM user WHERE id= '.$_SESSION['UserID']);109 $IDUser = $Database->SQLCommand('SELECT * FROM `user` WHERE `id` = '.$_SESSION['UserID']); 106 110 $LineUser = mysql_fetch_array($IDUser); 107 111 $Language = $LineUser['Language']; //jiný user vyčítám … … 112 116 if($TextItem['Visible'] == 1) 113 117 { 114 if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> '')) { 115 if ($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR ($Table == 'glue_strings'))) 116 echo('<tr><th>'.$LineAJ['ShortCut'].'</th>'); 117 else 118 echo('<tr><th>'.$TextItem['Name'].'</th>'); 119 echo ('<td>'.str_replace("\n", '<br/>', htmlspecialchars($LineAJ[$TextItem['Column']])).'</td> 118 if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> '')) 119 { 120 if ($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR ($Table == 'glue_strings'))) echo('<tr><th>'.$LineAJ['ShortCut'].'</th>'); 121 else echo('<tr><th>'.$TextItem['Name'].'</th>'); 122 echo('<td>'.str_replace("\n", '<br/>', htmlspecialchars($LineAJ[$TextItem['Column']])).'</td> 120 123 <td><textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">'.htmlspecialchars($Line[$TextItem['Column']]).'</textarea></td></tr>'); 121 124 } 122 125 } else 123 126 { 124 echo('<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Line[$TextItem['Column']]).'" />');127 echo('<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Line[$TextItem['Column']]).'" />'); 125 128 } 126 129 echo('</table></div></form>'); -
trunk/save.php
r309 r321 106 106 if(array_key_exists($GroupItem['Column'], $_POST)) 107 107 $sql .= ', `'.$GroupItem['Column'].'`="'.$_POST[$GroupItem['Column']].'"'; 108 $sql .= ', `Language` = '.$Language.' WHERE ID = '.$TextID.' AND Language<> 0';108 $sql .= ', `Language` = '.$Language.' WHERE `ID` = '.$TextID.' AND `Language` <> 0'; 109 109 //echo($sql); 110 110 $Database->SQLCommand($sql); … … 119 119 $next = FollowingTran($TextID,$Table,$GroupId); 120 120 echo('<br /><br />'); 121 $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT redirecting FROM user WHERE ID='.$UserID));121 $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `redirecting` FROM `user` WHERE `ID`='.$UserID)); 122 122 123 123 switch($redirecting['redirecting']) … … 145 145 146 146 // Aktualizace informace o nutnosti načíst XP 147 $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1 WHERE ID= '.$UserID);147 $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1 WHERE `ID` = '.$UserID); 148 148 } else 149 149 {
Note:
See TracChangeset
for help on using the changeset viewer.