-
帝国CMS 6.0会员信息调用功能解析
- 时间:2025-03-29 02:55:52 来源: 人气:0
今天我们将深入探讨如何使用帝国CMS 6.0新增的会员信息调用函数来调用会员资料。以下内容将帮助您更好地理解和应用这些功能,同时优化SEO效果。
前言:
在帝国CMS的早期版本中,如果需要调用会员资料,通常需要通过SQL查询来实现。这种方式对于基础用户来说可能显得复杂且不够直观。因此,在帝国CMS 6.0版本中,官方直接内置了会员信息调用函数,使调用过程变得更加简便。
两种主要的调用函数:
1、会员信息调用函数:sys_ShowMemberInfo(用户ID, 查询字段)
用户ID:设置要调用的会员信息的用户ID。如果是在信息内容页下调用,可以设置为0,表示调用信息发布者的资料。 查询字段:默认为查询所有会员字段,此参数一般不用设置。为了提高效率,可以指定相应的字段,例如:"u.userid,ui.company"(u为主表,ui为副表)。 |
其他说明:函数返回结果为会员资料数组,显示时可以使用<?=$userr[字段名]?>
2、会员列表调用函数:sys_ListMemberInfo(调用条数, 操作类型, 会员组ID, 用户ID, 查询字段)
调用条数:调用前几条记录。 操作类型:0为按注册时间、1为按积分排行、2为按资金排行、3为按会员空间人气排行 会员组ID:指定要调用的会员组ID,不设置为不限,多个会员组用逗号隔开,如:'1,2' 用户ID:指定要调用的会员ID,不设置为不限,多个用户ID用逗号隔开,如:'25,27' 查询字段:默认为查询所有会员字段,此参数一般不用设置,如果为了效率更高可以指定相应的字段。如:"u.userid,ui.company"(u为主表,ui为副表)。 |
其他说明:函数返回结果为会员资料数组,显示时可以使用<?=$userr[字段名]?>
会员信息调用函数:sys_ShowMemberInfo
例子:在任意模板中加入以下代码:
<?php
$userr=sys_ShowMemberInfo(1,'');
?>
<table width="500" border="0" cellspacing="1" cellpadding="3" class="tableborder" align="center">
<tr bgcolor="#FFFFFF" class="header">
<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>
会员列表调用函数:sys_ListMemberInfo
例子:在任意模板中加入以下代码:
<table width="600" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr class="header">
<td width="345"><div align="center">公司名称</div></td>
<td width="119"><div align="center">注册帐号</div></td>
<td width="114"><div align="center">访问空间</div></td>
</tr>
<?php
$usersql=sys_ListMemberInfo(3,0,'3','','');
while($userr=$empire->fetch($usersql))
{
?>
<tr bgcolor="#FFFFFF">
<td>
<div align="center">
<?=$userr[company]?>
</div></td>
<td>
<div align="center">
<?=$userr[username]?>
</div></td>
<td>
<div align="center"><a href="/e/space/?userid=<?=$userr[userid]?>">[点击访问]</a></div></td>
</tr>
<?php
}
?>
</table>
以上内容详细介绍了如何使用帝国CMS 6.0中的会员信息调用函数,希望对您有所帮助。
上一篇:帝国后台密码遗忘解决方案 下一篇:帝国CMS标签与模板教程汇总
相关文章
-
在留言板和后台留言审核面板中显示留言者的IP地址,是增强网站安全性和管理效率的重要功能。通过记录和展示IP地址,管理员可以更方便地追踪留言来源,确保内容的真实性和合法性。本文将详细介绍如何实现这一功能,并优化搜索引擎排名(SEO)。 首先,我们需要了解如何在代码中正确插入IP地址的显示逻辑。以下是...2025-03-29
-
在网站开发中,保护用户隐私是一个重要的考虑因素。当您在分类信息内容页添加了发布人的IP显示功能时,可能会面临如何隐藏IP地址的部分数字以保护用户隐私的问题。本文将介绍一种方法,让您能够像处理评论中的IP地址一样,将IP地址的最后一位数字替换为“*”。 为了实现这一功能,您可以使用PHP代码对IP地...2025-03-29
-
创建符合SEO标准的Google Sitemap对于提高网站在搜索引擎中的可见性至关重要。以下是一篇经过改写的文章,详细介绍了如何利用栏目分别创建不同的Sitemap,并确保其符合Google的要求。 技术整理:24mp3技术支持:wm_chief, hicode 制作Google Sitema...2025-03-29
-
在构建动态网站时,使用循环结构来展示数据是一种常见的做法。例如,在EmpireCMS中,我们可以利用[e:loop]标签来实现这一功能。下面是一篇关于如何使用[e:loop]标签生成友情链接列表的文章,旨在优化搜索引擎排名(SEO),同时确保代码的可读性和功能性。 在EmpireCMS中,[e:l...2025-03-29