- Timestamp:
- Jan 30, 2009, 10:33:08 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 15 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:ignore
set to
SqlTranslate.zip
-
Property svn:ignore
set to
-
trunk/Options.php
r43 r49 2 2 include('includes/global.php'); 3 3 4 if (Licence(0)) { 4 if(Licence(LICENCE_USER)) 5 { 6 $User = @$_SESSION['User']; 5 7 6 $User = @$_SESSION['User']; 7 8 if (array_key_exists('Email', $_POST)) { 8 if(array_key_exists('Email', $_POST)) 9 { 9 10 $Email = $_POST['Email']; 10 11 $OldPass = $_POST['OldPass']; … … 14 15 15 16 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID'])); 16 if (($Line['pass'] == $OldPass) and ($NewPass == $NewPass2)) { 17 if(($Line['pass'] == $OldPass) and ($NewPass == $NewPass2)) 18 { 17 19 $Database->SQLCommand("UPDATE user SET pass = '$NewPass' WHERE ID = ".$_SESSION['UserID']); 18 echo 'Heslo změněno!<br />';19 } else echo '<br />Hesla se neshodují!<br />';20 echo('Heslo změněno!<br />'); 21 } else echo('<br />Hesla se neshodují!<br />)'); 20 22 $Database->SQLCommand("UPDATE user SET Email = '$Email', Language = '$Language' WHERE ID = ".$_SESSION['UserID']); 21 echo 'Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User.'</b><br />';23 echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User.'</b><br />'); 22 24 WriteLog('Úprava nastavení!', 3); 23 } else { 25 } else 26 { 24 27 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID'])); 25 ?> 26 <form action="Options.php" method="post"> 28 echo('<form action="Options.php" method="post"> 27 29 <table> 28 30 <tr> 29 31 <td>Email: </td> 30 <td><input type="text" name="Email" value=" <?php echo $Line['Email']; ?>"></td>32 <td><input type="text" name="Email" value="'.$Line['Email'].'" /></td> 31 33 </tr> 32 34 <tr> 33 35 <td>Původní heslo: </td> 34 <td><input type="password" name="OldPass" ></td>36 <td><input type="password" name="OldPass" /></td> 35 37 </tr> 36 38 <tr> 37 39 <td>Nové heslo: </td> 38 <td><input type="password" name="NewPass" ></td>40 <td><input type="password" name="NewPass" /></td> 39 41 </tr> 40 42 <tr> 41 43 <td>Nové heslo pro potvrzení: </td> 42 <td><input type="password" name="NewPass2" ></td>44 <td><input type="password" name="NewPass2" /></td> 43 45 </tr> 44 46 <tr> 45 47 <td>Normálně budu překládat do: </td> 46 <td><?php WriteLanguages($Line['Language']); ?></td> 48 <td>'); 49 WriteLanguages($Line['Language']); 50 echo('</td> 47 51 </tr> 48 52 <tr> 49 <th><input type="submit" value="Uložit" ></th>53 <th><input type="submit" value="Uložit" /></th> 50 54 </tr> 51 55 </table> 52 </form> 53 54 55 <?php 56 </form>'); 56 57 } 57 58 } else echo 'Nejste přihlášený!'; -
trunk/TranslationList.php
r48 r49 4 4 5 5 $TranslationItemPerPage = 200; 6 7 6 8 7 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group']; else $GroupId = 1; … … 66 65 function WriteQuests($sql, $limit, $address) 67 66 { 68 global $Database, $order, $desc ;69 67 global $Database, $order, $desc, $TranslationTree, $GroupId, $Table; 68 70 69 if($limit <> '') $limit = 'LIMIT '.$limit; 71 70 … … 81 80 82 81 echo('<table border="1" cellpadding="2" cellspacing="0"><tr> 83 <th><a href=" group='.$GroupId.'&?'.$address.'&order=ID&desc='.$desc.'">Pořadové číslo</a></th>84 <th><a href=" group='.$GroupId.'&?'.$address.'&order=entry&desc='.$desc.'">Identifikační číslo</a></th>85 <th><a href="?group='.$GroupId.'& '.$address.'&order=Title&desc='.$desc.'">Název</a></th>');86 if ($address == 'selection') echo('<th><a href="?group='.$GroupId.'& '.$address.'&order=CountQuests&desc='.$desc.'">Výskyt</a></th>');87 else if($address <> 'notran') echo('<th><a href="?group='.$GroupId.'& '.$address.'&order=user&desc='.$desc.'">Uživatel</a></th>88 <th><a href="?group='.$GroupId.'& '.$address.'&order=vote&desc='.$desc.'">Známka</a></th>89 <th><a href="?group='.$GroupId.'& '.$address.'&order=CountVote&desc='.$desc.'">Počet hlasování</a></th>');82 <th><a href="?group='.$GroupId.'&action='.$address.'&order=ID&desc='.$desc.'">Pořadové číslo</a></th> 83 <th><a href="?group='.$GroupId.'&action='.$address.'&order=entry&desc='.$desc.'">Identifikační číslo</a></th> 84 <th><a href="?group='.$GroupId.'&action='.$address.'&order=Title&desc='.$desc.'">Název</a></th>'); 85 if ($address == 'selection') echo('<th><a href="?group='.$GroupId.'&action='.$address.'&order=CountQuests&desc='.$desc.'">Výskyt</a></th>'); 86 else if($address <> 'notran') echo('<th><a href="?group='.$GroupId.'&action='.$address.'&order=user&desc='.$desc.'">Uživatel</a></th> 87 <th><a href="?group='.$GroupId.'&action='.$address.'&order=vote&desc='.$desc.'">Známka</a></th> 88 <th><a href="?group='.$GroupId.'&action='.$address.'&order=CountVote&desc='.$desc.'">Počet hlasování</a></th>'); 90 89 echo('</tr>'); 91 92 $ID = $Database->SQLCommand("$sql $order $desc $limit"); 93 while($Line = mysql_fetch_array($ID)) 94 { 95 echo('<tr><td><a href="form.php?ID='.$Line['ID'].'">'.$Line['ID'].'</a></td> 90 91 //print_r($TranslationTree[$GroupId]['Items']); 92 $ID = $Database->SQLCommand($sql.' '.$order.' '.$desc.' '.$limit); 93 while($Line = mysql_fetch_assoc($ID)) 94 { 95 //print_r($Line); 96 echo('<tr><td><a href="form.php?group='.$GroupId.'&ID='.$Line['ID'].'">'.$Line['ID'].'</a></td> 96 97 <td>'.$Line['entry'].'</td> 97 <td>'.htmlspecialchars($Line[ 'Title']).'</td>');98 <td>'.htmlspecialchars($Line[$TranslationTree[$GroupId]['Items'][0]['Column']]).'</td>'); 98 99 if($address == 'selection') echo('<td>'.$Line['CountQuest'].'</td>'); 99 else if($address <> 'notran') echo('<td>'. @$Line['User'].'</td>100 else if($address <> 'notran') echo('<td>'.$Line['User'].'</td> 100 101 <td>'.substr($Line['Vote'], 0, 4).'</td> 101 102 <td>'.$Line['CountVote'].'</td>'); … … 105 106 } 106 107 107 if($Action == 'selection')108 {109 echo('<a title="Zobrazit překlady podle vlasního filtru" href="?group='.$GroupId.'&action=filter">Filtr překladů</a> ->110 <a title="Zde můžete začít překládat" href="?group='.$GroupId.'&action=selection">Nepřeložené texty</a><br /><br />');111 112 echo('<table border="1" cellspacing="0" cellpadding="10"><tr><td>113 <br /><b>Prioritně byste měli překládat tyto texty:</b><br /><br />');114 115 WriteQuests('SELECT '.$Table.'.ID, entry, Title, CountQuest FROM '.$Table.', '.$Table.'_status116 WHERE '.$Table.'.language = 0 AND '.$Table.'.entry = '.$Table.'_status.questentry ORDER BY '.$Table.'_status.CountQuest DESC', 18, 'selection');117 118 echo('</td></tr><tr><td>119 <a href="?group='.$GroupId.'&action=notran">Ostatní nepřeložené texty</a>');120 121 echo('</td></tr></table>');122 }123 124 125 108 if($Action == 'notran') 126 109 { … … 176 159 <a title="Zatím nezkontrolované questy" href="?group='.$GroupId.'&action=admin_nocheck">Nezkontrolované texty</a><br /><br />'); 177 160 178 WritePages(' ListQuests.php?nocheck', ' WHERE Language <> 0 AND '.$Table.'.Complete = 1 AND admin_check <> 1');161 WritePages('?group='.$GroupId.'&action=nocheck', ' WHERE Language <> 0 AND '.$Table.'.Complete = 1 AND admin_check <> 1'); 179 162 180 163 WriteQuests('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User … … 254 237 $Search = $_GET['search']; 255 238 256 $sql = "SELECT * FROM $Table.'` WHERE `ID` LIKE '%$Search%' 257 OR `entry` LIKE '%$Search%' 258 OR `Title` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 259 OR `Details` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 260 OR `Objectives` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 261 OR `OfferRewardText` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 262 OR `RequestItemsText` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 263 OR `EndText` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 264 OR `ObjectiveText1` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 265 OR `ObjectiveText2` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 266 OR `ObjectiveText3` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 267 OR `ObjectiveText4` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 268 OR `Language` LIKE '%$Search%' 269 OR `Vote` LIKE '%$Search%' 270 OR `User` LIKE '%$Search%' 271 OR `complete` LIKE '%$Search%'"; 239 $sql = 'SELECT * FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%" 240 OR `entry` LIKE "%'.$Search.'%" 241 OR `Language` LIKE "%'.$Search.'%" 242 OR `Vote` LIKE "%'.$Search.'%" 243 OR `User` LIKE "%'.$Search.'%" 244 OR `complete` LIKE "%'.$Search.'%"'; 245 foreach($TranslationTree[$GroupId]['Items'] as $Item) 246 { 247 if($Item['Column'] != '') $sql .= ' OR `'.$Item['Column'].'` LIKE "%'.$Search.'%"'; 248 } 272 249 273 250 WriteQuests($sql, '', 'search='.$Search); … … 276 253 if($Action == 'searchentry') 277 254 { 278 $Search = $_GET[' searchentry'];255 $Search = $_GET['ID']; 279 256 280 $sql = 'SELECT * FROM `'.$Table.'` WHERE `entry` LIKE "'.$Search.'"';257 $sql = 'SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) FROM `'.$Table.'` WHERE `entry` LIKE "'.$Search.'"'; 281 258 282 259 WriteQuests($sql, '', 'searchentry='.$Search); … … 308 285 <select name="users[]" size="10" multiple>'); 309 286 310 $ID = $Database->SQLCommand('SELECT user, ID FROM `user` WHERE287 $ID = $Database->SQLCommand('SELECT user, ID FROM `user` WHERE 311 288 EXISTS(SELECT 1 FROM '.$Table.' WHERE user = user.ID) ORDER BY user'); 312 while($Line = mysql_fetch_array($ID)) 289 if($ID) 290 while($Line = mysql_fetch_assoc($ID)) 313 291 echo('<option value="'.$Line['ID'].'">'.$Line['user'].'</option>'); 314 292 -
trunk/action.php
r47 r49 1 1 <?php 2 2 3 3 include('includes/global.php'); 4 4 5 if (array_key_exists('delete', $_GET) and Licence(1)) 5 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group']; else $GroupId = 1; 6 $Table = $TranslationTree[$GroupId]['TablePrefix']; 7 if(array_key_exists('action', $_GET)) $Action = $_GET['action']; else $Action = ''; 8 9 if(($Action == 'delete') and Licence(LICENCE_MODERATOR)) 10 { 11 $TextID = $_GET['ID']; 12 $Database->SQLCommand('DELETE FROM '.$Table.' WHERE ID = '.$TextID.' AND Language <> 0'); 13 echo('Překlad byl smazán!'); 14 WriteLog('Překlad byl smazán! <a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>', 4); 15 } 16 17 if((@$_POST['Action'] == 'type_translation') and Licence(LICENCE_MODERATOR)) 18 { 19 if(array_key_exists('1', $_POST)) $check = 1; else $check = 0; 20 $ID_translation = $_POST['ID_translation']; 21 $type_translation = $_POST['type_translation']; 22 $Database->SQLCommand("DELETE FROM tag WHERE ID_user = ".$_SESSION['UserID']." AND ID_translation = $ID_translation AND type_translation = $type_translation"); 23 $Database->SQLCommand("INSERT INTO `tag` ( `type_translation` , `ID_translation` , `ID_user` , `tag` ) 24 VALUES ('$type_translation', '$ID_translation', '".$_SESSION['UserID']."', '$check')"); 25 echo('Překlad označen!'); 26 WriteLog('Překlad označen: '.$check.' <a href="form.php?group='.$GroupId.'&ID='.$ID_translation.'">'.$ID_translation.'</a>', 5); 27 } 28 29 if(($Action == 'admin_check') and Licence(LICENCE_ADMIN)) 30 { 31 $ID = $_GET['ID']; 32 $admin_check = $_GET['admin_check']; 33 $entry = mysql_fetch_array($Database->SQLCommand('SELECT entry FROM '.$Table.' Where ID = '.$ID)); 34 $Database->SQLCommand('UPDATE '.$Table.' SET admin_check = 0 WHERE entry = '.$entry['entry'].' AND Language <> 0'); 35 $Database->SQLCommand('UPDATE '.$Table.' SET admin_check = '.$admin_check.' WHERE ID = '.$ID.' AND Language <> 0'); 36 if($admin_check == 1) 6 37 { 7 $QuestID = $_GET['ID']; 8 $Database->SQLCommand("DELETE FROM quests WHERE ID = '$QuestID' AND Language <> '0'"); 9 echo 'Překlad byl smazán!'; 10 WriteLog('Překlad byl smazán! <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 4); 38 echo('Překlad byl zkontrolován!'); 39 WriteLog('Překlad byl zkontrolován! <a href="form.php?group='.$GroupId.'&ID='.$ID.'">'.$ID.'</a>', 4); 40 } else 41 { 42 echo('U překladu bylo zrušeno zkontrolování!'); 43 WriteLog('U překladu bylo zrušeno zkontrolování! <a href="form.php?group='.$GroupId.'&ID='.$ID.'">'.$ID.'</a>', 4); 11 44 } 45 } 12 46 13 if (array_key_exists('type_translation', $_POST) and Licence(1)) 47 if(($Action == 'NotComplete') and Licence(LICENCE_MODERATOR)) 48 { 49 $TextID = $_GET['ID']; 50 $Database->SQLCommand('UPDATE '.$Table.' SET Complete = 0 WHERE ID = '.$TextID); 51 echo('Překlad byl vrácen k opravě!'); 52 WriteLog('Překlad byl vrácen k opravě˝ <a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>', 4); 53 } 54 55 if($Action == 'shoutbox') 56 { 57 $shoutbox = $_GET['shoutbox']; 58 if($shoutbox == '') 14 59 { 15 if (array_key_exists('1', $_POST)) 16 $check = 1; 17 else $check = 0; 18 $ID_translation = $_POST['ID_translation']; 19 $type_translation = $_POST['type_translation']; 20 $Database->SQLCommand("DELETE FROM tag WHERE ID_user = ".$_SESSION['UserID']." AND ID_translation = $ID_translation AND type_translation = $type_translation"); 21 $Database->SQLCommand("INSERT INTO `tag` ( `type_translation` , `ID_translation` , `ID_user` , `tag` ) 22 VALUES ('$type_translation', '$ID_translation', '".$_SESSION['UserID']."', '$check')"); 23 echo 'Překlad označen!'; 24 if ($type_translation == 1) 25 WriteLog('Překlad označen: '.$check.' <a href="form.php?ID='.$ID_translation.'">'.$ID_translation.'</a>', 5); 26 if ($type_translation == 2) 27 WriteLog('Překlad označen: '.$check.' <a href="npc_form.php?ID='.$ID_translation.'">'.$ID_translation.'</a>', 5); 28 if ($type_translation == 3) 29 WriteLog('Překlad označen: '.$check.' <a href="page_form.php?ID='.$ID_translation.'">'.$ID_translation.'</a>', 5); 30 } 31 32 if (array_key_exists('admin_check', $_GET) and Licence(2)) { 33 $ID = $_GET['ID']; 34 $admin_check = $_GET['admin_check']; 35 $entry = mysql_fetch_array($Database->SQLCommand("SELECT entry FROM quests Where ID = $ID")); 36 $Database->SQLCommand("UPDATE quests SET admin_check = '0' WHERE entry = '".$entry['entry']."' AND Language <> '0'"); 37 $Database->SQLCommand("UPDATE quests SET admin_check = '$admin_check' WHERE ID = '$ID' AND Language <> '0'"); 38 if ($admin_check == 1) { 39 echo 'Překlad byl zkontrolován!'; 40 WriteLog('Překlad byl zkontrolován! <a href="form.php?ID='.$ID.'">'.$ID.'</a>', 4); 41 } else { 42 echo 'U překladu bylo zrušeno zkontrolování!'; 43 WriteLog('U překladu bylo zrušeno zkontrolování! <a href="form.php?ID='.$ID.'">'.$ID.'</a>', 4); 44 } 45 } 46 47 if (array_key_exists('NotComplete', $_GET) and Licence(1)) { 48 $QuestID = $_GET['ID']; 49 $Database->SQLCommand("UPDATE quests SET Complete = '0' WHERE ID = '$QuestID'"); 50 echo 'Překlad byl vrácen k opravě!'; 51 WriteLog('Překlad byl vrácen k opravě˝ <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 4); 52 } 53 54 if (array_key_exists('shoutbox', $_GET)) { 55 $shoutbox = $_GET['shoutbox']; 56 if ($shoutbox == '') { 57 echo '<form action="action.php?shoutbox=1" method="post"> 58 Uživatel: '; 59 if (Licence(0)) echo '<b>'.$_SESSION['User'].'</b><br />'; else echo '<input type="text" name="user"><br />'; 60 echo 'Text zprávy: <br> 61 <textarea name="text" cols="40"></textarea> <br> 62 <input type="submit" value="Uložit"><br /> 63 </form>'; 64 } else { 65 if (Licence(0)) $user = $_SESSION['User']; else { 66 die('Pro vkládaní musíte byt registrováni!'); 67 } 68 $text = $_POST['text']; 69 $Database->SQLCommand("INSERT INTO `shoutbox` ( `user` , `text` , `date` , `IP` ) 70 VALUES ( '$user', '$text', now(), '".$_SERVER['REMOTE_ADDR']."');"); 71 echo('Zpráva vložena!<br>Budete přesměrováni...'); 72 echo(' 60 echo('<form action="action.php?action=shoutbox&shoutbox=1" method="post"> 61 Uživatel: '); 62 if(Licence(LICENCE_USER)) echo('<b>'.$_SESSION['User'].'</b><br />'); 63 else echo('<input type="text" name="user" /><br />'); 64 echo('Text zprávy: <br> 65 <textarea name="text" cols="40"></textarea> <br /> 66 <input type="submit" value="Uložit" /><br /> 67 </form>'); 68 } else 69 { 70 if(Licence(LICENCE_USER)) $user = $_SESSION['User']; 71 else die('Pro vkládaní musíte byt registrováni!'); 72 $text = $_POST['text']; 73 $Database->SQLCommand("INSERT INTO `shoutbox` ( `user` , `text` , `date` , `IP` ) 74 VALUES ( '$user', '$text', now(), '".$_SERVER['REMOTE_ADDR']."');"); 75 echo('Zpráva vložena!<br>Budete přesměrováni...'); 76 echo(' 73 77 <script type="text/javascript" language="JavaScript" charset="utf-8"> 74 78 setTimeout("parent.location.href=\'index.php\'",1000) 75 79 </script>'); 76 80 77 }78 81 } 82 } 79 83 80 if (array_key_exists('vote', $_GET)) { 81 $questID = $_GET['ID']; 82 $vote = $_GET['vote']; 83 $IDuser = $_SESSION['UserID']; 84 if($Action == 'vote') 85 { 86 $TextID = $_GET['ID']; 87 $vote = $_GET['vote']; 88 $IDuser = $_SESSION['UserID']; 84 89 85 if (($vote > 5) OR ($vote < 1)) die('špatná známka');90 if(($vote > 5) OR ($vote < 1)) die('špatná známka'); 86 91 92 $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM '.$Table.'_vote WHERE IDuser = '.$IDuser.' AND TextId = '.$TextID)); 93 if((!$Line) and (Licence(LICENCE_USER))) 94 { 95 $Line = mysql_fetch_array($Database->SQLCommand('SELECT Vote,CountVote FROM '.$Table.' WHERE ID='.$TextID)); 96 $CountVote = $Line['CountVote'] + 1; 97 $OldVote = $Line['Vote'] * $Line['CountVote']; 98 $NewVote = ($OldVote + $vote) / $CountVote; 99 100 $Database->SQLCommand('UPDATE '.$Table.' SET Vote = '.$NewVote.', CountVote = '.$CountVote.' WHERE ID = '.$TextID); 101 102 $Database->SQLCommand('INSERT INTO `'.$Table.'_vote` ( `TextId` , `IDuser` , `vote` ) VALUES ( '.$TextID.', '.$IDuser.', '.$vote.')'); 103 echo('Hlas byl uložen! Hlasoval jste: '.$vote.'<br /> Nyní je známka překladu '.$NewVote); 104 105 WriteLog('Uživatel hlasoval: '.$vote.'! Nyní je známka překladu (<a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>): '.$NewVote, 5); 106 } else echo('Již jste hlasoval nebo nemůžete hlasovat!'); 107 } 87 108 88 $Line = mysql_fetch_row($Database->SQLCommand("SELECT * FROM quests_vote WHERE IDuser = '$IDuser' AND IDquest = '$questID'")); 89 if ((!$Line) and (Licence(0))) 90 { 91 $Line = mysql_fetch_array($Database->SQLCommand("SELECT Vote,CountVote FROM quests WHERE ID = '$questID'")); 92 $CountVote = $Line['CountVote'] + 1; 93 $OldVote = $Line['Vote'] * $Line['CountVote']; 94 $NewVote = ($OldVote + $vote) / $CountVote; 95 96 $Database->SQLCommand("UPDATE quests SET Vote = '$NewVote', CountVote = '$CountVote' WHERE ID = '$questID'"); 97 98 $Database->SQLCommand("INSERT INTO `quests_vote` ( `IDquest` , `IDuser` , `vote` ) VALUES ( '$questID', '$IDuser', '$vote');"); 99 echo 'Hlas byl uložen! Hlasoval jste: '.$vote.'<br /> Nyní je známka překladu '.$NewVote; 100 101 WriteLog('Uživatel hlasoval: '.$vote.'! Nyní je známka překladu (<a href="form.php?ID='.$questID.'">'.$questID.'</a>): '.$NewVote, 5); 102 } else echo 'Již jste hlasoval nebo nemůžete hlasovat!'; 103 } 109 ShowFooter(); 104 110 105 ShowFooter();106 111 ?> 107 112 -
trunk/dictionary.php
r43 r49 2 2 3 3 session_start(); 4 5 // SQL injection hack protection 6 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($_POST[$Index]); 7 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 8 4 9 include('includes/config.php'); 5 10 include('includes/databaseconection.php'); … … 10 15 $Database->SelectDatabase($Config['Database']['Database']); 11 16 12 13 function Licence($Licence) 14 { // BEGIN function Licence 15 global $Database; 16 if (isset($_SESSION['User']) and $_SESSION['User'] <> '') { 17 $User = $_SESSION['User']; 18 $Pass = $_SESSION['Pass']; 17 function Licence($Licence) 18 { 19 global $Database; 20 21 if (isset($_SESSION['User']) and $_SESSION['User'] <> '') 22 { 23 $User = $_SESSION['User']; 24 $Pass = $_SESSION['Pass']; 19 25 20 26 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('$User')")); 21 if (!$Line) { 27 if (!$Line) 28 { 22 29 return false; 23 30 } else { … … 41 48 // die('Nemáte zde přístup, přihlate se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>'); 42 49 } 43 44 } // END function Licence 50 } 45 51 46 47 48 49 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 52 echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 50 53 <HTML> 51 54 <HEAD> … … 56 59 <TITLE>Projekt překládání textů do WoW</TITLE> 57 60 </HEAD> 58 <body> 61 <body>'); 59 62 60 '; 61 62 if (array_key_exists('insert', $_GET)) { 63 echo '<form action="dictionary.php" method="post"> 63 if(array_key_exists('insert', $_GET)) 64 { 65 echo('<form action="dictionary.php" method="post"> 64 66 <input type="text" name="AJWord"> Anglické slovo<br> 65 67 <input type="text" name="CZWord"> České slovo<br> 66 68 <input type="text" name="description"> Popis<br> 67 69 <input type="submit" value="Uložit"> 68 </form> 69 ';70 $WinWidth = 230; 71 } else{72 73 if (array_key_exists('AJWord', $_POST)) {74 $AJWord = $_POST['AJWord'];75 $CZWord = $_POST['CZWord'];76 $description = $_POST['description'];77 $user = @$_SESSION['UserID'];78 $Database->SQLCommand("INSERT INTO `dictionary` ( `AJWord` , `CZWord` , `description` , `user` )79 80 echo 'Záznam byl uložen!';81 82 83 70 </form>'); 71 $WinWidth = 230; 72 } else 73 { 74 $WinWidth = 345; 75 if (array_key_exists('AJWord', $_POST)) 76 { 77 $AJWord = $_POST['AJWord']; 78 $CZWord = $_POST['CZWord']; 79 $description = $_POST['description']; 80 $user = @$_SESSION['UserID']; 81 $Database->SQLCommand("INSERT INTO `dictionary` ( `AJWord` , `CZWord` , `description` , `user` ) VALUES ('$AJWord', '$CZWord', '$description', '$user');"); 82 echo('Záznam byl uložen!'); 83 $WinWidth = 325; 84 } 85 } 84 86 87 echo('<table border="1" width="100%">'); 88 89 if(array_key_exists('search', $_GET)) 90 { 91 $Search = $_GET['search']; 92 } else 93 { 94 $Search = ''; 95 } 96 97 echo('<tr><td><form action="dictionary.php" method="get"> 98 <input type="text" value="'.$Search.'" name="search" size="30"> 99 <input type="submit" value="Vyhledat">'); 100 if(Licence(0)) 101 echo(' <a href="dictionary.php?insert">Vložit slovo</a>'); 102 103 echo('</form></td></tr>'); 104 echo('<tr><td> 105 <p style=" overflow: auto; width: 100%; height: '.$WinWidth.'px;">'); 106 //todo select 107 if($Search <> '') 108 { 109 $sql = "SELECT * FROM `dictionary` WHERE LOWER(AJWord) LIKE LOWER('%$Search%') OR LOWER(CZWord) LIKE LOWER('%$Search%') OR LOWER(description) LIKE LOWER('%$Search%')"; 110 } else 111 { 112 $sql = "SELECT * FROM `dictionary`"; 113 } 114 echo('<table border="1" cellpadding="2" cellspacing="0" width="100%"> 115 <tr><th>Eng</th> 116 <th>Cze</th> 117 <th> Popis</th></tr>'); 118 $ID = $Database->SQLCommand($sql); 119 while ($Line = mysql_fetch_array($ID)) 120 { 121 echo('<tr> 122 <td>'.$Line['AJWord'].'</td> 123 <th>'.$Line['CZWord'].'</th> 124 <td>'.$Line['description'].'</td></tr>'); 125 } 126 echo('</table>'); 85 127 86 echo '<table border="1" width="100%">'; 87 88 if (array_key_exists('search', $_GET)) { 89 $Search = $_GET['search']; 90 } else { 91 $Search = ''; 92 } 93 94 95 echo '<tr><td><form action="dictionary.php" method="get"> 96 <input type="text" value="'.$Search.'" name="search" size="30"> 97 <input type="submit" value="Vyhledat">'; 98 if (Licence(0)) 99 echo ' <a href="dictionary.php?insert">Vložit slovo</a>'; 100 101 echo '</form></td></tr>'; 102 echo '<tr><td> 103 <p style=" overflow: auto; width: 100%; height: '.$WinWidth.'px;">'; 104 //todo select 105 if ($Search <> '') { 106 $sql = "SELECT * FROM `dictionary` WHERE LOWER(AJWord) LIKE LOWER('%$Search%') OR LOWER(CZWord) LIKE LOWER('%$Search%') OR LOWER(description) LIKE LOWER('%$Search%')"; 107 } else { 108 $sql = "SELECT * FROM `dictionary`"; 109 } 110 echo '<table border="1" cellpadding="2" cellspacing="0" width="100%"> 111 <tr><th>Eng</th> 112 <th>Cze</th> 113 <th> Popis</th></tr>'; 114 $ID = $Database->SQLCommand($sql); 115 while ($Line = mysql_fetch_array($ID)) { 116 echo '<tr> 117 <td>'.$Line['AJWord'].'</td> 118 <th>'.$Line['CZWord'].'</th> 119 <td>'.$Line['description'].'</td></tr>'; 120 } 121 echo '</table>'; 128 echo('</td></tr>'); 122 129 123 echo '</td></tr>'; 124 125 echo '</table> 126 </body>'; 130 echo('</table></body>'); 131 127 132 ?> -
trunk/download.php
r43 r49 1 1 <?php 2 2 3 3 include('includes/global.php'); 4 4 5 if (array_key_exists('Type', $_POST)) { 6 include 'includes/zip.lib.php'; 7 include 'export.php'; 8 } else { 9 ?> 10 <div style=" border: 2px dotted black; padding: 0px 5px 5px 5px;"> 11 <big><b><i>Pro klinta:</i></b></big><br> 5 if(array_key_exists('Type', $_POST)) 6 { 7 include('includes/zip.lib.php'); 8 include('export.php'); 9 } else 10 { 11 echo('<div style="border: 1px dotted black; padding: 0px 5px 5px 5px;"> 12 <big><b><i>Pro klinta:</i></b></big><br /> 12 13 <b><a href="download-addon.php">CZWoW</a></b> - <a href="download-addon.php">Stáhnout češtinu pro clienta</a><br /> 13 - Změny ve verzích můžete sledovat v: <a href="client_files/_czwow/CzWoW/CzWoW.html">ChangeLog</a><br >14 - Změny ve verzích můžete sledovat v: <a href="client_files/_czwow/CzWoW/CzWoW.html">ChangeLog</a><br /> 14 15 - Čeština pro clienta obsahuje:<br /> 15 16 - Přeložené texty z projektu wowpřeklad<br /> … … 23 24 - zvukové soubory převzaté z české verze Warcraftu III <a href="http://www.wowresource.eu/index.php?showtopic=4260&hl=hl%C3%A1%C5%A1ky" title="http://www.wowresource.eu/index.php?showtopic=4260&hl=hl%C3%A1%C5%A1ky">České hlášky z Warcraftu III</a> 24 25 </div> 25 <br >26 <div style=" border: 2px dotted black; padding: 0px 5px 5px 5px;">26 <br /> 27 <div style="border: 1px dotted black; padding: 0px 5px 5px 5px;"> 27 28 <big><b><i>Pro server:</i></b></big><br> 28 29 <b>Export překladu:</b><br /> … … 31 32 <tr><th>Sql</th><th>Filtr</th><th>Jazyk</th><th>Texty</th></tr> 32 33 <tr><td> 33 <input type="radio" name="Export" value="Zip" checked="true"> Exportovat do zip<br> 34 <input type="radio" name="Export" value="Display"> Export zobrazit<br> 35 <?php 36 if (Licence(2)) { 37 echo '<input type="radio" name="Export" value="Mangos"> Import na server (Admin only)<br>'; 38 } 39 ?> 34 <input type="radio" name="Export" value="Zip" checked="true"> Exportovat do zip<br /> 35 <input type="radio" name="Export" value="Display"> Export zobrazit<br />'); 36 if(Licence(LICENCE_ADMIN)) 37 { 38 echo('<input type="radio" name="Export" value="Mangos" /> Import na server (pouze admin)<br />'); 39 } 40 echo('<br /> 41 <input type="radio" name="Type" value="Insert" /> Insert (zatím nefunguje)<br /> 42 <input type="radio" name="Type" value="Update" checked="true" /> Update <br /> 40 43 <br /> 41 <input type="radio" name="Type" value="Insert"> Insert (zatím nefunguje)<br> 42 <input type="radio" name="Type" value="Update" checked="true"> Update <br> 43 <br /> 44 <input type="checkbox" name="Use" checked="true"> Přidat Use mangos <br> 45 <br /> 46 <input type="checkbox" name="Quests" checked="true"> Questy <br> 47 <input type="checkbox" name="NPC_texts" checked="true"> NPC_texts <br> 48 <input type="checkbox" name="page_texts" checked="true"> page_texts <br> 49 </td><td> 50 <input type="text" name="NumberVote" value="3" size="1"> Počet nutných hlasů <br> 51 <input type="text" name="Vote" value="4" size="1"> Známka lepší nebo stejná jak <br> 44 <input type="checkbox" name="Use" checked="true"> Přidat Use mangos <br /> 45 <br />'); 46 echo('</td><td> 47 <input type="text" name="NumberVote" value="3" size="1" /> Počet nutných hlasů <br /> 48 <input type="text" name="Vote" value="4" size="1" /> Známka lepší nebo stejná jak <br /> 52 49 <br /> 53 <select name="users[]" size="10" multiple> 54 55 <?php 56 // multiple="multiple" 57 $ID = $Database->SQLCommand("SELECT user,ID FROM `user` WHERE 58 EXISTS(SELECT 1 FROM quests WHERE user = user.ID) OR 59 EXISTS(SELECT 1 FROM npc_text WHERE user = user.ID) ORDER BY user"); 60 while ($Line = mysql_fetch_array($ID)) 61 echo '<option value="'.$Line['ID'].'">'.$Line['user'].'</option>'; 62 63 ?> 64 65 </select><br> Exportovat pouze od těchto uživatalů<br> 66 Vybrat více uživatelů můžete pomocí CTRL+click 67 50 <select name="users[]" size="10" multiple>'); 51 52 // multiple="multiple" 53 $Query = 'SELECT user,ID FROM `user` WHERE '; 54 foreach($TranslationTree as $Group) 55 if($Group['TablePrefix'] != '') 56 $Query .= 'EXISTS(SELECT 1 FROM '.$Group['TablePrefix'].' WHERE user = user.ID) OR '; 57 $Query .= ' 0 ORDER BY user'; 58 $ID = $Database->SQLCommand($Query); 59 while ($Line = mysql_fetch_array($ID)) 60 echo('<option value="'.$Line['ID'].'">'.$Line['user'].'</option>'); 61 62 echo('</select><br /> Exportovat pouze od těchto uživatalů<br /> 63 Vybrat více uživatelů můžete pomocí CTRL+click 68 64 69 65 </td><td> 70 <input type="checkbox" name="Diacritical" checked="true" > Včetně diakritiky <br>66 <input type="checkbox" name="Diacritical" checked="true" /> Včetně diakritiky <br> 71 67 <br /> 72 <input type="checkbox" name="CZ" checked="true"> Český překlad <br> 73 <input type="checkbox" name="SK" checked="true"> Slovenský překlad <br> 74 <input type="checkbox" name="OtherLanguage"> Jiné jazyky <br> 75 </td><td> 76 <b>Title questu:</b><br> 77 <input type="radio" name="AddTitle" value="Translate" checked="true"> Přeložený název <br> 78 <input type="radio" name="AddTitle" value="EN"> Původní název <br> 79 <input type="radio" name="AddTitle" value="Both"> Přeložený název (Anglický název) <br> 80 <br> 81 <?php 82 foreach($Texts as $Index => $TextItem) 83 echo '<input type="checkbox" name="Add'.$TextItem[0].'" checked="true"> '.$TextItem[0].'<br>'; 84 ?> 85 </td></tr> 68 <input type="checkbox" name="CZ" checked="true" /> Český překlad <br /> 69 <input type="checkbox" name="SK" checked="true" /> Slovenský překlad <br /> 70 <input type="checkbox" name="OtherLanguage" /> Jiné jazyky <br /> 71 </td><td>'); 72 foreach($TranslationTree as $Group) 73 if($Group['TablePrefix'] != '') 74 echo('<input type="checkbox" name="'.$Group['TablePrefix'].'" checked="true" /> '.$Group['Name'].'<br />'); 75 76 echo('</td></tr> 86 77 </table> 87 <br ><input type="submit" value="Generovat SQL soubor překladu (Stažení)">88 </form> 78 <br /><input type="submit" value="Generovat SQL soubor překladu (Stažení)" /> 79 </form><br /> 89 80 <b>Český překlad MaNGOS Minimanageru:</b><br /> 90 - Stránky projektu: <a href="http://sourceforge.net/projects/mmfpm/">http://sourceforge.net/projects/mmfpm/</a><br >91 - Překlad: <a href="http://wow.zdechov.net/minimanager/lang/csCZ.zip">Čeština do minimanageru</a><br >81 - Stránky projektu: <a href="http://sourceforge.net/projects/mmfpm/">http://sourceforge.net/projects/mmfpm/</a><br /> 82 - Překlad: <a href="http://wow.zdechov.net/minimanager/lang/csCZ.zip">Čeština do minimanageru</a><br /> 92 83 - Diskusní forum pro případné připomínky k překladu: <a href="http://wow.zdechov.net/forum/viewtopic.php?p=5533">Forum</a> 93 84 94 </div> 95 <br> 96 <?php 85 </div> 86 <br />'); 97 87 } 98 99 100 ShowFooter(); 88 89 ShowFooter(); 101 90 ?> -
trunk/fill_database.php
r43 r49 1 1 <?php 2 2 3 3 include('includes/global.php'); 4 4 5 echo 'Načítání questů z databáze: '; 5 echo('Načítání textů z databáze MaNGOSu: '); 6 echo('<div style="font-size: xx-small;">'); 6 7 7 $sql = "SELECT * FROM mangos.quest_template as mangos_quests 8 WHERE NOT EXISTS (SELECT * FROM quests.quests WHERE quests.quests.entry=mangos_quests.entry)"; 8 foreach($TranslationTree as $Group) 9 { 10 if(($Group['MangosTable'] != '') and ($Group['TablePrefix'] != '')) 11 { 12 echo('<br />'.$Group['Name'].'<br />'); 13 $Columns = '`'.$Config['Database']['DatabaseMangos'].'`.`'.$Group['MangosTable'].'`.`'.$Group['MangosTableIndex'].'`'; 14 foreach($Group['Items'] as $GroupItem) 15 $Columns .= ', `'.$Config['Database']['DatabaseMangos'].'`.`'.$Group['MangosTable'].'`.`'.$GroupItem['MangosColumn'].'` AS `'.$GroupItem['Column'].'`'; 16 $Query = 'SELECT '.$Columns.' FROM `'.$Config['Database']['DatabaseMangos'].'`.`'.$Group['MangosTable'].'`'; 17 echo($Query.'<br />'); 18 $Count = 0; 19 $NewCount = 0; 20 $DbResult = $Database->SQLCommand($Query); 21 while($DbRow = mysql_fetch_assoc($DbResult)) 22 { 23 //echo('SELECT ID FROM '.$Group['TablePrefix'].' WHERE entry='.$DbRow[$Group['MangosTableIndex']].' AND Language=0'."<br>"); 24 $DbResult2 = $Database->SQLCommand('SELECT ID FROM '.$Group['TablePrefix'].' WHERE entry='.$DbRow[$Group['MangosTableIndex']].' AND Language=0'); 25 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 26 { 27 $DbRow2 = mysql_fetch_assoc($DbResult2); 28 //echo($DbRow2['ID']); 29 $ColumnsValues = ''; 30 foreach($Group['Items'] as $GroupItem) 31 { 32 $ColumnsValues .= ', `'.$GroupItem['Column'].'`="'.addslashes($DbRow[$GroupItem['MangosColumn']]).'"'; 33 } 34 $ColumnsValues = substr($ColumnsValues, 2); 35 echo('. '); //'UPDATE `'.$Group['TablePrefix'].'` SET '.$ColumnsValues.' WHERE ID='.$DbRow2['ID']."<br>"); 36 //print_r($DbRow2); 37 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET '.$ColumnsValues.' WHERE ID='.$DbRow2['ID']); 38 } else 39 { 40 $Columns = 'entry, language'; 41 $Values = $DbRow[$Group['MangosTableIndex']].', 0'; 42 foreach($Group['Items'] as $GroupItem) 43 { 44 $Columns .= ', `'.$GroupItem['Column'].'`'; 45 $Values .= ', "'.addslashes($DbRow[$GroupItem['MangosColumn']]).'"'; 46 } 47 //$Columns = substr($Columns, 2); 48 //$Values = substr($Values, 2); 49 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 50 echo('# '); 51 //echo('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'."<br>"); 52 $NewCount++; 53 } 54 $Count++; 55 } 56 echo('<br />Celkem: '.$Count.' Nových: '.$NewCount.'<br />'); 57 } 58 } 59 echo('Dokončeno.</div>'); 9 60 10 $ID = $Database->SQLCommand($sql); 11 while ($Line = mysql_fetch_array($ID)) { 61 WriteLog('Plnění databáze', 4); 12 62 13 $sql = " 14 INSERT INTO `quests` ( `ID` , `entry` , `Title` , `Details` , `Objectives` , 15 `OfferRewardText` , `RequestItemsText` , `EndText` , `ObjectiveText1` , `ObjectiveText2` , 16 `ObjectiveText3` , `ObjectiveText4` , `Language`) 17 VALUES (NULL , '".mysql_escape_string($Line['entry'])."', '".mysql_escape_string($Line['Title'])."', '".mysql_escape_string($Line['Details'])."', 18 '".mysql_escape_string($Line['Objectives'])."', '".mysql_escape_string($Line['OfferRewardText'])."', '".mysql_escape_string($Line['RequestItemsText'])."', '".mysql_escape_string($Line['EndText'])."', 19 '".mysql_escape_string($Line['ObjectiveText1'])."', '".mysql_escape_string($Line['ObjectiveText2'])."', '".mysql_escape_string($Line['ObjectiveText3'])."', '".mysql_escape_string($Line['ObjectiveText4'])."', '0')"; 20 // echo $sql; 21 $Database->SQLCommand($sql); 22 } 23 echo 'HOTOVO'; 24 25 WriteLog('Plnění databáze', 4); 26 27 28 ShowFooter(); 63 ShowFooter(); 64 29 65 ?> -
trunk/form.php
r43 r49 1 1 <?php 2 2 3 include('includes/global.php'); 3 4 4 if (array_key_exists('ID', $_GET)) { 5 $QuestID = mysql_escape_string($_GET['ID']); 5 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group']; else $GroupId = 1; 6 $Table = $TranslationTree[$GroupId]['TablePrefix']; 7 if(array_key_exists('action', $_GET)) $Action = $_GET['action']; else $Action = ''; 6 8 7 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests Where ID = $QuestID")); 8 9 $LineAJ = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests Where Language = '0' 10 AND entry = '".$Line['entry']."'")); 11 12 $User = @$_SESSION['User']; 13 $IDUser = $Database->SQLCommand("SELECT * FROM user Where id = '".$Line['User']."'"); 14 $LineUser = mysql_fetch_array($IDUser); 9 if(array_key_exists('ID', $_GET)) 10 { 11 $TextID = $_GET['ID']; 12 13 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' Where ID = '.$TextID)); 14 if(!$Line) die('Překlad nenalezen.'); 15 16 $LineAJ = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE Language = 0 AND entry = '.$Line['entry'])); 17 if(!$Line) die('Anglický originál k překladu nenalezen.'); 18 19 $User = @$_SESSION['User']; 20 $IDUser = $Database->SQLCommand('SELECT * FROM user Where id = '.$Line['User']); 21 $LineUser = mysql_fetch_array($IDUser); 15 22 16 23 17 if ($Line['Language'] <> '0' and $LineUser['user'] <> '') echo 'Přeložil: <b>'.$LineUser['user'].'</b> <br />'; 18 if ($Line['Take'] <> '0' and $Line['Take'] <> $Line['ID']) { 19 $Language = mysql_fetch_array($Database->SQLCommand("SELECT Language FROM quests Where ID = '".$Line['Take']."'")); 20 // echo $Language['Language'].' '.$Line['Take']; 21 if ($Language['Language'] <> 0) 22 echo 'Převzato z: <a href="form.php?ID='.$Line['Take'].'">'.$Line['Take'].'</a> <br />'; 23 } 24 echo 'Quest: '; 25 if ($Line['Language'] <> '0') { 26 if ($Line['complete'] == 1) echo ' <b>Hotov</b><br />'; 27 else echo ' <b> Uložen v rozepsaných</b><br />'; 28 } else { 29 echo ' <b>Anglická, původní verze</b><br />'; 30 } 24 if(($Line['Language'] <> 0) and ($LineUser['user'] <> '')) echo('Přeložil: <strong>'.$LineUser['user'].'</strong> <br />'); 25 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID'])) 26 { 27 $Language = mysql_fetch_array($Database->SQLCommand('SELECT Language FROM '.$Table.' Where ID = '.$Line['Take'])); 28 // echo $Language['Language'].' '.$Line['Take']; 29 if($Language['Language'] <> 0) 30 echo('Převzato z: <a href="form.php?group='.$GroupId.'&ID='.$Line['Take'].'">'.$Line['Take'].'</a> <br />'); 31 } 32 echo('Text: '); 33 if($Line['Language'] <> 0) 34 { 35 if($Line['complete'] == 1) echo(' <b>Hotov</b><br />'); 36 else echo(' <b> Uložen v rozepsaných</b><br />'); 37 } else 38 { 39 echo(' <b>Anglická, původní verze</b><br />'); 40 } 31 41 32 if ($Line['Language'] <> '0') { 33 echo 'Známka Questu: <b>'.$Line['Vote'].'</b><br />'; 34 } 42 if($Line['Language'] <> 0) 43 { 44 echo('Známka překladu: <b>'.$Line['Vote'].'</b><br />'); 45 } 35 46 36 37 if (Licence(0) and ($LineUser['ID'] <> $_SESSION['UserID']) and ($Line['Language'] <> 0)) { 38 $LineVote = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests_vote WHERE 39 IDuser = ".$_SESSION['UserID']." AND IDquest = $QuestID")); 40 if (!$LineVote) { 41 echo ' Hodnotit Quest: '; 42 for ($i=1; $i<6; ++$i) 43 echo '<a href="action.php?vote='.$i.'&ID='.$QuestID.'">'.$i.'</a> '; 44 echo ' bodů (5 nejlepší)'; 45 } else { echo ' Již jsi hlasoval: '.$LineVote['vote']; } 46 echo '<br> 47 48 '; 49 50 51 47 if(Licence(LICENCE_USER) and ($LineUser['ID'] <> $_SESSION['UserID']) and ($Line['Language'] <> 0)) 48 { 49 $LineVote = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.'_vote WHERE IDuser = '.$_SESSION['UserID'].' AND TextId = '.$TextID)); 50 if(!$LineVote) 51 { 52 echo(' Hodnotit text: '); 53 for($i = 1; $i < 6; ++$i) 54 echo('<a href="action.php?group='.$GroupId.'&vote='.$i.'&ID='.$TextID.'">'.$i.'</a> '); 55 echo(' bodů (5 nejlepší)'); 56 } else 57 { 58 echo(' Již jsi hlasoval: '.$LineVote['vote']); 59 } 60 echo('<br />'); 52 61 } 53 62 54 //kontrolování textů55 $ID_translation = $ QuestID;63 // kontrolování textů 64 $ID_translation = $TextID; 56 65 $type_translation = 1; 57 $check = mysql_fetch_array($Database->SQLCommand( "SELECT * FROM tag WHERE ID_user = ".$_SESSION['UserID']." AND ID_translation = $ID_translation AND type_translation = $type_translation"));58 echo '<form action="action.php" method="post" name="check">';59 if 60 echo '<input name="0" type="submit" value="Odebrat z vlastního výběru">';66 $check = mysql_fetch_array($Database->SQLCommand('SELECT * FROM tag WHERE ID_user = '.$_SESSION['UserID'].' AND ID_translation = '.$ID_translation.' AND type_translation = '.$type_translation)); 67 echo('<form action="action.php?group='.$GroupId.'" method="post" name="check">'); 68 if($check['tag'] == 1) 69 echo('<input name="0" type="submit" value="Odebrat z vlastního výběru" />'); 61 70 else 62 echo '<input name="1" type="submit" value="Přidat do vlastního výběru">'; 63 echo ' <input type="hidden" name="ID_translation" value="'.$ID_translation.'"> 64 <input type="hidden" name="type_translation" value="'.$type_translation.'"> 65 66 </form>'; 67 if ($Line['admin_check'] <> '0') { 68 echo '<b>Quest byl zkontrolován adminem</b><br />'; 69 } 70 if (Licence(2)) { 71 $admin_check = mysql_fetch_array($Database->SQLCommand("SELECT ID FROM quests Where entry = ".$Line['entry']." AND admin_check = 1 AND ID <> $QuestID")); 72 if (isset($admin_check['ID'])) 73 echo 'Již byla zkontrolována adminem jiná verze questu: <a href="form.php?ID='.$admin_check['ID'].'">'.$admin_check['ID'].'</a><br />'; 74 } 75 $number_version = mysql_fetch_array($Database->SQLCommand("SELECT count(*) FROM quests Where entry = ".$Line['entry']." AND Language <> 0")); 76 echo 'Počet verzí: <b>'.$number_version['count(*)'].'</b> '; 77 echo '<a href="ListQuests.php?searchentry='.$Line['entry'].'">Zobrazit všechny verze tohoto questu</a>'; 71 echo('<input name="1" type="submit" value="Přidat do vlastního výběru" />'); 72 echo(' <input type="hidden" name="ID_translation" value="'.$ID_translation.'" /> 73 <input type="hidden" name="type_translation" value="'.$type_translation.'" /> 74 </form>'); 75 if($Line['admin_check'] <> 0) 76 { 77 echo('<b>Překlad byl zkontrolován adminem</b><br />'); 78 } 79 if(Licence(LICENCE_ADMIN)) 80 { 81 $admin_check = mysql_fetch_array($Database->SQLCommand('SELECT ID FROM '.$Table.' Where entry = '.$Line['entry'].' AND admin_check = 1 AND ID <> '.$TextID)); 82 if(isset($admin_check['ID'])) 83 echo('Již byla zkontrolována adminem jiná verze překladu: <a href="form.php?group='.$GroupId.'&ID='.$admin_check['ID'].'">'.$admin_check['ID'].'</a><br />'); 84 } 85 $number_version = mysql_fetch_array($Database->SQLCommand('SELECT count(*) FROM '.$Table.' Where entry = '.$Line['entry'].' AND Language <> 0')); 86 echo('Počet verzí: <b>'.$number_version['count(*)'].'</b> '); 87 echo('<a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line['entry'].'">Zobrazit všechny verze tohoto překladu</a>'); 78 88 79 89 // Speciální znaky: $B - Odřádkování, $N - Jméno, $C - povolání 80 ?> 81 <form action="save.php" method="post"> 82 <?php 83 if (Licence(0)) { 84 echo '<input type="submit" value="Uložit do rozepsaných" name="save" Title="Klikněte na uložit pro pozdější dokončení Q"> 85 <input type="submit" value="Dokončeno" name="End" Title="Klikněte na Dokončeno jesli jsou všechny texty hotové a chcete již publikovat">'; 86 90 echo('<form action="save.php?group='.$GroupId.'" method="post">'); 91 if(Licence(LICENCE_USER)) 92 { 93 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" /> 94 <input type="submit" value="Dokončeno" name="End" Title="Klikněte na Dokončeno jesli jsou všechny texty hotové a chcete již publikovat" />'); 87 95 } 88 96 89 90 if (Licence(1) and $Line['Language'] <> 0){91 echo '<input type="submit" value="Opravit" name="Repair" Title="Opravit po uživateli chyby (Moderator only)">';97 if (Licence(LICENCE_MODERATOR) and ($Line['Language'] <> 0)) 98 { 99 echo('<input type="submit" value="Opravit" name="Repair" Title="Opravit po uživateli chyby (pouze moderátor)" />'); 92 100 } 93 if (Licence(1) and ($Line['Language'] <> 0)) { 101 if(Licence(LICENCE_MODERATOR) and ($Line['Language'] <> 0)) 102 { 94 103 // echo '<input type="submit" value="Opravit Q" name="Repair"> Klikněte Jestli si přejete opravit chyby v Questu<br>'; 95 104 96 echo ' <input type="hidden" name="UserRepair" value="'.$Line['User'].'">'; 97 echo ' <a style="color: Red" title="smazat (Moderator only)" href="action.php?delete=1&ID='.$QuestID.'">x</a> 98 <a style="color: Red" title="Není hotovo (Moderator only)" href="action.php?NotComplete=1&ID='.$QuestID.'"><-</a> 99 100 '; 101 if (Licence(2)) { 102 if ($Line['admin_check'] <> '1') { 103 echo ' <a style="color: Green" title="Zkontrolováno (Admin only)" href="action.php?admin_check=1&ID='.$QuestID.'"><b>+</b></a>'; 104 } else { 105 echo ' <a style="color: Green" title="Zrušit zkontrolování (Admin only)" href="action.php?admin_check=0&ID='.$QuestID.'"><b>-</b></a>'; 106 } 107 } 108 } 109 ?> 110 <input type="hidden" name="entry" value="<?php echo $LineAJ['entry']?>"> 111 <input type="hidden" name="user" value="<?php echo $User ?>"> 112 <input type="hidden" name="ID" value="<?php echo $QuestID ?>"> 105 echo(' <input type="hidden" name="UserRepair" value="'.$Line['User'].'" />'); 106 echo(' <a style="color: Red" title="smazat (pouze moderátor)" href="action.php?group='.$GroupId.'&action=delete&delete=1&ID='.$TextID.'">x</a> 107 <a style="color: Red" title="Není hotovo (pouze moderátor)" href="action.php?group='.$GroupId.'&action=NotComplete&NotComplete=1&ID='.$TextID.'"><-</a>'); 108 if(Licence(LICENCE_ADMIN)) 109 { 110 if($Line['admin_check'] <> '1') 111 { 112 echo(' <a style="color: Green" title="Zkontrolováno (pouze admin)" href="action.php?group='.$GroupId.'&action=admin_check&admin_check=1&ID='.$TextID.'"><b>+</b></a>'); 113 } else 114 { 115 echo(' <a style="color: Green" title="Zrušit zkontrolování (pouze admin)" href="action.php?group='.$GroupId.'&action=admin_check&admin_check=0&ID='.$TextID.'"><b>-</b></a>'); 116 } 117 } 118 } 119 120 echo('<input type="hidden" name="entry" value="'.$LineAJ['entry'].'" /> 121 <input type="hidden" name="user" value="'.$User.'" /> 122 <input type="hidden" name="ID" value="'.$TextID.'" /> 113 123 <table border="1" cellpadding="1" cellspacing="0"> 114 124 <tr> 115 <th>Číslo Q.: <?php echo '<a Title="Zobrazit quest na wowhead.com" href="http://www.wowhead.com/?quest='.$LineAJ['entry'].'">'.$LineAJ['entry'].'</a>'; ?></th>125 <th>Číslo textu: <a Title="Zobrazit text na wowhead.com" href="http://www.wowhead.com/?quest='.$LineAJ['entry'].'">'.$LineAJ['entry'].'</a></th> 116 126 <th>Nepřeložené</th> 117 127 <th>Přeložené</th> … … 121 131 <td width="300">Anglický</td> 122 132 <td> 123 Přeloženo do: <?php 124 if ($Line['Language'] <> 0) 125 $Language = $Line['Language']; 126 else { 127 $IDUser = $Database->SQLCommand("SELECT * FROM user Where id = '".@$_SESSION['UserID']."'"); 128 $LineUser = mysql_fetch_array($IDUser); 129 $Language = $LineUser['Language']; //jiný user vyčítám 130 } 131 WriteLanguages($Language); 132 ?> 133 </td> 134 </tr> 135 <tr> 136 <th>Title</th> 137 <td width="300"><?php echo htmlspecialchars($LineAJ['Title'])?></td> 138 <td><input type="text" size="45" name="Title" value="<?php echo htmlspecialchars($Line['Title']) ?>"></td> 139 </tr> 140 141 <?php foreach($Texts as $Index => $TextItem) 142 { 143 if (($LineAJ[$TextItem[0]] <> '') or ($Line[$TextItem[0]] <> '')) 144 echo ' 145 <tr> 146 <th>'.$TextItem[0].'</th> 147 <td width="300">'.htmlspecialchars($LineAJ[$TextItem[0]]).'</td> 148 <td><textarea rows="8" style="width: 300px; height=100%;" name="'.$TextItem[0].'">'.htmlspecialchars($Line[$TextItem[0]]).'</textarea></td> 149 </tr> 150 '; 151 152 } 153 154 ?> 155 156 </table> 157 </form> 158 <?php 133 Přeloženo do:'); 134 if($Line['Language'] <> 0) $Language = $Line['Language']; 135 else 136 { 137 $IDUser = $Database->SQLCommand('SELECT * FROM user Where id = '.@$_SESSION['UserID']); 138 $LineUser = mysql_fetch_array($IDUser); 139 $Language = $LineUser['Language']; //jiný user vyčítám 140 } 141 WriteLanguages($Language); 142 echo('</td></tr><tr>'); 143 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem) 144 { 145 if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> '')) 146 echo('<tr> 147 <th>'.$TextItem['Name'].'</th> 148 <td width="300">'.htmlspecialchars($LineAJ[$TextItem['Column']]).'</td> 149 <td><textarea rows="8" style="width: 300px; height=100%;" name="'.$TextItem['Column'].'">'.htmlspecialchars($Line[$TextItem['Column']]).'</textarea></td></tr>'); 150 } 151 echo('</table> 152 </form>'); 153 } else 154 { 155 // include 'ListQuests.php'; 156 echo('Nebylo zadáno ID <a href="index.php">zpět</a>'); 157 } 159 158 160 } else { 161 // include 'ListQuests.php'; 162 163 echo 'Nebylo zadáno ID <a href="index.php">zpět</a>'; 164 165 } 159 ShowFooter(); 166 160 167 168 169 ShowFooter();170 161 ?> 171 162 -
trunk/img_statistic.php
r43 r49 3 3 include('includes/config.php'); 4 4 include('includes/databaseconection.php'); 5 6 // SQL injection hack protection 7 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($_POST[$Index]); 8 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 5 9 6 10 //připojení do databáze … … 12 16 13 17 // echo "SELECT count(distinct(entry)) FROM $TypeTexts WHERE Language <> '0' AND Complete = '1'"; 14 $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(distinct(entry)) FROM $TypeTextsWHERE Language <> '0' AND Complete = '1'"));18 $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(distinct(entry)) FROM ".$TypeTexts." WHERE Language <> '0' AND Complete = '1'")); 15 19 $NumberTranslate = $ID[0]; 16 20 17 $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(*) FROM $TypeTextsWHERE Language = '0'"));21 $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(*) FROM ".$TypeTexts." WHERE Language = '0'")); 18 22 $NumberAJ = $ID[0]; 19 23 20 $Percent = ($NumberTranslate /$NumberAJ)*100;24 $Percent = ($NumberTranslate / $NumberAJ) * 100; 21 25 $Percent = substr($Percent, 0, 5); 22 26 23 $PercentBar = $Percent*4; 24 $obrazek = imagecreatetruecolor(400,60); 25 $Color1 = imagecolorallocate($obrazek,225,246,247); 26 $Color2 = imagecolorallocate($obrazek,77,225,251); 27 $Color3 = imagecolorallocate($obrazek,2,59,199); 28 imagefilledrectangle($obrazek,0,0,400,59,$Color1); 29 imagefilledrectangle($obrazek,0,0,$PercentBar,59,$Color2); 30 imagestring($obrazek, 10, 120, 15, $NumberTranslate.'/'.$NumberAJ, $Color3); 31 imagestring($obrazek, 3, 300, 15, $TypeTexts, $Color3); 32 imagestring($obrazek, 10, 120, 30, $Percent.' %', $Color3); 33 imagestring($obrazek, 1, 240, 50, 'Aktualizováno: '.date("m.d.y H:i"), $Color3); 34 27 $PercentBar = $Percent * 4; 28 $obrazek = imagecreatetruecolor(400, 40); 29 $Color1 = imagecolorallocate($obrazek, 225, 246, 247); 30 $Color2 = imagecolorallocate($obrazek, 77, 225, 251); 31 $Color3 = imagecolorallocate($obrazek, 2, 9, 199); 32 imagefilledrectangle($obrazek, 0, 0, 400, 39, $Color1); 33 imagefilledrectangle($obrazek, 0, 0, $PercentBar, 59, $Color2); 34 imagestring($obrazek, 10, 120, 5, $NumberTranslate.'/'.$NumberAJ, $Color3); 35 imagestring($obrazek, 3, 300, 5, $TypeTexts, $Color3); 36 imagestring($obrazek, 10, 120, 20, $Percent.' %', $Color3); 37 imagestring($obrazek, 1, 240, 30, 'Aktualizace: '.date("m.d.y H:i"), $Color3); 35 38 36 39 header('Content-Type: image/png'); -
trunk/includes/config.sample.php
r43 r49 6 6 'User' => 'root', 7 7 'Password' => '', 8 'Database' => ' quests',8 'Database' => 'wowpreklad', 9 9 'DatabaseCharacters' => 'characters', 10 10 'DatabaseMangos' => 'mangos', … … 16 16 'Charset' => 'utf-8', 17 17 'BaseURL' => 'http://localhost/', 18 'AdminEmail' => 'admin@localhost', 18 19 ), 19 20 ); -
trunk/includes/databaseconection.php
r47 r49 22 22 { 23 23 $ReturnCommand = mysql_query($Command, $this->id_connection); 24 return $ReturnCommand; 24 if(mysql_error() != '') echo('<div>'.mysql_error().'<br>'.$Command.'</div>'); 25 return($ReturnCommand); 25 26 } 26 27 -
trunk/includes/global.php
r48 r49 4 4 5 5 // SQL injection hack protection 6 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($_POST[$Index]); 6 foreach($_POST as $Index => $Item) 7 { 8 if(is_array($_POST[$Index])) 9 foreach($_POST[$Index] as $Index2 => $Item2) $_POST[$Index][$Index2] = addslashes($Item2); 10 else $_POST[$Index] = addslashes($_POST[$Index]); 11 } 7 12 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 8 13 … … 70 75 'index.php?Logout' => array(LICENCE_USER, 'Odhlášení ze systému', 'Odhlásit'), 71 76 'log.php' => array(LICENCE_MODERATOR, 'Log dění (Pouze moderátor)', 'Záznamy'), 72 'priorite.php' => array(LICENCE_ADMIN, 'Načtení priority questů (pouze admin)', 'Priorita'), 73 'fill_database.php' => array(LICENCE_ADMIN, 'Načtení questů do database (pouze admin)', 'Plnění databáse'), 77 'fill_database.php' => array(LICENCE_ADMIN, 'Načtení questů do database (pouze admin)', 'Import textů z MaNGOSu'), 74 78 //'client_files/generate_SQL.php' => array(LICENCE_ADMIN, 'Generování clientských souborů (pouze admin)', 'Generování C.S.'), 75 79 'https://wow.zdechov.net/mysql/' => array(LICENCE_ADMIN, 'phpMyAdmin(pouze admin)', 'Správa databáze'), … … 86 90 echo('<br />'); 87 91 92 echo('<strong>Překladové skupiny:</strong><br />'); 88 93 foreach($TranslationTree as $Group) 89 94 { … … 91 96 <a href="TranslationList.php?group='.$Group['Id'].'&action=filter">'.$Group['Name'].'</a></div> 92 97 <div id="group'.$Group['Id'].'" class="hidden-menu-item" onmousemove="show(\'group'.$Group['Id'].'\')" onmouseout="hide(\'group'.$Group['Id'].'\')">'); 93 echo(' <a title="Zde můžete začít překládat" href="TranslationList.php?group='.$Group['Id'].'&action= selection">Nepřeložené</a><br />98 echo(' <a title="Zde můžete začít překládat" href="TranslationList.php?group='.$Group['Id'].'&action=notran">Nepřeložené</a><br /> 94 99 <a title="Přeložené texty, můžete zde hlasovat, nebo opravovat překlady" href="TranslationList.php?group='.$Group['Id'].'&action=Translate">Přeložené</a><br />'); 95 100 if(Licence(LICENCE_USER)) … … 104 109 echo(' <a title="Zkontrolované překlady" href="TranslationList.php?group='.$Group['Id'].'&action=check">Zkontrolované</a><br />'); 105 110 } 106 echo(' <a title="Sestavit speciální fi tr" href="TranslationList.php?group='.$Group['Id'].'&action=filter">Filtr</a><br />');111 echo(' <a title="Sestavit speciální filtr" href="TranslationList.php?group='.$Group['Id'].'&action=filter">Filtr</a><br />'); 107 112 echo('</div>'); 108 113 } -
trunk/includes/global_function.php
r48 r49 87 87 while($DbRow = mysql_fetch_assoc($DbResult)) 88 88 { 89 $Result[$DbRow['Group']]['Items'][ $DbRow['Id']] = $DbRow;89 $Result[$DbRow['Group']]['Items'][] = $DbRow; 90 90 } 91 91 return($Result); 92 92 } 93 94 $Texts = array95 (96 //array('Title'),97 array('Details'),98 array('Objectives'),99 array('OfferRewardText'),100 array('RequestItemsText'),101 array('EndText'),102 array('ObjectiveText1'),103 array('ObjectiveText2'),104 array('ObjectiveText3'),105 array('ObjectiveText4'),106 );107 93 108 94 $LogTypes = array … … 128 114 $user = @$_SESSION['UserID']; 129 115 $Database->SelectDatabase($Config['Database']['Database']); 130 $Database->SQLCommand('INSERT INTO `log` ( `user` , `type` , `text` , `date` , `IP` ) 131 VALUES ( "'.$user.'", "'.$Type.'", "'.$Text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")'); 116 $Query = 'INSERT INTO `log` ( `user` , `type` , `text` , `date` , `IP` ) 117 VALUES ('.$user.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.addslashes($_SERVER['REMOTE_ADDR']).'")'; 118 $Database->SQLCommand($Query); 132 119 } 133 120 134 $npc_text = array135 (136 '0' => 'text0_0',137 '1' => 'text0_1',138 '2' => 'text1_0',139 '3' => 'text1_1',140 '4' => 'text2_0',141 '5' => 'text2_1',142 '6' => 'text3_0',143 '7' => 'text3_1',144 '8' => 'text4_0',145 '9' => 'text4_1',146 '10' => 'text5_0',147 '11' => 'text5_1',148 '12' => 'text6_0',149 '13' => 'text6_1',150 '14' => 'text7_0',151 '15' => 'text7_1',152 );153 154 $page_text = array155 (156 '0' => 'text',157 );158 121 159 122 $client_files = array … … 168 131 ); 169 132 170 $client_text = array171 (172 '0' => 'text',173 );174 175 133 ?> -
trunk/index.php
r47 r49 41 41 - Pro překládání nestačí vložit text do PC Translatoru a nechat ho zpracovat. Je nutné provést ruční kontrolu a překlad.<br /> 42 42 - Doporučujeme používat prohlížeč Mozilla Firefox a stáhnout si něj rozšiření pro kontrolu pravopisu: 43 <a href="https://addons.mozilla.org/cs/firefox/browse/type:3">Rozšíření do mozily</a><br />43 <a href="https://addons.mozilla.org/cs/firefox/browse/type:3">Rozšíření do Firefoxu</a><br /> 44 44 <br /> 45 45 46 46 <?php 47 47 // Některé texty najdete <a href="http://wow-cz.wz.cz/index.php">zde</a> 48 if (Licence(0))48 if(Licence(LICENCE_USER)) 49 49 { 50 50 /* 51 51 $UserID = $_SESSION['UserID']; 52 52 $ID = $Database->SQLCommand("SELECT COUNT(*) FROM quests WHERE User='$UserID' AND complete = 0"); … … 59 59 if($ID['Email'] == '') 60 60 echo('<span style="color: red"><b>Nemáte nastavený e-mail, <a href="Options.php">nastavit</a></b></span>'); 61 61 */ 62 62 } 63 63 -
trunk/log.php
r43 r49 1 1 <?php 2 2 3 3 include('includes/global.php'); 4 4 5 echo '<b>Filtr: </b>'; 6 Echo '<a href="log.php" Title="Bez filtrování"><span style="color:black">Všechny</span></a> '; 5 echo('<b>Filtr: </b>'); 6 echo('<a href="log.php" title="Bez filtrování"><span style="color:black">Všechny</span></a> '); 7 foreach($LogTypes as $Index => $LogItem) 8 { 9 echo('<a href="log.php?type='.$LogItem[0].'" title="'.$LogItem[3].'"><span style="color:'.$LogItem[2].'">'.$LogItem[1].'</span></a> '); 10 } 11 12 // echo ' Formát: datum: text zprávy (uživatel, IP)<br /><br />'; 13 echo('<br /><br />'); 14 15 if(array_key_exists('type', $_GET)) 16 { 17 $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user 18 FROM log WHERE type = '".$_GET['type']."' ORDER BY date DESC LIMIT 100"; 19 // if ($_GET['type'] == $LogItem[0]) { } 20 } else $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user FROM log ORDER BY date DESC LIMIT 100"; 21 22 $ID = $Database->SQLCommand($sql); 23 while($Line = mysql_fetch_array($ID)) 24 { 7 25 foreach($LogTypes as $Index => $LogItem) 8 26 { 9 Echo '<a href="log.php?type='.$LogItem[0].'" Title="'.$LogItem[3].'"><span style="color:'.$LogItem[2].'">'.$LogItem[1].'</span></a> ';27 if($Line['type'] == $LogItem[0]) $color = $LogItem[2]; 10 28 } 29 echo($Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].', '.$Line['IP'].')<br />'); 30 } 31 32 ShowFooter(); 11 33 12 13 // echo ' Formát: datum: text zprávy (uživatel, IP)<br /><br />';14 echo '<br /><br />';15 16 if (array_key_exists('type', $_GET)) {17 $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user18 FROM log WHERE type = '".$_GET['type']."' ORDER BY date DESC LIMIT 100";19 // if ($_GET['type'] == $LogItem[0]) { }20 } else $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user21 FROM log ORDER BY date DESC LIMIT 100";22 23 24 $ID = $Database->SQLCommand($sql);25 while ($Line = mysql_fetch_array($ID)) {26 foreach($LogTypes as $Index => $LogItem)27 {28 if ($Line['type'] == $LogItem[0]) { $color = $LogItem[2]; }29 }30 echo $Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].', '.$Line['IP'].')<br />';31 }32 33 ShowFooter();34 34 ?> -
trunk/registrace.php
r43 r49 1 1 <?php 2 2 3 3 include('includes/global.php'); 4 4 5 if (array_key_exists('user', $_POST)) { 6 5 if(array_key_exists('user', $_POST)) 6 { 7 7 $User = $_POST['user']; 8 8 $Pass = $_POST['pass']; … … 11 11 $Language = $_POST['Language']; 12 12 13 if ($Pass == $Pass2) {14 13 if($Pass == $Pass2) 14 { 15 15 $Line = mysql_fetch_row($Database->SQLCommand("SELECT * FROM user WHERE user = '$User'")); 16 if (!$Line) { 16 if(!$Line) 17 { 17 18 $Addres = $_SERVER['REMOTE_ADDR']; 18 19 $Database->SQLCommand("INSERT INTO `user` (`user` , `pass` , `LastIP` , `LastLogin` , `Email` , `Language` ) 19 20 VALUES ('$User','$Pass','$Addres',now(),'$Email','$Language')"); 20 21 // $Database->SQLCommand("INSERT INTO user () VALUES('$User','$Pass','0','$Addres',now(),'0','$Email')"); 21 echo 'Registrace proběhla úspěšně<br />';22 echo('Registrace proběhla úspěšně<br />)'); 22 23 WriteLog('Uživatel se zaregistroval: '.$User, 3); 23 24 … … 29 30 30 31 // echo $Database->id_connection; 31 } else {32 echo 'Uživatel s touto přezdívkou již existuje 33 <A href="registrace.php">zpět</a>';32 } else 33 { 34 echo('Uživatel s touto přezdívkou již existuje. <a href="registrace.php">Zpět</a>'); 34 35 } 35 } else { 36 echo 'Hesla se neshodují 37 <A href="registrace.php">zpět</a>'; 38 } 39 40 } else { 41 42 ?> 43 <form action="registrace.php" method="post"> 36 } else 37 { 38 echo('Hesla se neshodují. <a href="registrace.php">Zpět</a>'); 39 } 40 } else 41 { 42 echo('<form action="registrace.php" method="post"> 44 43 <table> 45 44 <tr> 46 45 <td>Jméno:</td> 47 <td><input type="text" name="user" ></td>46 <td><input type="text" name="user" /></td> 48 47 </tr> 49 48 <tr> 50 49 <td>Heslo:</td> 51 <td><input type="password" name="pass" ></td>50 <td><input type="password" name="pass" /></td> 52 51 </tr> 53 52 <tr> 54 53 <td>Potvrzení Hesla: </td> 55 <td><input type="password" name="pass2" ></td>54 <td><input type="password" name="pass2" /></td> 56 55 </tr> 57 56 <tr> 58 57 <td>Email: </td> 59 <td><input type="text" name="Email" ></td>58 <td><input type="text" name="Email" /></td> 60 59 </tr> 61 60 <tr> 62 61 <td>Normálně budu překládat do: </td> 63 <td> <?php WriteLanguages($Line['Language']); ?></td>62 <td>'); WriteLanguages(1); echo('</td> 64 63 </tr> 64 <tr> 65 <th><input type="submit" value="Registrovat" /></th> 66 </tr> 67 </table></form>'); 68 } 69 70 ShowFooter(); 65 71 66 67 <tr>68 <th><input type="submit" value="Registrovat"></th>69 </tr>70 </table>71 </form>72 73 <?php74 75 }76 77 ShowFooter();78 72 ?> -
trunk/save.php
r43 r49 1 1 <?php 2 2 3 3 include('includes/global.php'); 4 4 5 // SQL injection hack protection6 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);7 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);8 5 9 //ochrana proti neoprávněnému přístupu10 if (Licence(0) == false) { die('Nemáte přístup do této sekce! Přihlašte se...'); } 6 // Ochrana proti neoprávněnému přístupu 7 if(Licence(LICENCE_USER) == false) die('Nemáte přístup do této sekce! Je nutné se přihásit.'); 11 8 12 if (array_key_exists('entry', $_POST)) { 9 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group']; else $GroupId = 1; 10 $Table = $TranslationTree[$GroupId]['TablePrefix']; 11 12 if(array_key_exists('entry', $_POST)) 13 { 14 $entry = $_POST['entry']; 15 $UserID = $_SESSION['UserID']; 16 $TextID = $_POST['ID']; 17 $Language = $_POST['Language']; 18 if(array_key_exists('End', $_POST)) $complete = 1; 19 else $complete = 0; 20 21 if(array_key_exists('Repair', $_POST) and Licence(1)) 22 { 23 $Line = mysql_fetch_array($Database->SQLCommand('SELECT user FROM '.$Table.' Where ID = '.$TextID)); 24 $UserID = $Line['user']; 25 $complete = 1; 26 WriteLog($TranslationTree[$GroupId]['Name'].' '.$entry.' Opraven moderátorem! <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>', 4); 27 } 28 29 //if(( == '') AND ($complete == 1)) die('Musite zadat název textu'); 13 30 14 $entry = $_POST['entry']; 15 $Title = $_POST['Title']; 16 $Details = @$_POST['Details']; 17 $Objectives = @$_POST['Objectives']; 18 $OfferRewardText = @$_POST['OfferRewardText']; 19 $RequestItemsText = @$_POST['RequestItemsText']; 20 $EndText = @$_POST['EndText']; 21 $ObjectiveText1 = @$_POST['ObjectiveText1']; 22 $ObjectiveText2 = @$_POST['ObjectiveText2']; 23 $ObjectiveText3 = @$_POST['ObjectiveText3']; 24 $ObjectiveText4 = @$_POST['ObjectiveText4']; 25 26 $UserID = $_SESSION['UserID']; 27 $QuestID = $_POST['ID']; 28 $Language = $_POST['Language']; 29 if (array_key_exists('End', $_POST)) 30 $complete = 1; 31 else 32 $complete = 0; 31 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$entry)); 32 if(!$Line) 33 { 34 $Columns = '`entry`, `Language` , `User` , `complete` , `Take` , `Vote` , `CountVote`'; 35 $Values = $entry.','.$Language.','.$UserID.','.$complete.','.$TextID.', 3 ,1'; 36 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 37 { 38 $Columns .= ', `'.$GroupItem['Column'].'`'; 39 $Values .= ', "'.@$_POST[$GroupItem['Column']].'"'; 40 } 41 //echo('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 42 $Database->SQLCommand('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 43 $LastID = mysql_insert_id(); 44 echo('Překlad <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> uložen!<br />'); 45 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); 46 } else 47 { 48 $sql = 'UPDATE '.$Table.' SET `complete` = '.$complete; 49 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 50 $sql .= ', `'.$GroupItem['Column'].'`="'.@$_POST[$GroupItem['Column']].'"'; 51 $sql .= ', `Language` = '.$Language.', `Vote` = 3, `CountVote` = 1, admin_check = 0 52 WHERE ID = '.$TextID.' AND Language <> 0'; 53 //echo($sql); 54 $Database->SQLCommand($sql); 55 // echo $sql.'<br />'; 56 echo('Změny v překladu: <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> uloženy!<br />'); 57 WriteLog('Změny v překladu: '.$entry.' uloženy! <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>', 1); 58 $Database->SQLCommand('DELETE FROM `'.$Table.'_vote` WHERE `TextId` = '.$TextID); 59 $type_translation = 1; 60 $ID_translation = $TextID; 61 $Database->SQLCommand("DELETE FROM tag WHERE ID_translation = $ID_translation AND type_translation = $type_translation"); 62 } 63 64 echo('Překládat: <a href="TranslationList.php?group='.$GroupId.'&action=notran">Nepřeložené</a>'); 65 } 33 66 34 if ($complete == 1) $Database->SQLCommand("DELETE FROM `quests`.`quests_status` WHERE QuestEntry = '$entry'"); 35 36 if (array_key_exists('Repair', $_POST) and Licence(1)) { 37 $Line = mysql_fetch_array($Database->SQLCommand("SELECT user FROM quests Where ID = '$QuestID'")); 38 $UserID = $Line['user']; 39 $complete = 1; 40 WriteLog('Quest: '.$entry.' Opraven moderátorem! <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 4); 41 } 42 43 if (($Title == '') AND ($complete == 1)) die('Musite zadat název Q'); 44 45 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests WHERE user='$UserID' AND entry = '$entry'")); 46 if (!$Line) { 47 48 $Database->SQLCommand("INSERT INTO `quests` (`entry` , `Title` , `Details` , `Objectives` , `OfferRewardText` , `RequestItemsText` , 49 `EndText` , `ObjectiveText1` , `ObjectiveText2` , `ObjectiveText3` , `ObjectiveText4` , `Language` , `User` , `complete` , `Take` , `Vote` , `CountVote` ) 50 VALUES('$entry','$Title','$Details','$Objectives','$OfferRewardText','$RequestItemsText','$EndText','$ObjectiveText1', 51 '$ObjectiveText2','$ObjectiveText3','$ObjectiveText4','$Language','$UserID','$complete','$QuestID','3','1')"); 52 echo 'Quest: '.$entry.' uložen!<br />'; 53 WriteLog('Quest: '.$entry.' uložen! Přvzat z: <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 1); 54 } else { 55 $sql = "UPDATE quests SET complete = '$complete', Title = '$Title', 56 Details = '$Details', Objectives = '$Objectives', 57 OfferRewardText = '$OfferRewardText', RequestItemsText = '$RequestItemsText', 58 EndText = '$EndText', ObjectiveText1 = '$ObjectiveText1', ObjectiveText2 = '$ObjectiveText2', 59 ObjectiveText3 = '$ObjectiveText3', ObjectiveText4 = '$ObjectiveText4', Language = '$Language', 60 Vote = '3', CountVote = '1', admin_check = '0' 61 WHERE ID = ".$QuestID." AND Language <> 0"; 62 $Database->SQLCommand($sql); 63 // echo $sql.'<br />'; 64 echo 'Změny v Questu: <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a> uloženy!<br />'; 65 WriteLog('Změny v Questu: '.$entry.' uloženy! <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 1); 66 $Database->SQLCommand("DELETE FROM `quests_vote` WHERE `quests_vote`.`IDquest` = ".$QuestID); 67 $type_translation = 1; 68 $ID_translation = $QuestID; 69 $Database->SQLCommand("DELETE FROM tag WHERE ID_translation = $ID_translation AND type_translation = $type_translation"); 70 } 71 72 echo 'Překládat: <a href="ListQuests.php?selection">Nepřeložené</a> '; 73 74 } 75 76 ShowFooter(); 67 ShowFooter(); 77 68 ?> -
trunk/statistic.php
r43 r49 1 1 <?php 2 2 3 include('includes/global.php'); 3 include('includes/global.php'); 4 5 echo('<strong>Statistika:</strong><br />'); 6 foreach($TranslationTree as $Group) 7 if($Group['TablePrefix'] != '') echo('<img alt="'.$Group['TablePrefix'].'" src="img_statistic.php?TypeText='.$Group['TablePrefix'].'" title="statistika překladů '.$Group['Name'].'" style="margin: 2px 0px 0px 0px;" /><br />'); 8 9 echo('<br /> 10 <b>Statistika v závislosti na čase: </b><a href="http://stat.zdechov.net/game/?Measure=18">Počet přeložených textů</a><br /> 11 <br /> 12 Počet stáhnutí přeložených textů v SQL souboru: <b>'); 13 14 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 2"); 15 $Line = mysql_fetch_row($ID); 16 echo($Line[0]); 17 18 echo('</b><br /> 19 Počet stáhnutí CZWoW pro clienta: <b>'); 20 21 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 0"); 22 $Line = mysql_fetch_row($ID); 23 echo($Line[0]); 24 25 echo('</b><br /><br /> 26 <b>Seznam uživatelů: </b> 27 <table border="1" cellpadding="2" cellspacing="0">'); 28 29 if(array_key_exists('order', $_GET)) 30 { 31 $order = $_GET['order']; 32 $desc = $_GET['desc']; 33 } else 34 { 35 $order = 'NumberTranslate'; 36 $desc = ''; 37 } 38 39 if($desc == '') $desc = 'desc'; else $desc = ''; 40 41 echo('<tr><th><a href="?order=user&desc='.$desc.'">Jméno</a></th> 42 <th><a href="statistic.php?order=NumberTranslate&desc='.$desc.'" title="Počet přeložených textů">Přeložených</a></th> 43 <th><a href="statistic.php?order=Vote&desc='.$desc.'" title="Průměrná známka textů">Průměrná známka</a></th> 44 <th><a href="statistic.php?order=GM&desc='.$desc.'">Oprávnění</a></th> 45 <th><a href="statistic.php?order=LastLogin&desc='.$desc.'">Poslední připojení</a></th></tr>'); 46 47 $Query = 'SELECT ID,user, LastLogin, GM, ('; 48 foreach($TranslationTree as $Group); 49 if($Group['TablePrefix'] != '') 50 $Query .= '(SELECT count(*) FROM `'.$Group['TablePrefix'].'` WHERE User = user.ID AND Complete = 1 AND Language <> 0) + '; 51 $Query .= '0) as NumberTranslate, ('; 52 foreach($TranslationTree as $Group) 53 if($Group['TablePrefix'] != '') 54 $Query .= 'IFNULL((SELECT sum(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE User = user.ID AND Complete =1 AND Language <> 0), 0) + '; 55 $Query .= '0) / ('; 56 foreach($TranslationTree as $Group) 57 if($Group['TablePrefix'] != '') 58 $Query .= '(SELECT count(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE User = user.ID AND Complete =1 AND Language <> 0) + '; 59 $Query .= '0) AS Vote FROM `user` ORDER BY '.$order.' '.$desc; 60 $ID = $Database->SQLCommand($Query); 61 while($Line = mysql_fetch_array($ID)) 62 { 63 if(Licence(LICENCE_MODERATOR)) 64 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>'; 65 else $Name = $Line['user']; 66 67 echo('<tr><td>'.$Name.'</td> 68 <td>'.$Line['NumberTranslate'].'</td> 69 <td>'.substr($Line['Vote'], 0, 4).'</td> 70 <td>'.$Moderators[$Line['GM']].'</td> 71 <td>'.$Line['LastLogin'].'</td></tr>'); 72 } 73 echo('</table>'); 74 75 ShowFooter(); 4 76 5 77 ?> 6 7 <b>Statistika:</b><br>8 <img alt="quests" src="img_statistic.php?TypeText=quests" title="statistika překladu úkolů" style="margin: 2px 0px 0px 0px;"><br />9 <img alt="npc_text" src="img_statistic.php?TypeText=npc_text" title="statistika překladu NPC_textů" style="margin: 2px 0px 0px 0px;"><br />10 <img alt="page_text" src="img_statistic.php?TypeText=page_text" title="statistika překladu page_textů" style="margin: 2px 0px 0px 0px;"><br />11 <?php // <img alt="page_text" src="img_statistic.php?TypeText=client_text" title="statistika překladu client_textů" style="margin: 2px 0px 0px 0px;"><br />12 ?>13 14 <br>15 <b>Statistika v závislosti na čase: </b><a href="http://stat.zdechov.net/game/?Measure=18">Počet přeložených textů</a><br>16 <br />17 Počet stáhnutí přeložených textů v SQL souboru: <b>18 <?php19 20 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 2");21 $Line = mysql_fetch_row($ID);22 echo $Line[0];23 ?>24 </b><br />25 Počet stáhnutí CZWoW pro clienta: <b>26 <?php27 28 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 0");29 $Line = mysql_fetch_row($ID);30 echo $Line[0];31 ?>32 </b><br /><br />33 <b>Seznam uživatelů: </b>34 <table border="1" cellpadding="2" cellspacing="0">35 <?php36 37 if(array_key_exists('order', $_GET)) {38 $order = $_GET['order'];39 $desc = $_GET['desc'];40 } else {41 $order = 'NumberTranslate';42 $desc = '';43 }44 45 if ($desc == '') $desc = 'desc'; else $desc = '';46 47 echo '<tr><th><a href="statistic.php?order=user&desc='.$desc.'">Jméno</a></th>48 <th><a href="statistic.php?order=NumberTranslate&desc='.$desc.'" Title="Počet přeložených textů">Přeložených</a></th>49 <th><a href="statistic.php?order=Vote&desc='.$desc.'" Title="Průměrná známka textů">Průměrná známka</a></th>50 <th><a href="statistic.php?order=GM&desc='.$desc.'">Oprávnění</a></th>51 <th><a href="statistic.php?order=LastLogin&desc='.$desc.'">Poslední připojení</a></th></tr>';52 53 /*54 SELECT user, LastLogin, GM, (55 (SELECT count(*) FROM `quests` WHERE User = user.ID AND User <> 0 AND Complete = 1) +56 (SELECT count(*) FROM `npc_text` WHERE User = user.ID AND User <> 0 AND Complete = 1) +57 (SELECT count(*) FROM `page_text` WHERE User = user.ID AND User <> 0 AND Complete = 1)58 ) as NumberTranslate, (59 SELECT IFNULL((SELECT AVG(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1),0)60 + IFNULL((SELECT AVG(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1),0)61 + IFNULL((SELECT AVG(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1),0)62 ) /3 AS Vote63 FROM `user`64 65 */66 67 $ID = $Database->SQLCommand("68 SELECT ID,user, LastLogin, GM, (69 (SELECT count(*) FROM `quests` WHERE User = user.ID AND Complete = 1 AND Language <> 0)70 + (SELECT count(*) FROM `npc_text` WHERE User = user.ID AND Complete = 1 AND Language <> 0)71 + (SELECT count(*) FROM `page_text` WHERE User = user.ID AND Complete = 1 AND Language <> 0)72 + (SELECT count(*) FROM `client_text` WHERE User = user.ID AND Complete = 1 AND Language <> 0)73 ) as NumberTranslate, (74 IFNULL((SELECT sum(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)75 + IFNULL((SELECT sum(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)76 + IFNULL((SELECT sum(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)77 + IFNULL((SELECT sum(Vote) AS Vote FROM `client_text` WHERE User = user.ID AND Complete =1 AND Language <> 0),0)78 ) / (79 (SELECT count(Vote) AS Vote FROM `quests` WHERE User = user.ID AND Complete =1 AND Language <> 0)80 + (SELECT count(Vote) AS Vote FROM `page_text` WHERE User = user.ID AND Complete =1 AND Language <> 0)81 + (SELECT count(Vote) AS Vote FROM `npc_text` WHERE User = user.ID AND Complete =1 AND Language <> 0)82 + (SELECT count(Vote) AS Vote FROM `client_text` WHERE User = user.ID AND Complete =1 AND Language <> 0)83 ) AS Vote84 FROM `user` ORDER BY $order $desc");85 86 while ($Line = mysql_fetch_array($ID)) {87 88 if (Licence(1))89 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>';90 else91 $Name = $Line['user'];92 93 echo '<tr><td>'.$Name.'</td>94 <td>'.$Line['NumberTranslate'].'</td>95 <td>'.substr($Line['Vote'], 0, 4).'</td>96 <td>'.$Moderators[$Line['GM']].'</td>97 <td>'.$Line['LastLogin'].'</td></tr>';98 99 }100 101 echo '</table>';102 103 ShowFooter();104 ?> -
trunk/user.php
r43 r49 1 1 <?php 2 2 3 3 include('includes/global.php'); 4 4 5 // SQL injection hack protection 6 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 7 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 8 9 10 if (array_key_exists('text', $_POST) and Licence(2)) { 11 $text = $_POST['text']; 12 $email = $_POST['email']; 13 $subject = $_POST['subject']; 14 echo 'email: <b>'.$email.'</b><br />'; 15 echo 'předmět: <b>'.$subject.'</b><br />'; 16 echo 'text: <b>'.$text.'</b><br />'; 5 if(array_key_exists('text', $_POST) and Licence(LICENCE_ADMIN)) 6 { 7 $text = $_POST['text']; 8 $email = $_POST['email']; 9 $subject = $_POST['subject']; 10 echo('email: <b>'.$email.'</b><br />'); 11 echo('předmět: <b>'.$subject.'</b><br />'); 12 echo('text: <b>'.$text.'</b><br />'); 17 13 18 if(@mail($email, $subject, $text, "From: maron2@centrum.cz\nReply-To: maron2@centrum.cz\nX-Mailer: PHP/")){ 19 echo 'Zpráva byla odeslána.<br /><br />'; 20 } 21 else{ echo "Nepodařilo se odesat E-mail.<br /><br />"; }; 22 14 if(@mail($email, $subject, $text, 'From: '.$Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/')) 15 { 16 echo('Zpráva byla odeslána.<br /><br />'); 23 17 } 18 else 19 { 20 echo('Nepodařilo se odesat E-mail.<br /><br />'); 21 } 22 } 24 23 25 if (array_key_exists('user', $_GET) and Licence(1)) { 26 27 $LineUser = mysql_fetch_array($Database->SQLCommand("28 SELECT *, (29 (SELECT count(*) FROM `quests` WHERE User = ".$_GET['user']." AND User <> 0 AND Complete = 1) +30 (SELECT count(*) FROM `npc_text` WHERE User = ".$_GET['user']." AND User <> 0 AND Complete = 1) +31 (SELECT count(*) FROM `page_text` WHERE User = ".$_GET['user']." AND User <> 0 AND Complete = 1) 32 ) as NumberTranslate, (33 IFNULL((SELECT sum(Vote) AS Vote FROM `quests` WHERE User = ".$_GET['user']." AND Complete =1),0)34 + IFNULL((SELECT sum(Vote) AS Vote FROM `page_text` WHERE User = ".$_GET['user']." AND Complete =1),0)35 + IFNULL((SELECT sum(Vote) AS Vote FROM `npc_text` WHERE User = ".$_GET['user']." AND Complete =1),0)36 ) / (37 (SELECT count(Vote) AS Vote FROM `quests` WHERE User = ".$_GET['user']." AND Complete =1)38 + (SELECT count(Vote) AS Vote FROM `page_text` WHERE User = ".$_GET['user']." AND Complete =1)39 + (SELECT count(Vote) AS Vote FROM `npc_text` WHERE User = ".$_GET['user']." AND Complete =1) 40 ) AS Vote41 FROM `user` WHERE ID = ".$_GET['user']));24 if(array_key_exists('user', $_GET) and Licence(LICENCE_MODERATOR)) 25 { 26 27 $Query = 'SELECT *, ('; 28 foreach($TranslationTree as $Group) 29 if($Group['TablePrefix'] != '') 30 $Query .= '(SELECT count(*) FROM `'.$Group['TablePrefix'].'` WHERE User = '.$_GET['user'].' AND User <> 0 AND Complete = 1) + '; 31 $Query .= '0) as NumberTranslate, ('; 32 foreach($TranslationTree as $Group) 33 if($Group['TablePrefix'] != '') 34 $Query .= 'IFNULL((SELECT sum(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE User = '.$_GET['user'].' AND Complete = 1), 0) + '; 35 $Query .= '0) / ('; 36 foreach($TranslationTree as $Group) 37 if($Group['TablePrefix'] != '') 38 $Query .= '(SELECT count(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE User = '.$_GET['user'].' AND Complete = 1) +'; 39 $Query .= '0) AS Vote FROM `user` WHERE ID = '.$_GET['user']; 40 $LineUser = mysql_fetch_array($Database->SQLCommand($Query)); 42 41 43 echo 'ID: <b>'.$_GET['user'].'</b><br />';44 echo 'Jméno: <b>'.$LineUser['user'].'</b><br />';45 echo 'Implicitní jazyk: <b>'.$LineUser['Language'].'</b><br />';46 echo 'Posledí připojení: <b>'.$LineUser['LastLogin'].'</b><br />';47 echo 'Posledí IP: <b>'.$LineUser['LastIP'].'</b><br />';48 echo 'Počet přeložených: <b>'.$LineUser['NumberTranslate'].'</b><br />';49 echo 'Průměrná známka: <b>'.$LineUser['Vote'].'</b><br />';50 echo 'Email: <b>'.$LineUser['Email'].'</b><br />';51 echo '<br>42 echo('ID: <b>'.$_GET['user'].'</b><br />'); 43 echo('Jméno: <b>'.$LineUser['user'].'</b><br />'); 44 echo('Výchozí jazyk: <b>'.$LineUser['Language'].'</b><br />'); 45 echo('Poslední připojení: <b>'.$LineUser['LastLogin'].'</b><br />'); 46 echo('Poslední IP: <b>'.$LineUser['LastIP'].'</b><br />'); 47 echo('Počet přeložených: <b>'.$LineUser['NumberTranslate'].'</b><br />'); 48 echo('Průměrná známka: <b>'.$LineUser['Vote'].'</b><br />'); 49 echo('Email: <b>'.$LineUser['Email'].'</b><br />'); 50 echo('<br /> 52 51 53 52 <form action="user.php" method="post"> 54 53 Napsat E-mail: 55 <input type="text" name="email" value="'.$LineUser['Email'].'" >54 <input type="text" name="email" value="'.$LineUser['Email'].'" /> 56 55 Předmět: 57 <input type="text" name="subject" value="Projekt překládání textů WoW" >58 <input type="submit" value="Odeslat" >56 <input type="text" name="subject" value="Projekt překládání textů WoW" /> 57 <input type="submit" value="Odeslat" /> 59 58 <br> 60 59 <textarea name="text" rows="20" cols="62"> 61 62 63 64 60 65 61 S pozdravem '.$_SESSION['User'].' … … 67 63 Projekt překládání textů WoW '.$Config['Web']['BaseURL'].' 68 64 </textarea> 69 </form> 70 '; 71 72 } 65 </form>'); 66 } 73 67 74 ShowFooter(); 68 ShowFooter(); 69 75 70 ?> 76 71
Note:
See TracChangeset
for help on using the changeset viewer.