Typecho Pigeon主题添加2233娘&小电视表情包

代码
722 10

下载表情包解压放在biaoqing文件夹

此处内容需要评论回复后(审核通过)方可阅读。

教程

打开Shortcode.php在合适的位置添加如下代码

        $content = preg_replace_callback('/\:\$\(\s*(.*?)\s*\)/is',
            array('feature', 'parseNiangBiaoqingCallback'), $content);
        $content = preg_replace_callback('/\:\%\(\s*(.*?)\s*\)/is',
            array('feature', 'parseBilibiliBiaoqingCallback'), $content);

打开feature.php在合适的位置添加如下代码

    /**
     * 2233娘表情回调函数
     *
     * @return string
     */
    public static function parseNiangBiaoqingCallback($match): string
    {
        return '<img class="biaoqing niang" src="' . ('' . customcdn . 'owo/biaoqing/niang/') . str_replace('%', '', urlencode($match[1])) . '.png" >';
    }
    /**
     * 小电视表情回调函数
     *
     * @return string
     */
    public static function parseBilibiliBiaoqingCallback($match): string
    {
        return '<img class="biaoqing bilibili" src="' . ('' . customcdn . 'owo/biaoqing/bilibili/') . str_replace('%', '', urlencode($match[1])) . '.png" >';
    }

打开style.css在最底部添加如下代码

.OwO .biaoqing.niang {
    margin-bottom: -0.125rem;
    min-height: 3.5rem;
    height: 1em;
}
.OwO .biaoqing.bilibili {
    margin-bottom: -0.125rem;
    min-height: 2.5rem;
    height: 1em;
}
.comment_excerpt img.biaoqing.niang, .cross-excerpt img.biaoqing.niang {
  margin-bottom: -0.125rem;
  min-height: 3.5rem;
  height: 1em;
}
.comment_excerpt img.biaoqing.bilibili, .cross-excerpt img.biaoqing.bilibili {
  margin-bottom: -0.125rem;
  min-height: 3rem;
  height: 1em;
}

如果你的表情框溢出了可以在style.css添加以下代码

.OwO .OwO-body .OwO-bar {
  width: 100%;
  height: 30px;
  border-top: 2px solid #ddd;
  background: #fff;
  border-radius: 0 0 4px 4px;
  white-space: nowrap;
  overflow-y: hidden;
}

打开OwO.json在合适的位置添加如下代码:

    "2233娘": {
    "type": "image",
    "container": [
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E7ACACE4B880.png",
            "data": ":~(2233娘_第一)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_第一"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E697A0E8AFAD.png",
            "data": ":~(2233娘_无语)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_无语"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E59090E9AD82.png",
            "data": ":~(2233娘_吐魂)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_吐魂"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E5A794E5B188.png",
            "data": ":~(2233娘_委屈)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_委屈"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E593ADE6B3A3.png",
            "data": ":~(2233娘_哭泣)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_哭泣"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E98381E997B7.png",
            "data": ":~(2233娘_郁闷)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_郁闷"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E59BB0E68391.png",
            "data": ":~(2233娘_困惑)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_困惑"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E7949FE6B094.png",
            "data": ":~(2233娘_生气)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_生气"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E59083E6838A.png",
            "data": ":~(2233娘_吃惊)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_吃惊"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E6B197.png",
            "data": ":~(2233娘_汗)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_汗"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E5A4A7E7AC91.png",
            "data": ":~(2233娘_大笑)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_大笑"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E5969DE6B0B4.png",
            "data": ":~(2233娘_喝水)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_喝水"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E880B6.png",
            "data": ":~(2233娘_耶)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_耶"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E58D96E8908C.png",
            "data": ":~(2233娘_卖萌)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_卖萌"
        },
        {
            "icon": "/assets/owo/biaoqing/niang/2233E5A898_E79691E997AE.png",
            "data": ":~(2233娘_疑问)",/* 把~替换成$ */
            "css": "niang",
            "text": "2233娘_疑问"
        }
    ]
},
    "小电视": {
    "type": "image",
    "container": [
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E78B97.png",
            "data": ":~(tv_狗)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_狗"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E4BAB2E4BAB2.png",
            "data": ":~(tv_亲亲)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_亲亲"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E581B7E7AC91.png",
            "data": ":~(tv_偷笑)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_偷笑"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E5868DE8A781.png",
            "data": ":~(tv_再见)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_再见"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E586B7E6BCA0.png",
            "data": ":~(tv_冷漠)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_冷漠"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E58F91E68092.png",
            "data": ":~(tv_发怒)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_发怒"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E58F91E8B4A2.png",
            "data": ":~(tv_发财)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_发财"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E58FAFE788B1.png",
            "data": ":~(tv_可爱)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_可爱"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E59090E8A180.png",
            "data": ":~(tv_吐血)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_吐血"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E59186.png",
            "data": ":~(tv_呆)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_呆"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E59195E59090.png",
            "data": ":~(tv_呕吐)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_呕吐"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E59BB0.png",
            "data": ":~(tv_困)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_困"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E59D8FE7AC91.png",
            "data": ":~(tv_坏笑)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_坏笑"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E5A4A7E4BDAC.png",
            "data": ":~(tv_大佬)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_大佬"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E5A4A7E593AD.png",
            "data": ":~(tv_大哭)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_大哭"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E5A794E5B188.png",
            "data": ":~(tv_委屈)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_委屈"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E5AEB3E7BE9E.png",
            "data": ":~(tv_害羞)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_害羞"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E5B0B4E5B0AC.png",
            "data": ":~(tv_尴尬)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_尴尬"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E5BEAEE7AC91.png",
            "data": ":~(tv_微笑)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_微笑"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E6809DE88083.png",
            "data": ":~(tv_思考)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_思考"
        },
        {
            "icon": "/assets/owo/biaoqing/bilibili/tv_E6838AE59093.png",
            "data": ":~(tv_惊吓)",/* 把~替换成% */
            "css": "bilibili",
            "text": "tv_惊吓"
        }
    ]
},
最后更新 2022-04-26
评论 ( 10 )
OωO
隐私评论
  1. 感谢大佬!

    25天前山东省临沂市回复
  2. 很好的文章

    6个月前越南回复
  3. liank

    来看看

    6个月前广西南宁市回复
  4. 7个月前浙江省杭州市回复
  5. Thanks! I using this theme too!

    7个月前越南回复
  6. 谢辞.

    是这一篇吗。我可能是因为json里填写了/assets/owo/biaoqing/bilibili/tv_xxxxxxxxxx.png,所以直接输出了这个链接。

    8个月前福建省莆田市仙游县回复
    1. @谢辞.

      是这个链接

      8个月前安徽省滁州市回复
      1. 谢辞.
        @白鸽

        我的没有显示出图片,而是显示/assets开头的/链接

        8个月前福建省莆田市仙游县回复
  7. 白嫖:$(2233娘_第一)

    9个月前广东省东莞市回复
  8. 来下表情包:$(2233娘_第一)

    9个月前福建省福州市回复