Changeset 321 for trunk/form.php
- Timestamp:
- Feb 14, 2010, 1:00:53 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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>');
Note:
See TracChangeset
for help on using the changeset viewer.