<?php
/**
* FILE_NAME : header.php
*
* @copyright Copyright www.shuangyulin.com
* @author 双鱼林设计
* @package 网页头文件
* @subpackage
* @version QQ:287307421或254540457
*/

require_once './include/common.inc.php';

/*--  对一些系统变量赋值  --*/
$template->assign("css_root",$css_root);
$template->assign("web_url",$web_url);
$template->assign("sitename",$_CFG['sitename']);

/*--  查询导航信息  --*/
$sql = $query = '';
$sql = "SELECT * FROM {$dbprefix}navgation ORDER BY displayorder";
$query = $DB->query($sql);
while ($row = $DB->fetch_array($query)) {
	if ($row['outurl']) {
		$row['url'] = $row['outurl'];
	}
	$navs[] = $row;
}

/*--  判断是否登录  --*/
$is_login = $_COOKIE['username'] ? 1 : 0;
if ($is_login) {
	$username = $_COOKIE['username'];
}

/*--  对导航栏赋值  --*/
$template->assign("navs",$navs);
$template->assign("is_login",$is_login);
$template->assign("username",$username);

$template->display("header.html");
?>