Typecho评论显示当前操作系统以及浏览器信息方法!

项目地址 https://github.com/hakula139/UserAgent-for-Typecho

使用说明
1.解压后修改文件夹名为 UserAgent,将插件上传至网站目录的 /usr/plugins 下
2.在 Typecho 后台「插件管理」处启用插件
3.在需要显示的地方插入以下代码:

<?php UserAgent_Plugin::render($comments->agent); ?>

handsome主题添加范例 在 /handsome/component/comments.php 找到69 - 71行位置添加

        <span class="comment-author vcard">
          <b class="fn"><?php echo $author; ?></b><?php UserAgent_Plugin::render($comments->agent); ?>
          </span>

效果如图
Typecho评论显示当前操作系统以及浏览器

Last modification:November 29, 2021
如果觉得我的文章对你有用,请随意赞赏