Ignore:
Timestamp:
Mar 9, 2010, 11:29:05 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Jména tabulek v databází upraveny na stejná s prvními velkými písmeny.
  • Upraveno: Doplněny SQL uvozovky do mnoha SQL dotazů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/global.php

    r362 r365  
    4444  if(Licence(LICENCE_USER)) echo(' <a href="'.$Config['Web']['BaseURL'].'action.php?action=shoutbox">Vložit</a>');
    4545  echo('<div class="box"><table>');
    46   $ID = $Database->SQLCommand('SELECT * FROM shoutbox ORDER BY ID DESC LIMIT 20');
     46  $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20');
    4747  while($Line = mysql_fetch_assoc($ID))
    48     echo('<tr><td><strong>'.$Line['user'].'</strong>: '.htmlspecialchars($Line['text']).'</td></tr>');
     48    echo('<tr><td><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</td></tr>');
    4949  echo('</table></div>');
    5050}
     
    5858  if(Licence(LICENCE_USER))
    5959  {
    60     $DbResult = $Database->SQLCommand('SELECT `team`, `user` FROM `user` WHERE ID='.$_SESSION['UserID']);
     60    $DbResult = $Database->SQLCommand('SELECT `Team`, `Name` FROM `User` WHERE ID='.$_SESSION['UserID']);
    6161    $User = mysql_fetch_assoc($DbResult);
    62     $DbResult = $Database->SQLCommand('SELECT `Id`, `Name` FROM `Team` WHERE Id='.$User['team']);
     62    $DbResult = $Database->SQLCommand('SELECT `Id`, `Name` FROM `Team` WHERE Id='.$User['Team']);
    6363    $Team = mysql_fetch_assoc($DbResult);
    6464
    6565    //echo('<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>');
    66     echo('<span class="MenuItem2">'.$User['user'].' <a href="'.$Config['Web']['BaseURL'].'?Logout">Odhlášení</a> <a href="'.$Config['Web']['BaseURL'].'Options.php">Nastavení</a></span>');
     66    echo('<span class="MenuItem2">'.$User['Name'].' <a href="'.$Config['Web']['BaseURL'].'?Logout">Odhlášení</a> <a href="'.$Config['Web']['BaseURL'].'Options.php">Nastavení</a></span>');
    6767  } else
    6868  {
     
    189189 
    190190  echo('Online překladatelé:<br />');
    191   $ID = $Database->SQLCommand('SELECT `user`, `GM`, `ID` FROM `user` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))');
    192   while ($Line = mysql_fetch_assoc($ID))
    193   {
    194     if(Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>';
    195     else $Name = $Line['user'];
    196     //if($Line['GM'] <> 0) $TextGM = '<small>('.$Moderators[$Line['GM']].')</small>';
    197     //else
     191  $ID = $Database->SQLCommand('SELECT `Name`, `GM`, `ID` FROM `User` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))');
     192  while($User = mysql_fetch_assoc($ID))
     193  {
     194    if(Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$User['ID'].'">'.$User['Name'].'</a>';
     195    else $Name = $User['Name'];
    198196    $TextGM = '';
    199197    echo('<strong>'.$Name.'</strong>'.$TextGM.'<br />');
     
    215213    $_SESSION['Pass'] = $_POST['LoginPass'];
    216214
    217     $DbResult = $Database->SQLCommand('SELECT * FROM `user` WHERE LOWER(`user`) = LOWER("'.$_SESSION['User'].'") AND `pass` = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), `Salt`))');
     215    $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE LOWER(`Name`) = LOWER("'.$_SESSION['User'].'") AND `Pass` = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), `Salt`))');
    218216    if(mysql_num_rows($DbResult) == 0)
    219217    {
     
    226224      $User = mysql_fetch_assoc($DbResult);
    227225      $_SESSION['UserID'] = $User['ID'];
    228       $_SESSION['User'] = $User['user'];
     226      $_SESSION['User'] = $User['Name'];
    229227      WriteLog('Login: '.$_SESSION['User'], LOG_TYPE_USER);
    230228    }
     
    236234    WriteLog('Odhlášení', LOG_TYPE_USER);
    237235    if(is_numeric($_SESSION['UserID']))
    238       $Database->SQLCommand('UPDATE `user` SET `LastLogout` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
     236      $Database->SQLCommand('UPDATE `User` SET `LastLogout` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
    239237    $_SESSION['User'] = '';
    240238    $_SESSION['Pass'] = '';
     
    244242  // Záznam o aktivitě
    245243  if(Licence(LICENCE_USER) and array_key_exists('REMOTE_ADDR', $_SERVER))
    246     $Database->SQLCommand('UPDATE `user` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
     244    $Database->SQLCommand('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
    247245}
    248246
Note: See TracChangeset for help on using the changeset viewer.