Changeset 220


Ignore:
Timestamp:
Jan 13, 2008, 11:25:19 AM (17 years ago)
Author:
maron
Message:

Různé opravy

Location:
quests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • quests/action.php

    r212 r220  
    2222    if (($vote > 5) OR ($vote < 1)) die ('Spadná známka');
    2323   
    24   //TODO:  if (Licence(0)) die('Hlasovat mùžou jenom registrovaní!');
     24  //TODO:  if (Licence(0)) die('Hlasovat mù¾ou jenom registrovaní!');
    2525
    2626
    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'"));
    2828    if (!$Line) { 
    2929      $Line = mysql_fetch_array($Database->SQLCommand("SELECT Vote,CountVote FROM quests WHERE ID = '$questID'"));
     
    3232      $NewVote = ($OldVote+$vote)/$CountVote;
    3333     
    34       echo $NewVote;
    35 
    3634      $Database->SQLCommand("UPDATE quests SET Vote = '$NewVote', CountVote = '$CountVote' WHERE ID = '$questID'");
    3735   
    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;   
    4038   
    4139    } else echo 'Ji¾ jste hlasoval!';
  • quests/includes/global.php

    r217 r220  
    1515    $_SESSION['Pass'] = $_POST['LoginPass'];
    1616   
    17     $Line = mysql_fetch_array($Database->SQLCommand("SELECT ID FROM user WHERE LOWER(user) = LOWER('".$_SESSION['User']."')"));
     17    $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('".$_SESSION['User']."')"));
    1818    $_SESSION['UserID'] = $Line['ID'];
     19    $_SESSION['User'] = $Line['user'];
    1920  }
    2021//odhlá¹ení
     
    2425    $_SESSION['UserID'] = '';
    2526  }
     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']);
    2630
    2731  function Licence($Licence)
     
    2933    global $Database;
    3034    if (isset($_SESSION['User']) and $_SESSION['User'] <> '') {
    31       $User = $_SESSION['User'];
     35    //  $User = $_SESSION['User'];
    3236      $Pass = $_SESSION['Pass'];
    3337   
    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']));
    3539    if (!$Line) {
    3640       return false;
     
    8690    <tr>
    8791      <td width="150" valign="top">
    88       <br /><br />
     92      <br />
    8993      <b>Odkazy:</b><br />
    9094      <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 />
    9197      <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 />
    9399      <a href="statistic.php">Statistika</a><br />
    94       <a href="export.php">Export</a><br />
    95100      <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 />
    96102      <br />
    97103      <a href="ListQuests.php?selection">Nepøelo¾ené questy</a><br />
    98104      <a href="ListQuests.php?Translate">Pøelo¾ené questy</a><br />';
    99105
    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      }
    107115     
    108 <form action="action.php" method="get">
     116      echo '<form action="action.php" method="get">
    109117<input type="text" name="search" size="13"><br>
    110118<input type="submit" value="Hledat">
     
    132140  ';
    133141}
     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
    134148  echo '</td>
    135149      <td>';
  • quests/priorite.php

    r219 r220  
    55  $Database->SQLCommand("TRUNCATE TABLE `quests`.quests_status");
    66
    7   //plnìní entry
     7/*  //plnìní entry
    88  $ID = $Database->SQLCommand("SELECT entry FROM `quests`.`quests` WHERE Language = 0");
    99  while ($Line = mysql_fetch_array($ID)) {
     
    1414  }
    1515     
    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 />
    1729 
     30  ';
    1831  //mazání pøelo¾ených Q
    1932  $ID = $Database->SQLCommand("SELECT entry FROM `quests`.`quests` WHERE Language <> 0 AND Complete = 1");
     
    2538  }
    2639 
    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  '; 
    2842 
    29   //Plnìní poètu
    30   $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 />';
    4043 
    4144         
  • quests/save.php

    r218 r220  
    2525      $complete = 0;
    2626   
    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    }
    3133     
    3234  /*  if (array_key_exists('Repair', $_POST)) {
     
    3840      die('Musite zadat název Q');
    3941   
    40     $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests Where user='$UserID' AND entry = '$entry'"));
     42    $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM quests WHERE user='$UserID' AND entry = '$entry'"));
    4143    if (!$Line) {
    4244   
     
    5153       OfferRewardText = '$OfferRewardText', RequestItemsText = '$RequestItemsText',
    5254       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";
    5558      $Database->SQLCommand($sql);
    5659    //  echo $sql.'<br />';     
    5760      echo 'Zmìny v Questu: '.$entry.' ulo¾eny!<br />';
     61      $Database->SQLCommand("DELETE FROM `quests_vote` WHERE `quests_vote`.`IDquest` = ".$QuestID);
    5862    }
    5963   
    6064
    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> ';
    6367     
    6468  }
Note: See TracChangeset for help on using the changeset viewer.