User Guide

Complete guide to /admin/. All content is server-rendered; JavaScript only enhances interactions.

On this page

Modules

Module (?s=)Purpose
dashboardStats, recent posts/pages/users
postsList, create, edit, delete, AI translation
pagesStandalone pages (about, contact, docs)
metasCategories and tags, multilingual names, counts
polyTranslation groups and AI translation (when plugin is on)
notesPrivate notes
commentsComment moderation
usersRegistered users and roles (admin / subscriber)
attachmentsMedia library
themesSwitch theme, theme settings
layoutsSidebar blocks and their order per page type
upgradeVersion and one-click upgrade with automatic backup
pluginsEnable / disable / uninstall
marketInstall themes & plugins from the market
settingsSite, SEO, analytics, languages
toolsBackup, repair, cache

Disabled built-ins (notes, poly) disappear from the menu; third-party plugins with admin menus append plug_<id>.

Posts & pages

ye_contents stores both post and page rows:

FieldMeaning
title / slugTitle and URL segment; unique, must not use Router::RESERVED words
excerpt / contentExcerpt and Markdown body
description / keywordsSEO meta
statuspublish / draft; deleted_at soft delete is filtered in every front-end query
published_atPublish time (scheduling supported)
template / orderCustom template, page order
featured / allow_comment / passwordSticky, comments, password
words / viewsWord count, view count (written back by tools/sync-views.php)

URLs are /<slug>.html; /docs and /changelog also have clean URLs. Prefer admin delete (soft delete); a hard delete must also clean ye_relationships and recalculate ye_metas.count.

Taxonomies

  • Terms live in ye_metas (category|tag), relations in ye_relationships.
  • count is a precomputed column — never replace it with a live COUNT() subquery in list views (see performance).
  • Multilingual names use names_i18n (JSON) or name_en, aliases use slug_i18n.
  • Check references before deleting a term; recalculate counts after deleting posts.

Nav::defs() in core/Nav.php is the single source for top/foot navigation; label is a language key and links get the language prefix automatically.

OptionEffect
nav.hide_top / nav.hide_footHide items (JSON arrays)
nav.customAdd custom items (label / uri / zone / zh_only)

Add fixed columns in Nav::defs() and add matching keys to lang/zh_CN.php + lang/en_US.php. For one-off pages, create them under Pages and link via custom nav.

Themes & layouts

  • Themes reads themes/<id>/theme.json; switching writes theme.default.
  • Theme settings only collect declared settings fields into theme.options (JSON).
  • Layouts controls sidebar blocks per page type and their order; theme.sidebar_mode = flow / sticky.
  • After changing either, flush page/block caches and rebuild the baked home page (cache).

Plugins

  • Directory = manifest: plugins/<id>/plugin.php. Enabling runs idempotent migrations/ first, then sets plugin.<id>.enabled=1.
  • Disabling only stops registration, data stays. Uninstall: purge=1 removes own tables + options (with automatic backup), purge=0 keeps data.
  • Market accepts https packages only with mandatory SHA-256 verification; packages need a valid plugin.php / theme.json; run php -l on every file.
  • Bundled plugin list: quick start.

i18n & AI

  • Multilingual manages ye_poly_contents (group_id + lang); only status=publish rows appear on the front end.
  • The AI translate button uses one language per request + a concurrency lock + a session queue that auto-continues, so one request can never saturate PHP-FPM (1.2.2).
  • Overwrite translation re-translates existing languages but protects manual edits (manual_override); target-language validation retries and fails loudly instead of storing the source text (1.2.3).
  • Full details: i18n & AI translation.

Settings

config.inc.php (never in version control):

ConstantMeaning
DB_HOST / DB_PORT / DB_NAME / DB_USER / DB_PASSDatabase connection
DB_PREFIXTable prefix, ye_ by default
SECRETSessions and key encryption; rotating invalidates encrypted keys
TZ / SITE_LANG / DEBUGTimezone, default UI language, debug (production: false)

Site options (ye_options):

OptionMeaning
site.name / site.name_en / site.subtitle*Names and tagline
site.description / site.keywordsSEO meta
site.languages / site.default_langEnabled languages, base language
theme.default / theme.options / theme.sidebar_modeTheme and layout
home.landing / home.style / home.show_circleHome layout
nav.hide_top / nav.hide_foot / nav.customNavigation
stats.head / stats.foot / stats.posts_totalAnalytics slots, denormalised post total
market.sourceMarket manifest URL; empty = var/market/manifest.json
blog.disabled1 disables blog routes (categories/tags/archives/search) for a pure corporate site

Secrets belong in the admin UI, encrypted with SECRET, never echoed in plaintext; keep them out of logs, error pages and exports.

Tools

php -r 'chdir("/www/wwwroot/yecha.org"); require "config.inc.php"; require "core/bootstrap.php"; Cache::flush("pages"); Cache::flush("blocks");'
php tools/upgrade.php --component core --dry-run
php tools/upgrade.php --component core
php tools/sync-views.php
curl -s -H 'Host: example.com' https://127.0.0.1/ > /dev/null

Backup/upgrade/rollback: operations.

Writing conventions

  • Markdown body: ## / ### headings, tables, lists, quotes, ``lang fences, {#anchor}` explicit anchors.
  • Body is HTML-escaped first — do not embed HTML; for special layouts use a theme view or a core renderer (like the structured /changelog timeline).
  • File/function names use inline code; commands and config go in fenced blocks (language tags render as a corner badge).
  • Internal links: /<slug>.html, /en/<slug>.html for English; taxonomy links come from Poly::termUrl() — never hand-write language prefixes.