导航下面增加固定的会员登陆框, 如何传递数据
想在搜索条下面,增加固定的会员登陆框。 (如下图效果)(补充说明,会员在这里可直接登录,不用 JS 调用的会员登录 )
麻烦老师帮看下,我增加的代码是不是哪里不对
<form method="post" autocomplete="off" id="lsform" action="member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <a href="member.php?mod={$_G}" class="xi2 xw1">$_G['setting']['reglinkname']</a></td>
</tr>
<tr>
<td>{lang username}<input type="text" name="username" id="ls_username" autocomplete="off" class="px vm" tabindex="901" /></td>
</tr>
<tr>
<td><label for="ls_password"{if !$_G['setting']['autoidselect']} class="z psw_w"{/if}></label></td>
</tr>
<tr>
<td>密码<input type="password" name="password" id="ls_password" class="px vm" autocomplete="off" tabindex="902" /></td>
</tr>
<tr>
<td class="fastlg_l"><button type="submit" class="pn vm" tabindex="904" style="width: 75px;"><em>{lang login}</em></button></td>
</tr>
<input type="hidden" name="quickforward" value="yes" />
<input type="hidden" name="handlekey" value="ls" />
</table>
</form>
此代码 前台显示的效果: 如下图
所出现问题:这里输入账号无法登录(会员可在这里可直接登录,不用 JS 调用的登录框)
:)也想加一个这个,期待解答啊~~ 直接修改官方的模板的登录区域代码就可以实现!把样式套过来!
默认代码:
<!--{if CURMODULE != 'logging'}-->
<script type="text/javascript" src="{$_G}logging.js?{VERHASH}"></script>
<form method="post" autocomplete="off" id="lsform" action="member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes" onsubmit="{if $_G['setting']['pwdsafety']}pwmd5('ls_password');{/if}return lsSubmit();">
<div class="fastlg cl">
<span id="return_ls" style="display:none"></span>
<div class="y pns">
<table cellspacing="0" cellpadding="0">
<tr>
<!--{if !$_G['setting']['autoidselect']}-->
<td>
<span class="ftid">
<select name="fastloginfield" id="ls_fastloginfield" width="40" tabindex="900">
<option value="username">{lang username}</option>
<!--{if getglobal('setting/uidlogin')}-->
<option value="uid">{lang uid}</option>
<!--{/if}-->
<option value="email">{lang email}</option>
</select>
</span>
<script type="text/javascript">simulateSelect('ls_fastloginfield')</script>
</td>
<td><input type="text" name="username" id="ls_username" autocomplete="off" class="px vm" tabindex="901" /></td>
<!--{else}-->
<td><label for="ls_username">{lang account}</label></td>
<td><input type="text" name="username" id="ls_username" class="px vm xg1" {if $_G['setting']['autoidselect']} value="{if getglobal('setting/uidlogin')}UID/{/if}{lang username}/Email" onfocus="if(this.value == '{if getglobal('setting/uidlogin')}UID/{/if}{lang username}/Email'){this.value = '';this.className = 'px vm';}" onblur="if(this.value == ''){this.value = '{if getglobal('setting/uidlogin')}UID/{/if}{lang username}/Email';this.className = 'px vm xg1';}"{/if} tabindex="901" /></td>
<!--{/if}-->
<td class="fastlg_l"><label for="ls_cookietime"><input type="checkbox" name="cookietime" id="ls_cookietime" class="pc" value="2592000" tabindex="903" />{lang login_permanent}</label></td>
<td> <a href="javascript:;" onclick="showWindow('login', 'member.php?mod=logging&action=login&viewlostpw=1')">{lang forgotpw}</a></td>
</tr>
<tr>
<td><label for="ls_password"{if !$_G['setting']['autoidselect']} class="z psw_w"{/if}>{lang password}</label></td>
<td><input type="password" name="password" id="ls_password" class="px vm" autocomplete="off" tabindex="902" /></td>
<td class="fastlg_l"><button type="submit" class="pn vm" tabindex="904" style="width: 75px;"><em>{lang login}</em></button></td>
<td> <a href="member.php?mod={$_G}" class="xi2 xw1">$_G['setting']['reglinkname']</a></td>
</tr>
</table>
<input type="hidden" name="quickforward" value="yes" />
<input type="hidden" name="handlekey" value="ls" />
</div>
<!--{hook/global_login_extra}-->
</div>
</form>
<!--{if $_G['setting']['pwdsafety']}-->
<script type="text/javascript" src="{$_G['setting']['jspath']}md5.js?{VERHASH}" reload="1"></script>
<!--{/if}-->
<!--{/if}-->
老师您的这个方法,试过了( 只要在discuz.html 直接 调用:<!--{<!--{template member/login_simple}-->}-->)即可
但是用这种方法,遇到三个问题。
问题1:将红色部份删除就不无登录。
问题2:点击登陆时 弹出 JS 调的登陆框用,相当于之前登陆框中输入的 用户名、密码。还要重新在 JS 调的登陆框中 再重新输入一次。
问题3: 登陆成功后就会显示登陆成功之的状态,此成登录框就隐藏了(目的是要做一个固定式登陆框)。想要的效果如下图:
简单表达:就要做一个 企业网站一样的简洁版 登录框 (把discuz 默认的登陆框 ,修改如下图后,无法登录)
此代码如下:
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <a href="member.php?mod={$_G}" class="xi2 xw1">$_G['setting']['reglinkname']</a></td>
</tr>
<tr>
<td><script type="text/javascript">simulateSelect('ls_fastloginfield')</script> </td>
</tr>
<tr>
<td><input type="text" name="username" id="ls_username" autocomplete="off" class="px vm" tabindex="901"value="{lang username}"/></td>
</tr>
<tr>
<td><label for="ls_password"{if !$_G['setting']['autoidselect']} class="z psw_w"{/if}></label></td>
</tr>
<tr>
<td><input type="password" name="password" id="ls_password" class="px vm" autocomplete="off" tabindex="902" value="{lang password}"/></td>
</tr>
<tr>
<td class="fastlg_l"><button type="submit" class="pn vm" tabindex="904" style="width: 75px;"><em>{lang login}</em></button></td>
</tr>
</table>
请老师指点下此方法应该怎么改,或其它更好的方案 。谢谢!
也想做一个静态的登陆框 坐等 学习中~~~~~~~~~~~ 本帖最后由 技术帮助 于 2015-3-15 11:47 编辑
<!--{if CURMODULE != 'logging'}-->
<script type="text/javascript" src="{$_G}logging.js?{VERHASH}"></script>
<form method="post" autocomplete="off" id="lsform" action="member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes" onsubmit="{if $_G['setting']['pwdsafety']}pwmd5('ls_password');{/if}return lsSubmit();">
<div class="fastlg cl">
<span id="return_ls" style="display:none"></span>
<ul class="login-list">
<li>
<!--{if !$_G['setting']['autoidselect']}-->
<input type="text" name="username" id="ls_username" autocomplete="off" class="ipt ipt-name" tabindex="901" placeholder="请输入您的账号" />
<!--{else}-->
<input type="text" name="username" id="ls_username" class="ipt ipt-name" {if $_G['setting']['autoidselect']} value="{if getglobal('setting/uidlogin')}UID/{/if}{lang username}/Email" onfocus="if(this.value == '{if getglobal('setting/uidlogin')}UID/{/if}{lang username}/Email'){this.value = '';this.className = 'px vm';}" onblur="if(this.value == ''){this.value = '{if getglobal('setting/uidlogin')}UID/{/if}{lang username}/Email';this.className = 'px vm xg1';}"{/if} tabindex="901" />
<!--{/if}-->
</li>
<li>
<input type="password" name="password" id="ls_password" class="ipt ipt-pass" autocomplete="off" tabindex="902" placeholder="请输入密码" />
</li>
<li class="dlsubmit">
<button type="submit" class="dlsubmitvm" tabindex="904" style="width: 75px;"><em>{lang login}</em></button>
</li>
</ul>
<input type="hidden" name="quickforward" value="yes" />
<input type="hidden" name="handlekey" value="ls" />
<!--{hook/global_login_extra}-->
</div>
</form>
<!--{if $_G['setting']['pwdsafety']}-->
<script type="text/javascript" src="{$_G['setting']['jspath']}md5.js?{VERHASH}" reload="1"></script>
<!--{/if}-->
<!--{/if}-->
以上代码是之前做的一个项目的登录区域!你可以参考下!
页:
[1]