Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[素材] 将登陆与用户信息置顶的做法

[复制链接]
skymens 发表于 2012-9-25 01:48:13 | 显示全部楼层 |阅读模式
本帖最后由 skymens 于 2012-9-25 02:08 编辑


不多说了自己看效果,其实制作很简单



点击登陆的效果



登陆后的效果
将以下代码粘贴到header.htm的    <div class="z">
     <!--{loop $_G['setting']['topnavs'][0] $nav}-->
      <!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}-->$nav
  1. <!--{/if}-->
  2.      <!--{/loop}-->
  3.      <!--{hook/global_cpnav_extra1}-->
  4.     </div>
  5. 后面
  6. [free]<!--开始-->
  7. <!--{if $_G['uid']}-->
  8. <a href="home.php?mod=space&uid=$_G[uid]">个人资料</a>
  9. <strong class="vwmy{if $_G['setting']['connect']['allow'] && $_G[member][conisbind]} qq{/if}"><a href="home.php?mod=space&uid=$_G[uid]" target="_blank" title="{lang visit_my_space}">{$_G[member][username]}</a></strong>
  10. <!--{if $_G['group']['allowinvisible']}-->
  11. <span id="loginstatus">
  12. <a id="loginstatusid" href="member.php?mod=switchstatus" title="{lang login_switch_invisible_mode}" class="xi2"></a>
  13. </span>
  14. <!--{/if}-->
  15. <!--{hook/global_usernav_extra1}-->
  16. <span class="pipe">|</span><!--{hook/global_usernav_extra4}--><a href="home.php?mod=spacecp">{lang setup}</a>
  17. <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}</a>
  18. <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>
  19. <!--{if $_G['setting']['taskon'] && !empty($_G['cookie']['taskdoing_'.$_G['uid']])}--><span class="pipe">|</span><a href="home.php?mod=task&item=doing" id="task_ntc" class="new">{lang task_doing}</a><!--{/if}-->
  20. <!--{if ($_G['group']['allowmanagearticle'] || $_G['group']['allowpostarticle'] || $_G['group']['allowdiy'] || getstatus($_G['member']['allowadmincp'], 4) || getstatus($_G['member']['allowadmincp'], 6) || getstatus($_G['member']['allowadmincp'], 2) || getstatus($_G['member']['allowadmincp'], 3))}-->
  21. <span class="pipe">|</span><a href="portal.php?mod=portalcp"><!--{if $_G['setting']['portalstatus'] }-->{lang portal_manage}<!--{else}-->{lang portal_block_manage}<!--{/if}--></a>
  22. <!--{/if}-->
  23. <!--{if $_G['uid'] && $_G['group']['radminid'] > 1}-->
  24. <span class="pipe">|</span><a href="forum.php?mod=modcp&fid=$_G[fid]" target="_blank">{lang forum_manager}</a>
  25. <!--{/if}-->
  26. <!--{if $_G['uid'] && $_G['adminid'] == 1 && $_G['setting']['cloud_status']}-->
  27. <span class="pipe">|</span><a href="admin.php?frames=yes&action=cloud&operation=applist" target="_blank">{lang cloudcp}</a>
  28. <!--{/if}-->
  29. <!--{if $_G['uid'] && getstatus($_G['member']['allowadmincp'], 1)}-->
  30. <span class="pipe">|</span><a href="admin.php" target="_blank">{lang admincp}</a>
  31. <!--{/if}-->
  32. <!--{hook/global_usernav_extra2}-->
  33. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>

  34. <!--{hook/global_usernav_extra3}-->
  35. <!--{eval $upgradecredit = $_G['uid'] && $_G['group']['grouptype'] == 'member' && $_G['group']['groupcreditslower'] != 999999999 ? $_G['group']['groupcreditslower'] - $_G['member']['credits'] : false;}-->
  36. <a href="home.php?mod=spacecp&ac=credit&showcredit=1" id="extcreditmenu"{if !$_G[setting][bbclosed]} class="showmenu"{/if}>{lang credits}: $_G[member][credits]</a>
  37. <span class="pipe">|</span><a href="home.php?mod=spacecp&ac=usergroup"{if $upgradecredit !== 'false'} id="g_upmine" class="xi2"{/if}>$_G[group][grouptitle]</a>
  38. <!--{elseif !empty($_G['cookie']['loginuser'])}-->
  39. <strong><a id="loginuser" class="noborder"><!--{echo dhtmlspecialchars($_G['cookie']['loginuser'])}--></a></strong>
  40. <span class="pipe">|</span><a href="member.php?mod=logging&action=login">{lang activation}</a>
  41. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
  42. <!--{elseif !$_G[connectguest]}-->
  43. <!--{template member/login_simpleB}-->
  44. <!--{else}-->
  45. <!--{avatar(0,small)}-->
  46. <strong class="vwmy qq">{$_G[member][username]}</strong>
  47. <!--{hook/global_usernav_extra1}-->
  48. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
  49. <a href="home.php?mod=spacecp&ac=credit&showcredit=1">{lang credits}: 0</a>
  50. <span class="pipe">|</span>{lang usergroup}: $_G[group][grouptitle]
  51. <!--{/if}-->

  52. <!--结束--> [/free]

  53. 在member目录中新建login_simpleB.htm文件,代码如下:
  54. [code]<!--{if CURMODULE != 'logging'}-->
  55. <script type="text/javascript" src="{$_G[setting][jspath]}logging.js?{VERHASH}"></script>
  56. <a href="member.php?mod=logging&action=login" onClick="showWindow('login', this.href);hideWindow('register');" style="background:none">登 录</a>
  57. <span class="pipe">|</span>
  58. <a href="member.php?mod=register">立即注册</a>
  59. <!--{/if}-->
复制代码
最后将header.htm中的以下代码删除:
  1. <!--{if $_G['uid']}-->
  2. <div id="um">
  3. <div class="diynav">
  4. <div style="display: inline;">
  5. <!--{if $_G['uid'] && !empty($_G['style']['extstyle'])}--><a id="sslct" href="javascript:;" onmouseover="delayShow(this, function() {showMenu({'ctrlid':'sslct','pos':'34!'})});">{lang changestyle}</a><!--{/if}-->
  6. <!--{if check_diy_perm($topic)}-->
  7. $diynav
  8. <!--{/if}-->
  9. <!--{hook/global_usernav_extra1}-->
  10. <!--{eval $upgradecredit = $_G['uid'] && $_G['group']['grouptype'] == 'member' && $_G['group']['groupcreditslower'] != 999999999 ? $_G['group']['groupcreditslower'] - $_G['member']['credits'] : false;}-->
  11. <a href="home.php?mod=spacecp&ac=credit&showcredit=1" id="extcreditmenu">{lang credits}: $_G[member][credits]</a>
  12. </div>
  13. <p>
  14. <!--{hook/global_usernav_extra2}-->
  15. <a href="home.php?mod=space&do=pm" id="pm_ntc"{if $_G[member][newpm]} class="new"{/if}>{lang pm_center}</a>
  16. <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>
  17. <!--{if $_G['setting']['taskon'] && !empty($_G['cookie']['taskdoing_'.$_G['uid']])}--><span class="pipe">|</span><a href="home.php?mod=task&item=doing" id="task_ntc" class="new">{lang task_doing}</a>
  18. <!--{/if}-->
  19. <span class="pipe">|</span><a href="home.php?mod=space&uid=$_G[uid]" target="_blank" title="{lang visit_my_space}" id="umnav" class="showmenu" onmouseover="showMenu({'ctrlid':this.id,'ctrlclass':'a'})">{$_G[member][username]}</a>
  20. <ul id="umnav_menu" class="p_pop nav_pop" style="display: none;">
  21. <!--{loop $_G['setting']['mynavs'] $nav}-->
  22. <!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}-->
  23. {eval $nav[code] = str_replace('style="', '_style="', $nav[code]);}
  24. <li>$nav[code]</li>
  25. <!--{/if}-->
  26. <!--{/loop}-->
  27. <!--{hook/global_usernav_extra3}-->
  28. <li><a href="home.php?mod=spacecp">{lang setup}</a></li>
  29. <!--{if ($_G['group']['allowmanagearticle'] || $_G['group']['allowpostarticle'] || $_G['group']['allowdiy'] || getstatus($_G['member']['allowadmincp'], 4) || getstatus($_G['member']['allowadmincp'], 6) || getstatus($_G['member']['allowadmincp'], 2) || getstatus($_G['member']['allowadmincp'], 3))}-->
  30. <li><a href="portal.php?mod=portalcp"><!--{if $_G['setting']['portalstatus'] }-->{lang portal_manage}<!--{else}-->{lang portal_block_manage}<!--{/if}--></a></li>
  31. <!--{/if}-->
  32. <!--{if $_G['uid'] && $_G['group']['radminid'] > 1}-->
  33. <li><a href="forum.php?mod=modcp&fid=$_G[fid]" target="_blank">{lang forum_manager}</a></li>
  34. <!--{/if}-->
  35. <!--{if $_G['uid'] && $_G['adminid'] == 1 && $_G['setting']['cloud_status']}-->
  36. <li><a href="admin.php?frames=yes&action=cloud&operation=applist" target="_blank">{lang cloudcp}</a></li>
  37. <!--{/if}-->
  38. <!--{if $_G['uid'] && getstatus($_G['member']['allowadmincp'], 1)}-->
  39. <li><a href="admin.php" target="_blank">{lang admincp}</a></li>
  40. <!--{/if}-->
  41. <!--{hook/global_usernav_extra4}-->
  42. <li><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a></li>
  43. </ul>
  44. </p>
  45. </div>

  46. </div>
  47. <!--{elseif !empty($_G['cookie']['loginuser'])}-->
  48. <p>
  49. <strong><a id="loginuser" class="noborder"><!--{echo dhtmlspecialchars($_G['cookie']['loginuser'])}--></a></strong>
  50. <span class="pipe">|</span><a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)">{lang activation}</a>
  51. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
  52. </p>
  53. <!--{elseif !$_G[connectguest]}-->
  54. <!--{template member/login_simple}-->
  55. <!--{else}-->
  56. <div id="um">
  57. <p>
  58. <strong class="vwmy qq">{$_G[member][username]}</strong>
  59. <!--{hook/global_usernav_extra1}-->
  60. <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
  61. </p>
  62. <p>
  63. <a href="home.php?mod=spacecp&ac=credit&showcredit=1">{lang credits}: 0</a>
  64. <span class="pipe">|</span>{lang usergroup}: $_G[group][grouptitle]
  65. </p>
  66. </div>
  67. <!--{/if}-->
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| skymens 发表于 2012-9-25 02:08:21 | 显示全部楼层
此帖仅作者可见

使用道具 举报

k58k 发表于 2012-9-25 12:31:26 | 显示全部楼层
此帖仅作者可见

使用道具 举报

czxjh 发表于 2012-9-25 15:14:37 | 显示全部楼层
此帖仅作者可见

使用道具 举报

敖游 发表于 2012-11-21 14:32:47 | 显示全部楼层
此帖仅作者可见

使用道具 举报

yxfwz 发表于 2013-3-9 07:46:01 | 显示全部楼层
此帖仅作者可见

使用道具 举报

sonhill 发表于 2013-8-16 07:42:00 | 显示全部楼层
此帖仅作者可见

使用道具 举报

房先生 发表于 2013-9-15 00:24:19 | 显示全部楼层
此帖仅作者可见

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-17 17:24 , Processed in 0.033504 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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