云水论坛
标题:
[转帖]DZX头部修改
[打印本页]
作者:
森森
时间:
2011-1-28 13:03
标题:
[转帖]DZX头部修改
给大家介绍一下如果修改DZX的默认头部!
首先大家要知道头部模板的默认存放位置:
\template\default\common\header.htm;
找到这个模板之后就可以修改了!
1.首先,把这个模板复制一份【复制 header.htm】以备查看,然后删除header.htm内所有代码把你自己的HTML头部代码写进去!
2.修改头部:打开上一步你备份的【复制 header.htm】,把
<!--{subtemplate common/header_common}-->
<link href=".../NewDefault.css" rel="stylesheet" type="text/css" />
<link href=".../newTop2.css" rel="stylesheet" type="text/css" />
<!--{if defined('CURMODULE') && ($_G['basescript'] == 'forum' || $_G['basescript'] == 'group') && (CURMODULE == 'index' || CURMODULE == 'forumdisplay' || CURMODULE == 'group')}-->$rsshead<!--{/if}-->
<!--{if $_G['basescript'] == 'forum' || $_G['forum']['status'] == 3}-->
<!--{if !empty($_G['cookie']['widthauto']) && empty($_G['disabledwidthauto'])}-->
<link rel="stylesheet" id="css_widthauto" type="text/css" href="data/cache/style_{STYLEID}_widthauto.css?{VERHASH}" />
<script type="text/javascript">HTMLNODE.className += ' widthauto'</script>
<!--{/if}-->
<script type="text/javascript" src="{$_G[setting][jspath]}forum.js?{VERHASH}"></script>
<!--{elseif $_G['basescript'] == 'home' || $_G['basescript'] == 'userapp'}-->
<script type="text/javascript" src="{$_G[setting][jspath]}home.js?{VERHASH}"></script>
<!--{elseif $_G['basescript'] == 'portal'}-->
<script type="text/javascript" src="{$_G[setting][jspath]}portal.js?{VERHASH}"></script>
<!--{/if}-->
<!--{if $_G['basescript'] != 'portal' && $_GET['diy'] == 'yes' && ($_G[mod] == 'topic' || $_G[group][allowdiy]) && !empty($_G['style']['tplfile'])}-->
<script type="text/javascript" src="{$_G[setting][jspath]}portal.js?{VERHASH}"></script>
<!--{/if}-->
<!--{if $_GET[diy] == 'yes' && ($_G[mod] == 'topic' || $_G[group][allowdiy]) && !empty($_G['style']['tplfile'])}-->
<link rel="stylesheet" type="text/css" href="data/cache/style_{STYLEID}_css_diy.css?{VERHASH}" />
<!--{/if}-->
</head>
复制代码
添加到你header.htm的<head>内,以前的删除!
注:
<link href=".../NewDefault.css" rel="stylesheet" type="text/css" />
<link href=".../newTop2.css" rel="stylesheet" type="text/css" />
复制代码
这2段代码是自己头部的CSS文件!其他部分便是默认头部的HEAD;
3.添加<body>为
<body id="nv_{$_G[basescript]}" class="pg_{CURMODULE}" >
复制代码
4.在<body>下添加这段代码:
<div id="append_parent"></div><div id="ajaxwaitid"></div>
复制代码
这段代码是必须要的!为整站的AJAX调用;
5.这一步就是添加头部登陆框了;头部登陆框可以自己修改位置,我是直接在<head>内添加一段CSS,绝对定位这个登陆框!想在在什么地方放在什么地方!^ _^!
在第四步的代码下面添加:
<div class="hdc cl">
<h2><a href="./" title="$_G['setting']['bbname']">{BOARDLOGO}</a></h2>
<!--{if $_G['uid']}-->
<div id="um">
<div class="avt y"><a href="home.php?mod=space&uid=$_G[uid]" c="34"><!--{avatar($_G[uid],small)}--></a></div>
<p>
<strong><a href="home.php?mod=space&uid=$_G[uid]" class="vwmy" target="_blank" title="{lang visit_my_space}">{$_G[member][username]}</a></strong>
<!--{if $_G['group']['allowinvisible']}-->
<span id="loginstatus" class="xg1">
<a href="member.php?mod=switchstatus" title="{lang login_switch_invisible_mode}" >
<!--{if $_G['session']['invisible']}-->
{lang login_invisible_mode}
<!--{else}-->
{lang login_normal_mode}
<!--{/if}-->
</a>
</span>
<!--{/if}-->
<span class="pipe">|</span><span id="usersetup" class="showmenu" ><a href="home.php?mod=spacecp">{lang setup}</a></span>
<!--{hook/global_usernav_extra1}-->
<span class="pipe">|</span><a href="home.php?mod=space&do=notice" id="myprompt"{if $_G[member][newprompt]} class="new"{/if}>{lang remind}<!--{if $_G[member][newprompt]}-->($_G[member][newprompt])<!--{/if}--></a><span id="myprompt_check"></span>
<span class="pipe">|</span><a href="home.php?mod=space&do=pm" id="pm_ntc"{if $_G[member][newpm]} class="new"{/if}>{lang pm_center}<!--{if $_G[member][newpm]}-->($_G[member][newpm])<!--{/if}--></a>
<span class="pipe">|</span><a href="home.php?mod=space&do=friend">{lang friends}</a> <!--{if $_G['setting']['regstatus'] > 1}--><a href="home.php?mod=spacecp&ac=invite" class="xg1">{lang invite}</a> <!--{/if}-->
<!--{if $_G['setting']['taskon']}-->
<span class="pipe">|</span>
<!--{if empty($_G['cookie']['taskdoing_'.$_G['uid']])}-->
<a href="home.php?mod=task&item=new">{lang task}</a>
<!--{else}-->
<a href="home.php?mod=task&item=doing" id="task_ntc" class="new">{lang task_doing}</a>
<!--{/if}-->
<!--{/if}-->
<!--{hook/global_usernav_extra2}-->
<!--{if $_G['group']['allowmanagearticle'] || $_G['group']['allowdiy'] || $_G['group']['allowauthorizedblock'] || $_G['group']['allowauthorizedarticle']}-->
<span class="pipe">|</span><a href="portal.php?mod=portalcp">{lang portal_manage}</a>
<!--{/if}-->
<!--{if $_G['uid'] && $_G['group']['radminid'] > 1}-->
<span class="pipe">|</span><a href="forum.php?mod=modcp&fid=$_G[fid]" target="_blank">{lang forum_manager}</a>
<!--{/if}-->
<!--{if $_G['uid'] && ($_G['group']['radminid'] == 1 || $_G['member']['allowadmincp'])}-->
<span class="pipe">|</span><a href="admin.php" target="_blank">{lang admincp}</a>
<!--{/if}-->
<span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
</p>
<p>
<!--{eval $upgradecredit = $_G['uid'] && $_G['group']['grouptype'] == 'member' && $_G['group']['groupcreditslower'] != 999999999 ? $_G['group']['groupcreditslower'] - $_G['member']['credits'] : false;}-->
{lang credits}: <a href="home.php?mod=spacecp&ac=credit">$_G[member][credits]</a><!--{loop $_G['setting']['extcredits'] $extcreditid $extcredit}--> , {$extcredit[img]}$extcredit[title]: <a href="home.php?mod=spacecp&ac=credit" id="hcredit_$extcreditid"><!--{echo getuserprofile('extcredits'.$extcreditid);}--></a> {$extcredit[unit]}<!--{/loop}--> , {lang usergroup}: <a href="home.php?mod=spacecp&ac=usergroup"{if $upgradecredit !== 'false'} id="g_upmine" class="xi2" {/if}>$_G[group][grouptitle]</a>
</p>
</div>
<!--{elseif !empty($_G['cookie']['loginuser'])}-->
<p>
<strong><a id="loginuser" class="noborder">$_G['cookie']['loginuser']</a></strong>
<span class="pipe">|</span><a href="member.php?mod=logging&action=login" >{lang activation}</a>
<span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
</p>
<!--{elseif !IS_ROBOT}-->
<!--{template member/login_simple}-->
<!--{/if}-->
</div>
<!--{if !IS_ROBOT}-->
复制代码
删除:
<h2><a href="./" title="$_G['setting']['bbname']">{BOARDLOGO}</a></h2>
复制代码
这段代码是调用LOGO的,你自己的HTML里面肯定已经有LOGO了,如果你想用他默认的话,也可以,但是需要修改它的样式!
以上操作就添加了TOP登陆框。
6.这一步就来修改导航,我的HTML导航是这样的
<div class="menu">
<ul>
<li class="select"><a href="http://www.nr99.com/index/" hidefocus="true" >首页</a></li>
<li><a href="http://www.nr99.com/wenzi/" hidefocus="true" >文字</a></li>
<li><a href="http://www.nr99.com/tupian/" hidefocus="true" >图片</a></li>
<li><a href="http://www.nr99.com/yinyue/" hidefocus="true" >音乐</a></li>
<li><a href="http://www.nr99.com/xinxian/" hidefocus="true" >新鲜</a></li>
<li><a href="http://www.nr99.com/misc.php?mod=ranklist" hidefocus="true" title="Ranklist" >粘人榜</a></li>
<li><a href="http://www.nr99.com/forum.php" hidefocus="true" title="BBS" >广场</a></li></ul>
</div>
复制代码
一般都是<ul><li>制作的导航!
然后把上面代码内的所有<LI>换成
<!--{eval $mnid = getcurrentnav();}-->
<!--{loop $_G['setting']['navs'] $nav}-->
<!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}--><li {if $mnid == $nav[navid]}class="select" {/if}$nav[nav]></li><!--{/if}-->
<!--{/loop}-->
复制代码
这里面的class=“select”是导航focus,就是该栏目的导航背景(不知道怎么表达。。。你懂的!)
这里面定义之后,系统内部有个JS可以自动通过ID判断该出是不是focus;
欢迎光临 云水论坛 (http://www.yunshui.net/)
Powered by Discuz! X2.5