Changeset 240
- Timestamp:
- Jan 17, 2008, 2:02:18 PM (17 years ago)
- Location:
- quests
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/Options.php
r231 r240 6 6 $User = @$_SESSION['User']; 7 7 8 if (array_key_exists('Email', $_GET)) { 9 $Email = $_GET['Email']; 10 11 $Database->SQLCommand("UPDATE user SET Email = '$Email' WHERE user = '$User'"); 12 echo 'Úprava nastavení probìhla v poøádku, Email: <b>'.$Email.'</b> U¾ivatel: <b>'.$User.'</b>'; 8 if (array_key_exists('Email', $_POST)) { 9 $Email = $_POST['Email']; 10 $OldPass = $_POST['OldPass']; 11 $NewPass = $_POST['NewPass']; 12 $NewPass2 = $_POST['NewPass2']; 13 14 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID'])); 15 if (($Line['pass'] == $OldPass) and ($NewPass == $NewPass2)) { 16 $Database->SQLCommand("UPDATE user SET pass = '$NewPass' WHERE ID = ".$_SESSION['UserID']); 17 echo 'Heslo zmìnìno!<br />'; 18 } else echo '<br />Hesla se neshodují!<br />'; 19 $Database->SQLCommand("UPDATE user SET Email = '$Email' WHERE ID = ".$_SESSION['UserID']); 20 echo 'Úprava nastavení probìhla v poøádku, Email: <b>'.$Email.'</b> U¾ivatel: <b>'.$User.'</b><br />'; 21 WriteLog('Úprava nastavení!', 3); 13 22 } else { 14 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE user = '$User'"));23 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID'])); 15 24 ?> 16 <form action="Options.php" method=" get">25 <form action="Options.php" method="post"> 17 26 <table> 18 27 <tr> … … 21 30 </tr> 22 31 <tr> 23 <th><input type="submit" value="ulozit"></th> 32 <td>Pùvodní heslo: </td> 33 <td><input type="password" name="OldPass"></td> 34 </tr> 35 <tr> 36 <td>Nové heslo: </td> 37 <td><input type="password" name="NewPass"></td> 38 </tr> 39 <tr> 40 <td>Nové heslo pro potvrzení: </td> 41 <td><input type="password" name="NewPass2"></td> 42 </tr> 43 <tr> 44 <th><input type="submit" value="Ulo¾it"></th> 24 45 </tr> 25 46 </table> -
quests/action.php
r238 r240 21 21 if ($shoutbox == '') { 22 22 echo '<form action="action.php?shoutbox=1" method="post"> 23 U ¾ivatel: ';23 Uµivatel: '; 24 24 if (Licence(0)) echo '<b>'.$_SESSION['User'].'</b><br />'; else echo '<input type="text" name="user"><br />'; 25 25 echo 'Text zprávy: <input type="text" name="text" size="50"> 26 <input type="submit" value="Ulo ¾it"><br />26 <input type="submit" value="Uloµit"><br /> 27 27 </form>'; 28 28 } else { … … 30 30 $user = $_POST['user']; 31 31 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE user = '$user'")); 32 if ((!$Line) or ($user == '')) {} else die('Toto jméno je registrováno nemù ¾ete psát za nìj. Pokud jste '.$user.' pak se pøihlaste.');32 if ((!$Line) or ($user == '')) {} else die('Toto jméno je registrováno nemùµete psát za nìj. Pokud jste '.$user.' pak se pøihlaste.'); 33 33 } 34 34 $text = $_POST['text']; … … 46 46 if (($vote > 5) OR ($vote < 1)) die ('Spadná známka'); 47 47 48 //TODO: if (Licence(0)) die('Hlasovat mù µou jenom registrovaní!');48 //TODO: if (Licence(0)) die('Hlasovat mùou jenom registrovaní!'); 49 49 50 50 … … 59 59 60 60 $Database->SQLCommand("INSERT INTO `quests_vote` ( `IDquest` , `IDuser` , `vote` ) VALUES ( '$questID', '$IDuser', '$vote');"); 61 echo 'Hlas byl ulo µen! Hlasoval jste: '.$vote.'<br /> Nyní je známka questu '.$NewVote;61 echo 'Hlas byl ulo¾en! Hlasoval jste: '.$vote.'<br /> Nyní je známka questu '.$NewVote; 62 62 63 WriteLog('U¾ivatel hlasoval: '.$vote.'! Nyní je známka questu (<a href="form.php?ID='.$questID.'">'.$questID.'</a>): '.$NewVote, 5); 63 64 } else echo 'Ji¾ jste hlasoval!'; 64 65 } -
quests/export.php
r238 r240 6 6 7 7 function WithOutDiacritical($teststring){ 8 $teststring=StrTr($teststring, "áäèïéìëíòóöø »úùüý¾ÁÄÈÏÉÌËÍÒÓÖØ©«ÚÙÜÝ®", "aacdeeeinoorstuuuyzAACDEEEINOORSTUUUYZ");8 $teststring=StrTr($teststring, "áäèïéìëíòóöø¹»úùüý¾ÁÄÈÏÉÌËÍÒÓÖØ©«ÚÙÜÝ®", "aacdeeeinoorstuuuyzAACDEEEINOORSTUUUYZ"); 9 9 10 10 return $teststring; … … 50 50 '; 51 51 52 $sql = "SELECT * FROM quests WHERE Complete = '1' AND CountVote >= '$NumberVote' AND Vote >= '$Vote'";52 $sql = "SELECT * FROM quests.quests WHERE Complete = '1' AND CountVote >= '$NumberVote' AND Vote >= '$Vote'"; 53 53 $Where = ''; 54 54 if (isset($CZ)) $Where .= " Language = '1'"; … … 84 84 $Title = "Title = '$Title'"; 85 85 else { 86 $IDtitle = $Database->SQLCommand("SELECT Title FROM quests WHERE entry = '$entry' AND Language = '0'");86 $IDtitle = $Database->SQLCommand("SELECT Title FROM quests.quests WHERE entry = '$entry' AND Language = '0'"); 87 87 $Linetitle = mysql_fetch_array($IDtitle); 88 88 … … 111 111 if ($Diacritical == False) $sql=WithOutDiacritical($sql); 112 112 113 $Database->SelectDatabase($Config['Database']['DatabaseMangos']);114 if ($Export == 'Mangos')113 if ($Export == 'Mangos') { 114 $Database->SelectDatabase($Config['Database']['DatabaseMangos']); 115 115 $Database->SQLCommand($sql); 116 116 } 117 117 $Buffer .= $sql." 118 118 "; 119 119 120 120 } 121 121 … … 172 172 <br /> 173 173 <b>Filtr:</b><br /> 174 <input type="text" name="NumberVote" value=" 4" size="1"> Poèet nutných hlasù <br>175 <input type="text" name="Vote" value=" 3" size="1"> Známka lep¹íjak174 <input type="text" name="NumberVote" value="3" size="1"> Poèet nutných hlasù <br> 175 <input type="text" name="Vote" value="4" size="1"> Známka lep¹í nebo stejná jak 176 176 </td><td> 177 177 <input type="checkbox" name="Diacritical" checked="true"> Vèetnì diakritiky <br> … … 197 197 - Stránky projektu: <a href="http://sourceforge.net/projects/mmfpm/">http://sourceforge.net/projects/mmfpm/</a><br> 198 198 - Pøeklad: <a href="http://wow.zdechov.net/minimanager/lang/csCZ.zip">Èe¹tina do minimanageru</a><br> 199 - Diskusní forum pro pøípadné pøipomínky : <a href="http://wow.zdechov.net/forum/viewtopic.php?p=5533">Forum</a>199 - Diskusní forum pro pøípadné pøipomínky k pøekladu: <a href="http://wow.zdechov.net/forum/viewtopic.php?p=5533">Forum</a> 200 200 201 201 </div> -
quests/includes/config.sample.php
r231 r240 7 7 'Password' => '', 8 8 'Database' => 'quests', 9 'DatabaseCharacters' => 'Characters', 9 'DatabaseCharacters' => 'characters', 10 'DatabaseMangos' => 'mangos', 10 11 'Prefix' => '', 11 12 'Charset' => 'latin2', -
quests/includes/global.php
r238 r240 14 14 15 15 16 //pøihlá¹ení17 if (array_key_exists('LoginUser',$_POST)) {18 $_SESSION['User'] = $_POST['LoginUser'];19 $_SESSION['Pass'] = $_POST['LoginPass'];20 21 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('".$_SESSION['User']."')"));22 $_SESSION['UserID'] = $Line['ID'];23 $_SESSION['User'] = $Line['user'];24 WriteLog('Login: '.$_SESSION['User'], 3);25 }26 //odhlá¹ení27 if (array_key_exists('Logout',$_GET)) {28 $_SESSION['User'] = '';29 $_SESSION['Pass'] = '';30 $_SESSION['UserID'] = '';31 WriteLog('Odhlá¹ení', 3);32 }33 //záznam o aktivitì34 if (Licence(0))35 $Database->SQLCommand("UPDATE user SET LastIP = '".$_SERVER['REMOTE_ADDR']."', LastLogin = now() WHERE ID = ".$_SESSION['UserID']);36 37 38 16 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 39 17 <HTML> … … 45 23 <TITLE>WoW server Heroes of Fantasy - Projekt pøekládání Questù do CZ</TITLE> 46 24 </HEAD> 47 <body> 48 <table border="0" width="100%"> 25 <body>'; 26 27 //pøihlá¹ení 28 if (array_key_exists('LoginUser',$_POST)) { 29 $_SESSION['User'] = $_POST['LoginUser']; 30 $_SESSION['Pass'] = $_POST['LoginPass']; 31 32 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('".$_SESSION['User']."') AND pass = '".$_SESSION['Pass']."'")); 33 if (!$Line ) { 34 echo '<script> alert("Jméno nebo heslo bylo zadáno ¹patnì!"); </script>'; 35 $_SESSION['UserID'] = ''; 36 $_SESSION['User'] = ''; 37 } else { 38 $_SESSION['UserID'] = $Line['ID']; 39 $_SESSION['User'] = $Line['user']; 40 WriteLog('Login: '.$_SESSION['User'], 3); 41 } 42 } 43 //odhlá¹ení 44 if (array_key_exists('Logout',$_GET)) { 45 WriteLog('Odhlá¹ení', 3); 46 $_SESSION['User'] = ''; 47 $_SESSION['Pass'] = ''; 48 $_SESSION['UserID'] = ''; 49 } 50 //záznam o aktivitì 51 if (Licence(0)) 52 $Database->SQLCommand("UPDATE user SET LastIP = '".$_SERVER['REMOTE_ADDR']."', LastLogin = now() WHERE ID = ".$_SESSION['UserID']); 53 54 55 echo'<table border="0" width="100%"> 49 56 <tr> 50 57 <td width="150" valign="top"> 51 <a href="index.php">Domù</a><br /> 52 <a href="http://wow.zdechov.net/forum/viewforum.php?f=22">Forum projektu</a><br /> 53 <a href="http://wow.zdechov.net/">Web serveru</a><br /> 54 <a href="registrace.php" style="color: red">Registrace</a><br /> 55 <a href="Options.php" Title="Nastavení u¾ivatele">Nastavení</a><br /> 56 <a href="statistic.php">Statistika</a><br /> 58 <a Title="Hlavní stránka" href="index.php">Domù</a><br /> 59 <a Title="Diskuze na téma pøeklárání" href="http://wow.zdechov.net/forum/viewforum.php?f=22">Forum projektu</a><br /> 60 <a Title="Domácí server" href="http://wow.zdechov.net/">Web serveru</a><br /> 57 61 <a Title="Slovník wow výrazù" href="javascript: window.open(\'dictionary.php\', \'Slovník\', \'width=400, height=412\'); blur()">Slovníèek</a><br /> 58 <a href="export.php" Title="Zdes i mù¾ete stáhnout pøelo¾ené texty">Download</a><br /> 59 <br /> 60 <a href="ListQuests.php?selection">Nepøelo¾ené questy</a><br /> 61 <a href="ListQuests.php?Translate">Pøelo¾ené questy</a><br />'; 62 <a Title="Statistika pøekládání" href="statistic.php">Statistika</a><br /> 63 <a href="export.php" Title="Zde si mù¾ete stáhnout pøelo¾ené texty">Download</a><br />'; 64 65 if (Licence(0)) 66 echo '<a Title="Nastavení u¾ivatele" href="Options.php" Title="Nastavení u¾ivatele">Nastavení</a><br />'; 67 else 68 echo '<a Title="Registrace u¾ivatele pro pøekládání" href="registrace.php" style="color: red">Registrace</a><br />'; 69 70 echo '<br /> 71 <a Title="Zde mù¾ete zaèít pøekládat" href="ListQuests.php?selection">Nepøelo¾ené questy</a><br /> 72 <a Title="Pøelo¾ené quest, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a><br />'; 62 73 63 74 if (Licence(0)) { 64 echo '<a href="ListQuests.php?mydevelop">Rozepsané questy</a><br /> 65 <a href="ListQuests.php?my">Moje questy</a><br />'; 75 echo '<a Title="Nedokonèené questy" href="ListQuests.php?mydevelop">Rozepsané questy</a><br /> 76 <a Title="Pøelo¾ené questy pøilá¹eného u¾ivatele" href="ListQuests.php?my">Moje questy</a><br /> 77 <br />'; 66 78 } 67 79 68 80 if (Licence(1)) { 69 81 // echo 'Administrace:'; 70 echo '<br /><a href="priorite.php" Title="Naètení priority questù (Moderator only)">Priorita</a><br />'; 71 echo '<a href="log.php" Title="Log dìní (Moderator only)">Log</a><br />'; 82 echo '<a href="priorite.php" Title="Naètení priority questù (Moderator only)">Priorita</a><br />'; 83 echo '<a href="log.php" Title="Log dìní (Moderator only)">Log</a><br /> 84 <br />'; 72 85 } 73 86 74 echo '<br /><form action="action.php" method="get">75 <input type="text" name="search" size="8">76 <input type="submit" value="Hledat">77 </form>78 ';79 87 80 88 if (Licence(0)) { 81 89 // echo 'Jste pøihlá¹en jako: <b>'.$_SESSION['User'].'</b> <a href="index.php?Logout">Odhlásit</a>'; 82 90 } else { 83 echo ' 91 echo ' <br /> 84 92 <b>Login:</b><br> 85 93 <form action="index.php" method="post"> … … 114 122 '; 115 123 124 echo '<form action="action.php" method="get"> 125 <input type="text" name="search" size="8"> 126 <input type="submit" value="Hledat"> 127 </form> 128 '; 116 129 117 130 echo '</td> -
quests/includes/global_function.php
r239 r240 53 53 array('1','Questy', 'green', 'Operace s questy'), 54 54 array('2','Download', 'brown', 'Stáhnutí Sql souboru'), 55 array('3','Pøihlá¹ení', 'blue', 'Pøihlá¹ení u¾ivatelù '),55 array('3','Pøihlá¹ení', 'blue', 'Pøihlá¹ení u¾ivatelù, nastavení'), 56 56 array('4','Moderátor', 'red', 'Pøihlá¹ení u¾ivatelù'), 57 array('5','Hlasování', 'yellowgreen', 'Pøihlá¹ení u¾ivatelù'), 57 58 ); 58 59 -
quests/log.php
r238 r240 11 11 12 12 13 echo ' Formát: datum: text zprávy (u¾ivatel )<br /><br />';13 echo ' Formát: datum: text zprávy (u¾ivatel, IP)<br /><br />'; 14 14 15 15 if (array_key_exists('type', $_GET)) { 16 16 $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user 17 FROM log WHERE type = '".$_GET['type']."' ORDER BY date DESC ";17 FROM log WHERE type = '".$_GET['type']."' ORDER BY date DESC LIMIT 100"; 18 18 // if ($_GET['type'] == $LogItem[0]) { } 19 19 } else $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user 20 FROM log ORDER BY date DESC ";20 FROM log ORDER BY date DESC LIMIT 100"; 21 21 22 22 … … 27 27 if ($Line['type'] == $LogItem[0]) { $color = $LogItem[2]; } 28 28 } 29 echo $Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].' )<br />';29 echo $Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].', '.$Line['IP'].')<br />'; 30 30 } 31 31 -
quests/registrace.php
r231 r240 19 19 // $Database->SQLCommand("INSERT INTO user () VALUES('$User','$Pass','0','$Addres',now(),'0','$Email')"); 20 20 echo 'Registrace probìhla úspì¹nì<br />'; 21 WriteLog('U¾ivatel se zaregistroval: '.$User, 3); 21 22 22 23 $_SESSION['User'] = $User; -
quests/statistic.php
r238 r240 12 12 <?php 13 13 14 $ID = $Database->SQLCommand("SELECT count( *) FROM log WHERE type = 2");14 $ID = $Database->SQLCommand("SELECT count(distinct(IP)) FROM log WHERE type = 2"); 15 15 $Line = mysql_fetch_row($ID); 16 16 echo $Line[0];
Note:
See TracChangeset
for help on using the changeset viewer.