惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

半日闲

不知所措 Typecho1.3文章永久链接获取 Typecho仿百度响应式主题Xaink XA Note - 小A笔记 2025总结 又是一年1024程序员节 outlook账号保证安全必要的修改 如何申请并cf托管免费域名ip6.arpa 铭记历史、缅怀先烈、珍爱和平、开创未来 再上阳台山 Typecho用户注册后的邮件验证插件 Typecho同步分享文章到telegram频道插件PostToTelegram
主题XaInk支持Typecho1.3
小A · 2026-02-06 · via 半日闲

从Typecho发布新版1.3后,我自己冒冒失失的自己升级到1.3,整体看了下界面和文章显示没有什么问题,以为就没问题了,可以自动兼容1.3版本。

网友反馈了一些升级到1.3的一些问题后,自己也花时间查了一下,现在 github 升级到1.7.0,支持Typecho 1.3了。

碰到了一些问题,简单反馈下:

  • v1.3后分类获取不再支持Widget_Metas_Category::getAllChildren($mid),子分类需要自行去写方法获取,可以使用以下方法:

    function GetCategoryChildren($parentMid) {
      $children = [];
      $all = Widget::widget('Widget\Metas\Category\Rows');
      
      if ($all) {
          while ($all->next()) {
              if ((int)$all->parent === (int)$parentMid) {
                  $children[] = [
                      'mid'   => (int)$all->mid,
                      'name'  => $all->name,
                      'permalink'   => $all->permalink,
                      'count' => (int)$all->count,
                      'description' => $all->description
                  ];
              }
          }
      }
      
      return $children;
    }
  • v1.3后在主题中获取的$this->PageRow不再为数组了,改为对象了,可以使用以下方法兼容:

    function GetPageRowValue($data, $key, $default = '') {
      if (is_array($data)) {
          return isset($data[$key]) ? $data[$key] : $default;
      } elseif (is_object($data)) {
          return isset($data->$key) ? $data->$key : $default;
      }
      return $default;
    }
  • v1.3使用Db查询获取文章使用$row = $widget->filter($row);不再自动注入分类信息、链接信息,需要使用Widget方法获取文章信息:

    $allPosts = \Typecho\Widget::widget('Widget\Contents\Post\Recent', [
      'pageSize' => 100000 // 足够大的数,确保包含所有文章
    ]);