dedecms 5.7如何实现首页会员横向登录

生活中只有两种选择:重新开始,成为自己生活的主角;或留在原处并成为他人的支持角色。生活中,很多时候都需要我们要耐心,耐心做人,耐心做事,更要耐心生活。

关健在红色部份

加在模板文件里的 head.htm里面


<head>
<link rel="nofollow noopener noreferrer" href="{dede:global.cfg_templets_skin/}/style/dedecms.css" rel="stylesheet" media="screen" type="text/css" />
<script language="javascript" type="text/javascript" src="{dede:global.cfg_cmsurl/}/include/dedeajax2.js"></script>
<script language="javascript" type="text/javascript" src="{dede:global.cfg_cmspath/}/images/js/j.js" ></script>
<script language="javascript" type="text/javascript" src="{dede:global.cfg_templets_skin/}/js/pic_scroll.js"></script>
<script language="javascript" type="text/javascript">
<!--
$(function(){
$("a[_for]").mouseover(function(){
$(this).parents().children("a[_for]").removeClass("thisclass").parents().children("dd").hide();
$(this).addClass("thisclass").blur();
$("#"+$(this).attr("_for")).show();
});
$("a[_for=uc_member]").mouseover();
$("a[_for=flink_1]").mouseover();
});
 
function CheckLogin(){
var taget_obj = document.getElementById('_userlogin');
myajax = new DedeAjax(taget_obj,false,false,'','','');
myajax.SendGet2("{dede:global.cfg_cmspath/}/member/ajax_loginsta.php");
DedeXHTTP = null;
}
-->
</script>
</head>
<div class="header_top">
<div class="w960 center">
<span id="time" class="time">
<div id="_userlogin">
<form name="userlogin" action="{dede:global.cfg_memberurl/}/index_do.php" method="POST">
<input type="hidden" name="fmdo" value="login" />
<input type="hidden" name="dopost" value="login" />
<input type="hidden" name="keeptime" value="604800" />
<input type="hidden" name="gourl" value="" />
用户名:
<input name="userid" type="text" id="userid" style="width:60px;height:12px;border:1px solid #000" />
密码:
<input type="password" name="pwd" style="width:60px;height:12px;border:1px solid #000" />
{dede:php}
if(preg_match("/2/",$safe_gdopen)){
echo '验证码:
<input type="text" name="vdcode" style="width:40px;height:12px;border:1px solid #000" />
<img id="vdimgck" align="absmiddle" onClick="this.src=this.src+\'?'" style="cursor:pointer;margin-left:0px;text-transform:uppercase;" src="'.$cfg_cmspath.'/include/vdimgck.php"width="42" height="18" align="absmiddle" />';
}
{/dede:php}
<input name="imageField" type="image" src="/templets/default/images/loginbt.gif" width="45" height="19" border="0" align="absmiddle" />
<a rel="nofollow noopener noreferrer" href="/member/resetpassword.php">忘记密码?</a><a rel="nofollow noopener noreferrer" href="/member/index_do.php?fmdo=user&dopost=regnew"></a>
<a rel="nofollow noopener noreferrer" href="/member/index_do.php?fmdo=user&dopost=regnew">注册帐号</a>
</form>
</div>
<script language="javascript" type="text/javascript">CheckLogin();</script>





下面是head.htm原有的可做部位参考
</span>
<div class="toplinks"><a rel="nofollow noopener noreferrer" href="{dede:global.cfg_cmsurl/}/plus/heightsearch.php" target="_blank">高级搜索</a>|<a rel="nofollow noopener noreferrer" href="{dede:global.cfg_cmsurl/}/data/sitemap.html" target="_blank">网站地图</a>|<a rel="nofollow noopener noreferrer" href="{dede:global.cfg_cmsurl/}/tags.php">TAG标签</a><a rel="nofollow noopener noreferrer" href="{dede:global.cfg_dataurl/}/rssmap.html" class="rss">RSS订阅</a><span>[<a rel="nofollow noopener noreferrer" href=""onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('{dede:global.cfg_basehost/}');">设为首页</a>] [<a rel="nofollow noopener noreferrer" href="javascript:window.external.AddFavorite('{dede:global.cfg_basehost/}','{dede:global.cfg_webname/}')">加入收藏</a>]</span></div>



ajax_loginsta.php文件的代码 全部覆盖好了


<?php
/**
* @version $Id: ajax_loginsta.php 1 8:38 2010年7月9日Z tianya $
* @package DedeCMS.Member
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once(dirname(__FILE__)."/config.php");
AjaxHead();
if($myurl == '') exit('');$uid = $cfg_ml->M_LoginID;
!$cfg_ml->fields['face'] && $face = ($cfg_ml->fields['sex'] == '女')? 'dfgirl' : 'dfboy';
$facepic = empty($face)? $cfg_ml->fields['face'] : $GLOBALS['cfg_memberurl'].'/templets/images/'.$face.'.png';
?>
<div class="welcome">您好:<strong><?php echo $cfg_ml->M_UserName; ?></strong>,欢迎回来! <a rel="nofollow noopener noreferrer" href="<?php echo $cfg_memberurl; ?>/guestbook_admin.php">我的留言</a> <a rel="nofollow noopener noreferrer" href="<?php echo $cfg_memberurl; ?>/mystow.php">我的收藏</a> <a rel="nofollow noopener noreferrer" href="<?php echo $cfg_memberurl; ?>/article_add.php">发表文章</a> <a rel="nofollow noopener noreferrer" href="<?php echo $cfg_memberurl; ?>/myfriend.php">好友管理</a> <span class="uclink"><a rel="nofollow noopener noreferrer" href="<?php echo $cfg_memberurl; ?>/index.php">会员中心</a> | <a rel="nofollow noopener noreferrer" href="<?php echo $cfg_memberurl; ?>/edit_fullinfo.php">资料</a> | <a rel="nofollow noopener noreferrer" href="<?php echo $myurl;?>">空间</a> | <a rel="nofollow noopener noreferrer" href="<?php echo $cfg_memberurl; ?>/index_do.php?fmdo=login&dopost=exit">退出登录</a></span></div>
<!-- /userinfo -->



绝对OK了
 登录前


登录后
 

转载自:http://www.2d30.cn/04/136.html 

本文dedecms 5.7如何实现首页会员横向登录到此结束。只有使自己自卑的心灵自信起来,弯曲的身躯才能挺直;只有使自己懦弱的体魄健壮起来,束缚的脚步才能迈开;只有使自己狭隘的心胸开阔起来,短视的眼光才能放远;只有使自己愚昧的头脑聪明起来,愚昧的幻想才能抛弃!小编再次感谢大家对我们的支持!

您可能有感兴趣的文章
织梦后台文档列表添加复制文档功能支持所有模型

织梦无法上传ico图标格式文件的如何解决方法

dedecms如何实现任意页面调用当前会员信息的方

织梦dede:tag调用指定多个栏目的TAG标签

织梦栏目列表按附加表自定义字段排序