阅读视图

Xc-Three主题 前台增加注册登录按钮

找到以下目录文件内的文字:<!-- 这里可以放很多东西 --> 这句文字注释,代码就放到这句文字下面(位子差不多在最底下)

默认左侧栏:Xc-Three/Miss/aside-left01.php
自定义左侧栏:Xc-Three/Miss/aside-left02.php

<!-- 登入 -->
<li>
    <?php if ($this->user->hasLogin()) : ?>
        <a class="link panel" href="#" rel="nofollow">
            <span class="Xc_balance"><?php $this->user->screenName(); ?></span>
            <svg class="icon-xl" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="15" height="15">
                <path d="M624.865 512.247L332.71 220.088c-12.28-12.27-12.28-32.186 0-44.457 12.27-12.28 32.186-12.28 44.457 0l314.388 314.388c12.28 12.27 12.28 32.186 0 44.457L377.167 848.863c-6.136 6.14-14.183 9.211-22.228 9.211s-16.092-3.071-22.228-9.211c-12.28-12.27-12.28-32.186 0-44.457l292.155-292.16z"></path>
            </svg>
        </a>
        <ul class="slides panel-body">
            <li>
                <?php if ($this->user->group == 'administrator' || $this->user->group == 'editor' || $this->user->group == 'contributor') : ?>
                    <a class="link" rel="noopener noreferrer nofollow" target="_blank" href="<?php $this->options->adminUrl("manage-posts.php"); ?>">管理文章</a>
                <?php endif; ?>
            </li>
            <li>
                <?php if ($this->user->group == 'administrator' || $this->user->group == 'editor') : ?>
                    <a class="link" rel="noopener noreferrer nofollow" target="_blank" href="<?php $this->options->adminUrl("manage-comments.php"); ?>">管理评论</a>
                <?php endif; ?>
            </li>
            <li>
                <?php if ($this->user->group == 'administrator') : ?>
                    <a class="link" rel="noopener noreferrer nofollow" target="_blank" href="<?php $this->options->adminUrl("options-theme.php"); ?>">修改外观</a>
                <?php endif; ?>
            </li>
            <li>
                <a class="link" rel="noopener noreferrer nofollow" target="_blank" href="<?php $this->options->adminUrl(); ?>">进入后台</a>
            </li>
        </ul>
    <?php else : ?>

<li>
    <a class="link panel" href="#" rel="nofollow" target="">
        <span class="Xc_balance">用户登录</span><svg class="icon-xl" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="15" height="15">
            <path d="M624.865 512.247L332.71 220.088c-12.28-12.27-12.28-32.186 0-44.457 12.27-12.28 32.186-12.28 44.457 0l314.388 314.388c12.28 12.27 12.28 32.186 0 44.457L377.167 848.863c-6.136 6.14-14.183 9.211-22.228 9.211s-16.092-3.071-22.228-9.211c-12.28-12.27-12.28-32.186 0-44.457l292.155-292.16z"></path>
        </svg></a>
    <ul class="slides panel-body panel-box" style="display: none;">
        <li>
            <a class="link" href="<?php $this->options->adminUrl('login.php'); ?>" target="_blank" rel="noopener noreferrer nofollow">登录</a>
            <?php if ($this->options->allowRegister) : ?>
                <a class="link" href="<?php $this->options->adminUrl('register.php'); ?>" target="_blank" rel="noopener noreferrer nofollow">注册</a>
            <?php endif; ?>
        </li>
    </ul>
</li>

<?php endif; ?>
</li>
  •  

Typecho主题模板 Xc-Three主题

Xc-Three

主题名字:Xc-Three
支持环境:PHP 8.0 8.1 8.2
支持全站Pjax无刷新加载
使用服务器搭建,虚拟主机不可用

{collapse}
{collapse-item label=" 授权方法" open}

主题采用单域名授权,需绑定一个授权域名,无限每7天可自助免费更换一次,后续升级版本均为免费

已购买用户 推荐人购买可获得30元奖励,未购买用户 推荐人购买可获得10元奖励,(提供推荐聊天截图)

当前主题售价128RMB,联系QQ:70027750(同微信)没想好购买不要添加

{/collapse-item}
{/collapse}

{collapse}
{collapse-item label=" 主题定制" open}

如果你觉得主题有加密授权的存在让你没有安全感

可以找我谈,我可以帮你写主题,功能外观也可与本站相同,加钱世界可及

接typecho主题定制,功能定制,主题美化

{/collapse-item}
{/collapse}

{collapse}
{collapse-item label=" 使用须知" open}

售后服务可帮你解决在使用本主题时遇到的问题,但不包含主机及 Typecho 安装、Typecho 的使用教程,如果你不会搭建,外加20¥可以帮你直接搭建好,加钱世界可及,避免扯皮。

因主题可复制性,个人使用可随意修改主题文件,还请勿泄露主题文件给他人,发现将不再提供后续服务,敬请谅解!

{/collapse-item}
{/collapse}

B站演示视频: https://www.bilibili.com/video/BV1X6zsYFE7T/

功能介绍
主题样式内置7种主题文章样式
多样式化顶部 侧栏 均可自定义内容
付费可见内置了一款免费的付费阅读插件,可对接当面付
评论样式内置2种评论区样式
邮箱推送有人评论回复都会给对方和站长发送邮件通知
置顶文章可在后台设置需要置顶显示的文章
pjax加载页面切换流畅度非常丝滑,几乎感觉不到卡顿
全局设置导航栏丶内容栏丶侧边栏都可以自定义宽度
侧边栏侧边栏可自定义显示和开关
字体内置多种页面字体和自定义字体
缩略图默认显示内置缩略图,也可自定义随机缩略图
懒加载图设置一个加载图,等图片完全加载出来了再显示文章的图
静态CDN可自定义网站的静态文件cdn加速
独立页面内置多种独立页面,留言板丶闪念丶友链丶壁纸丶导航丶归档
短代码编辑器多达40种丰富的短代码功能
其他功能还有很多其他功能,已本站为准,本站有的功能都有

 

{dotted startColor="#ff6c6c" endColor="#1989fa"/}

警告提示

{alert type="info"}警告提示{/alert}{alert type="success"}警告提示{/alert}{alert type="warning"}警告提示{/alert}{alert type="error"}警告提示{/alert}

消息提示

{message type="success" content=""/}
{message type="info" content=""/}
{message type="warning" content=""/}
{message type="error" content=""/}

云盘下载

{cloud title="默认网盘" type="default" url="" password=""/}

{cloud title="360网盘" type="360" url="" password=""/}

{cloud title="百度网盘" type="bd" url="" password=""/}

{cloud title="天翼网盘" type="ty" url="" password=""/}

{cloud title="诚通网盘" type="ct" url="" password=""/}

{cloud title="微云网盘" type="wy" url="" password=""/}

{cloud title="Github仓库" type="github" url="" password=""/}

{cloud title="蓝奏网盘" type="lz" url="" password="123456"/}

超链按钮

自定义自己想要的颜色  {abtn color="#73aaff" href="https://www.baidu.com" radius="" content="超链按钮"/}

自定义颜色按钮 {abtn color="#20c6a7" href="https://www.baidu.com" radius="" content="超链按钮"/}

彩色虚线

{dotted startColor="#ff6c6c" endColor="#1989fa"/}
自定义虚线颜色,支持任意颜色

{dotted startColor="#1772e8" endColor="#4cd327"/}

回复可见

隐藏内容,请前往内页查看详情

进度条

{progress percentage="" color="#ff6c6c"/}

自定义颜色

{progress percentage="30%" color="#3a9aee"/}

3行3列的表格

表头表头表头
表格表格表格
表格表格表格
表格表格表格

代码块

const obj = {
    name: 'hi',
    age: 18
}
// 判断某个属性是否在对象里
console.log('name' in obj)
// 删除对象某个属性
console.log(delete obj.name)
// 将对象的属性名提取成数组
console.log(Object.keys(obj))

Tabs标签页

{tabs}{tabs-pane label="标签一"}啊哈哈哈哈我是大傻逼!{/tabs-pane}{tabs-pane label="标签二"}啊啊啊啊啊!哦哦哦哦哦?哈哈哈哈哈!{/tabs-pane}{/tabs}

时间轴

{timeline}{timeline-item color="#19be6b"} 1.0.0版本正式上线{/timeline-item}{timeline-item color="#19be6b"} 更新2.0.0版本{/timeline-item}{timeline-item color="#ed4014"} 删库跑路{/timeline-item}{/timeline}

跑马灯

{lamp/}

折叠面板

{collapse}{collapse-item label="折叠标题一" open} 折叠内容一{/collapse-item}{collapse-item label="折叠标题二"} 折叠内容二{/collapse-item}{/collapse}

  •  

2024最新QQ昵称获取 官方接口

官方接口最新获取QQ昵称,解决编码问题

<?php

// 设置跨域和返回格式
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: Content-Type");
header('Content-type: application/json;charset=utf-8');

// 如果没有通过 GET 参数传入则使用此默认值
$qq = isset($_GET['qq']) ? $_GET['qq'] : '70027750';

function getUserInfo($qq)
{
  $curl = curl_init();
  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://users.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg?uins=' . $qq,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_POSTFIELDS => '------WebKitFormBoundaryYTwvlk5brGmyD3Mn',
    CURLOPT_HTTPHEADER => array(
      'Content-Type: multipart/form-data; boundary=---012345678912345678912312',
    ),
  ));
  $response = curl_exec($curl);
  $encode = mb_detect_encoding($response, array("ASCII", 'UTF-8', "GB2312", "GBK", 'BIG5'));
  $response = mb_convert_encoding($response, 'UTF-8', $encode);
  $data = json_decode(substr($response, 17, -1), true);

  // 返回的用户信息
  $userInfo = array(
    'name' => isset($data[$qq][6]) ? $data[$qq][6] : '',
    'mail' => $qq . '@qq.com',
    'avatar' => isset($data[$qq][0]) ? str_replace('http://', 'https://', $data[$qq][0]) : '',
    'qzone' => 'https://user.qzone.qq.com/' . $qq,
    'imgurl' => 'https://q1.qlogo.cn/g?b=qq&nk=' . $qq . '&s=40',
    'imgurl1' => 'https://q1.qlogo.cn/g?b=qq&nk=' . $qq . '&s=100',
    'imgurl2' => 'https://q1.qlogo.cn/g?b=qq&nk=' . $qq . '&s=140',
    'imgurl3' => 'https://q1.qlogo.cn/g?b=qq&nk=' . $qq . '&s=640',
    'by' => 'Miss君',
    'blog' => '博客:www.tmetu.cn',
  );

  return $userInfo;
}

// 获取用户信息
$userInfo = getUserInfo($qq);

// 构建返回的结果数组
$result = array(
  'code' => 200,
  'qq' => $qq,
  'data' => $userInfo,
  'time' => date('Y-m-d H:i:s') // 添加当前时间戳
);

// 输出 JSON 格式的结果
echo json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);

输出格式

{
    "code": 200,
    "qq": "70027750",
    "data": {
        "name": "Miss",
        "mail": "70027750@qq.com",
        "avatar": "https://qlogo3.store.qq.com/qzone/70027750/70027750/100",
        "qzone": "https://user.qzone.qq.com/70027750",
        "imgurl": "https://q1.qlogo.cn/g?b=qq&nk=70027750&s=40",
        "imgurl1": "https://q1.qlogo.cn/g?b=qq&nk=70027750&s=100",
        "imgurl2": "https://q1.qlogo.cn/g?b=qq&nk=70027750&s=140",
        "imgurl3": "https://q1.qlogo.cn/g?b=qq&nk=70027750&s=640",
        "by": "Miss君",
        "blog": "博客:www.tmetu.cn"
    },
    "time": "2024-08-30 00:11:20"
}
  •  

简约系PHP授权系统

Test

一款简约系PHP授权系统

  1. 支持用户等级判断,不一样的等级添加授权需要不一样的价格。
  2. 后台生成余额卡密,卡密可充值余额,余额可添加授权。
  3. 后台生成授权卡密,卡密可兑换添加授权。
  4. 前台支持查询授权是否为正版授权。
  5. 前台支持输入域名+qq+授权码下载源码。
  •  

思源宋,小米官方字体 css调用

偶然发现小米官网的字体无防盗链 可以直接使用,而且小米还储存了思源宋体

为什么用别人的字体?本地储存字体加载起来很慢,自己服务器慢的话那就可想而知了,所以我们可以利用小米官网储存的字体加速,看链接就知道这是小米官网,放心使用~

链接中的400,600,700 可以去除其中一个,分别对应字体的粗细,看自己需求

演示站: https://tmetu.cn/

小米字体

//css引用 
<link rel="stylesheet" href="https://font.sec.miui.com/font/css?family=MiSans:400,700:MiSans" />

//css调用
* {font-family: MiSans}

思源宋字体

//css引用 
<link rel="stylesheet" href="https://font.sec.miui.com/font/css?family=Source_Han_Serif:400,600:Source_Han_Serif" />

//css调用
* {font-family: Source Han Serif}

程序员专用字体

//css引用 
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,700,700i" />

//css调用
* {font-family: Open Sans}
  •  

给网站顶部加一个进度条(适用于Pjax)

很多网站使用了Pjax无刷新加载 顶部没有页面加载进度,为了美观丶流畅感觉可以加进去,分享写个教程给大家

首先创建一个js文件引入(把以下js代码放进去)
注意:引入到jquery.js的下面

!(function (n, e) {
  "function" == typeof define && define.amd
    ? define(e)
    : "object" == typeof exports
    ? (module.exports = e())
    : (n.NProgress = e());
})(this, function () {
  function n(n, e, t) {
    return e > n ? e : n > t ? t : n;
  }
  function e(n) {
    return 100 * (-1 + n);
  }
  function t(n, t, r) {
    var i;
    return (
      (i =
        "translate3d" === c.positionUsing
          ? { transform: "translate3d(" + e(n) + "%,0,0)" }
          : "translate" === c.positionUsing
          ? { transform: "translate(" + e(n) + "%,0)" }
          : { "margin-left": e(n) + "%" }),
      (i.transition = "all " + t + "ms " + r),
      i
    );
  }
  function r(n, e) {
    var t = "string" == typeof n ? n : o(n);
    return t.indexOf(" " + e + " ") >= 0;
  }
  function i(n, e) {
    var t = o(n),
      i = t + e;
    r(t, e) || (n.className = i.substring(1));
  }
  function s(n, e) {
    var t,
      i = o(n);
    r(n, e) &&
      ((t = i.replace(" " + e + " ", " ")),
      (n.className = t.substring(1, t.length - 1)));
  }
  function o(n) {
    return (" " + (n.className || "") + " ").replace(/\s+/gi, " ");
  }
  function a(n) {
    n && n.parentNode && n.parentNode.removeChild(n);
  }
  var u = {};
  u.version = "0.2.0";
  var c = (u.settings = {
    minimum: 0.08,
    easing: "ease",
    positionUsing: "",
    speed: 200,
    trickle: !0,
    trickleRate: 0.02,
    trickleSpeed: 800,
    showSpinner: !0,
    barSelector: '[role="bar"]',
    parent: "body",
    template:
      '<div class="bar" role="bar"><div class="peg"></div></div></div>'
  });
  (u.configure = function (n) {
    var e, t;
    for (e in n) (t = n[e]), void 0 !== t && n.hasOwnProperty(e) && (c[e] = t);
    return this;
  }),
    (u.status = null),
    (u.set = function (e) {
      var r = u.isStarted();
      (e = n(e, c.minimum, 1)), (u.status = 1 === e ? null : e);
      var i = u.render(!r),
        s = i.querySelector(c.barSelector),
        o = c.speed,
        a = c.easing;
      return (
        i.offsetWidth,
        l(function (n) {
          "" === c.positionUsing && (c.positionUsing = u.getPositioningCSS()),
            f(s, t(e, o, a)),
            1 === e
              ? (f(i, { transition: "none", opacity: 1 }),
                i.offsetWidth,
                setTimeout(function () {
                  f(i, { transition: "all " + o + "ms linear", opacity: 0 }),
                    setTimeout(function () {
                      u.remove(), n();
                    }, o);
                }, o))
              : setTimeout(n, o);
        }),
        this
      );
    }),
    (u.isStarted = function () {
      return "number" == typeof u.status;
    }),
    (u.start = function () {
      u.status || u.set(0);
      var n = function () {
        setTimeout(function () {
          u.status && (u.trickle(), n());
        }, c.trickleSpeed);
      };
      return c.trickle && n(), this;
    }),
    (u.done = function (n) {
      return n || u.status ? u.inc(0.3 + 0.5 * Math.random()).set(1) : this;
    }),
    (u.inc = function (e) {
      var t = u.status;
      return t
        ? ("number" != typeof e &&
            (e = (1 - t) * n(Math.random() * t, 0.1, 0.95)),
          (t = n(t + e, 0, 0.994)),
          u.set(t))
        : u.start();
    }),
    (u.trickle = function () {
      return u.inc(Math.random() * c.trickleRate);
    }),
    (function () {
      var n = 0,
        e = 0;
      u.promise = function (t) {
        return t && "resolved" !== t.state()
          ? (0 === e && u.start(),
            n++,
            e++,
            t.always(function () {
              e--, 0 === e ? ((n = 0), u.done()) : u.set((n - e) / n);
            }),
            this)
          : this;
      };
    })(),
    (u.render = function (n) {
      if (u.isRendered()) return document.getElementById("nprogress");
      i(document.documentElement, "Progress-bar");
      var t = document.createElement("div");
      (t.id = "nprogress"), (t.innerHTML = c.template);
      var r,
        s = t.querySelector(c.barSelector),
        o = n ? "-100" : e(u.status || 0),
        l = document.querySelector(c.parent);
      return (
        f(s, {
          transition: "all 0 linear",
          transform: "translate3d(" + o + "%,0,0)"
        }),
        c.showSpinner || ((r = t.querySelector(c.spinnerSelector)), r && a(r)),
        l != document.body && i(l, "nprogress-custom-parent"),
        l.appendChild(t),
        t
      );
    }),
    (u.remove = function () {
      s(document.documentElement, "Progress-bar"),
        s(document.querySelector(c.parent), "nprogress-custom-parent");
      var n = document.getElementById("nprogress");
      n && a(n);
    }),
    (u.isRendered = function () {
      return !!document.getElementById("nprogress");
    }),
    (u.getPositioningCSS = function () {
      var n = document.body.style,
        e =
          "WebkitTransform" in n
            ? "Webkit"
            : "MozTransform" in n
            ? "Moz"
            : "msTransform" in n
            ? "ms"
            : "OTransform" in n
            ? "O"
            : "";
      return e + "Perspective" in n
        ? "translate3d"
        : e + "Transform" in n
        ? "translate"
        : "margin";
    });
  var l = (function () {
      function n() {
        var t = e.shift();
        t && t(n);
      }
      var e = [];
      return function (t) {
        e.push(t), 1 == e.length && n();
      };
    })(),
    f = (function () {
      function n(n) {
        return n
          .replace(/^-ms-/, "ms-")
          .replace(/-([\da-z])/gi, function (n, e) {
            return e.toUpperCase();
          });
      }
      function e(n) {
        var e = document.body.style;
        if (n in e) return n;
        for (
          var t, r = i.length, s = n.charAt(0).toUpperCase() + n.slice(1);
          r--;

        )
          if (((t = i[r] + s), t in e)) return t;
        return n;
      }
      function t(t) {
        return (t = n(t)), s[t] || (s[t] = e(t));
      }
      function r(n, e, r) {
        (e = t(e)), (n.style[e] = r);
      }
      var i = ["Webkit", "O", "Moz", "ms"],
        s = {};
      return function (n, e) {
        var t,
          i,
          s = arguments;
        if (2 == s.length)
          for (t in e)
            (i = e[t]), void 0 !== i && e.hasOwnProperty(t) && r(n, t, i);
        else r(n, s[1], s[2]);
      };
    })();
  return u;
});

在创建一个css文件 引入(把以下css代码放进去)

#nprogress{pointer-events:none}
#nprogress .bar{background:#73aaff;position:fixed;z-index:99999;top:0;left:0;width:100%;height:2px;}
#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;opacity:1;transform:rotate(3deg) translate(0,-4px);}

最后加入pjax 重载函数

$(document).on('pjax:send', function() {
NProgress.start()
});

$(document).on("pjax:complete", function () {
NProgress.done();
});
  •