原文来自:https://www.zixuephp.com
dedecms首页调用登陆状态
dedecms首页调用登陆状态,必须引用:
- <scriptlanguage="javascript"type="text/javascript"src="{dede:global.cfg_cmsurl/}/include/dedeajax2.js">
- <script>
在适当位置加入:
- <divid="_userlogin">
- 未登陆显示:<ahref="/member/">登录|<ahref="/member/">免费注册
- </div>
- <scriptlanguage="javascript"type="text/javascript">CheckLogin(); </script>
修改登陆后显示/member/ajax_loginsta.php个文件:
- <divclass="welcome">你好:<ahref="/index.php"><?phpecho$cfg_ml->M_UserName;?></strong>!<ahref="/index_do.php?fmdo=login&dopost=exit">退出登录</div>
- <strong><aclass="user"href="/index.php"></strong>
- <?phpecho$cfg_ml->M_Rank;?>,
- <ahref="/index_do.php?fmdo=login&dopost=exit">退出