天我们解密的是如何使用帝国CMS6.0新增的会员信息调用函数调用会员资料。
前言:
先前版本调用会员资料要通过SQL查询调用,对于比较基础的用户略显麻烦,所以V6.0直接内置调用函数,调用更简单。
两种调用函数:
1、会员信息调用函数:sys_ShowMemberInfo(用户ID,查询字段)
用户ID:设置要调用的会员信息的用户ID,在信息内容页下调用可以设置为0,表示调用信息发布者的资料。 查询字段:默认为查询所有会员字段,此参数一般不用设置,如果为了效率更高可以指定相应的字段。如:“u.userID,ui.company”(u为主表,ui为副表)。 |
调用条数:调用前几条记录。 *** 作类型:0为按注册时间、1为按积分排行、2为按资金排行、3为按会员空间人气排行 会员组ID:指定要调用的会员组ID,不设置为不限,多个会员组用逗号隔开,如:'1,2' 用户ID:指定要调用的会员ID,不设置为不限,多个用户ID用逗号隔开,如:'25,27' 查询字段:默认为查询所有会员字段,此参数一般不用设置,如果为了效率更高可以指定相应的字段。如:“u.userID,ui.company”(u为主表,ui为副表)。 |
<?PHP $userr=sys_ShowMemberInfo(1,''); ?> <table wIDth="500" border="0" cellspacing="1" cellpadding="3" align="center"> <tr bgcolor="#FFFFFF" > <td height="23" colspan="2"><Font color="#333333">会员资料</Font></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">会员头像</Font></td> <td><img src="<?=$userr[userpic]?$userr[userpic]:'/e/data/images/nouserpic.gif'?>" border="0"></td> </tr> <tr bgcolor="#FFFFFF"> <td wIDth="23%" height="23"><Font color="#333333">用户名</Font></td> <td wIDth="77%"><a href="/e/space/?userID=<?=$userr[userID]?>"><?=$userr[username]?></a> <Font color="#666666">(点击访问会员空间)</Font></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">会员组</Font></td> <td><?=$userr[groupname]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">注册时间</Font></td> <td><?=$userr[registertime]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">公司名称</Font></td> <td><?=$userr[company]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">联系人</Font></td> <td><?=$userr[truename]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">联系电话</Font></td> <td><?=$userr[call]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">传真</Font></td> <td><?=$userr[fax]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">手机</Font></td> <td><?=$userr[phone]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">联系邮箱</Font></td> <td><?=$userr[email]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">QQ号码</Font></td> <td><?=$userr[oicq]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">MSN</Font></td> <td><?=$userr[msn]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">网站</Font></td> <td><?=$userr[homepage]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><Font color="#333333">联系地址</Font></td> <td><?=$userr[address]?> 邮编:<?=$userr[zip]?></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23" valign="top"><Font color="#333333">公司介绍</Font></td> <td><?=nl2br($userr[saytext])?></td> </tr> </table> |
评论列表(0条)