dedecms首页调用登陆状态 – DeDecms


avatar
pcwnas 2023-04-21 213

原文来自:https://www.zixuephp.com

dedecms首页调用登陆状态

dedecms首页调用登陆状态,必须引用:

  1. <scriptlanguage="javascript"type="text/javascript"src="{dede:global.cfg_cmsurl/}/include/dedeajax2.js">
  2. <script>

在适当位置加入:

  1. <divid="_userlogin">
  2. 未登陆显示:<ahref="/member/">登录|<ahref="/member/">免费注册
  3. </div>
  4. <scriptlanguage="javascript"type="text/javascript">CheckLogin(); </script>

修改登陆后显示/member/ajax_loginsta.php个文件:

  1. <divclass="welcome">你好:<ahref="/index.php"><?phpecho$cfg_ml->M_UserName;?></strong>!<ahref="/index_do.php?fmdo=login&dopost=exit">退出登录</div>
  2. <strong><aclass="user"href="/index.php"></strong>
  3. <?phpecho$cfg_ml->M_Rank;?>,
  4. <ahref="/index_do.php?fmdo=login&dopost=exit">退出