Ripro主题侧边小工具会员信息及消费排行榜(美化版)
发布时间: 2020-04-16
514 人阅读
Ripro主题外观小工具侧边会员用户信息及会员消费排行榜样式美化版,效果图如下:
找到ripro/inc/codestar-framework/options/widgets.theme.php 找到“//用户信息小工具”,插入以下代码:
// 用户信息小工具
CSF::createWidget('cao_widget_userinfo', array(
'title' => 'RIPRO-用户信息展示',
'classname' => 'widget-userinfo',
'description' => 'RIPRO主题的小工具',
'fields' => array(
),
));
if (!function_exists('cao_widget_userinfo')) {
function cao_widget_userinfo($args, $instance)
{
if (_cao('close_site_shop','0')) {
return false;
}
if (!is_user_logged_in()) {
return false;
}
global $current_user;
$CaoUser = new CaoUser($current_user->ID);
$site_money_ua = _cao('site_money_ua');
echo $args['before_widget'];
// start
ob_start(); ?>
<div class="author-card_content">
<div class="author_avatar">
<?php echo get_avatar($current_user->user_email); ?>
<a href="<?php echo esc_url(home_url('/user'))?>"><?php echo $current_user->display_name;?>
<?php
if ($CaoUser->vip_status()) {
$tips='<span class="tips">正常</span>';
echo '<span class="label label-warning"><i class="fa fa-diamond"></i> '.$CaoUser->vip_name().'</span>';
}else{
$tips='<span class="tips">到期</span>';
echo '<span class="label label-default"><i class="fa fa-user"></i> '.$CaoUser->vip_name().'</span>';
}
?>
</a>
<?php echo '<span class="tips">'.$CaoUser->vip_end_time().'</span>';?>
</div>
<div class="author-fields">
<div>
<span><?php echo $site_money_ua;?></span>
<span><?php echo $CaoUser->get_balance();?></span>
</div>
<div>
<span>已消费</span>
<span><?php echo $CaoUser->get_consumed_balance();?></span>
</div>
</div>
<?php if (_cao('is_qiandao','1')) : ?>
<div class="author-qiandao">
<?php if (_cao_user_is_qiandao()) {
echo '<p class="qiandao-notic">今日已领<span>'._cao('qiandao_to_money','5').'</span>'.$site_money_ua.',请明日继续签到</p>';
echo '<button type="button" class="btn btn--secondary disabled"><i class="fa fa-check"></i> 今日已签到</button>';
}else{
echo '<p class="qiandao-notic">今日签到可领取<span>'._cao('qiandao_to_money','5').'</span>'.$site_money_ua.'</p>';
echo '<button type="button" class="click-qiandao btn btn--secondary"><i class="fa fa-hand-peace-o"></i> 签到</button>';
}
?>
</div>
<?php endif; ?>
</div>
<?php echo ob_get_clean();
// end
echo $args['after_widget'];
}
}
找到ripro/inc/codestar-framework/options/widgets.theme.php 找到“余额排行榜”,修改为以下代码:
// ripro主题的用户余额排行榜
CSF::createWidget('cao_widget_userstop', array(
'title' => 'RIPRO-用户排行榜',
'classname' => 'widget-userstop',
'description' => 'RIPRO主题的小工具',
'fields' => array(
array(
'id' => 'title',
'type' => 'text',
'title' => '标题',
'default' => '排行榜',
),
array(
'id' => 'limit',
'type' => 'text',
'title' => '显示数量',
'default' => '6',
),
),
));
if (!function_exists('cao_widget_userstop')) {
function cao_widget_userstop($args, $instance)
{
if (_cao('close_site_shop','0')) {
return false;
}
echo $args['before_widget'];
if ( ! empty( $instance['title'] ) ) {
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
}
// start
$limit = $instance['limit'];
$outer = isset($instance['outer']) ? $instance['outer'] : 0;
$output = '';
//查询用户
$arg = array(
'meta_key' => 'cao_balance',
'meta_query' => array(),
'orderby' => 'meta_value_num',
'order' => 'DESC',
'number' => $limit,
'count_total' => false,
);
$users = get_users($arg);
$site_money_ua = _cao('site_money_ua');
if(!empty($users)){
foreach($users as $key => $search_user){
$CaoUser = new CaoUser($search_user->ID);
$output .= '<li>';
$output .= '<span class="index num-'.($key+1).'">'.($key+1).'</span>';
$output .= '<span class="avatar">'.get_avatar($search_user->ID).'</span>';
$output .= '<span class="name">'.$search_user->display_name.'</span>';
$output .= '<span class="credits"><span class="num">'.(int)$CaoUser->get_balance().'</span>'.$site_money_ua.'</span>';
$output .= '</li>';
}
}
echo '<ul>' . $output . '</ul>';
// end
echo $args['after_widget'];
}
}
会员用户信息CSS样式,打开diy.css插入以下代码:
.widget-userinfo{background:url(../images/vip_bg.png);background-repeat:no-repeat;background-size:100% 100%;box-shadow:0 34px 10px -24px rgba(136,161,206,.34)}
.authorinfo-header-title{margin-bottom:1.5rem;margin-top:1.5rem;display:flex!important}
.authorinfo-codesign-avatar{width:45.6px;height:45.6px;display:flex;flex-shrink:0;cursor:pointer;border-radius:50%;overflow:hidden}
.author-info-vip{margin-left:1rem;flex-shrink:0;border-radius:500px;cursor:pointer}
.authorinfo-header{font-size:.9rem!important;font-weight:400;line-height:1.5;color:#fff}
.authorinfo-header-time,.label-default{font-size:.7rem!important;color:#dedbd2;font-weight:400;line-height:1.5;background-color:rgba(0,0,0,0)}
.authorinfo-codesign-single{width:40px;height:40px;display:flex;flex-shrink:0;cursor:pointer;border-radius:50%;overflow:hidden}
.author-info-vip-single{margin-left:.4rem;flex-shrink:0;border-radius:500px;cursor:pointer}
.author-qiandao-single{padding:0;padding-top:0;height:40px;line-height:40px;right:-15px;position:absolute}
.ripro-author-fields{background-color:rgba(0,0,0,0)!important;color:#fff}
.ripro-author-yue{font-size:23px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;white-space:normal}
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!vip@mobanstar.com
2. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!
3. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站不保证所提供下载的资源的准确性、安全性和完整性,源码仅供下载学习之用!
8. 如用于商业或者非法用途,与本站无关,一切后果请用户自负!
9. 如遇到加密压缩包,默认解压密码为"www.mobanstar.com",如遇到无法解压的请联系管理员!
模板星 » Ripro主题侧边小工具会员信息及消费排行榜(美化版)
2. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!
3. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站不保证所提供下载的资源的准确性、安全性和完整性,源码仅供下载学习之用!
8. 如用于商业或者非法用途,与本站无关,一切后果请用户自负!
9. 如遇到加密压缩包,默认解压密码为"www.mobanstar.com",如遇到无法解压的请联系管理员!
模板星 » Ripro主题侧边小工具会员信息及消费排行榜(美化版)
常见问题FAQ
- 购买的模板是永久使用的嘛?需要授权码嘛?
- 凡是在模板星购买的模板/主题都是支持永久使用的,无需购买授权码,请用户放心购买使用。
- VIP模板提供安装服务嘛?需要收费嘛?
- 凡在模板星购买的模板/主题均可提供一次免费安装服务(需提供空间及数据库账号),请用户放心购买。
售后服务:
-
售后服务范围 1、商业模板使用范围内问题免费咨询 2、源码安装、模板安装(一般 ¥50-300)服务答疑仅限SVIP用户 3、单价超过200元的模板免费一次安装,需提供服务器信息。 付费增值服务 1、提供dedecms模板、WordPress主题模板优化等服务请详询在线客服 2、承接DedeCMS、 WordPress等系统建站、仿站、开发、定制等服务 3、服务器环境配置(一般 ¥50-300) 4、网站中毒处理(需额外付费,500元/次/质保三个月) 售后服务时间 周一至周日(法定节假日除外) 9:00-23:00 免责声明 本站所提供的模板(主题/插件)等资源仅供学习交流,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担,有部分资源为网上收集或仿制而来,若模板侵犯了您的合法权益,请来信通知我们(Email:vip@mobanstar.com),我们会及时删除,给您带来的不便,我们深表歉意!