Changeset 123
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r116 r123 37 37 38 38 $Output = '<br /><strong>Poslední překlady:</strong><div class="NewsBox">'; 39 $DbResult = $Database->SQLCommand('SELECT date,user.user,text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY date DESC LIMIT 10');39 $DbResult = $Database->SQLCommand('SELECT date,user.user,text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY date DESC LIMIT 30'); 40 40 while($DbRow = mysql_fetch_assoc($DbResult)) 41 41 $Output .= '<strong>'.$DbRow['user'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['date'])).')</strong> -
trunk/save.php
r112 r123 22 22 //if(( == '') AND ($complete == 1)) die('Musite zadat název textu'); 23 23 24 $LineAJ = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE Language = 0 AND entry = '.$entry)); 24 25 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$entry)); 25 26 if(!$Line) 26 27 { 27 $Columns = '` entry`, `Language` , `User` , `Complete` , `Take`';28 $Values = $ entry.','.$Language.','.$UserID.','.$complete.','.$TextID;28 $Columns = '`Language` , `User` , `Complete` , `Take`'; 29 $Values = $Language.','.$UserID.','.$complete.','.$TextID; 29 30 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 30 31 { … … 36 37 } 37 38 //echo('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 38 $Database->SQLCommand('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 39 $LastID = mysql_insert_id(); 40 echo('Překlad <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> uložen!<br />'); 41 WriteLog($TranslationTree[$GroupId]['Name'].' <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> uložen! Převzat z: <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>', 1); 42 } else 43 { 39 // $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$entry.','.$Values.')'); 40 // $LastID = mysql_insert_id(); 41 42 //kontrolování stejných textů 43 $Where = 'Language = 0 '; 44 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 45 { 46 if(array_key_exists($GroupItem['Column'], $_POST)) 47 { 48 $Where .= ' AND `'.$GroupItem['Column'].'` = "'.$LineAJ[$GroupItem['Column']].'"'; 49 } 50 } 51 $SameTranID = $Database->SQLCommand('SELECT * FROM '.$Table.' WHERE '.$Where); 52 while($SameTranLine = mysql_fetch_assoc($SameTranID)) { 53 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$SameTranLine['entry'])); 54 if(!$Line) { 55 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$SameTranLine['entry'].','.$Values.')'); 56 $LastIDs[] = mysql_insert_id(); 57 } 58 } 59 60 echo('Překlad <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> uložen!<br />'); 61 foreach($LastIDs as $LastID) { 62 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 />'; 63 WriteLog($TranslationTree[$GroupId]['Name'].' <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> uložen! Převzat z: <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>', 1); 64 } 65 } else { 44 66 $sql = 'UPDATE '.$Table.' SET `Complete` = '.$complete; 45 67 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem)
Note:
See TracChangeset
for help on using the changeset viewer.