Discuz教程网

【Discuz X1.5】论坛头部美化插件

[复制链接]
authicon 小白 发表于 2011-2-20 19:37:31 | 显示全部楼层 |阅读模式
插件作者: XX 无法下载,请举报
插件编码: GBK简体 UTF8简体 BIG5繁体 UTF8繁体 
适用版本: Discuz! X1.5 
支持站点: XX
作品介绍: 首先大家要知道头部模板的默认存放位置

本帖最后由 小白 于 2011-2-20 19:45 编辑

首先大家要知道头部模板的默认存放位置:\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>为<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">

  1. <h2><a href="./" title="$_G['setting']['bbname']">{BOARDLOGO}</a></h2>

  2. <!--{if $_G['uid']}-->

  3. <div id="um">

  4. <div class="avt y"><a href="home.php?mod=space&uid=$_G[uid]" c="34"><!--{avatar($_G[uid],small)}--></a></div>

  5. <p>

  6. <strong><a href="home.php?mod=space&uid=$_G[uid]" class="vwmy" target="_blank" title="{lang visit_my_space}">{$_G[member][username]}</a></strong>

  7. <!--{if $_G['group']['allowinvisible']}-->

  8. <span id="loginstatus" class="xg1">

  9. <a href="member.php?mod=switchstatus" title="{lang login_switch_invisible_mode}">

  10. <!--{if $_G['session']['invisible']}-->

  11. {lang login_invisible_mode}

  12. <!--{else}-->

  13. {lang login_normal_mode}

  14. <!--{/if}-->

  15. </a>

  16. </span>

  17. <!--{/if}-->

  18. <span class="pipe">|</span><span id="usersetup" class="showmenu"><a href="home.php?mod=spacecp">{lang setup}</a></span>

  19. <!--{hook/global_usernav_extra1}-->

  20. <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>

  21. <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>

  22. <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}-->


  23. <!--{if $_G['setting']['taskon']}-->

  24. <span class="pipe">|</span>

  25. <!--{if empty($_G['cookie']['taskdoing_'.$_G['uid']])}-->

  26. <a href="home.php?mod=task&item=new">{lang task}</a>

  27. <!--{else}-->

  28. <a href="home.php?mod=task&item=doing" id="task_ntc" class="new">{lang task_doing}</a>

  29. <!--{/if}-->

  30. <!--{/if}-->

  31. <!--{hook/global_usernav_extra2}-->

  32. <!--{if $_G['group']['allowmanagearticle'] || $_G['group']['allowdiy'] || $_G['group']['allowauthorizedblock'] || $_G['group']['allowauthorizedarticle']}-->

  33. <span class="pipe">|</span><a href="portal.php?mod=portalcp">{lang portal_manage}</a>

  34. <!--{/if}-->

  35. <!--{if $_G['uid'] && $_G['group']['radminid'] > 1}-->

  36. <span class="pipe">|</span><a href="forum.php?mod=modcp&fid=$_G[fid]" target="_blank">{lang forum_manager}</a>

  37. <!--{/if}-->

  38. <!--{if $_G['uid'] && ($_G['group']['radminid'] == 1 || $_G['member']['allowadmincp'])}-->

  39. <span class="pipe">|</span><a href="admin.php" target="_blank">{lang admincp}</a>

  40. <!--{/if}-->

  41. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>

  42. </p>

  43. <p>

  44. <!--{eval $upgradecredit = $_G['uid'] && $_G['group']['grouptype'] == 'member' && $_G['group']['groupcreditslower'] != 999999999 ? $_G['group']['groupcreditslower'] - $_G['member']['credits'] : false;}-->

  45. {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>

  46. </p>

  47. </div>

  48. <!--{elseif !empty($_G['cookie']['loginuser'])}-->

  49. <p>

  50. <strong><a id="loginuser" class="noborder">$_G['cookie']['loginuser']</a></strong>

  51. <span class="pipe">|</span><a href="member.php?mod=logging&action=login">{lang activation}</a>

  52. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>

  53. </p>

  54. <!--{elseif !IS_ROBOT}-->

  55. <!--{template member/login_simple}-->

  56. <!--{/if}-->

  57. </div>


  58. <!--{if !IS_ROBOT}-->
复制代码

删除:<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.xxxx.com/index/" hidefocus="true" >首页</a></li>

  4. <li><a href="http://www.xxxxxx.com/wenzi/" hidefocus="true" >文字</a></li>

  5. <li><a href="http://www.xxxxx.com/tupian/" hidefocus="true" >图片</a></li>

  6. <li><a href="http://www.xxxxxxx.com/yinyue/" hidefocus="true" >音乐</a></li>

  7. <li><a href="http://www.xxxx.com/xinxian/" hidefocus="true" >新鲜</a></li>

  8. <li><a href="http://www.xxxxx.com/misc.php?mod=ranklist" hidefocus="true" title="Ranklist" >粘人榜</a></li>

  9. <li><a href="http://www.xxxx.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;
OK,大功造成!头部就完全修改完了!



上一篇:手工diy的清爽门户新闻频道模板
下一篇:【Discuz X1.5】滑动快速返回顶部通用插件
authicon test 发表于 2011-2-20 21:16:59 | 显示全部楼层
看着有点晕,请问大神能不能把您演示的文件提供一个下载啊???
authicon yeluli 发表于 2011-2-20 23:01:40 | 显示全部楼层
感谢楼主的无私分享!要想1314学习网好 就靠你我他
authicon  楼主| 小白 发表于 2011-2-21 08:14:00 | 显示全部楼层
回复 test 的帖子

只有这个文件了
authicon test 发表于 2011-2-21 10:03:07 | 显示全部楼层
没有改好的图看
谢谢了
authicon  楼主| 小白 发表于 2011-2-21 20:33:08 | 显示全部楼层
回复 test 的帖子

有图我就发了,我也没看到图,转载的呀
authicon test 发表于 2011-2-22 16:12:50 | 显示全部楼层
既然你诚信诚意的推荐了,那我就勉为其难的看看吧!1314学习网不走平凡路。
authicon test 发表于 2011-3-3 22:53:53 | 显示全部楼层
1111111111111
authicon a137580399 发表于 2011-4-29 09:56:44 | 显示全部楼层
怎么没有演示
authicon 卡卡猫 发表于 2011-5-7 14:59:33 | 显示全部楼层
看看  好像不错
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 03:10

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表