Skip to content

templates

YanQS edited this page Dec 13, 2025 · 1 revision

模板与样式

目录结构

  • includes/templates/:插件默认模板文件所在目录(reply.php、new_comment.php、pending.php)。
  • includes/templates/styles/{modern,plain,compact}/:按风格组织的样式模板(每个风格包含对应的模板文件)。

管理模板

  • 管理页面会展示 HTML 编辑器(支持 TinyMCE)。
  • “载入所选风格” 会从 includes/templates/styles/<style>/ 读取对应文件并尝试写入到 includes/templates/,若写入失败则保存到 pcn_templates 选项。
  • 保存时:插件会保留模板中包含的 PHP 源代码;但出于安全,后台的“预览”会在渲染前移除 PHP 以避免执行。

模板变量

  • 常用变量: {{blogname}}, {{parent_author}}, {{parent_content}}, {{reply_author}}, {{reply_content}}, {{comment_link}}, {{unsubscribe_url}}

自定义与回退

  • 建议在子主题或版本控制中保存自定义模板。若想禁用样式文件写入,请保证 includes/templates/ 为只读,这会促使插件使用数据库中的模板备份。

主页 (Home)中文English

安装与升级 (Installation and Upgrade)中文English

模板与样式 (Templates and Style)中文English

日志与Cron (logs&cron)中文English

国际化 (Localization)中文English

变更日志 (Changelog)中文English

Clone this wiki locally