- Timestamp:
- Apr 8, 2010, 7:46:41 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r418 r427 47 47 echo(' <a href="'.$System->Link('/action.php?action=shoutbox').'">Vložit</a>'); 48 48 echo('<div class="box"><table>'); 49 $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20');49 $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 30'); 50 50 while($Line = mysql_fetch_assoc($ID)) 51 51 echo('<tr><td><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</td></tr>'); -
trunk/index.php
r417 r427 18 18 function ShowLastTranslated() 19 19 { 20 global $ Database;20 global $System; 21 21 22 $Output = '<br /><strong>Poslední překlady:</strong><div class="NewsBox">'; 23 $DbResult = $Database->SQLCommand('SELECT `Date`, `User`.`Name`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 20'); 24 while($DbRow = mysql_fetch_assoc($DbResult)) 25 $Output .= '<strong>'.$DbRow['Name'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Date'])).')</strong> 26 '.$DbRow['Text'].' <br />'; 27 $Output .= '</div>'; 22 $Count = 40; 23 $Output = '<strong>Poslední překlady:</strong><div class="NewsBox">'; 24 25 $GroupListQuery = 'SELECT `Group`.* FROM `Group`'; 26 $Query = ''; 27 $UnionItems = array(); 28 $DbResult = $System->Database->query($GroupListQuery); 29 while($DbRow = $DbResult->fetch_assoc()) 30 { 31 //echo($DbRow['Name'].', '); 32 $UnionItems[] = 'SELECT `T`.`User`, `T`.`ID`, `T`.`ModifyTime`, '.$DbRow['Id'].' AS `Group`, "'.addslashes($DbRow['Name']).'" AS `GroupName`, `T`.`Take` FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 33 ' WHERE (`T`.`Complete` = 1) AND (`T`.`Language` != 0) LIMIT '.$Count; 34 } 35 $Query = 'SELECT `TT`.*, `User`.`Name` AS `UserName` FROM ('.implode(' UNION ', $UnionItems).') AS `TT`'. 36 ' JOIN `User` ON `User`.`Id` = `TT`.`User`'. 37 ' ORDER BY `ModifyTime` DESC LIMIT '.$Count; 38 $DbResult = $System->Database->query($Query); 39 //echo($System->Database->error); 40 //echo($Query); 41 while($DbRow = $DbResult->fetch_assoc()) 42 { 43 $Output .= '<strong>'.HumanDate($DbRow['ModifyTime']).' '.$DbRow['UserName'].'</strong> přeložil text <a href="form.php?group='.$DbRow['Group'].'&ID='.$DbRow['ID'].'">'.$DbRow['ID'].'</a> převzatý z textu <a href="form.php?group='.$DbRow['Group'].'&ID='.$DbRow['Take'].'">'.$DbRow['Take'].'</a> ve skupině <a href="TanslationList.php?group='.$DbRow['Group'].'&action=filter">'.$DbRow['GroupName'].'</a><br />'; 44 } 28 45 return($Output); 29 46 } … … 119 136 120 137 echo('<br />'. 121 '<table class="Home"><tr><td >'.138 '<table class="Home"><tr><td colspan="2">'. 122 139 'Nacházíte se na stránce projektu překládání textů ze hry World of Warcraft (WoW).<br />'. 123 140 '<ul>'. … … 128 145 '<li>Cílem projektu je přeložit všechny texty ze hry. Nikoliv pouze texty výprav (questů).</li>'. 129 146 '<li>Texty lze překládat do dvou jazyků, češtiny a slovenštiny.</li>'. 130 '</ul> '.ShowLastTranslated().'</td><td class="news-box">'.ShowNews().'</td></tr></table>');147 '</ul></td></tr><tr><td>'.ShowLastTranslated().'</td><td class="news-box">'.ShowNews().'</td></tr></table>'); 131 148 132 149 -
trunk/save.php
r420 r427 7 7 // Ochrana proti neoprávněnému přístupu 8 8 // if($User->Licence(LICENCE_USER) == false) die('Nemáte přístup do této sekce! Je nutné se přihásit.'); 9 10 $CompleteText = array('nedokončený', 'dokončený'); 9 11 10 12 $GroupId = LoadGroupIdParameter(); … … 36 38 $Filter = ''; 37 39 foreach($Group['Items'] as $GroupItem) 38 if($GroupItem['Visible'] == 1) 39 $Filter .= ' AND (`'.$GroupItem['Column'].'` = "'.$EnglishText[$GroupItem['Column']].'")'; 40 if(($GroupItem['Visible'] == 1) and ($EnglishText[$GroupItem['Column']] != '')) 41 $Filter .= ' OR (`'.$GroupItem['Column'].'` = "'.$EnglishText[$GroupItem['Column']].'")'; 42 $Filter = ' AND ('.substr($Filter, 3).')'; 40 43 41 44 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0)'.$Filter); 42 while($ DbRow= $DbResult->fetch_assoc())45 while($EnglishFound = $DbResult->fetch_assoc()) 43 46 { 44 47 // Get user translation paired to found english item entry 45 $DbResult2 = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id.') AND (`Entry` = '.$ DbRow['Entry'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');48 $DbResult2 = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id.') AND (`Entry` = '.$EnglishFound['Entry'].') AND (`VersionStart` = '.$EnglishFound['VersionStart'].') AND (`VersionEnd` = '.$EnglishFound['VersionEnd'].')'); 46 49 if($DbResult2->num_rows > 0) 47 50 { 48 51 $ExistedText = $DbResult2->fetch_assoc(); 49 $Values = '`Language` = '.$Language.', `Complete`='.$Complete; 52 $Values = '`Language` = '.$Language.', `ModifyTime` = NOW()'; 53 54 $Completable = true; 55 $CompleteParts = $ExistedText['CompleteParts']; 50 56 foreach($Group['Items'] as $GroupItem) 51 57 { 52 58 if($GroupItem['Visible'] == 1) 53 if(array_key_exists($GroupItem['Column'], $_POST)) 54 $Values .= ', `'.$GroupItem['Column'].'` = "'.$_POST[$GroupItem['Column']].'"'; 55 } 59 { 60 if($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']]) 61 if(array_key_exists($GroupItem['Column'], $_POST)) 62 { 63 $Values .= ', `'.$GroupItem['Column'].'` = "'.$_POST[$GroupItem['Column']].'"'; 64 $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 65 } 66 if((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false; 67 } 68 } 69 if($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed 70 else $NewComplete = 0; 71 if($SourceText['ID'] == $ExistedText['ID']) 72 { 73 $NewComplete = $Complete; // Our original user text, set complete according user choice 74 if($Complete == 1) 75 { 76 foreach($Group['Items'] as $GroupItem) 77 if($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 78 } 79 } 80 $Values .= ', `Complete`='.$NewComplete.', `CompleteParts` = '.$CompleteParts; 56 81 57 82 // Update user translation 58 83 $System->Database->query('UPDATE `'.$Table.'` SET '.$Values.' WHERE `ID` = '.$ExistedText['ID']); 59 84 60 echo('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy !<br />');61 WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy .', LOG_TYPE_TRANSLATION);85 echo('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy jako '.$CompleteText[$NewComplete].'.<br />'); 86 WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy jako '.$CompleteText[$NewComplete].'.', LOG_TYPE_TRANSLATION); 62 87 } else 63 88 { 64 89 // Insert new user translation 65 $Columns = '`Entry`, `VersionStart`, `VersionEnd`, `Language`, `Complete`, `User`, `Take`'; 66 $Values = $DbRow['Entry'].', '.$DbRow['VersionStart'].', '.$DbRow['VersionEnd'].', '.$Language.', '.$Complete.', '.$User->Id.', '.$SourceText['ID']; 90 $Columns = '`Entry`, `VersionStart`, `VersionEnd`, `Language`, `User`, `Take`, `ModifyTime`'; 91 $Values = $EnglishFound['Entry'].', '.$EnglishFound['VersionStart'].', '.$EnglishFound['VersionEnd'].', '.$Language.', '.$User->Id.', '.$SourceText['ID'].', NOW()'; 92 93 $CompleteParts = 0; 94 $Completable = true; 67 95 foreach($Group['Items'] as $GroupItem) 68 96 { 97 $Columns .= ', `'.$GroupItem['Column'].'`'; 69 98 if($GroupItem['Visible'] == 1) 70 99 { 71 // Read form user data 72 if(array_key_exists($GroupItem['Column'], $_POST)) 100 if($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']]) 73 101 { 74 $Columns .= ', `'.$GroupItem['Column'].'`'; 75 $Values .= ', "'.$_POST[$GroupItem['Column']].'"'; 76 } 102 // Read form user data 103 if(array_key_exists($GroupItem['Column'], $_POST)) 104 { 105 $Values .= ', "'.$_POST[$GroupItem['Column']].'"'; 106 $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 107 } else $Values .= ', "'.$EnglishFound[$GroupItem['Column']].'"'; 108 } else $Values .= ', "'.$EnglishFound[$GroupItem['Column']].'"'; 109 if((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false; 77 110 } else 78 111 { 79 112 // Read from english text 80 $Columns .= ', `'.$GroupItem['Column'].'`'; 81 $Values .= ', "'.$DbRow[$GroupItem['Column']].'"'; 82 } 83 } 113 $Values .= ', "'.$EnglishFound[$GroupItem['Column']].'"'; 114 } 115 } 116 if($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed 117 else $NewComplete = 0; 118 if($SourceText['ID'] == $EnglishFound['ID']) 119 { 120 $NewComplete = $Complete; // Our original user text, set complete according user choice 121 if($Complete == 1) 122 { 123 foreach($Group['Items'] as $GroupItem) 124 if($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1)); 125 } 126 } 127 $Columns .= ', `Complete`, `CompleteParts`'; 128 $Values .= ', '.$NewComplete.', '.$CompleteParts; 129 130 //echo('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 84 131 $System->Database->query('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 85 132 $LastID = $System->Database->insert_id; 86 133 87 echo('Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen !Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.<br/>');88 WriteLog('Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen !Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.', LOG_TYPE_TRANSLATION);134 echo('Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen jako '.$CompleteText[$NewComplete].'. Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.<br/>'); 135 WriteLog('Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen jako '.$CompleteText[$NewComplete].'. Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.', LOG_TYPE_TRANSLATION); 89 136 } 90 137 } -
trunk/style/style.css
r410 r427 221 221 overflow: auto; 222 222 width: 180px; 223 height: 500px;223 height: 1000px; 224 224 font-size: 10px; 225 225 border-width: 1px; … … 341 341 .news-box 342 342 { 343 width: 350px;343 width: 50%; 344 344 } 345 345
Note:
See TracChangeset
for help on using the changeset viewer.