- Timestamp:
- Jan 20, 2008, 12:08:14 PM (17 years ago)
- Location:
- quests
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/ListQuests.php
r249 r250 87 87 <td>'.htmlspecialchars($Line['Title']).'</td>'; 88 88 if ($address == 'selection') echo '<td>'.$Line['CountQuest'].'</td>'; else 89 if ($address <> 'not tran')echo '<td>'.@$Line['User'].'</td>89 if ($address <> 'notran') echo '<td>'.@$Line['User'].'</td> 90 90 <td>'.substr($Line['Vote'], 0, 4).'</td> 91 91 <td>'.$Line['CountVote'].'</td>'; … … 126 126 WriteQuests("SELECT * FROM quests items WHERE items.Language = '0' AND 127 127 NOT EXISTS(SELECT 1 FROM quests sub WHERE sub.Language <> 0 AND sub.entry = items.entry) ", $_SESSION['limitx'].','.$_SESSION['limity'],'notran'); 128 } 129 130 if(array_key_exists('notvote', $_GET)) { 131 echo '<a Title="Zobrazit questy podle vlasního filtru" href="ListQuests.php?filter">Filtr questù</a> -> 132 <a Title="Zatím neznámkované questy" href="ListQuests.php?notvote">Neznámkované questy</a><br><br>'; 133 134 WritePages('ListQuests.php?notvote'," WHERE Language <> 0 AND quests.Complete = '1' AND User <> ".$_SESSION['UserID']." AND 135 NOT EXISTS(SELECT 1 FROM quests_vote WHERE IDuser = ".$_SESSION['UserID']." AND IDquest = quests.ID)"); 136 137 WriteQuests("SELECT *, (SELECT user.user FROM user WHERE user.id = quests.user) as User 138 FROM quests WHERE Language <> 0 AND quests.Complete = '1' AND User <> ".$_SESSION['UserID']." AND 139 NOT EXISTS(SELECT 1 FROM quests_vote WHERE IDuser = ".$_SESSION['UserID']." AND IDquest = quests.ID)", $_SESSION['limitx'].','.$_SESSION['limity'],'notvote'); 128 140 } 129 141 … … 215 227 if(array_key_exists('filter', $_GET)) { 216 228 echo '<a Title="Zobrazit questy podle vlasního filtru" href="ListQuests.php?filter">Filtr questù</a><br><br><br>'; 217 echo '<table border="1" cellpadding="3" cellspacing="0"> 229 echo ' 230 231 <script type="text/javascript" language="JavaScript"> 232 <!-- 233 234 function showhidemain(){ 235 show(Button2); 236 if (Main1.style.display==\'none\') { 237 show(Button2); 238 hide(Button1); 239 show(Main1); 240 show(Main2); 241 show(Main3); 242 show(Main4); 243 show(Main5); 244 } else { 245 hide(Button2); 246 show(Button1); 247 hide(Main1); 248 hide(Main2); 249 hide(Main3); 250 hide(Main4); 251 hide(Main5); 252 } 253 254 } 255 --> 256 257 </script> 258 259 <span ID="Button1" onClick="showhidemain()">[Zobrazit hlavní fitry]</span> 260 <span ID="Button2" onClick="showhidemain()" style="display:none">[Skrýt hlavní fitry]</span> 261 262 <table border="1" cellpadding="3" cellspacing="0"> 218 263 <tr><th>Odkaz</th><th>Popis</th></tr>'; 219 264 220 echo '<tr ><td><a Title="Zde mù¾ete zaèít pøekládat" href="ListQuests.php?selection">Nepøelo¾ené questy</a></td>265 echo '<tr ID="Main1" style="display:none"><td><a Title="Zde mù¾ete zaèít pøekládat" href="ListQuests.php?selection">Nepøelo¾ené questy</a></td> 221 266 <td>Nikým nepøelo¾ené questy, zde mù¾ete zaèít pøekládat</td></tr> 222 <tr ><td><a Title="Pøelo¾ené questy, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a></td>267 <tr ID="Main2" style="display:none"><td><a Title="Pøelo¾ené questy, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a></td> 223 268 <td>Pøelo¾ené questy, mù¾ete zde hlasovat, nebo opravovat Quest</td></tr> 224 269 '; 225 270 226 271 if (Licence(0)) { 227 echo '<tr ><td><a Title="Nedokonèené questy" href="ListQuests.php?mydevelop">Rozepsané questy</a></td>272 echo '<tr ID="Main3" style="display:none"><td><a Title="Nedokonèené questy" href="ListQuests.php?mydevelop">Rozepsané questy</a></td> 228 273 <td>Nedokonèené questy pøilá¹eného u¾ivatele</td></tr> 229 <tr><td><a Title="Pøelo¾ené questy pøilá¹eného u¾ivatele" href="ListQuests.php?my">Moje questy</a></td> 230 <td>Pøelo¾ené questy pøilá¹eného u¾ivatele</td></tr>'; 274 <tr ID="Main4" style="display:none"><td><a Title="Pøelo¾ené questy pøilá¹eného u¾ivatele" href="ListQuests.php?my">Moje questy</a></td> 275 <td>Pøelo¾ené questy pøilá¹eného u¾ivatele</td></tr> 276 <tr ID="Main5" style="display:none"><td><a Title="Zatím neznámkované questy" href="ListQuests.php?notvote">Neznámkované questy</a></td> 277 <td>Zatím neznámkované questy</td></tr>'; 231 278 } 232 279 -
quests/Options.php
r240 r250 11 11 $NewPass = $_POST['NewPass']; 12 12 $NewPass2 = $_POST['NewPass2']; 13 $Language = $_POST['Language']; 13 14 14 15 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID'])); … … 17 18 echo 'Heslo zmìnìno!<br />'; 18 19 } else echo '<br />Hesla se neshodují!<br />'; 19 $Database->SQLCommand("UPDATE user SET Email = '$Email' WHERE ID = ".$_SESSION['UserID']);20 $Database->SQLCommand("UPDATE user SET Email = '$Email', Language = '$Language' WHERE ID = ".$_SESSION['UserID']); 20 21 echo 'Úprava nastavení probìhla v poøádku, Email: <b>'.$Email.'</b> U¾ivatel: <b>'.$User.'</b><br />'; 21 22 WriteLog('Úprava nastavení!', 3); … … 42 43 </tr> 43 44 <tr> 45 <td>Normálnì budu pøekládat do: </td> 46 <td><?php WriteLanguages($Line['Language']); ?></td> 47 </tr> 48 <tr> 44 49 <th><input type="submit" value="Ulo¾it"></th> 45 50 </tr> -
quests/TODO.txt
r248 r250 20 20 - mono zobrazit pouze od uivatelù hotovo 21 21 - u slovníku pouze ruit odkaz, ne na pozadí hotovo 22 - Nezobrazovat hlasování, kdy u hlasoval hotovo 23 - ve fitlu zobrazi pro které jsem jetì nehlasoval hotovo 24 - známka questu zobrazovat v formuláøi hotovo 25 - v nastavení a pøi registraci vybírat jazyk a ten potom pøi pøekládání defaultnì nabízet hotovo 26 - search mono order by hotovo 22 27 - Rozdìlení pomocí ras 23 28 - mení známka za nedokonèený quest 24 - pamatovat nastavení u uivatel + v nastavení 29 - pamatovat nastavení export u uivatel + v nastavení 30 - pøi známce 2 a hùø nabýzet na pøeloení 25 31 - import 26 32 - jiné texty ne questy - hlavní texty 27 - search mono order by28 33 (npc_text, page_text, - prioritnì quest_end_scripts, quest_start_scripts) -
quests/form.php
r249 r250 28 28 } 29 29 30 if ($Line['Language'] <> '0') { 31 echo 'Známka Questu: <b>'.$Line['Vote'].'</b><br />'; 32 } 33 30 34 if (Licence(0) and ($LineUser['ID'] <> $_SESSION['UserID']) and ($Line['Language'] <> 0)) { 35 $LineVote = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests_vote WHERE 36 IDuser = ".$_SESSION['UserID']." AND IDquest = $QuestID")); 37 if (!$LineVote) { 31 38 echo ' Hodnotit Quest: '; 32 39 for ($i=1; $i<6; ++$i) 33 40 echo '<a href="action.php?vote='.$i.'&ID='.$QuestID.'">'.$i.'</a> '; 34 echo ' bodù (5 nejlep¹í)'; 41 echo ' bodù (5 nejlep¹í)'; 42 } else { echo ' Ji¾ jsi hlasoval: '.$LineVote['vote']; } 35 43 } 36 44 … … 72 80 <td width="300">Anglický</td> 73 81 <td> 74 <select name="Language"> 75 <option value="1" <?php if ($Line['Language'] == '1') echo 'selected="selected"'; ?>>Pøelo¾ení do èeského jazyka</option> 76 <option value="2" <?php if ($Line['Language'] == '2') echo 'selected="selected"'; ?>>Pøelo¾ení do slovenského jazyka</option> 77 <option value="3" <?php if ($Line['Language'] == '3') echo 'selected="selected"'; ?>>Pøelo¾ení do jiného jazyka</option> 78 </select> 82 Pøekládám do: <?php 83 if ($Line['Language'] <> 0) 84 $Language = $Line['Language']; 85 else { 86 $IDUser = $Database->SQLCommand("SELECT * FROM user Where id = '".@$_SESSION['UserID']."'"); 87 $LineUser = mysql_fetch_array($IDUser); 88 $Language = $LineUser['Language']; //jiný user vyèítám 89 } 90 WriteLanguages($Language); 91 ?> 79 92 </td> 80 93 </tr> -
quests/includes/global.php
r248 r250 39 39 40 40 '; 41 42 43 // SQL injection hack protection 44 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 45 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 46 41 47 42 48 //pøihlá¹ení … … 83 89 echo '<a Title="Registrace u¾ivatele pro pøekládání" href="registrace.php" style="color: red">Registrace</a><br />'; 84 90 85 echo '<br /><a Title="Pøekládání questù" onMouseMove="show(menu2outline)" onmouseout="hide(menu2outline)" 86 href="ListQuests.php?filter">Questy</a> 87 <div style="position: absolute; left: 54; top: 165; 88 display:none; width: 200; font-family: Verdana;font-size: 13px; background-color:white; 91 echo '<br /><div style="background-color: #ffff66" onMouseMove="show(menu2outline)" onmouseout="hide(menu2outline)"><a Title="Pøekládání questù" 92 href="ListQuests.php?filter">Questy</a></div> 93 94 95 <div style="position: absolute; left: 70; top: 165; 96 display:none; width: 200; font-family: Verdana;font-size: 13px; background-color: #ffff66; 89 97 border: 2px dotted black; padding: 5px 5px 5px 5px;" 90 98 id="menu2outline" onMouseMove="show(menu2outline)" onmouseout="hide(menu2outline)"> 91 99 <a Title="Zde mù¾ete zaèít pøekládat" href="ListQuests.php?selection">Nepøelo¾ené questy</a><br> 92 <a Title="Pøelo¾ené questy, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a><br>'; 100 <a Title="Pøelo¾ené questy, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a><br> 101 '; 93 102 if (Licence(0)) { 94 103 echo ' <a Title="Nedokonèené questy" href="ListQuests.php?mydevelop">Rozepsané questy</a><br /> 95 <a Title="Pøelo¾ené questy pøilá¹eného u¾ivatele" href="ListQuests.php?my">Moje questy</a><br />'; 104 <a Title="Pøelo¾ené questy pøilá¹eného u¾ivatele" href="ListQuests.php?my">Moje questy</a><br /> 105 <a Title="Zatím neznámkované questy" href="ListQuests.php?notvote">Neznámkované questy</a><br />'; 96 106 } 97 107 echo ' <a Title="Zobrazit questy podle vlastního fitru" href="ListQuests.php?filter">Filtr questù ...</a><br>'; 98 108 echo '</div> 99 <br /><br />'; 109 110 111 <br />'; 100 112 101 113 /* echo '<a Title="Pøelo¾ené quest, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a><br />'; -
quests/includes/global_function.php
r247 r250 1 1 <?php 2 3 function WriteLanguages($Selected) 4 { // BEGIN function WriteLanguages 5 echo '<select name="Language">'; 6 echo '<option value="1"'; if ($Selected == '1') echo ' selected="selected"'; echo '>Èeského jazyka</option>'; 7 echo '<option value="2"'; if ($Selected == '2') echo ' selected="selected"'; echo '>Slovenského jazyka</option>'; 8 echo '<option value="3"'; if ($Selected == '3') echo ' selected="selected"'; echo '>Jiného jazyka</option>'; 9 echo '</select>'; 10 } // END function WriteLanguages 2 11 3 12 function Licence($Licence) -
quests/registrace.php
r240 r250 9 9 $Pass2 = $_POST['pass2']; 10 10 $Email = $_POST['Email']; 11 $Language = $_POST['Language']; 11 12 12 13 if ($Pass == $Pass2) { … … 15 16 if (!$Line) { 16 17 $Addres = $_SERVER['REMOTE_ADDR']; 17 $Database->SQLCommand("INSERT INTO `user` (`user` , `pass` , `LastIP` , `LastLogin` , `Email` )18 VALUES ('$User','$Pass','$Addres',now(),'$Email' )");18 $Database->SQLCommand("INSERT INTO `user` (`user` , `pass` , `LastIP` , `LastLogin` , `Email` , `Language` ) 19 VALUES ('$User','$Pass','$Addres',now(),'$Email','$Language')"); 19 20 // $Database->SQLCommand("INSERT INTO user () VALUES('$User','$Pass','0','$Addres',now(),'0','$Email')"); 20 21 echo 'Registrace probìhla úspì¹nì<br />'; … … 59 60 </tr> 60 61 <tr> 62 <td>Normálnì budu pøekládat do: </td> 63 <td><?php WriteLanguages($Line['Language']); ?></td> 64 </tr> 65 66 67 <tr> 61 68 <th><input type="submit" value="Registrovat"></th> 62 69 </tr> -
quests/structure/quests_vote.sql
r245 r250 6 6 -- 7 7 8 CREATE TABLE IF NOT EXISTS`quests_vote` (8 CREATE TABLE `quests_vote` ( 9 9 `ID` int(11) NOT NULL auto_increment, 10 10 `IDquest` int(11) NOT NULL, 11 11 `IDuser` int(11) NOT NULL, 12 12 `vote` int(11) NOT NULL, 13 PRIMARY KEY (`ID`) 14 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2012 ; 13 PRIMARY KEY (`ID`), 14 KEY `IDuser` (`IDuser`), 15 KEY `IDquest` (`IDquest`) 16 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=85 ; 15 17 16 18 -- -------------------------------------------------------- -
quests/structure/user.sql
r245 r250 6 6 -- 7 7 8 CREATE TABLE IF NOT EXISTS`user` (8 CREATE TABLE `user` ( 9 9 `ID` int(11) NOT NULL auto_increment, 10 10 `user` varchar(64) character set latin2 collate latin2_czech_cs NOT NULL, … … 14 14 `LastLogin` datetime NOT NULL default '0000-00-00 00:00:00', 15 15 `Email` text character set latin2 collate latin2_czech_cs NOT NULL, 16 `Language` int(11) NOT NULL default '1', 16 17 PRIMARY KEY (`ID`) 17 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 35;18 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=129 ; 18 19 19 20 -- --------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.