typecho博客追番插件Mo66CnBilifan发布

typecho博客追番插件Mo66CnBilifan发布

admin
2021-01-27 / 29 评论 / 9,106 阅读 / 正在检测是否收录...

自从typecho后就一直没有找到b站追番的主题插件,于是前几天就下定决心自己写一个bilibili追番插件。今天刚刚写完项目已经放到github上面了,需要的可以去下载,下面是安装教程

码云:https://gitee.com/mo_66/Mo66CnBilifan.git

安装&使用

安装方式

将文件解压后将文件夹重命名为Mo66CnBilifan

上传到网站的/usr/plugins目录下

登录博客后台:控制台-插件-将Mo66CnBilifan插件启用

设置方式

点击插件设置,将你b站的uid输入进去保存

然后进入你的主题目录下/usr/themes/主题/

不管是独立页面还是要插入到其他页面,方式都差不多

我这里用独立页面,新建一个page_bilifan.php的文件,然后在文件中编辑,将你主题的page模板粘贴进去。接着找到合适的位置,将下面的代码粘贴进去即可

<div class="post-content"id="post-content">
    <?php Typecho_Plugin::factory('page_bilifan.php')->navBar(); ?>
</div>

handsome主题用户

这兼容页面据说是handsome客服给的,好像可以直接兼容,handsome用户们可以试试

  1. 在handsome主题目录下新建文件:page_bilifan.php
  2. 将下面的代码全部复制到page_bilifan.php文件中保存
<?php
/**
 * bilibili 追番
 *
 * @package custom
 */

/**
 * 本独立页面代码来自:https://mo66.cn/archives-42.html
 * 仅仅做了与handsome主题的兼容,感谢原作者
 */
?>
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('component/header.php'); ?>

<!-- aside -->
<?php $this->need('component/aside.php'); ?>
<!-- / aside -->

<style>
    .Mo66CnBilifanItem{
        line-height: 20px;
        width: 100%;
        overflow: hidden;
        display: block;
        padding: 10px;
        height:120px;
        background: #fff;
        color: #14191e;
    }
    .Mo66CnBilifanItem:hover{
        color: #14191e;
        opacity: 0.8;
        filter: saturate(150%);
        -webkit-filter: saturate(150%);
        -moz-filter: saturate(150%);
        -o-filter: saturate(150%);
        -ms-filter: saturate(150%);
    }
    .Mo66CnBilifanItem img{
        height:100%;
        display:inline-block;
        float:left;
        margin: 0 5% 0 0!important;
    }
    .Mo66CnBilifanItem .textBox{
        text-overflow:ellipsis;overflow:hidden;
        position: relative;
        z-index: 1;
        height: 100%;
    }
    .Mo66CnBilifanItem .jinduBG{
        height:16px;
        width: 100%;
        background-color:gray;
        display:inline-block;
        border-radius:4px;
        position: absolute;
        bottom: 3px;
    }
    .Mo66CnBilifanItem .jinduFG
    {
        height:16px;
        background-color:#ff8c83;
        border-radius:4px;
        position: absolute;
        bottom: 0px;
        z-index: 1;
    }
    .Mo66CnBilifanItem .jinduText
    {
        width:100%;height:auto;
        text-align:center;
        color:#fff;
        line-height:15px;
        font-size:15px;
        position: absolute;
        bottom: 0px;
        z-index: 2;
    }
    @media screen and (max-width:1000px) {
        .Mo66CnBilifanItem{
            width:95%;
        }
    }
</style>
<!-- <div id="content" class="app-content"> -->
<a class="off-screen-toggle hide"></a>
<main class="app-content-body <?php echo Content::returnPageAnimateClass($this); ?>">
    <div class="hbox hbox-auto-xs hbox-auto-sm">
        <!--文章-->
        <div class="col center-part">
            <!--标题下的一排功能信息图标:作者/时间/浏览次数/评论数/分类-->
            <?php echo Content::exportPostPageHeader($this,$this->user->hasLogin(),true); ?>
            <div class="wrapper-md" id="post-panel">
                <?php Content::BreadcrumbNavigation($this, $this->options->rootUrl); ?>
                <!--博客文章样式 begin with .blog-post-->
                <div id="postpage" class="blog-post">
                    <article class="single-post panel">
                        <!--文章页面的头图-->
                        <?php echo Content::exportHeaderImg($this); ?>
                        <!--文章内容-->
                        <div class="wrapper-lg" id="post-content">
                            <div class="post-content" id="post-content" style="display: flow-root">
                                <?php Typecho_Plugin::factory('page_bilifan.php')->navBar(); ?>
                            </div>
                            <?php Content::postContentHtml($this,
                                $this->user->hasLogin()); ?>
                            <?php Content::pageFooter($this->options) ?>
                        </div>
                    </article>
                </div>
                <!--评论-->
                <?php $this->need('component/comments.php') ?>
            </div>
        </div>
        <!--文章右侧边栏开始-->
        <?php $this->need('component/sidebar.php'); ?>
        <!--文章右侧边栏结束-->
    </div>
</main>

<!-- footer -->
<?php $this->need('component/footer.php'); ?>
<!-- / footer -->

现在还需要在博客中创建一个新的独立页面:点击博客后台的管理-独立页面新增,将模板改成追番列表然后进行发布就可以了

注意事项

哔哩哔哩的追番要设置为公开

README

介绍

支持作者

如果你觉得这个项目对您有所帮助,不妨考虑小额支持我一下
支持作者

版本历史

version:1.0.1(首版本)

支持将b站的追番获取展示到页面上

根据屏幕大小缩放卡片

6

打赏

评论 (29)

取消
  1. 头像
    晨狐戏语
    Windows 10 · Google Chrome

    感谢分享 get一个新姿势

    回复
  2. 头像
    sunlife
    Windows 10 · Google Chrome

    补充一下,handsome其实没有那么麻烦,可省去1,2步,直接建一个新的独立页面模板改成追番列表就可以了

    回复
  3. 头像
    sunlife
    Windows 10 · Google Chrome

    补充一下,handsome其实没有那么麻烦,可省去1,2步,直接建一个新的独立页面模板改成追番列表就可以了

    回复
  4. 头像
    22攻略
    Windows 7 · FireFox

    非常感谢你分享这篇文章,我从中学到了很多新的知识。

    回复
  5. 头像
    hy
    Windows 10 · Google Chrome

    请问出现500 fwrite(): Argument #1 ($stream) must be of type resource, bool given,怎么办

    回复
    1. 头像
      admin 作者
      Windows 10 · Google Chrome
      @ hy

      这个bug我好像没遇到过,具体原因我就不清楚啦,检查一下是不是哪步设置错了

      回复
  6. 头像
    丑丑呀
    Windows 10 · Google Chrome

    缓存文件需要有读写权限,否则不会有data.json文件,

    回复
    1. 头像
      admin 作者
      Windows 10 · Google Chrome
      @ 丑丑呀

      是的呀,没有读写权限的话没办法写入数据

      回复
  7. 头像
    淄博测漏
    Windows 10 · Google Chrome

    真厉害,赞一个

    回复
  8. 头像
    残雪
    Windows 10 · Google Chrome

    如何获取cookie

    回复
    1. 头像
      admin 作者
      Windows 10 · Google Chrome
      @ 残雪

      https://mo66.cn/archives-48.html

      回复
  9. 头像
    limo
    Android · FireFox

    有没有WordPress用的

    回复
  10. 头像
    防xxx
    Windows 10 · Google Chrome

    感谢分享 赞一个

    回复
  11. 头像
    gojosa
    Windows 10 · Google Chrome

    为什么我改了插件里的css的height没用

    回复
  12. 头像
    gojosa
    Windows 10 · Google Chrome

    为什么我改了插件里的css的height没用

    回复
  13. 头像
    热月
    Windows 10 · Google Chrome

    大佬,请问出现如下报错怎么办,Warning: mb_convert_encoding() expects parameter 1 to be string, array given in

    回复
  14. 头像
    不知名
    Windows 10 · Google Chrome

    感谢大佬

    回复
  15. 头像
    站元素主机
    Windows 10 · FireFox

    感谢分享 赞一个

    回复
  16. 头像
    ScarletDor
    Windows 10 · Google Chrome

    好难过,插件不显示,cookie是哪一个呢

    回复
  17. 头像
    dyt5AAUi
    Windows 10 · Google Chrome

    为啥在handsome的7.1版本没显示呢。感谢大佬插件

    回复
  18. 头像
    桉蓝
    Windows 10 · Google Chrome

    大佬,cookie怎么获取啊

    回复
    1. 头像
      桉蓝
      Windows 10 · Google Chrome
      @ 桉蓝

      还有就是缓存怎么更新啊,我删掉了部分追番,我网站上的番剧好像并没有消失?

      回复
  19. 头像
    aipower
    Windows 10 · Google Chrome

    我有个问题,b站cookie如何获取?

    回复
  20. 头像
    xxx主机
    Windows 10 · FireFox

    真不错 赞一个

    回复
  21. 头像
    Mr.Y
    Windows 10 · Google Chrome

    这个好唉!B站看番用户狂喜.jpg

    回复
  22. 头像
    王光卫博客
    MacOS · Google Chrome

    好东西,B站爱好者福利

    回复
  23. 头像
    zeruns
    Windows 10 · Google Chrome

    厉害啊

    回复
    1. 头像
      admin 作者
      Windows 10 · Google Chrome
      @ zeruns

      嘿嘿嘿你也是嘛,你比我还要厉害的呢!

      回复
  24. 头像
    珂泽
    Android · Google Chrome

    这个不错啊,正好需要嘞

    回复