点击广告查看隐藏内容....
0.成品图

1.修改aside.php文件,新增如下代码,文件路径:usr/themes/Joe-master/public
2.修改core.php文件,底部新增,文件路径:usr/themes/Joe-master/core
/**
 * 显示用户等级,按邮箱
 */
function autvip($i){
    $db=Typecho_Db::get();
    $mail=$db->fetchAll($db->select(array('COUNT(cid)'=>'rbq'))->from('table.comments')->where('mail = ?', $i)/**->where('authorId = ?','0')**/);
    foreach ($mail as $sl){
        $rbq=$sl['rbq'];}
    if($rbq<1){
        echo '<span class="autlv aut-0">Lv.0</span>';
    }elseif ($rbq<10 && $rbq>0) {
        echo '<span class="autlv aut-1">Lv.1</span>';
    }elseif ($rbq<20 && $rbq>=10) {
        echo '<span class="autlv aut-2">Lv.2</span>';
    }elseif ($rbq<40 && $rbq>=20) {
        echo '<span class="autlv aut-3">Lv.3</span>';
    }elseif ($rbq<80 && $rbq>=40) {
        echo '<span class="autlv aut-4">Lv.4</span>';
    }elseif ($rbq<100 && $rbq>=80) {
        echo '<span class="autlv aut-5">Lv.5</span>';
    }elseif ($rbq>=100) {
        echo '<span class="autlv aut-6">Lv.6</span>';
    }
}
/**
*输出作者文章总数,可以指定
*/
function allpostnum($id){
    $db = Typecho_Db::get();
    $postnum=$db->fetchRow($db->select(array('COUNT(authorId)'=>'allpostnum'))->from ('table.contents')->where ('table.contents.authorId=?',$id)->where('table.contents.type=?', 'post'));
    $postnum = $postnum['allpostnum'];
    if($postnum=='0')
    {
        return '暂无文章';
    }
    else{
        return '文章 '.$postnum.' 篇';
    }
}
/* 通过邮箱生成头像地址 */
function _getAvatarUrlByMail($mail)
{
    $gravatarsUrl = Helper::options()->JCustomAvatarSource ? Helper::options()->JCustomAvatarSource : 'https://gravatar.ihuan.me/avatar/';
    $mailLower = strtolower($mail);
    $md5MailLower = md5($mailLower);
    $qqMail = str_replace('@qq.com', '', $mailLower);
    if (strstr($mailLower, "qq.com") && is_numeric($qqMail) && strlen($qqMail) < 11 && strlen($qqMail) > 4) {
        return 'https://thirdqq.qlogo.cn/g?b=qq&nk=' . $qqMail . '&s=100';
    } else {
        return $gravatarsUrl . $md5MailLower . '?d=mm';
    }
}{/tabs-pane}
{tabs-pane label="代码位置图片"}
{/tabs-pane}
3.修改include.php文件,底部新增,代码路径:usr/themes/Joe-master/public
<?php if ($this->options->JactiveUsers === 'on') : ?>
    <link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/custom.css'); ?>">
<?php endif; ?>{/tabs-pane}
{tabs-pane label="代码位置图片"}
{/tabs-pane}
4.新增custom.css文件,文件路径:usr/themes/Joe-master/assets/css
.autlv {
  font-size: 10px;
  color: #fff;
  display: inline-block;
  vertical-align: text-top;
  font-weight: normal;
  border-radius: 2px;
  line-height: 1.4;
  padding: 0 4px;
  margin-left: 5px;
  letter-spacing: 0px;
}
.aut-0 {
  background: #d1d5dc;
}
.aut-1 {
  background: #448EF6;
}
.aut-2 {
  background: #f6b044;
}
.aut-3 {
  background: #c444f6;
}
.aut-4 {
  background: #f69644;
}
.aut-5 {
  background-image: -webkit-linear-gradient(0deg, #3ca5f6 0%, #a86af9 100%);
}
.aut-6 {
  background: #f64444;
}
.aside-hunter-authors {
  background: var(--background);
  margin-bottom: 15px;
}
.aside-hunter-authors .vs {
  border-radius: 100%;
}
.aside-hunter-authors ul {
  padding: 14px;
  list-style: none;
  line-height: 2.5;
}
.aside-hunter-authors .item {
  border-bottom: 1px dashed #eee;
  margin-bottom: 0px;
  position: relative;
  padding-bottom: 4px;
}
.aside-hunter-authors .item .hunter-avatar {
  float: left;
  line-height: 55px;
}
.aside-hunter-authors .item .hunter-avatar .vatar {
  position: relative;
}
.aside-hunter-authors .item .hunter-avatar .vatar img {
  width: 45px;
  border-radius: 100%;
}
.aside-hunter-authors .item .hunter-avatar .vatar .va_v_honor {
  position: absolute;
  bottom: 3px;
  right: 0px;
  width: 18px;
  height: 18px;
}
.aside-hunter-authors .item .item-main {
  min-height: 60px;
  margin-left: 60px;
  color: #393939;
}
.aside-hunter-authors .item .item-main h4 {
  font-size: 12px;
  line-height: 1;
  margin-bottom: 7px;
  font-weight: normal;
  color: #999;
}
.aside-hunter-authors .item .item-main h4 i {
  font-style: normal;
  color: #aaa;
  margin: 0 5px;
}{/tabs-pane}
{tabs-pane label="代码位置图片"}
{/tabs-pane}
5.修改functions.php文件,底部新增,文件路径:usr/themes/Joe-master
// 互动读者
$JactiveUsers = new Typecho_Widget_Helper_Form_Element_Select(
    'JactiveUsers',
    array('off' => '关闭(默认)', 'on' => '开启'),
    'off',
    '是否开启互动读者',
    '介绍:显示评论相关用户'
);
$JactiveUsers->setAttribute('class', 'joe_content joe_custom'); // 如果后台无法展示该设置,将joe_custom修改为joe_other
$form->addInput($JactiveUsers);{/tabs-pane}
{tabs-pane label="代码位置图片"}
{/tabs-pane}
6.全量文件下载地址如下:
本文共 217 个字数,平均阅读时长 ≈ 1分钟
点击广告查看隐藏内容....
 
                                
             
         
                
这些突兀地出现在荒野中的草棚麦垛,绊住了风的腿,扯住了风的衣裳,缠住了风的头发,让它追不上前面的风。她撕扯,哭喊。喊得满天地都是风声。
我是奥尔加·伊滋卡,几颗子弹不要紧的!
作者厉害
看看
这个功能有需要,学习了
谢谢
谢谢
厉害
看看
闲着无聊就来加一个功能
666666
666
666
6666666666666666666
66666
太棒了!!!!!!
不错的
回复
不错的
当初
1
6666666
太赞了!!!!!!
太赞了!!!!!!
哦开心
66
看看