Changeset 220
- Timestamp:
- Jan 13, 2008, 11:25:19 AM (17 years ago)
- Location:
- quests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/action.php
r212 r220 22 22 if (($vote > 5) OR ($vote < 1)) die ('Spadná známka'); 23 23 24 //TODO: if (Licence(0)) die('Hlasovat mù ou jenom registrovaní!');24 //TODO: if (Licence(0)) die('Hlasovat mù¾ou jenom registrovaní!'); 25 25 26 26 27 $Line = mysql_fetch_row($Database->SQLCommand("SELECT * FROM vote WHERE IDuser = '$IDuser' AND IDquest = '$questID'"));27 $Line = mysql_fetch_row($Database->SQLCommand("SELECT * FROM quests_vote WHERE IDuser = '$IDuser' AND IDquest = '$questID'")); 28 28 if (!$Line) { 29 29 $Line = mysql_fetch_array($Database->SQLCommand("SELECT Vote,CountVote FROM quests WHERE ID = '$questID'")); … … 32 32 $NewVote = ($OldVote+$vote)/$CountVote; 33 33 34 echo $NewVote;35 36 34 $Database->SQLCommand("UPDATE quests SET Vote = '$NewVote', CountVote = '$CountVote' WHERE ID = '$questID'"); 37 35 38 $Database->SQLCommand("INSERT INTO ` vote` ( `IDquest` , `IDuser` , `vote` ) VALUES ( '$questID', '$IDuser', '$vote');");39 echo 'Hlas byl ulo¾en! ';36 $Database->SQLCommand("INSERT INTO `quests_vote` ( `IDquest` , `IDuser` , `vote` ) VALUES ( '$questID', '$IDuser', '$vote');"); 37 echo 'Hlas byl ulo¾en! Hlasoval jste: '.$vote.'<br /> Nyní je známka questu '.$NewVote; 40 38 41 39 } else echo 'Ji¾ jste hlasoval!'; -
quests/includes/global.php
r217 r220 15 15 $_SESSION['Pass'] = $_POST['LoginPass']; 16 16 17 $Line = mysql_fetch_array($Database->SQLCommand("SELECT IDFROM user WHERE LOWER(user) = LOWER('".$_SESSION['User']."')"));17 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('".$_SESSION['User']."')")); 18 18 $_SESSION['UserID'] = $Line['ID']; 19 $_SESSION['User'] = $Line['user']; 19 20 } 20 21 //odhlá¹ení … … 24 25 $_SESSION['UserID'] = ''; 25 26 } 27 //záznam o aktivitì 28 if (Licence(0)) 29 $Database->SQLCommand("UPDATE user SET LastIP = '".$_SERVER['REMOTE_ADDR']."', LastLogin = now() WHERE ID = ".$_SESSION['UserID']); 26 30 27 31 function Licence($Licence) … … 29 33 global $Database; 30 34 if (isset($_SESSION['User']) and $_SESSION['User'] <> '') { 31 $User = $_SESSION['User'];35 // $User = $_SESSION['User']; 32 36 $Pass = $_SESSION['Pass']; 33 37 34 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('$User')"));38 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID'])); 35 39 if (!$Line) { 36 40 return false; … … 86 90 <tr> 87 91 <td width="150" valign="top"> 88 <br /> <br />92 <br /> 89 93 <b>Odkazy:</b><br /> 90 94 <a href="index.php">Domù</a><br /> 95 <a href="http://wow.zdechov.net/forum/viewforum.php?f=22">Forum projektu</a><br /> 96 <a href="http://wow.zdechov.net/">Web serveru</a><br /> 91 97 <a href="registrace.php" style="color: red">Registrace</a><br /> 92 <a href="Options.php" >Nastavení</a><br />98 <a href="Options.php" Title="Nastavení u¾ivatele">Nastavení</a><br /> 93 99 <a href="statistic.php">Statistika</a><br /> 94 <a href="export.php">Export</a><br />95 100 <a Title="Slovník wow výrazù" href="javascript: window.open(\'dictionary.php\', \'Slovník\', \'width=400, height=400\'); blur()">Slovníèek</a><br /> 101 <a href="export.php" Title="Zdes i mù¾ete stáhnout pøelo¾ené texty">Export</a><br /> 96 102 <br /> 97 103 <a href="ListQuests.php?selection">Nepøelo¾ené questy</a><br /> 98 104 <a href="ListQuests.php?Translate">Pøelo¾ené questy</a><br />'; 99 105 100 if (Licence(0)) { 101 echo '<a href="ListQuests.php?mydevelop">Rozepsané questy</a><br /> 102 <a href="ListQuests.php?my">Moje questy</a><br />'; 103 } 104 echo '<br /> 105 <a href="http://wow.zdechov.net/forum/viewforum.php?f=22">Forum projektu</a><br /> 106 <a href="http://wow.zdechov.net/">Web serveru</a><br /><br /> 106 if (Licence(0)) { 107 echo '<a href="ListQuests.php?mydevelop">Rozepsané questy</a><br /> 108 <a href="ListQuests.php?my">Moje questy</a><br />'; 109 } 110 111 if (Licence(1)) { 112 // echo 'Administrace:'; 113 echo '<br /><a href="priorite.php" Title="Naètení priority questù (Moderator only)">Priorita</a><br /><br />'; 114 } 107 115 108 <form action="action.php" method="get">116 echo '<form action="action.php" method="get"> 109 117 <input type="text" name="search" size="13"><br> 110 118 <input type="submit" value="Hledat"> … … 132 140 '; 133 141 } 142 echo '<br /><br />Online u¾ivatelé:<br />'; 143 $ID = $Database->SQLCommand("SELECT user FROM `user` WHERE LastLogin >= Now()-300"); 144 while ($Line = mysql_fetch_array($ID)) 145 echo '<b>'.$Line['user'].'</b><br />'; 146 147 134 148 echo '</td> 135 149 <td>'; -
quests/priorite.php
r219 r220 5 5 $Database->SQLCommand("TRUNCATE TABLE `quests`.quests_status"); 6 6 7 //plnìní entry7 /* //plnìní entry 8 8 $ID = $Database->SQLCommand("SELECT entry FROM `quests`.`quests` WHERE Language = 0"); 9 9 while ($Line = mysql_fetch_array($ID)) { … … 14 14 } 15 15 16 echo 'Nahrávání ID questù hotovo<br />'; 16 echo 'Nahrávání ID questù hotovo<br /> 17 '; 18 */ 19 //Plnìní poètu 20 $ID = $Database->SQLCommand("SELECT DISTINCT(quest) as QuestEntry, COUNT(*) as QuestCount FROM `".$Config['Database']['DatabaseCharacters']."`.`character_queststatus` GROUP BY quest"); 21 while ($Line = mysql_fetch_array($ID)) { 22 echo 'Poèet Q pro '.$Line['QuestEntry'].'/11558 hotov <br /> 23 '; 24 $Database->SQLCommand("INSERT INTO `quests`.`quests_status` ( `QuestEntry`, `CountQuest`) VALUES ( '".$Line['QuestEntry']."','".$Line['QuestCount']."')"); 25 // echo 'Poèet Q pro '.$QuestEntry.'/11558 hotov <br /> 26 } 27 28 echo 'Nahrávání poètu questù od ú¾ivatelù<br /> 17 29 30 '; 18 31 //mazání pøelo¾ených Q 19 32 $ID = $Database->SQLCommand("SELECT entry FROM `quests`.`quests` WHERE Language <> 0 AND Complete = 1"); … … 25 38 } 26 39 27 echo 'Mazání pøelo¾ených ve statusu hotovo<br />'; 40 echo 'Mazání pøelo¾ených ve statusu hotovo<br /> 41 '; 28 42 29 //Plnìní poètu30 $ID = $Database->SQLCommand("SELECT QuestEntry FROM `quests_status`");31 while ($Line = mysql_fetch_array($ID)) {32 $QuestEntry = $Line['QuestEntry'];33 // echo "UPDATE `quests_status` SET CountQuest = (SELECT Count(quest) FROM `".$Config['Database']['DatabaseCharacters']."`.`character_queststatus` WHERE quest = '$QuestEntry')";34 $Database->SQLCommand("UPDATE `quests_status` SET CountQuest =35 (SELECT Count(quest) FROM `".$Config['Database']['DatabaseCharacters']."`.`character_queststatus` WHERE quest = '$QuestEntry')36 WHERE QuestEntry = '$QuestEntry'");37 }38 39 echo 'Nahrávání poètu questù od ú¾ivatelù<br />';40 43 41 44 -
quests/save.php
r218 r220 25 25 $complete = 0; 26 26 27 $Line = mysql_fetch_array($Database->SQLCommand("SELECT user FROM quests Where ID = '$QuestID'")); 28 if (array_key_exists('Repair', $_POST)) 29 $UserID = $Line['user']; 30 27 if ($complete = 1) $Database->SQLCommand("DELETE FROM `quests`.`quests_status` WHERE QuestEntry = '$entry'"); 28 29 if (array_key_exists('Repair', $_POST) and Licence(1)) { 30 $Line = mysql_fetch_array($Database->SQLCommand("SELECT user FROM quests Where ID = '$QuestID'")); 31 $UserID = $Line['user']; 32 } 31 33 32 34 /* if (array_key_exists('Repair', $_POST)) { … … 38 40 die('Musite zadat název Q'); 39 41 40 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests W hereuser='$UserID' AND entry = '$entry'"));42 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests WHERE user='$UserID' AND entry = '$entry'")); 41 43 if (!$Line) { 42 44 … … 51 53 OfferRewardText = '$OfferRewardText', RequestItemsText = '$RequestItemsText', 52 54 EndText = '$EndText', ObjectiveText1 = '$ObjectiveText1', ObjectiveText2 = '$ObjectiveText2', 53 ObjectiveText3 = '$ObjectiveText3', ObjectiveText4 = '$ObjectiveText4', Language = '$Language' 54 WHERE user='$UserID' AND entry = '$entry' AND Language <> 0"; 55 ObjectiveText3 = '$ObjectiveText3', ObjectiveText4 = '$ObjectiveText4', Language = '$Language', 56 Vote = '3', CountVote = '1' 57 WHERE ID = ".$QuestID." AND Language <> 0"; 55 58 $Database->SQLCommand($sql); 56 59 // echo $sql.'<br />'; 57 60 echo 'Zmìny v Questu: '.$entry.' ulo¾eny!<br />'; 61 $Database->SQLCommand("DELETE FROM `quests_vote` WHERE `quests_vote`.`IDquest` = ".$QuestID); 58 62 } 59 63 60 64 61 ++$QuestID;62 echo 'Pøekládat: <a href=" Form.php?ID='.$QuestID.'">Následující</a> ';65 // ++$QuestID; 66 echo 'Pøekládat: <a href="ListQuests.php?selection">Nepøelo¾ené</a> '; 63 67 64 68 }
Note:
See TracChangeset
for help on using the changeset viewer.