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

推荐订阅源

博客园_首页
N
News and Events Feed by Topic
P
Privacy International News Feed
The Hacker News
The Hacker News
Schneier on Security
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
Security Latest
Security Latest
L
LINUX DO - 最新话题
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
博客园 - 【当耐特】
博客园 - Franky
P
Privacy & Cybersecurity Law Blog
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
月光博客
月光博客
D
Docker
Webroot Blog
Webroot Blog
The GitHub Blog
The GitHub Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
W
WeLiveSecurity
S
Security Affairs
Martin Fowler
Martin Fowler
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Security Archives - TechRepublic
Security Archives - TechRepublic
Microsoft Azure Blog
Microsoft Azure Blog
C
CERT Recently Published Vulnerability Notes
B
Blog
L
Lohrmann on Cybersecurity
T
Threatpost
量子位
S
Schneier on Security
V
Visual Studio Blog
S
Securelist
T
The Exploit Database - CXSecurity.com
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
I
Intezer
Stack Overflow Blog
Stack Overflow Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 聂微东
小众软件
小众软件
罗磊的独立博客
雷峰网
雷峰网
Recorded Future
Recorded Future

半日闲

不知所措 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 // 足够大的数,确保包含所有文章
    ]);