云水论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3026|回复: 0
打印 上一主题 下一主题

[转帖]DZX头部修改

[复制链接]

1788

主题

62

好友

8525

积分

管理员

Rank: 9Rank: 9Rank: 9

跳转到指定楼层
楼主
发表于 2011-1-28 13:03:29 |只看该作者 |倒序浏览
给大家介绍一下如果修改DZX的默认头部!
首先大家要知道头部模板的默认存放位置:
\template\default\common\header.htm;
找到这个模板之后就可以修改了!
1.首先,把这个模板复制一份【复制 header.htm】以备查看,然后删除header.htm内所有代码把你自己的HTML头部代码写进去!

2.修改头部:打开上一步你备份的【复制 header.htm】,把
  1. <!--{subtemplate common/header_common}-->
  2.   <link href=".../NewDefault.css" rel="stylesheet" type="text/css" />
  3.   <link href=".../newTop2.css" rel="stylesheet" type="text/css" />
  4. <!--{if defined('CURMODULE') && ($_G['basescript'] == 'forum' || $_G['basescript'] == 'group') && (CURMODULE == 'index' || CURMODULE == 'forumdisplay' || CURMODULE == 'group')}-->$rsshead<!--{/if}-->
  5. <!--{if $_G['basescript'] == 'forum' || $_G['forum']['status'] == 3}-->
  6.   <!--{if !empty($_G['cookie']['widthauto']) && empty($_G['disabledwidthauto'])}-->
  7.    <link rel="stylesheet" id="css_widthauto" type="text/css" href="data/cache/style_{STYLEID}_widthauto.css?{VERHASH}" />
  8.    <script type="text/javascript">HTMLNODE.className += ' widthauto'</script>
  9.   <!--{/if}-->
  10.   <script type="text/javascript" src="{$_G[setting][jspath]}forum.js?{VERHASH}"></script>
  11. <!--{elseif $_G['basescript'] == 'home' || $_G['basescript'] == 'userapp'}-->
  12.   <script type="text/javascript" src="{$_G[setting][jspath]}home.js?{VERHASH}"></script>
  13. <!--{elseif $_G['basescript'] == 'portal'}-->
  14.   <script type="text/javascript" src="{$_G[setting][jspath]}portal.js?{VERHASH}"></script>
  15. <!--{/if}-->
  16. <!--{if $_G['basescript'] != 'portal' && $_GET['diy'] == 'yes' && ($_G[mod] == 'topic' || $_G[group][allowdiy]) && !empty($_G['style']['tplfile'])}-->
  17.   <script type="text/javascript" src="{$_G[setting][jspath]}portal.js?{VERHASH}"></script>
  18. <!--{/if}-->
  19. <!--{if $_GET[diy] == 'yes' && ($_G[mod] == 'topic' || $_G[group][allowdiy]) && !empty($_G['style']['tplfile'])}-->
  20. <link rel="stylesheet" type="text/css" href="data/cache/style_{STYLEID}_css_diy.css?{VERHASH}" />
  21. <!--{/if}-->
  22. </head>
复制代码

添加到你header.htm的<head>内,以前的删除!
注:
  1. <link href=".../NewDefault.css" rel="stylesheet" type="text/css" />

  2. <link href=".../newTop2.css" rel="stylesheet" type="text/css" />
复制代码
这2段代码是自己头部的CSS文件!其他部分便是默认头部的HEAD;

3.添加<body>为
  1. <body id="nv_{$_G[basescript]}" class="pg_{CURMODULE}" >
复制代码
4.在<body>下添加这段代码:
  1. <div id="append_parent"></div><div id="ajaxwaitid"></div>
复制代码
这段代码是必须要的!为整站的AJAX调用;

5.这一步就是添加头部登陆框了;头部登陆框可以自己修改位置,我是直接在<head>内添加一段CSS,绝对定位这个登陆框!想在在什么地方放在什么地方!^ _^!
在第四步的代码下面添加:
  1. <div class="hdc cl">
  2. <h2><a href="./" title="$_G['setting']['bbname']">{BOARDLOGO}</a></h2>

  3. <!--{if $_G['uid']}-->
  4. <div id="um">
  5. <div class="avt y"><a href="home.php?mod=space&uid=$_G[uid]" c="34"><!--{avatar($_G[uid],small)}--></a></div>
  6. <p>
  7. <strong><a href="home.php?mod=space&uid=$_G[uid]" class="vwmy" target="_blank" title="{lang visit_my_space}">{$_G[member][username]}</a></strong>
  8. <!--{if $_G['group']['allowinvisible']}-->
  9. <span id="loginstatus" class="xg1">
  10. <a href="member.php?mod=switchstatus" title="{lang login_switch_invisible_mode}" >
  11. <!--{if $_G['session']['invisible']}-->
  12. {lang login_invisible_mode}
  13. <!--{else}-->
  14. {lang login_normal_mode}
  15. <!--{/if}-->
  16. </a>
  17. </span>
  18. <!--{/if}-->
  19. <span class="pipe">|</span><span id="usersetup" class="showmenu" ><a href="home.php?mod=spacecp">{lang setup}</a></span>
  20. <!--{hook/global_usernav_extra1}-->
  21. <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>
  22. <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>
  23. <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}-->

  24. <!--{if $_G['setting']['taskon']}-->
  25. <span class="pipe">|</span>
  26. <!--{if empty($_G['cookie']['taskdoing_'.$_G['uid']])}-->
  27. <a href="home.php?mod=task&item=new">{lang task}</a>
  28. <!--{else}-->
  29. <a href="home.php?mod=task&item=doing" id="task_ntc" class="new">{lang task_doing}</a>
  30. <!--{/if}-->
  31. <!--{/if}-->
  32. <!--{hook/global_usernav_extra2}-->
  33. <!--{if $_G['group']['allowmanagearticle'] || $_G['group']['allowdiy'] || $_G['group']['allowauthorizedblock'] || $_G['group']['allowauthorizedarticle']}-->
  34. <span class="pipe">|</span><a href="portal.php?mod=portalcp">{lang portal_manage}</a>
  35. <!--{/if}-->
  36. <!--{if $_G['uid'] && $_G['group']['radminid'] > 1}-->
  37. <span class="pipe">|</span><a href="forum.php?mod=modcp&fid=$_G[fid]" target="_blank">{lang forum_manager}</a>
  38. <!--{/if}-->
  39. <!--{if $_G['uid'] && ($_G['group']['radminid'] == 1 || $_G['member']['allowadmincp'])}-->
  40. <span class="pipe">|</span><a href="admin.php" target="_blank">{lang admincp}</a>
  41. <!--{/if}-->
  42. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
  43. </p>
  44. <p>
  45. <!--{eval $upgradecredit = $_G['uid'] && $_G['group']['grouptype'] == 'member' && $_G['group']['groupcreditslower'] != 999999999 ? $_G['group']['groupcreditslower'] - $_G['member']['credits'] : false;}-->
  46. {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>
  47. </p>
  48. </div>
  49. <!--{elseif !empty($_G['cookie']['loginuser'])}-->
  50. <p>
  51. <strong><a id="loginuser" class="noborder">$_G['cookie']['loginuser']</a></strong>
  52. <span class="pipe">|</span><a href="member.php?mod=logging&action=login" >{lang activation}</a>
  53. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
  54. </p>
  55. <!--{elseif !IS_ROBOT}-->
  56. <!--{template member/login_simple}-->
  57. <!--{/if}-->
  58. </div>

  59. <!--{if !IS_ROBOT}-->
复制代码
删除:
  1. <h2><a href="./" title="$_G['setting']['bbname']">{BOARDLOGO}</a></h2>
复制代码
这段代码是调用LOGO的,你自己的HTML里面肯定已经有LOGO了,如果你想用他默认的话,也可以,但是需要修改它的样式!

以上操作就添加了TOP登陆框。

6.这一步就来修改导航,我的HTML导航是这样的
  1. <div class="menu">
  2. <ul>
  3. <li class="select"><a href="http://www.nr99.com/index/" hidefocus="true" >首页</a></li>
  4. <li><a href="http://www.nr99.com/wenzi/" hidefocus="true" >文字</a></li>
  5. <li><a href="http://www.nr99.com/tupian/" hidefocus="true" >图片</a></li>
  6. <li><a href="http://www.nr99.com/yinyue/" hidefocus="true" >音乐</a></li>
  7. <li><a href="http://www.nr99.com/xinxian/" hidefocus="true" >新鲜</a></li>
  8. <li><a href="http://www.nr99.com/misc.php?mod=ranklist" hidefocus="true" title="Ranklist" >粘人榜</a></li>
  9. <li><a href="http://www.nr99.com/forum.php" hidefocus="true" title="BBS" >广场</a></li></ul>
  10. </div>
复制代码
一般都是<ul><li>制作的导航!
然后把上面代码内的所有<LI>换成
  1. <!--{eval $mnid = getcurrentnav();}-->
  2. <!--{loop $_G['setting']['navs'] $nav}-->
  3. <!--{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}-->
  4. <!--{/loop}-->
复制代码
这里面的class=“select”是导航focus,就是该栏目的导航背景(不知道怎么表达。。。你懂的!)
这里面定义之后,系统内部有个JS可以自动通过ID判断该出是不是focus;
  你的沉默明亮如灯、简单如指环。

  论坛其他名字 【云水.墨】 【淡墨瀑雪】
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|手机版|云水网 ( 鲁ICP备09069806号 )

GMT+8, 2024-6-1 22:43 , Processed in 0.032939 second(s), 18 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部