View file includes/start.php

File size: 979B
<?php 
// by mides, icq: 529-899-6, mail: [email protected]

//@session_start(); // запускаем сессию

$t = microtime(1); // генерация

error_reporting(0); // отключение показа ошибок

$config = mysql_fetch_assoc(mysql_query("SELECT * FROM `config` WHERE `id` = 1"));

if($_SESSION['login']){
	$user = mysql_fetch_assoc(mysql_query("SELECT `set_style`, `set_onpage` FROM `users` WHERE `id` = '".$_SESSION['user_id']."'"));
	$config['style'] = $user['set_style'];
	$config['onpage'] = $user['set_onpage'];
}

$private_new = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `private` WHERE `login` = '".$_SESSION['login']."' and `read` = 0"), 0);
if($private_new == 1){
	echo '<a href="../pages/private.php"><font color="red">Вам сообщение (1)</font></a>';
}elseif($private_new > 1){
	echo '<a href="../pages/private.php"><font color="red">Вам сообщения ('.$private_new.')</font></a>';
}

?>