Changeset 365 for trunk/includes/global.php
- Timestamp:
- Mar 9, 2010, 11:29:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r362 r365 44 44 if(Licence(LICENCE_USER)) echo(' <a href="'.$Config['Web']['BaseURL'].'action.php?action=shoutbox">Vložit</a>'); 45 45 echo('<div class="box"><table>'); 46 $ID = $Database->SQLCommand('SELECT * FROM shoutbox ORDER BY IDDESC LIMIT 20');46 $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20'); 47 47 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>'); 49 49 echo('</table></div>'); 50 50 } … … 58 58 if(Licence(LICENCE_USER)) 59 59 { 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']); 61 61 $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']); 63 63 $Team = mysql_fetch_assoc($DbResult); 64 64 65 65 //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>'); 67 67 } else 68 68 { … … 189 189 190 190 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']; 198 196 $TextGM = ''; 199 197 echo('<strong>'.$Name.'</strong>'.$TextGM.'<br />'); … … 215 213 $_SESSION['Pass'] = $_POST['LoginPass']; 216 214 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`))'); 218 216 if(mysql_num_rows($DbResult) == 0) 219 217 { … … 226 224 $User = mysql_fetch_assoc($DbResult); 227 225 $_SESSION['UserID'] = $User['ID']; 228 $_SESSION['User'] = $User[' user'];226 $_SESSION['User'] = $User['Name']; 229 227 WriteLog('Login: '.$_SESSION['User'], LOG_TYPE_USER); 230 228 } … … 236 234 WriteLog('Odhlášení', LOG_TYPE_USER); 237 235 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']); 239 237 $_SESSION['User'] = ''; 240 238 $_SESSION['Pass'] = ''; … … 244 242 // Záznam o aktivitě 245 243 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']); 247 245 } 248 246
Note:
See TracChangeset
for help on using the changeset viewer.