Apple CMS (maccms10)

repository·master·Indexed 25 days ago

https://github.com/magicblack/maccms10

A lightweight, high-performance website building system optimized for PHP and MySQL environments. Built on the ThinkPHP 5.x kernel, it features an MVC architecture, a custom template engine, and powerful data acquisition capabilities. The system includes a comprehensive addon ecosystem with a cloud marketplace supporting RS256 directory signing, as well as integrated administrative tools for system monitoring, cache management, and visit statistics.

Tokens
30.8K
Snippets
13
Records
216
Agent score
83%

What's inside maccms10

  1. Overview of Apple CMS v10

    master

    Apple CMS (maccms10) is a high-performance website construction system designed for PHP and MySQL environments. It is optimized for speed and low resource consumption, making it suitable for standard virtual hosting.

    Key features include:

    • MVC Architecture: Uses a template-logic separation pattern to allow designers and developers to work independently.
    • Core Engine: Built on the tp5.x (ThinkPHP 5.x) kernel.
    • Template Engine: Features an extended template processing engine with built-in tags and a custom function tag interface.
    • Data Acquisition: Includes powerful custom collection (scraping/acquisition) capabilities.
    • Ease of Use: Designed with a simplified backend management module for intuitive operation.
  2. Understand the ThinkPHP 5.0 Directory Structure

    master

    The project follows a specific directory layout. Note that these names and structures can be modified depending on your entry file and configuration parameters.

    • www: WEB deployment directory (or subdirectory).
    • application: Application directory containing modules, configurations, and logic.
      • common: Public module directory.
      • module_name: Specific module directory containing config.php, common.php, controller/, model/, and view/.
      • config.php: Global application configuration.
      • route.php: Routing configuration.
      • database.php: Database configuration.
    • public: The WEB root directory accessible to the outside world.
      • index.php: The main entry file.
      • .htaccess: Apache rewrite rules.
    • thinkphp: The core framework system directory.
    • extend: Directory for extended class libraries.
    • runtime: Application runtime directory (must be writable).
    • vendor: Third-party libraries managed by Composer.
    • think: Command-line interface (CLI) entry file.
  3. Understand the MacCMS Architecture

    master

    MacCMS (苹果 CMS / MacCMS10) is a PHP and MySQL-based content management system. The application is divided into two primary entry points:

    • index module: The front-end visitor site, handling VOD (video on demand), articles, topics, comics, searches, and guestbooks.
    • admin module: The administrative backend for managing content, categories, collection (scraping), users, templates, and system parameters.

    Front-end display is controlled by files located in the template/ directory.

  4. Access Addon development and configuration documentation

    master

    The application/data/addon/ directory contains resources for developers and administrators working with plugins (Addons). Use the following documentation paths to guide your development or configuration tasks:

  5. Understand Addon Marketplace Installation Security

    master

    The Addon Marketplace implements a security model for remote installations:

    1. Signed Catalogs: One-click installations are handled via the new RS256 signed cloud catalogs using AddonCloudService (cloudCatalog and cloudInstall).
    2. Legacy API: The old api.maccms.com is currently in read-only mode. It is used to populate the local addon list via Addon::fetchLegacyOnlineCatalog and merge with downloaded metadata, but it cannot be used for new installations.
    3. Unsigned Packages: Remote installation of unsigned packages is disabled. The Addon::install method will reject any installation attempts that do not meet the signature requirements.
  6. Addon package security and constraints

    master

    When preparing addon zip files, observe the following security constraints:

    • Mandatory Verification: If a zip package includes signature files (package.sig or package.manifest.json), verification is mandatory even if require_local_signature is set to 0. A public key must be present for verification to succeed.
    • Path Restrictions: Zip entries are path-normalized. To prevent site root overlays, top-level directories such as application/ and static/ are blocked.
    • Integrity: The verifier hashes every listed file and rejects any file found in the zip that is not explicitly listed in the manifest.
  7. Identify key directory structures in MacCMS v10

    master

    Understanding the directory layout is essential for managing code, configuration, and assets. Key directories include:

    • application/: Contains core business logic (admin, index, api, common, extra, data, etc.).
    • application/extra/maccms.php: The primary configuration file.
    • application/data/admin_assistant/*.md: Knowledge base files for the admin assistant.
    • application/data/backup/database/: Default directory for database backups (governed by the maccms.db.backup_path setting).
    • runtime/: Stores cache, logs, and temporary files. This directory must be writable by the server but should not be directly accessible via the public web.
    • public/ (or your Site Web Root): Contains the entry points index.php and admin.php, as well as static and upload directories.
    • template/{template_dir}/: Contains front-end templates (governed by site.template_dir).
    • static/ or static_new/: Contains static assets for the admin and front-end.
    • vendor/ or thinkphp/: Framework core and dependencies; do not modify these.
    • addons/: Contains installed plugin files.
  8. Configure URL, SEO, and Routing

    master

    Manage how your content is accessed and indexed via the 系统 (System) menu:

    • URL 设置: Configure routing, pseudo-static (rewrite) rules, and URL patterns for different modules (Video, Article, Special Topic, etc.).
    • SEO 设置: Manage TDK (Title, Description, Keywords) for the homepage and categories, sitemaps, and push settings.
    • URL 推送: Manually or automatically push URLs to search engines.
  9. Manage and edit templates

    master

    Templates are managed via the Template Management menu (模版 → 模板管理 / menu/template).

    Directory Structure

    Template files are stored on the physical disk at: 站点根/template/{模板目录}/

    Inside the template directory, subdirectories correspond to the following system parameters:

    • Template pages: html (matches html_dir)
    • Ad fragments: ads (matches ads_dir)
    • General template directory: template_dir

    Note: PC and WAP versions may use separate directories (e.g., mob_template_dir).

    Workflow

    1. Verify Template Name: Go to System → Website Parameters (系统 → 网站参数) to confirm the currently active template name.
    2. Edit Files: Use the online editor in the admin panel or download .html, .js, or .css files via FTP for local editing.
    3. Implement Tags: Use the Tag Wizard (标签向导) to copy standard tags instead of writing field names manually to prevent syntax errors.
    4. Apply Changes: After editing, Clear Cache / Regenerate (if using static or page caching) and perform a hard refresh (Ctrl+F5) in your browser.
  10. Configure homepage sections

    master

    Customize the homepage layout by selecting, ordering, and styling specific content modules. For each module, you can specify the display status, order (1 = top), number of items (1–30), and specific styles.

    Available Modules (keys):

    KeyContent TypeOptional Settings
    heroVideo Hero/CarouselSort by: [最热 (Hot), 最新 (Latest), 评分 (Rating)]
    vod_hotVideoStyle: [默认 (Default), 轮播 (Carousel), 网格 (Grid), 列表 (List)]
    vod_latestVideoStyle: [默认 (Default), 轮播 (Carousel), 网格 (Grid), 列表 (List)]
    rank_weekVideoCycle: [日 (Day), 周 (Week), 月 (Month), 全部 (All)]
    art_listArticleStyle: [默认 (Default), 网格 (Grid), 列表 (List)]
    topic_listTopic
    live_listLive Stream
    manga_listMangaStyle: [默认 (Default), 轮播 (Carousel), 网格 (Grid), 列表 (List)]
    rank_modulesVideo (Multi-column)
    website_listWebsite
    gbook_listMessage/Interaction

    Advanced Filtering:

    • Module-to-Category Mapping: You can restrict a module to show only a specific category by specifying Module → Category.
    • Custom Modules: You can request additional modules by defining a Title, Content Type (Video/Article/Manga/Rank), Category (Name or ID), Item Count, and Style.