您现在的位置是:首页 > cms教程 > 帝国CMS教程帝国CMS教程

帝国CMS内容页调用当前文章作者信息及会员除了相关文章

君菁2023-01-21帝国CMS教程已有人查阅

导读内容页调用当前文章作者信息及调用会员除了当前文章以外的其他相关文章

内容页调用当前文章作者信息及调用会员除了当前文章以外的其他相关文章
一、调用会员信息:
把以下代码加到内容页模板里即可
<?php
$userr=sys_ShowMemberInfo(0,'');
?>
<span>会员头像:<img src="<?=$userr[userpic]?$userr[userpic]:$public_r[newsurl].'e/data/images/doimg.gif'?>"></span> <br>
<span>会员:<?=$userr[username]?></span> <br>
<span>会员ID:<?=$userr[userid]?></span> <br>
<span>注册时间:<?=$userr[registertime]==null?"":date('y-m-d',$userr[registertime])?></span> <br>
<span>会员积分:<?=$userr[userfen]?>分</span> <br>
<span>发布新闻:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_news where userid='$navinfor[userid]' and ismember=1")?>条</span> <br>
<span>会员组:<?=$userr[groupname]?></span><br>
<span>作者文章列表:<a href="<?=$public_r[newsurl]?>e/space/list.php?userid=<?=$userr[userid]?>&mid=1">文章列表</a></span><br>
二、调用用户发过的其他文章信息(会员投稿文章):
1、php调用
调用当前会员投稿的文章(5条):
<?php
$sql=$empire->query("select * from {$dbtbpre}ecms_news where userid='$navinfor[userid]' and classid='$navinfor[classid]' and id<>$navinfor[id] and ismember=1 order by newstime asc limit 5");
while($r=$empire->fetch($sql))
if($navinfor[ismember]==1)
{
$titleurl=sys_ReturnBqTitleLink($r);//链接
?>
<li><a href="<?=$titleurl?>" target="_blank" title="<?=$r[title]?>" ><?=esub($r[title],40)?></a></li>
<?php
}
else
{
?>
暂时没有其他文章
<?php
}
?>
2、灵动标签调用
[e:loop={"select * from [!db.pre!]ecms_news where userid='$navinfor[userid]' and classid='$navinfor[classid]' and id<>$navinfor[id] and ismember=1 order by newstime desc limit 10",0,24,0}]
<?php
if($navinfor[ismember]==1)
{
?>
<li><a href="<?=$bqsr[titleurl]?>" title="<?=$bqr[title]?>"><?=esub($bqr[title],50)?></a></li>
<?php
}
else
{
?>
暂时没有其他文章
<?php
}
?>
[/e:loop]
或
[e:loop={'selfinfo',10,0,0,"userid='$navinfor[userid]' and classid='$navinfor[classid]' and id<>$navinfor[id] and ismember=1"}]
<?php
if($navinfor[ismember]==1)
{
?>
<li><a href="<?=$bqsr[titleurl]?>" title="<?=$bqr[title]?>"><?=esub($bqr[title],50)?></a></li>
<?php
}
else
{
?>
暂时没有其他文章
<?php
}
?>
[/e:loop]
注释:id<>$navinfor[id]或and id!=$navinfor[id] 意思为:不等于当前文章id
①、classid='$navinfor[classid]' 意思为:只调用当前栏目的文章(如果删除它后,会调用会员在整个模型中其他栏目发过的文章)
②、classid也可以指定显示栏目的id 格式如:classid=34 或 classid in (2,3))
③、classid还可以排除当前栏目 格式如:classid<>$navinfor[classid] 即:调用当前发布者在其他栏目发布的信息
“暂时没有其他文章”可以删除
注意:以上(调用用户发过的其他文章信息)除了不能调用后台“站长”发布的文章外,能调出“会员”和“游客”的文章

本文标签:帝国cms会员系统 帝国cms相关调用 

很赞哦! ()

相关源码

  • (自适应响应式)html5蓝色智能水表营销型网站pbootcms模板下载PbootCMS内核开发,为智能水表企业打造的营销型网站解决方案,本模板基于PbootCMS内核开发,为智能水表及相关行业企业设计,采用HTML5+CSS3技术构建,具有响应式布局。查看源码
  • html5响应式pbootcms模板新闻资讯博客网站源码该模板采用PbootCMS内核开发,专为新闻资讯类网站打造,同时具备高度行业适配性--只需替换图文内容即可快速转型为企业官网、行业门户等各类站点。查看源码
  • (自适应)帝国cms7.5模板自媒体文章新闻博客为帝国CMS7.5设计的响应式模板,采用H5技术构建现代化内容展示框架。通过智能断点检测技术实现手机、平板、PC三端适配查看源码
  • (响应式)蓝色智能摄像头安防防盗电子设备免费pbootcms源码下载这是一款针对智能安防行业特点设计的网站模板,采用蓝色系配色方案,体现科技感和安全性。模板包含产品展示、解决方案、技术支持和新闻中心等核心模块,能够全面展示智能安防设备的技术特点和行业应用。查看源码
  • (自适应)餐具英文外贸生活用品带下载功能网站模板免费下载为餐具及生活用品外贸企业打造的响应式网站模板,基于PbootCMS内核开发。突出产品展示与多语言支持特性,通过自适应设计确保更好客户在手机、平板、电脑等设备上获得一致浏览体验。查看源码
  • (自适应响应式)APP应用程序软件介绍落地页源码免费下载该模板为营销技术从业者设计,提供专业的内容展示平台。采用响应式布局,适配软件介绍、APP推广等营销场景,通过可视化后台可快速搭建符合行业特性的展示网站。查看源码
分享笔记 (共有 篇笔记)
验证码: