Просмотр файла system/header.php

Размер файла: 1.75Kb
<?php
// by mides, 1da.su

$config['copy'] = $_SERVER['HTTP_HOST'];
header('Cache-control: no-cache');
if ($title) {
	$title_m = $title.' - '.$config['copy'];
} else {
	$title_m = $config['copy'];
}
echo '<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="http://'.$config['copy'].'/favicon.ico"/>
<link rel="stylesheet" href="http://'.$config['copy'].'/inc/styles/'.$config['style'].'/style.css" type="text/css"/>
<title>'.$title_m.'</title>
</head>
<body>';

echo '<div class="header">';

if ($u['id']) {
	
	if ($u['access'] > 1) {
		echo '<a href="/panel">+</a>) ';
	}
	
	echo '<b><a href="http://'.$config['copy'].'/main.php">'.$u['login'].'</a>';

	$priv_count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `private_msg` WHERE `id_user` = '$u[id]' and `seen` = 0"), 0);
	$priv_r = mysql_query("SELECT `id_private` FROM `private_msg` WHERE `id_user` = '$u[id]' and `seen` = 0 ORDER BY `time`");
	$priv = mysql_fetch_assoc($priv_r);
	if ($priv['id_private']) {
		echo ' | <a href="main.php?act=private_view&amp;id='.$priv['id_private'].'">Приват! ('.$priv_count.')</a>';
	}
	
	echo '</b> | <a href="http://'.$config['copy'].'/main.php?act=exit">Выход</a></b>';
} else {
	echo '<b><a href="login.php">Вход</a></b> | <a href="reg.php">Регистрация</a>';
}
echo '</div>';

$ad_r = mysql_query("SELECT * FROM `ad` WHERE `type` = 1 ORDER BY `id`");
if (mysql_num_rows($ad_r)) {
	echo '<div class="ad">';
	while ($ad = mysql_fetch_assoc($ad_r)) {
		echo '<a href="'.$ad['link'].'">'.$ad['name'].'</a><br />';
	}
	echo '</div>';
}

?>