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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

Discuz!x1.5头部登录框、注册部分移动到页面顶端的方法

  [复制链接]
az031120103 发表于 2010-10-19 20:46:37 | 显示全部楼层 |阅读模式
本帖最后由 az031120103 于 2010-10-30 09:24 编辑

触DZ有一个星期了,总算了解一点皮毛,昨天突然想把登陆和注册移到顶部,经过百度、google后未果,于是静下心来经过一个上午的研究解决了这个问题,在此同大家进行分享,相信对不少人有帮助吧!好了,闲话不多说了上效果。

未登录的效果:


登录成功后:



下面讲解实现步骤:写的不够明了,希望您仔细阅读核对,您一定能实现最终效果,蓝色字为描述。

一、根据代码的顺序我们首先实现的是登陆成功后的效果。
①用编辑器(Dreamweaver、记事本等等)打开文件template\default\common\header.htm,会看到如下代码

  1. <!--{subtemplate common/header_common}-->
  2. <!--{if defined('CURMODULE') && ($_G['basescript'] == 'forum' || $_G['basescript'] == 'group') && (CURMODULE == 'index' || CURMODULE == 'forumdisplay' || CURMODULE == 'group')}-->$rsshead<!--{/if}-->
  3. <!--{if $_G['basescript'] == 'forum' || $_G['forum']['status'] == 3}-->
  4.   <!--{if !empty($_G['cookie']['widthauto']) && empty($_G['disabledwidthauto'])}-->
  5.    <link rel="stylesheet" id="css_widthauto" type="text/css" href="data/cache/style_{STYLEID}_widthauto.css?{VERHASH}" />
  6.    <script type="text/javascript">HTMLNODE.className += ' widthauto'</script>
  7.   <!--{/if}-->
  8.   <script type="text/javascript" src="{$_G[setting][jspath]}forum.js?{VERHASH}"></script>
  9. <!--{elseif $_G['basescript'] == 'home' || $_G['basescript'] == 'userapp'}-->
  10.   <script type="text/javascript" src="{$_G[setting][jspath]}home.js?{VERHASH}"></script>
  11. <!--{elseif $_G['basescript'] == 'portal'}-->
  12.   <script type="text/javascript" src="{$_G[setting][jspath]}portal.js?{VERHASH}"></script>
  13. <!--{/if}-->
  14. <!--{if $_G['basescript'] != 'portal' && $_GET['diy'] == 'yes' && ($_G[mod] == 'topic' || $_G[group][allowdiy]) && !empty($_G['style']['tplfile'])}-->
  15.   <script type="text/javascript" src="{$_G[setting][jspath]}portal.js?{VERHASH}"></script>
  16. <!--{/if}-->
  17. <!--{if $_GET[diy] == 'yes' && ($_G[mod] == 'topic' || $_G[group][allowdiy]) && !empty($_G['style']['tplfile'])}-->
  18. <link rel="stylesheet" type="text/css" href="data/cache/style_{STYLEID}_css_diy.css?{VERHASH}" />
  19. <!--{/if}-->
  20. </head>
  21. <body id="nv_{$_G[basescript]}" class="pg_{CURMODULE}" onkeydown="if(event.keyCode==27) return false;">
  22. <!--{if ($_G[mod]!='topic' && $_G[group][allowdiy] && !empty($_G['style']['tplfile'])) || (!empty($_G['style']['tplfile']) && $_G[mod]=='topic' && (($_G['group']['allowaddtopic'] && $topic[uid]==$_G[uid]) || $_G[group][allowmanagetopic]))}-->
  23. <a id="diy-tg" href="javascript:openDiy();" title="{lang open_diy}"><img src="{STATICURL}image/diy/panel-toggle.png" alt="DIY" /></a>
  24. <!--{/if}-->
  25. <div id="append_parent"></div><div id="ajaxwaitid"></div>
  26. <!--{if $_GET['diy'] == 'yes' && (CURMODULE == 'topic' || $_G[group][allowdiy]) && !empty($_G['style']['tplfile'])}-->
  27.   <!--{template common/header_diy}-->
  28. <!--{/if}-->
  29. <!--{if empty($topic) || $topic[useheader]}-->
  30. <!--{ad/headerbanner/wp a_h}-->
  31. <div id="hd">
  32.   <div class="wp">
  33.    <div class="hdc cl">
  34.     <h2><a href="./" title="$_G['setting']['bbname']">{BOARDLOGO}</a></h2>
  35.     <!--{if $_G['uid']}-->
  36.     <div id="um">
  37.      <div class="avt y"><a href="home.php?mod=space&uid=$_G[uid]" c="34"><!--{avatar($_G[uid],small)}--></a></div>
  38.      <p>
  39.       <strong><a href="home.php?mod=space&uid=$_G[uid]" class="vwmy" target="_blank" title="{lang visit_my_space}">{$_G[member][username]}</a></strong>
  40.       <!--{if $_G['group']['allowinvisible']}-->
  41.        <span id="loginstatus" class="xg1">
  42.         <a href="member.php?mod=switchstatus" title="{lang login_switch_invisible_mode}" onclick="ajaxget(this.href, 'loginstatus');doane(event);">
  43.         <!--{if $_G['session']['invisible']}-->
  44.          {lang login_invisible_mode}
  45.         <!--{else}-->
  46.          {lang login_normal_mode}
  47.         <!--{/if}-->
  48.         </a>
  49.        </span>
  50.       <!--{/if}-->
  51.       <span class="pipe">|</span><span id="usersetup" class="showmenu" onmouseover="showMenu(this.id);"><a href="home.php?mod=spacecp">{lang setup}</a></span>
  52.       <!--{hook/global_usernav_extra1}-->
  53.       <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>
  54.       <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>
  55.       <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}-->
  56.       <!--{if $_G['setting']['taskon']}-->
  57.        <span class="pipe">|</span>
  58.        <!--{if empty($_G['cookie']['taskdoing_'.$_G['uid']])}-->
  59.         <a href="home.php?mod=task&item=new">{lang task}</a>
  60.        <!--{else}-->
  61.         <a href="home.php?mod=task&item=doing" id="task_ntc" class="new">{lang task_doing}</a>
  62.        <!--{/if}-->
  63.       <!--{/if}-->
  64.       <!--{hook/global_usernav_extra2}-->
  65.       <!--{if $_G['group']['allowmanagearticle'] || $_G['group']['allowdiy'] || $_G['group']['allowauthorizedblock'] || $_G['group']['allowauthorizedarticle']}-->
  66.        <span class="pipe">|</span><a href="portal.php?mod=portalcp">{lang portal_manage}</a>
  67.       <!--{/if}-->
  68.       <!--{if $_G['uid'] && $_G['group']['radminid'] > 1}-->
  69.        <span class="pipe">|</span><a href="forum.php?mod=modcp&fid=$_G[fid]" target="_blank">{lang forum_manager}</a>
  70.       <!--{/if}-->
  71.       <!--{if $_G['uid'] && ($_G['group']['radminid'] == 1 || $_G['member']['allowadmincp'])}-->
  72.        <span class="pipe">|</span><a href="admin.php" target="_blank">{lang admincp}</a>
  73.       <!--{/if}-->
  74.       <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
  75.      </p>
  76.      <p>
  77.       <!--{eval $upgradecredit = $_G['uid'] && $_G['group']['grouptype'] == 'member' && $_G['group']['groupcreditslower'] != 999999999 ? $_G['group']['groupcreditslower'] - $_G['member']['credits'] : false;}-->
  78.       {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" onmouseover="showMenu({'ctrlid':this.id, 'pos':'21'});"{/if}>$_G[group][grouptitle]</a>
  79.      </p>
  80.     </div>
  81.     <!--{elseif !empty($_G['cookie']['loginuser'])}-->
  82.     <p>
  83.      <strong><a id="loginuser" class="noborder">$_G['cookie']['loginuser']</a></strong>
  84.      <span class="pipe">|</span><a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href);hideWindow('register');">{lang activation}</a>
  85.      <span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}">{lang logout}</a>
  86.     </p>
  87.     <!--{elseif !IS_ROBOT}-->
  88.      <!--{template member/login_simple}-->
  89.     <!--{/if}-->
  90.    </div>
  91.    
  92.    <!--{if !IS_ROBOT}-->
  93.     <div id="qmenu_menu" class="p_pop" style="display: none; zoom: 1;">
  94.      <!--{if $_G['uid']}-->
  95.       <ul>
  96.        <!--{loop $_G['setting']['mynavs'] $nav}-->
  97.         <!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}-->
  98.          <li>$nav[code]</li>
  99.         <!--{/if}-->
  100.        <!--{/loop}-->
  101.       </ul>
  102.       <!--{if !empty($_G['style']['extstyle'])}-->
  103.        <div class="sslct cl">
  104.         <!--{if !$_G[style][defaultextstyle]}--><span class="sslct_btn" onclick="extstyle('')" title="{lang default}"><i>&nbsp;</i></span><!--{/if}-->
  105.         <!--{loop $_G['style']['extstyle'] $extstyle}-->
  106.          <span class="sslct_btn" onclick="extstyle('$extstyle[0]')" title="$extstyle[1]"><i style='background:$extstyle[2]'>&nbsp;</i></span>
  107.         <!--{/loop}-->
  108.        </div>
  109.       <!--{/if}-->
  110.      <!--{else}-->
  111.       <p class="reg_tip">
  112.        <a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="xi2">{lang qmenu_register}</a>
  113.       </p>
  114.      <!--{/if}-->
  115.      <!--{if $_G['basescript'] == 'forum' && empty($_G['disabledwidthauto'])}-->
  116.      <ul class="wslct">
  117.       <li><a href="javascript:;" onclick="widthauto(this)"><!--{if empty($_G['cookie']['widthauto'])}-->{lang switch_wide}<!--{else}-->{lang switch_narrow}<!--{/if}--></a></li>
  118.      </ul>
  119.      <!--{/if}-->
  120.     </div>
  121.    <!--{/if}-->
  122.    <div id="nv">
  123.     <a href="{if $_G['uid']}home.php{else}javascript:;{/if}" id="qmenu" onmouseover="showMenu(this.id)">{lang my_center}</a>
  124.     <ul>
  125.      <!--{eval $mnid = getcurrentnav();}-->
  126.      <!--{loop $_G['setting']['navs'] $nav}-->
  127.       <!--{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="a" {/if}$nav[nav]></li><!--{/if}-->
  128.      <!--{/loop}-->
  129.     </ul>
  130.    </div>
  131.    <!--{if !empty($_G['setting']['plugins']['jsmenu'])}-->
  132.     <ul class="p_pop h_pop" id="plugin_menu" style="display: none">
  133.     <!--{loop $_G['setting']['plugins']['jsmenu'] $module}-->
  134.       <!--{if !$module['adminid'] || ($module['adminid'] && $_G['adminid'] > 0 && $module['adminid'] >= $_G['adminid'])}-->
  135.       <li>$module[url]</li>
  136.       <!--{/if}-->
  137.     <!--{/loop}-->
  138.     </ul>
  139.    <!--{/if}-->
  140.    $_G[setting][menunavs]
  141.    <div id="mu" class="cl">
  142.    <!--{if $_G['setting']['subnavs']}-->
  143.     <!--{loop $_G[setting][subnavs] $navid $subnav}-->
  144.      <!--{if $_G['setting']['navsubhover'] || $mnid == $navid}-->
  145.      <ul class="cl {if $mnid == $navid}current{/if}" id="snav_$navid" style="display:{if $mnid != $navid}none{/if}">
  146.      $subnav
  147.      </ul>
  148.      <!--{/if}-->
  149.     <!--{/loop}-->
  150.    <!--{/if}-->
  151.    </div>
  152.    <!--{ad/subnavbanner/a_mu}-->
  153.   </div>
  154. </div>
  155. <!--{hook/global_header}-->
  156. <!--{/if}-->
  157. <div id="wp" class="wp">
复制代码

那么我们需要改动的代码如下(这段代码就是登陆注册部分,其他代码直接无视):
  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}" onclick="ajaxget(this.href, 'loginstatus');doane(event);">
  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" onmouseover="showMenu(this.id);"><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" onmouseover="showMenu({'ctrlid':this.id, 'pos':'21'});"{/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" onclick="showWindow('login', this.href);hideWindow('register');">{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>
复制代码

③找到以下的代码(下划线蓝色)
第一段代码
  1. <h2><a href="./" title="$_G['setting']['bbname']">{BOARDLOGO}</a></h2>
复制代码
这段代码显示logo,logo可以通过编辑你的默认模板进行修改,具体位置在后台-界面-风格管理。根据默认头部的结构这里不能保留这段代码,如果需要logo,可以把这段代码移到第一步中第二段代码的下面(格式为<div>这里放logo代码</div>)logo默认出现在最左边,在这个<div></div>之间可以再加入一个Flash广告什么的,这里需要一点html+css知识

第二段代码
  1. <div class="avt y"><a href="home.php?mod=space&uid=$_G[uid]" c="34"><!--{avatar($_G[uid],small)}--></a></div>
复制代码
这段代码控制登陆后显示出的头像

第三段代码
  1. <p>
  2. <!--{eval $upgradecredit = $_G['uid'] && $_G['group']['grouptype'] == 'member' && $_G['group']['groupcreditslower'] != 999999999 ? $_G['group']['groupcreditslower'] - $_G['member']['credits'] : false;}-->
  3. {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" onmouseover="showMenu({'ctrlid':this.id, 'pos':'21'});"{/if}>$_G[group][grouptitle]</a>
  4. </p>
复制代码
这段代码显示积分以及用户组信息

将以上3段代码删除,删除之后可以看到如下效果。看不到效果的更新缓存,在后台-工具里面。



④看到上面的效果之后,接下来要做的就很明确了,页面没有置顶,要把整个页面往上提。

  1. <div class="hdc cl">              //我是下划线红色
复制代码
的后面加上代码style="margin-top:-40px;"(我的头部用-40px比较合适,具体数值可以根据需要而定。
完整代码如下:
  1. <div class="hdc cl" style="margin-top:-40px;">
复制代码
到这里登陆成功的效果就实现了。加背景的方法:
  1. <div class="hdc cl" style="margin-top:-40px;background-color:颜色自定;background:uri(图片路径,注:这里要用ps切出的一小段图片)  repeat-x ; "
复制代码
repeat-x的意思是水平填充。


二、下面开始修改未登录的效果。
①找到代码
  1. <!--{template member/login_simple}->          //我是有下划线的那个
复制代码
代码的意思是导入template/member/login_simple.htm,这个页面就是未登录时的效果,用编辑器打开它,代码如下
  1. <!--{if CURSCRIPT != 'member'}-->
  2. <form method="post" autocomplete="off" id="lsform" action="member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes" onsubmit="return lsSubmit()">
  3. <div class="fastlg cl">
  4. <span id="return_ls" style="display:none"></span>
  5. <div class="y">
  6. <p><a href="member.php?mod=logging&action=login&viewlostpw" onclick="showWindow('login', this.href)" class="xi2">{lang getpassword}</a></p>
  7. <p><a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="reglk xi2">$_G['setting']['reglinkname']</a></p>
  8. </div>
  9. <div class="fastlg_fm y pns">
  10. <p>
  11. <!--{if !$_G['setting']['autoidselect']}-->
  12. <span class="ftid">
  13. <select name="fastloginfield" id="ls_fastloginfield" width="45" tabindex="900">
  14. <option value="username">{lang username}</option>
  15. <option value="uid">{lang uid}</option>
  16. <option value="email">{lang email}</option>
  17. </select>
  18. </span>
  19. <script type="text/javascript">simulateSelect('ls_fastloginfield')</script>
  20. <input type="text" name="username" id="ls_username" autocomplete="off" class="px vm" tabindex="901" />
  21. <!--{else}-->
  22. <label for="ls_username">{lang account}</label> <input type="text" name="username" id="ls_username" class="px vm" {if $_G['setting']['autoidselect']} value="UID/{lang username}/Email" onfocus="if(this.value == 'UID/{lang username}/Email') this.value = '';" onblur="if(this.value == '') this.value = 'UID/{lang username}/Email';"{/if} tabindex="901" />
  23. <!--{/if}-->
  24. <input type="checkbox" name="cookietime" id="ls_cookietime" class="pc" value="2592000" tabindex="903" /> <label for="ls_cookietime">{lang save_password}</label>
  25. </p>
  26. <p>
  27. <label for="ls_password"{if !$_G['setting']['autoidselect']} class="z psw_w"{/if}>{lang password}</label> <input type="password" name="password" id="ls_password" class="px vm" autocomplete="off" tabindex="902" onfocus="lsShowmore()" />
  28. <button type="submit" class="pn vm"><em>{lang login}</em></button>
  29. </p>
  30. <input type="hidden" name="quickforward" value="yes" />
  31. <input type="hidden" name="handlekey" value="ls" />
  32. </div>
  33. </div>
  34. <div id="ls_more" style="display:none">
  35. <h3>
  36. <em class="y"><a title="{lang close}" onclick="display('ls_more')" class="flbc" href="javascript:;">{lang close}</a></em>
  37. {lang safety_verification}
  38. </h3>
  39. <span class="z"><script type="text/javascript">var ls_sechash = '';</script></span>
  40. <!--{if $_G['setting']['seccodestatus'] & 2}-->
  41. {eval
  42. $seccodechecktmp = !empty($seccodecheck) ? $seccodecheck : false;
  43. $secqaachecktmp = !empty($secqaacheck) ? $secqaacheck : false;
  44. $seccodecheck = $_G['setting']['seccodestatus'] & 2;
  45. $secqaacheck = false;
  46. $secshow = 0;
  47. $sectabindex = 904;
  48. }
  49. <!--{if $seccodecheck}-->
  50. <!--{block sectpl}--><div class="mtm mbn c"><em style="display:none"><sec></em><sec></div><div class="pbm bbda xg1 d"><sec></div><!--{/block}-->
  51. <!--{subtemplate common/seccheck}-->
  52. <script type="text/javascript">ls_sechash = '$sechash';</script>
  53. <!--{/if}-->
  54. <!--{eval $seccodecheck = $seccodechecktmp;$secqaacheck = $secqaachecktmp;}-->
  55. <!--{/if}-->
  56. <div class="ftid mtm mbn">
  57. <select id="ls_questionid" width="131" name="questionid" autocomplete="off" tabindex="905" change="if($('ls_questionid').value > 0) {$('ls_answer').style.display='';$('ls_answer').focus();} else {$('ls_answer').style.display='none';}">
  58. <option value="0">{lang security_question}</option>
  59. <option value="1">{lang security_question_1}</option>
  60. <option value="2">{lang security_question_2}</option>
  61. <option value="3">{lang security_question_3}</option>
  62. <option value="4">{lang security_question_4}</option>
  63. <option value="5">{lang security_question_5}</option>
  64. <option value="6">{lang security_question_6}</option>
  65. <option value="7">{lang security_question_7}</option>
  66. </select>
  67. <input type="text" name="answer" id="ls_answer" style="display:none" autocomplete="off" size="36" class="px mtn" tabindex="906" />
  68. </div>
  69. <script type="text/javascript">simulateSelect('ls_questionid')</script>
  70. </div>
  71. </form>
  72. <!--{/if}-->
复制代码
这个要改动的部分稍微多一些,但也很简单
我们需要修改的代码为以下部分,同样其他代码果断无视
  1. <!--{if CURSCRIPT != 'member'}-->
  2. <form method="post" autocomplete="off" id="lsform" action="member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes" onsubmit="return lsSubmit()">
  3. <div class="fastlg cl">
  4. <span id="return_ls" style="display:none"></span>
  5. <div class="y">
  6. <p><a href="member.php?mod=logging&action=login&viewlostpw" onclick="showWindow('login', this.href)" class="xi2">{lang getpassword}</a></p>
  7. <p><a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="reglk xi2">$_G['setting']['reglinkname']</a></p>
  8. </div>
  9. <div class="fastlg_fm y pns">
  10. <p>
  11. <!--{if !$_G['setting']['autoidselect']}-->
  12. <span class="ftid">
  13. <select name="fastloginfield" id="ls_fastloginfield" width="45" tabindex="900">
  14. <option value="username">{lang username}</option>
  15. <option value="uid">{lang uid}</option>
  16. <option value="email">{lang email}</option>
  17. </select>
  18. </span>
  19. <script type="text/javascript">simulateSelect('ls_fastloginfield')</script>
  20. <input type="text" name="username" id="ls_username" autocomplete="off" class="px vm" tabindex="901" />
  21. <!--{else}-->
  22. <label for="ls_username">{lang account}</label> <input type="text" name="username" id="ls_username" class="px vm" {if $_G['setting']['autoidselect']} value="UID/{lang username}/Email" onfocus="if(this.value == 'UID/{lang username}/Email') this.value = '';" onblur="if(this.value == '') this.value = 'UID/{lang username}/Email';"{/if} tabindex="901" />
  23. <!--{/if}-->
  24. <input type="checkbox" name="cookietime" id="ls_cookietime" class="pc" value="2592000" tabindex="903" /> <label for="ls_cookietime">{lang save_password}</label>
  25. </p>
  26. <p>
  27. <label for="ls_password"{if !$_G['setting']['autoidselect']} class="z psw_w" {/if}>{lang password}</label> <input type="password" name="password" id="ls_password" class="px vm" autocomplete="off" tabindex="902" onfocus="lsShowmore()" />
  28. <button type="submit" class="pn vm"><em>{lang login}</em></button>
  29. </p>
  30. <input type="hidden" name="quickforward" value="yes" />
  31. <input type="hidden" name="handlekey" value="ls" />
  32. </div>
  33. </div>
复制代码

②将上面代码中的<p>替换成<span>,</p>替换成</span>。(这样是为了让登录等信息水平显示)
接着删除以下代码中的红色部分(都是按钮和文本框的样式,我们不需要)
由于代码里不能改颜色所以写出来
1.reglk

2.class="px vm"    (只要是这个都删,button标签里那个pn vm的不要删)
3.class="pc"
4.class="z psw_w"


  1. <!--{if CURSCRIPT != 'member'}-->
  2. <form method="post" autocomplete="off" id="lsform" action="member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes" onsubmit="return lsSubmit()">
  3. <div class="fastlg cl">
  4. <span id="return_ls" style="display:none"></span>
  5. <div class="y">
  6. <p><a href="member.php?mod=logging&action=login&viewlostpw" onclick="showWindow('login', this.href)" class="xi2">{lang getpassword}</a></p>
  7. <p><a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="reglk xi2">$_G['setting']['reglinkname']</a></p>
  8. </div>
  9. <div class="fastlg_fm y pns">
  10. <p>
  11. <!--{if !$_G['setting']['autoidselect']}-->
  12. <span class="ftid">
  13. <select name="fastloginfield" id="ls_fastloginfield" width="45" tabindex="900">
  14. <option value="username">{lang username}</option>
  15. <option value="uid">{lang uid}</option>
  16. <option value="email">{lang email}</option>
  17. </select>
  18. </span>
  19. <script type="text/javascript">simulateSelect('ls_fastloginfield')</script>
  20. <input type="text" name="username" id="ls_username" autocomplete="off" class="px vm" tabindex="901" />
  21. <!--{else}-->
  22. <label for="ls_username">{lang account}</label> <input type="text" name="username" id="ls_username" class="px vm" {if $_G['setting']['autoidselect']} value="UID/{lang username}/Email" onfocus="if(this.value == 'UID/{lang username}/Email') this.value = '';" onblur="if(this.value == '') this.value = 'UID/{lang username}/Email';"{/if} tabindex="901" />
  23. <!--{/if}-->
  24. <input type="checkbox" name="cookietime" id="ls_cookietime" class="pc" value="2592000" tabindex="903" /> <label for="ls_cookietime">{lang save_password}</label>
  25. </p>
  26. <p>
  27. <label for="ls_password"{if !$_G['setting']['autoidselect']} class="z psw_w" /if}>{lang password}</label> <input type="password" name="password" id="ls_password" class="px vm" autocomplete="off" tabindex="902" onfocus="lsShowmore()" />
  28. <button type="submit" class="pn vm"><em>{lang login}</em></button>
  29. </p>
  30. <input type="hidden" name="quickforward" value="yes" />
  31. <input type="hidden" name="handlekey" value="ls" />
  32. </div>
  33. </div>
复制代码

删除之后将上面代码中下划线部分改为
  1. <div class="fastlg cl" style="width:670px;margin-top:44px;margin-left:240px;">

复制代码

三、您是否还沉溺在修改代码的欣喜之中?非常抱歉整个效果已经修改完成。


另附:记住密码放到登录按钮前面的办法,把代码<input type="checkbox" name="cookietime" id="ls_cookietime" class="pc" value="2592000" tabindex="903" /> <label for="ls_cookietime">{lang save_password}</label>放到代码
<button type="submit" class="pn vm"><em>{lang login}</em></button>前面即可,2段代码中间可以加点间隔,加个





评分

3

查看全部评分

oijk 发表于 2010-10-19 20:51:46 | 显示全部楼层
这是干嘛,大修改么
回复

使用道具 举报

meiont345 发表于 2010-10-19 21:43:52 | 显示全部楼层
实用的东东
回复

使用道具 举报

 楼主| az031120103 发表于 2010-10-20 11:51:58 | 显示全部楼层
占位编辑
回复

使用道具 举报

nostudio 发表于 2010-10-20 12:54:12 | 显示全部楼层
很好,谢谢分享了,我正想修改呢,原来占的位置太大了
回复

使用道具 举报

642332128 发表于 2010-10-22 04:08:33 | 显示全部楼层
赞一个
回复

使用道具 举报

lioo 发表于 2010-10-24 16:57:54 | 显示全部楼层
弄玩之后怎么没有连接地址了?  登录后
回复

使用道具 举报

苍耳子 发表于 2010-10-25 09:25:33 | 显示全部楼层
lioo 发表于 2010-10-24 16:57
弄玩之后怎么没有连接地址了?  登录后

你再核对一下代码
回复

使用道具 举报

huaer3366 发表于 2010-11-3 17:42:31 | 显示全部楼层

弄完之后,怎么显示的是这个样呢?

能把全部改过的代码发给我吗?谢谢!!邮箱 595289453@qq.com
回复

使用道具 举报

苍耳子 发表于 2010-11-6 11:38:45 | 显示全部楼层
huaer3366 发表于 2010-11-3 17:42
弄完之后,怎么显示的是这个样呢?

能把全部改过的代码发给我吗?谢谢!!邮箱

核对二的最后一步
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-23 21:20 , Processed in 0.052555 second(s), 8 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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