wordpress ripro 用户信息修改模块

2019-12-01 0 387

Ripro主题 文章右上角 用户信息修改模块

未修改的:

修改后图片:

全屏截图(已修改):

教程开始:首先打开 Ripro主题文件,搜索 widgets.theme.php 如图:


打开文件,并搜索 widget-userinfo (大概在208行左右) 全部复制替换一下代码

// 用户信息小工具
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="authorinfo-header-title">
        <div class="authorinfo-codesign-single">    
            <?php echo get_avatar($current_user->user_email); ?>
        </div>
        <div class="author-info-vip-single">
            <div class="authorinfo-header">
                <?php echo $current_user->display_name;?>

            </div>
            <?php 
                        if ($CaoUser->vip_status()) {
                            $tips='<span class="tips">正常</span>';
                            echo '<span class="label label-warning">'.$CaoUser->vip_name().'</span>';
                        }else{
                            $tips='<span class="tips">到期</span>';
                            echo '<span class="label label-default" style="padding-left:0px;padding-top:0px;">已到期</span>';
                        }
                    ?>
        </div>
            <?php if (_cao('is_qiandao','1')) : ?>
            <div class="author-qiandao-single">
                <?php if (_cao_user_is_qiandao()) {
                   echo '<button type="button" class="btn btn--secondary disabled ripro-qiandao" style="right: -15px;border-radius:50px;background-image: linear-gradient(60deg, #777777 60%, #ffd1ff 100%);"><i class="fa fa-check"></i> 明日继续</button>'; 
                }else{
                   echo '<button type="button" class="click-qiandao btn btn--secondary ripro-qiandao" style="right: -15px;border-radius:50px;background-image: linear-gradient(60deg, #777777 60%, #ffd1ff 100%);">签到<span>领<span>'._cao('qiandao_to_money','5').'</span>'.$site_money_ua.'</span></button>'; 
                }
                ?>
            </div>
               <?php endif; ?>

            </div>

            <div class="author-fields">
                <div class="ripro-author-fields">
                    
                    <span class="ripro-author-yue" style="color:#fff"><?php echo $CaoUser->get_balance();?></span>
                    <span style="color:#bcb7a9">余额(<?php echo $site_money_ua;?>)</span>
                </div>
                <div class="ripro-author-fields">
                    
                    <span class="ripro-author-yue" style="color:#fff"><?php echo $CaoUser->get_consumed_balance();?></span>
                    <span style="color:#bcb7a9">消费(<?php echo $site_money_ua;?>币)</span>
                </div>
            </div>
 
        </div>

        <?php echo ob_get_clean();
       
        // end
        echo $args['after_widget'];
    }
}

替换后保存,并打开 diy.css 文件(有缓存的记得清理浏览器缓存 / 清理CDN缓存)

添加:

/*签到 样式开始*/
.widget-userinfo{
	background: url(https://img.srcdict.com/VIPZ.png);
    background-repeat: no-repeat;
    background-size: 100% 100%;
        box-shadow: 0 34px 10px -24px rgba(136,161,206,0.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: 0.9rem !important;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
}
.authorinfo-header-time, .label-default{
    font-size: 0.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: 0.4rem;
    flex-shrink: 0;
    border-radius: 500px;
    cursor: pointer;
}
.author-qiandao-single {
    padding: 0px;
    padding-top: 0px;
    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;
}
/*签到 样式结束*/

注: 此教程仅对 未修改/美化 过 用户信息模块生效,其他美化 / 修改 过 的用户请自行处理

:本文采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可, 转载请附上原文出处链接。
1、本站提供的源码不保证资源的完整性以及安全性,不附带任何技术服务!
2、本站提供的模板、软件工具等其他资源,均不包含技术服务,请大家谅解!
3、本站提供的资源仅供下载者参考学习,请勿用于任何商业用途,请24小时内删除!
4、如需商用,请购买正版,由于未及时购买正版发生的侵权行为,与本站无关。
5、本站部分资源存放于百度网盘或其他网盘中,请提前注册好百度网盘账号,下载安装百度网盘客户端或其他网盘客户端进行下载;
6、本站部分资源文件是经压缩后的,请下载后安装解压软件,推荐使用WinRAR和7-Zip解压软件。
7、如果本站提供的资源侵犯到了您的权益,请邮件联系: 442469558@qq.com 进行处理!

猪小侠源码-最新源码下载平台 WordPress教程 wordpress ripro 用户信息修改模块 http://www.20zxx.cn/16838/wordpres/wordpressq.html

猪小侠源码,优质资源分享网

常见问题
  • 本站所有资源版权均属于原作者所有,均只能用于参考学习,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担
查看详情
  • 最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,建议提前注册好百度网盘账号,使用百度网盘客户端下载
查看详情

相关文章

官方客服团队

为您解决烦忧 - 24小时在线 专业服务