CheckInfo(); "That's it."/> CheckInfo(); "That's it.">

Home >CMS Tutorial >DEDECMS >How to call the current member information on any page in DreamWeaver

How to call the current member information on any page in DreamWeaver

藏色散人
藏色散人Original
2020-01-06 09:18:312124browse

How to call the current member information on any page in DreamWeaver

How can Dreamweaver call the current member information on any page?

Dream Weaver DEDECMS calls the current member information on any page

Recommended study: Dream Weaver cms

I have been studying dede these days I also tried to get some of the various functions myself. Today I encountered the need to call the member number, which is the Mid value. I checked it on Baidu and found that there are many methods:

{dede:memberinfos} You can use mid= ""Points to calling a certain member information

This method can only call mid=1 by default, which is the information of the website administrator. Using invalid classmates is not invalid, it is just disabled by official default. You only need Comment out include/taglib/memberinfos.lib.php about line 62 (mine is line 62) if($row['matt'])==10) return " ;But this method still cannot call the mid value .

After checking it for a long time, I suddenly found that it can be called by imitating the ajax framework at the top of the template. My code:

<script language="javascript" src="/include/dedeajax2.js"></script> 
<script language="javascript" type="text/javascript"> 
 
/*这一段是默认的*/ 
function CheckLogin(){ 
var taget_obj = document.getElementById(&#39;_userlogin&#39;); 
myajax = new DedeAjax(taget_obj,false,false,&#39;&#39;,&#39;&#39;,&#39;&#39;); 
myajax.SendGet2("/member/ajax_loginsta.php"); 
DedeXHTTP = null; 
} 
/*这一段是自己填写的*/ 
function CheckInfo(){ 
var taget_obj = document.getElementById(&#39;_userinfo&#39;);
/*这里的名字一定要和调用的页面使用的ID值一致*/ 
myajax = new DedeAjax(taget_obj,false,false,&#39;&#39;,&#39;&#39;,&#39;&#39;); 
myajax.SendGet2("/member/ajax_loginuser.php");
/*可以复制上面的loginsta 在php页面填写需要的信息 最后记住一定要改名字哦。*/ 
DedeXHTTP = null; 
} 
</script>

Calling page:

<div id="_userinfo" style="color:#f00; height:50px; line-height:20px;"></div> 
<script language="javascript" type="text/javascript">CheckInfo();</script> 
<!--记住一定要和上面的function 值一致-->

Supplement: Calling mid value:< ;?php echo $cfg_ml->M_ID; ?> must be filled in on the ajax_loginuser.php page.

The above is the detailed content of How to call the current member information on any page in DreamWeaver. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn