!
您也想出现在这里吗?点击联系我们吧!
点击投个广告吧
当前位置:首页>源码分享>B2源码> B2主题首页添加注册会员用户与付费会员展示

B2主题首页添加注册会员用户与付费会员展示

效果图:

B2主题首页添加注册会员用户与付费会员展示

第一步:

[gzh2v keyword="2374" key="2374110"]

在你的首页模块添加以下代码:

<div  class="  home_row home_row_1  module-qukuai  " style="background-color:;"> 
<div class="wrapper">
<div class="home-row-left content-area box b2-radius"> 
 <div class="hot-top wrapper layui-clear">
<span class="note"> 花 粉 </span>
<i class="tg-ph"></i>
<div class="left">
<a class="hover" id="lively_online" onmouseenter=lively_online()>最新注册</a>
<a class="" id="contribution" onmouseenter=contribution()>付费用户</a>
</div>
<div class="right">
<div class="right-overflow" id="yhturns" style="transform: translateY(0px);">
<div class="right-main">
<ul class="layui-clear top-ul">
<?php $usernames = $wpdb->get_results("SELECT ID,display_name, user_url FROM $wpdb->users ORDER BY ID DESC LIMIT 8");
foreach ($usernames as $username) {
    echo '<li>
    <a href="'.esc_html(get_home_url().'/users/'.$username->ID).'">
    <div class="list-img">
    <img src="'.get_avatar_url($username->ID).'" class="yuan">
    </div>
    <h3>
    ' . $username->display_name .'
    </h3>
    </a>
    </li>
    ';
    }
    ?>
</ul>
</div>

<div class="right-main">
<ul class="layui-clear top-ul">
<?php $usernames = $wpdb->get_results("SELECT user_id FROM $wpdb->usermeta where meta_key='zrz_vip' and meta_value='vip0' or meta_key='zrz_vip' and meta_value='vip1' or meta_key='zrz_vip'  and meta_value='vip2' or meta_key='zrz_vip' and meta_value='vip3' order by user_id desc limit 8");
foreach ($usernames as $username) {
    $userinfo = get_userdata($username->user_id);
    echo '<li>
    <a href="'.esc_html(get_home_url().'/users/'.$username->user_id).'">
    <div class="list-img">
    <img src="'.get_avatar_url($username->user_id).'" class="yuan">
    </div>
    <h3>
    ' .$userinfo->display_name.'
    </h3>
    </a>
    </li>
    ';
    }
    ?>
</ul>
</div>
</div>
</div>
</div>

<script type="text/javascript">
function lively_online() {
    document.getElementById('lively_online').className = 'hover';
    document.getElementById('contribution').className = ' ';
    document.getElementById('yhturns').style = 'transform: translateY(0px);';
    }
function contribution() {
    document.getElementById('lively_online').className = ' ';
    document.getElementById('contribution').className = 'hover';
    document.getElementById('yhturns').style = 'transform: translateY(-160px);';
    }
</script>
</div></div></div>

第二步:

在你的自定义CSS中添加以下样式代码:

/**用户排行榜开始*/.hot-top .left {
    float: left;
}
.hot-top .right .top-ul li a h3 {
    white-space: nowrap;
}
.hot-top .right {
    float: right;
}
img {
    border: none;
}
 
.hot-top {
    width: 1500px;
    margin-bottom: 25px;
    padding: 22px 20px;
    position: relative;
    height: 147px;
    overflow: hidden;
    border-radius: 10px 10px 10px 10px;
}
.hot-top .tg-ph {
    background-size: 100% 100%;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 2;
    display: block;
    width: 60px;
    height: 60px;
}
.hot-top .left {
    height: 100%;
}
.hot-top .left a {
    display: block;
    width: 121px;
    height: 45px;
    line-height: 45px;
    background: #f6f6f6;
    text-align: center;
    font-size: 15px;
    color: #989898;
    margin-bottom: 13px;
    cursor: pointer;
    border-radius: 10px;
}
.hot-top .left a:last-child {
    margin-bottom: 0;
}
.hot-top .left .hover {
    background: var(--b2color);
    color: #FFF;
    position: relative;
}
.hot-top .left .hover:after {
    content: "";
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid var(--b2color);
    position: absolute;
    top: 15.5px;
    right: -10px;
    z-index: 1;
}
.hot-top .right-main {
    height: 100%;
    overflow-y: auto;
    margin-bottom: 30px;
}
.hot-top .right-main:last-child {
    margin-bottom: 0px;
}
.hot-top .right-overflow {
    transition: 0.4s all;
    transform: translateY(0);
}
.hot-top .right {
    float: left;
    width: calc( 100% - 147px);
    margin-left: 26px;
    height: 100%;
}
.hot-top .right .top-ul {
    height: 130px;
    overflow: hidden;
}
.hot-top .right .top-ul li {
    width: 78px;
    float: center;
    margin:0px 20px;
    display:inline-block;
}
.hot-top .right .top-ul li:nth-child(10n) {
    margin-right: 0;
}
.hot-top .right .top-ul li a {
    display: block;
}
 
.hot-top .right .top-ul li a .list-img {
    width: 100%;
    height: 78px;
    line-height: 38px;
    text-align: center;
    border-radius: 10px;
}
.hot-top .right .top-ul li a .list-img img {
    width: 100%;
}
.hot-top .right .top-ul li a .list-img img:hover {
    opacity: 0.8;
}
.hot-top .right .top-ul li a h3 {
    margin-top: 7px;
    font-size: 13px;
    line-height: 25px;
    height: 25px;
    overflow: hidden;
    width: 100%;
    text-align: center;
}
.new-position {
    height: 780px;
}
.new-position .left {
    height: 100%;
    width: calc( ( 100% - 13px ) * 0.36 );
}
.new-position .right {
    width: calc( ( 100% - 13px ) * 0.64 );
    height: 100%;
    background: #FFF;
    padding: 17px 28px;
}
.new-position .layui-carousel > [carousel-item] > * {
    background: #FFF;
}
.new-position #index-lb {
    height: 300px;
}
.new-position #index-lb div div img {
    width: 100%;
    min-height: 100%;
}
.new-position .index-login {
    background: #FFF;
    margin-top: 13px;
    height: calc( 767px - 300px);
    padding: 25px 33px;
    position: relative;
}
span.note {
    position: absolute;
    top: 10px;
    right: -50px;
    z-index: 1;
    width: 140px;
    height: 20px;
    background: var(--b2color);
    color: #fff;
    line-height: 20px;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
    text-align: center;
    font-size: 12px;
}
img.rela {
    position: absolute;
    left: 52px;
    z-index: 2;
    /* right: 50px; */    top: 58px;
    height: 25px;
    width: 25px;
}
/*头像呼吸光环和鼠标悬停旋转放大开始*/img.yuan {
    border-radius: 50%;
    animation: light 4s ease-in-out infinite;
    transition: 2s;
}
img.yuan:hover {
    transform: scale(1) rotate(720deg);
}
}
/*头像呼吸光环和鼠标悬停旋转放大结束*//**用户排行榜结束*/

[/gzh2v]

第三步:

刷新浏览器缓存查看效果

文章链接:https://sjcnh.cn/2374.html
文章标题:B2主题首页添加注册会员用户与付费会员展示
文章版权:@花醉 所发布的内容,部分为原创文章,转载请注明来源,网络转载文章如有侵权请联系我们!我们将在24小时内极速处理!
本文最后更新发布于2024年12月16日 0时35分17秒,某些文章具有时效性,若有错误或已失效,请在下方留言或联系:841134898@qq.com

您已阅读完《推荐(共43篇)》专题的第 41 篇。您可以继续阅读该专题下面的其它文章:

本文声明 本站上的部份代码,教程,软件,插件来自会员发布以及互联网收集,不代表本站立场,仅供网友个人学习交流或测试研究使用,未经原版权作者许可,禁止用于任何商业途径!请用户仔细辨认内容的真实性,避免上当受骗!本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请在下载24小时内删除!若您喜欢本文可附上原文链接随意转载。如无意侵害了您的权益,请发送邮件841134898@qq.com 或点击右侧 私信:花醉 反馈,我们将尽快处理。如果遇到付费才可观看的文章,建议升级终身VIP。全站所有资源“任意下免费看”。本站资源少部分采用7z压缩,为防止有人压缩软件不支持7z格式,建议下载7-zip。zip、rar解压,建议下载WinRAR。

给TA赞助
共{{data.count}}人
人已赞助
!
您也想出现在这里吗?点击联系我们吧!
点击投个广告吧
本文共收获 0 条评论,让我们看看您的独特见解。
  • QQ
  • 微博
    暂无讨论,说说你的看法吧
个人中心

有新商品 购物车

有可用券 优惠劵
今日签到

有新私信 私信列表

有新消息 消息中心
快速搜索
关注我们
  • 手机扫码打开网页

  • 微信公众号

语言切换
返回顶部