易优cms会员调用标签大全
一、会员属性调用
{eyou:memberinfos mid=’$eyou.field.users_id’>
会员属性:{$users.para_这里请查阅后台会员属性的ID}
{$users.hidden}
{/eyou:memberinfos}
适用1.47+版本,para_*,可以在会员后台属性查阅
二、会员等级调用
{eyou:memberinfos mid=’$eyou.field.users_id’>
会员等级:{$users.level_name}
{$users.hidden}
{/eyou:memberinfos}
适用1.47+版本
三、会员头像/昵称
{eyou:memberinfos mid=’$eyou.field.users_id’>
会员昵称:{$users.nickname}
会员头像:
{$users.hidden}
{/eyou:memberinfos}
四、内容页调用会员投稿文章数量
会员投稿发布数量:{$eyou.field.users_id|diy_GetArcusercount=###}
会员投稿文章总阅读量:{$eyou.field.users_id|diy_GetArcuserclick=###}
将以下代码加进根目录下extend文件夹里面function.php文件的代码如下:
/**
* 统计会员投稿的文章数
*/
<?php /** * 统计会员投稿的文章数 */ function diy_GetArcusercount($users_id = 0) { if (empty($users_id)) { return 0; } else { $condition = [ ‘users_id’ => $users_id,
‘arcrank’ => [‘gt’, -1],
‘status’ => 1,
‘is_del’ => 0,
];
/*定时文档显示插件*/
if (is_dir(‘./weapp/TimingTask/’)) {
$TimingTaskRow = model(‘Weapp’)->getWeappList(‘TimingTask’);
if (!empty($TimingTaskRow[‘status’]) && 1 == $TimingTaskRow[‘status’]) {
$condition[‘add_time’] = [‘elt’, getTime()]; // 只显当天或之前的文档
}
}
/*end*/
$count = thinkDb::name(‘archives’)->where($condition)->count(‘aid’);
return intval($count);
}
}
/**
* 统计会员投稿的文章数阅读总量
*/
function diy_GetArcuserclick($users_id = 0)
{
if (empty($users_id)) {
return 0;
} else {
$condition = [
‘users_id’ => $users_id,
‘arcrank’ => [‘gt’, -1],
‘status’ => 1,
‘is_del’ => 0,
];
/*定时文档显示插件*/
if (is_dir(‘./weapp/TimingTask/’)) {
$TimingTaskRow = model(‘Weapp’)->getWeappList(‘TimingTask’);
if (!empty($TimingTaskRow[‘status’]) && 1 == $TimingTaskRow[‘status’]) {
$condition[‘add_time’] = [‘elt’, getTime()]; // 只显当天或之前的文档
}
}
/*end*/
$userclick = thinkDb::name(‘archives’)->where($condition)->sum(‘click’);
$click = $userclick + 1;
return intval($click);
}
}