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

Размер файла: 1.55Kb
<?php
// by Mike O. (mides), coolcms.mobi

header('Cache-control: no-cache');
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="'.HTTPHOME.'/favicon.ico"/>
<link rel="stylesheet" href="'.HTTPHOME.'/inc/styles/'.$config['style'].'/style.css" type="text/css"/>
<title>'.$m_title.'</title>
</head>
<body>';

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

if (isset($u['id'])) {
	
	if ($u['access'] > 0) {
		echo '<a href="/panel">+</a>)&nbsp;';
	}
	
	echo '<b><a href="'.HTTPHOME.'/main.php">'.$u['username'].'</a>';

	$priv_count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `pm_msg` WHERE `id_user` = '$u[id]' and `read` = 0"), 0);
	$priv_r = mysql_query("SELECT `id_pm` FROM `pm_msg` WHERE `id_user` = '$u[id]' and `read` = 0 ORDER BY `time`");
	$priv = mysql_fetch_assoc($priv_r);
	if ($priv['id_pm']) {
		echo ' | <a href="/main.php?act=pm_view&amp;id='.$priv['id_pm'].'">Приват! ('.$priv_count.')</a>';
	}
	
	echo '</b> | <a href="/">'.$lang['home_header'].'</a></b>';
} else {
	echo '<b><a href="login.php">'.$lang['login'].'</a></b> | <a href="reg.php">'.$lang['signup'].'</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>';
}

?>