Changeset 309
- Timestamp:
- Jan 31, 2010, 10:13:41 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TranslationList.php
r307 r309 297 297 { 298 298 if(array_key_exists('search', $_GET)) $Search = $_GET['search']; 299 else $Search = $_POST['search']; 299 else if(array_key_exists('search', $_POST)) $Search = $_POST['search']; 300 else ErrorMessage('Nebyl zadán text k vyhledání.'); 300 301 301 302 $sql = 'SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%" … … 306 307 foreach($TranslationTree[$GroupId]['Items'] as $Item) 307 308 { 308 if($Item['Column'] != '') $sql .= ' OR `'.$Item['Column'].'` LIKE "%'.$Search.'%"';309 if($Item['Column'] != '') $sql .= ' OR `'.$Item['Column'].'` LIKE "%'.$Search.'%"'; 309 310 } 310 311 -
trunk/export/create_addon.php
r297 r309 155 155 $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n"; 156 156 } 157 // nepřeložené texty157 // Nepřeložené texty 158 158 $Query = 'SELECT '.$Column['Column'].' as Original, ShortCut FROM '.$Group['TablePrefix'].' WHERE Language = 0 AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND entry NOT IN (SELECT entry FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.')'; 159 159 $DbResult = $this->Database->query($Query); … … 169 169 $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n"; 170 170 } 171 if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true); 171 172 file_put_contents($this->TempDir.'CzWoW/LocalizationStrings.lua', $Buffer); 172 173 } -
trunk/img_statistic.php
r292 r309 47 47 imagefilledrectangle($Image, 0, 0, $PercentBar, 59, $Color2); 48 48 $FontSize = 10; 49 if(($NumberPerDay > 0) and ($team == '') and ($language == '') and ($ user_sql == '') and ($NotTran > 0))49 if(($NumberPerDay > 0) and ($team == '') and ($language == '') and ($NotTran > 0)) 50 50 { 51 51 $TimeToTranslate = ($NotTran / $NumberPerDay) * $Days; -
trunk/includes/global_function.php
r308 r309 550 550 } 551 551 552 function ErrorMessage($Text) 553 { 554 echo($Text); 555 ShowFooter(); 556 die(); 557 } 558 552 559 ?> -
trunk/save.php
r286 r309 12 12 if(array_key_exists('entry', $_POST) and Licence(LICENCE_USER)) 13 13 { 14 $entry = $_POST['entry'] ;14 $entry = $_POST['entry'] * 1; // Make numeric 15 15 $UserID = $_SESSION['UserID']; 16 $TextID = $_POST['ID'] ;17 $Language = $_POST['Language'] ;16 $TextID = $_POST['ID'] * 1; 17 $Language = $_POST['Language'] * 1; 18 18 if(array_key_exists('End', $_POST)) $complete = 1; 19 19 else $complete = 0; 20 20 21 $LineAJ = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE Language = 0 AND entry = '.$entry)); 21 $DbResult = $Database->SQLCommand('SELECT * FROM '.$Table.' WHERE Language = 0 AND entry = '.$entry); 22 if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky'); 23 $LineAJ = mysql_fetch_array($DbResult); 22 24 $LineTake = mysql_fetch_array($Database->SQLCommand('SELECT VersionEnd,VersionStart FROM '.$Table.' WHERE ID = '.$TextID)); 23 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$entry.' 24 AND VersionStart = '.$LineTake['VersionStart'].' AND VersionEnd = '.$LineTake['VersionEnd'])); 25 if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky'); 26 $DbResult = $Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$entry.' AND VersionStart = '.$LineTake['VersionStart'].' AND VersionEnd = '.$LineTake['VersionEnd']); 27 $Line = mysql_fetch_array($DbResult); 25 28 if(!$Line) 26 29 { 27 $Columns = '`Language` , `User` , `Complete` , `Take` , `VersionStart` , `VersionEnd`';28 $Values = $Language.','.$UserID.','.$complete.','.$TextID.','.$LineTake['VersionStart'].','.$LineTake['VersionEnd'];29 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem)30 {30 $Columns = '`Language` , `User` , `Complete` , `Take` , `VersionStart` , `VersionEnd`'; 31 $Values = $Language.','.$UserID.','.$complete.','.$TextID.','.$LineTake['VersionStart'].','.$LineTake['VersionEnd']; 32 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 33 { 31 34 if(array_key_exists($GroupItem['Column'], $_POST)) 35 { 36 if (($GroupItem['Column'] <> 'ShortCut') and ($GroupItem['Column'] <> 'Rank')) 37 { 38 $Columns .= ', `'.$GroupItem['Column'].'`'; 39 $Values .= ', "'.@$_POST[$GroupItem['Column']].'"'; 40 } 41 } 42 } 43 //echo('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 44 // $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$entry.','.$Values.')'); 45 // $LastID = mysql_insert_id(); 46 47 // Kontrolování stejných textů 48 $Where = 'Language = 0'; 49 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 32 50 { 33 if (($GroupItem['Column'] <> 'ShortCut') and ($GroupItem['Column'] <> 'Rank')) { 34 $Columns .= ', `'.$GroupItem['Column'].'`'; 35 $Values .= ', "'.@$_POST[$GroupItem['Column']].'"'; 36 } 51 if(($GroupItem['Column'] <> 'ShortCut') and ($GroupItem['Column'] <> 'Rank')) 52 { 53 if(array_key_exists($GroupItem['Column'], $_POST)) 54 $Where .= ' AND `'.$GroupItem['Column'].'` = "'.addslashes($LineAJ[$GroupItem['Column']]).'"'; 55 else $Where .= ' AND `'.$GroupItem['Column'].'` = ""'; 56 } 57 if($GroupItem['Column'] == 'Rank') 58 { 59 if(array_key_exists('Rank', $_POST)) 60 { 61 $Rank = substr($_POST['Rank'],0 ,strpos($_POST['Rank'],' ')); 62 if(strlen($Rank) <= 2) 63 $Rank = substr($_POST['Rank'], strpos($_POST['Rank'],' ') + 1); 64 } else $Rank = 'Úroveň'; 65 } 37 66 } 38 } 39 //echo('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 40 // $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$entry.','.$Values.')'); 41 // $LastID = mysql_insert_id(); 42 43 //kontrolování stejných textů 67 68 $SameTranID = $Database->SQLCommand('SELECT * FROM '.$Table.' WHERE '.$Where); 69 while($SameTranLine = mysql_fetch_assoc($SameTranID)) 70 { 71 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$SameTranLine['entry'].' AND VersionStart = '.$LineTake['VersionStart'].' AND VersionEnd = '.$LineTake['VersionEnd'])); 72 if(!$Line) 73 { 74 if($GroupItem['Column'] <> 'ShortCut') 75 { 76 if(isset($Rank)) 77 { 78 $Rank_number = substr($SameTranLine['Rank'], strpos($SameTranLine['Rank'],' ') + 1); 79 if($Rank_number <> '') $Rank_cur = $Rank.' '.$Rank_number; 80 else $Rank_cur = $SameTranLine['Rank']; 81 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `Rank`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$Rank_cur.'")'); 82 } else 83 { 84 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$SameTranLine['entry'].','.$Values.')'); 85 } 86 } else 87 { 88 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `ShortCut`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$SameTranLine['ShortCut'].'")'); 89 } 90 $LastIDs[] = mysql_insert_id(); 91 } 92 } 44 93 45 46 $Where = 'Language = 0'; 47 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 48 { 49 if (($GroupItem['Column'] <> 'ShortCut') and ($GroupItem['Column'] <> 'Rank')) 50 if(array_key_exists($GroupItem['Column'], $_POST)) { 51 $Where .= ' AND `'.$GroupItem['Column'].'` = "'.addslashes($LineAJ[$GroupItem['Column']]).'"'; 52 } else { 53 $Where .= ' AND `'.$GroupItem['Column'].'` = ""'; 54 } 55 if ($GroupItem['Column'] == 'Rank') { 56 if (array_key_exists('Rank',$_POST)) { 57 $Rank = substr($_POST['Rank'], 0 ,strpos($_POST['Rank'],' ')); 58 if (strlen($Rank)<= 2) 59 $Rank = substr($_POST['Rank'], strpos($_POST['Rank'],' ')+1); 60 } else { 61 $Rank = 'Úroveň'; 62 } 63 } 64 } 65 66 $SameTranID = $Database->SQLCommand('SELECT * FROM '.$Table.' WHERE '.$Where); 67 while($SameTranLine = mysql_fetch_assoc($SameTranID)) 68 { 69 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$SameTranLine['entry'].' 70 AND VersionStart = '.$LineTake['VersionStart'].' AND VersionEnd = '.$LineTake['VersionEnd'])); 71 if(!$Line) { 72 if ($GroupItem['Column'] <> 'ShortCut') { 73 if (isset($Rank)) { 74 $Rank_number = substr($SameTranLine['Rank'], strpos($SameTranLine['Rank'],' ')+1); 75 if ($Rank_number <> '') { 76 $Rank_cur = $Rank.' '.$Rank_number; 77 } else { 78 $Rank_cur = $SameTranLine['Rank']; 79 } 80 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `Rank`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$Rank_cur.'")'); 81 } else { 82 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$SameTranLine['entry'].','.$Values.')'); 83 } 84 } else { 85 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `ShortCut`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$SameTranLine['ShortCut'].'")'); 86 } 87 $LastIDs[] = mysql_insert_id(); 88 } 89 } 90 91 //konec kontrolování stejných textů 94 // Konec kontrolování stejných textů 92 95 93 96 echo('Překlad <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$entry.') uložen!<br />'); 94 foreach($LastIDs as $LastID)95 {96 if (count($LastIDs) > 1) echo 'Nalezen stejný překlad, systémově přeložen: <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> Převzat z: <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a><br />';97 foreach($LastIDs as $LastID) 98 { 99 if(count($LastIDs) > 1) echo('Nalezen stejný překlad, systémově přeložen: <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> Převzat z: <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a><br />'); 97 100 WriteLog('Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="?group='.$GroupId.'&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen! Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.', 1); 98 }101 } 99 102 } else 100 103 { … … 110 113 WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$entry.') uloženy!', 1); 111 114 } 112 //addres and redirecting113 115 // Address and redirecting 116 echo('<br />Překládat: <a href="TranslationList.php?group='.$GroupId.'&action=notran">Nepřeložené</a> '); 114 117 115 116 117 118 $prev = FollowingTran($TextID,$Table,$GroupId, True); 119 $next = FollowingTran($TextID,$Table,$GroupId); 120 echo('<br /><br />'); 118 121 $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT redirecting FROM user WHERE ID='.$UserID)); 119 122 120 switch ($redirecting['redirecting']) { 121 case 1: 122 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 123 'setTimeout("parent.location.href=\''.htmlspecialchars_decode('TranslationList.php?group='.$GroupId.'&action=notran').'\'", 1500)'. 124 '</script>'); 125 break; 126 case 2: 127 if ($next <> '') 128 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 123 switch($redirecting['redirecting']) 124 { 125 case 1: 126 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 127 'setTimeout("parent.location.href=\''.htmlspecialchars_decode('TranslationList.php?group='.$GroupId.'&action=notran').'\'", 1500)'. 128 '</script>'); 129 break; 130 case 2: 131 if($next <> '') 132 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 129 133 'setTimeout("parent.location.href=\''.htmlspecialchars_decode($next).'\'", 1500)'. 130 134 '</script>'); 131 132 133 if($prev <> '')134 135 break; 136 case 3: 137 if($prev <> '') 138 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 135 139 'setTimeout("parent.location.href=\''.htmlspecialchars_decode($prev).'\'", 1500)'. 136 140 '</script>'); 137 141 break; 138 142 } 139 143 140 144 echo ('Z této stránky můžete být automaticky přesměrování. Nastavit kam chcete být přesměrování si můžete v <a href="'.$Config['Web']['BaseURL'].'Options.php" Title = "Nastavení uživatele">Nastavení</a>'); 141 145 142 $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1 WHERE ID = '.$UserID); //informace o nutnosti načíst XP 146 // Aktualizace informace o nutnosti načíst XP 147 $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1 WHERE ID = '.$UserID); 143 148 } else 144 149 { … … 170 175 171 176 ShowFooter(); 177 172 178 ?> -
trunk/sql/updates/308.sql
r308 r309 2 2 3 3 -- Salt passwords 4 UPDATE `user` SET Salt= SUBSTRING(SHA1(RAND()), 1, 8);5 UPDATE `user` SET `pass` = sha1(CONCAT(`pass`, `Salt`)) 4 UPDATE `user` SET `Salt` = SUBSTRING(SHA1(RAND()), 1, 8); 5 UPDATE `user` SET `pass` = sha1(CONCAT(`pass`, `Salt`));
Note:
See TracChangeset
for help on using the changeset viewer.