为了方便,head便一起写在top.php,便不另起head.php了,应用了K9的用户中心和导航的高亮显示技术。
导航的高亮显示可查看《输出当前栏目高亮显示》
<?php !defined('INC') && exit('Load failure!'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> {#if(!empty($keywords))}<meta name="keywords" content="{$keywords code='quote'}" />{#endif} {#if(!empty($description))}<meta name="description" content="{$description code='quote' size='156'}" />{#endif} <link rel="icon" href="/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> <script type="text/javascript" charset="UTF-8" src="{DIR}user/js/jquery.js"></script> <script type="text/javascript" charset="UTF-8" src="{DIR}user/js/system.js"></script> <title>{$title}{?= PID==1?'':PID ?}_{$site.name}</title> <link href="{DIR.T}css/base.css" rel="stylesheet" type="text/css" /> <link href="{DIR.T}css/style.css" rel="stylesheet" type="text/css" /> <link href="{DIR.T}css/system.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="topnav"> {#if($u->info['islogin'])} 您好,<strong><?=$u->info['username']?></strong> <a href="javascript:;" onclick="$.kc_ajax({URL:'{DIR}user/manage.php',CMD:'logout'})" title="退出登录">退出</a> {? $userid=$u->info['userid'] ?} {@count_pm.count table='%s_pm' where="userid=$userid and islook=0"} <a href="{DIR}?user-pm" title="短信息">站内信{?=empty($count_pm)?'':'(<em>'.$count_pm.'</em>)'?}</a> {#else} <form action="" method="post" id="login"> <label>用户名:</label> <input type="text" id="username" name="username" class="w80" size="5" maxlength="12"/> <label>密码:</label> <input type="password" id="userpass" name="userpass" class="w80" size="5" maxlength="30"/> <input type="submit" class="submit_login" value="登录"onclick="$.kc_ajax({URL:'{DIR}user/manage.php',CMD:'login',FORM:'login'});return false;" id="input"/> <input type="submit" class="submit_login" value="注册"onclick="$.kc_ajax({URL:'{DIR}user/manage.php',CMD:'register',FORM:'login'});return false;" id="input"/> </form> {#endif} </div> <!--/topanv--> <div class="header"> <a href="{DIR}" class="logo">网站名称</a> <div class="topmenu"> {@res table='%s_link' field='name,url' where='cid=1' order='norder,id'} {#foreach($res as $rs)} <a href="{$rs[url]}"{?=$_SERVER['REQUEST_URI']==$rs['url']?' class="topmenu_on"' :''?}>{$rs[name]}</a>| {#endforeach} </div> <!--/topmenu--> <form action="{DIR}search/" method="get" class="form_search"> <input name="q" type="text" class="input_search" value="{?=empty($_GET['q'])?'':htmlspecialchars($_GET['q'])?}" /> <input name="b" type="button" class="btn_search" value="<?=kc_val($_GET,'b')?>" /> </form> <!--/form_search--> </div> <!--/header-->
转载请注明出处:唯众网络