Jizhicms Content Management System

repository·2.0·Indexed 42 days ago

https://github.com/cherry-toto/jizhicms

A free and open-source PHP-based CMS supporting commercial use. It features online template management, multi-language localization, and a flexible field system. Built on the FrPHP framework, it includes a Model-View-Controller (MVC) architecture with a custom template engine, a flexible Model class for database operations, and integrated PHPMailer extras for NTLM authentication, XSS filtering, and ICS calendar event generation.

Tokens
8.9K
Snippets
24
Records
37
Agent score
53%

What's inside Jizhicms

  1. Implement Tag aggregation and details

    2.0

    JizhiCMS includes a built-in Tagging system. When publishing articles or products, you can assign tags. The system provides dedicated pages for tag aggregation and details:

    • Tag Aggregation Page: tags.html (located in the same directory as index.html in your template).
    • Tag Details Page: tags-details.html.
    • Controller: Home/TagsController.php.

    In your tags.html template, you can use {fun dump($pages)} to understand the pagination structure provided by the ArrayPage.php class.

    <!-- In your template, use the dump function to inspect pagination -->
    {fun dump($pages)}
  2. Filter HTML for XSS prevention with htmlfilter

    2.0

    The htmlfilter class provides a lightweight mechanism to remove potentially malicious HTML tags (like <script>) and attributes (like onclick=) to help prevent Cross-Site Scripting (XSS) attacks.

    Note: This is a simple filter and is not intended to be as comprehensive as specialized libraries like HTMLPurifier. It is best used as a quick way to sanitize user-supplied HTML before assigning it to a PHPMailer message body.

  3. Configure single-entry mode (index.php)

    2.0
    JizhiCMS supports a single-entry mode where both the front-end and back-end are accessed via index.php. You can specify a custom entry file, but by default, the back-end address is /index.php/admins. You can modify the admins back-end module identifier within index.php.
  4. Extend system functions via FunctionsExt.php

    2.0

    You can completely customize system functions by writing your own logic in a file named FunctionsExt.php. This allows you to override or extend the core functionality defined in conf/Functions.php without modifying the core files directly.

    /* Write your custom functions in FunctionsExt.php to override or extend conf/Functions.php */
  5. Install Jizhicms

    2.0

    Follow these steps to perform a fresh installation:

    1. Download the source code and extract it into your web root directory (e.g., www).
    2. Access the installation wizard via your browser:
      • Local environment: http://127.0.0.1/install/
      • Server environment: http://your-domain/install/
    3. Follow the step-by-step instructions in the wizard.
    4. During the first installation, you may choose to install backup data or test data.
    5. Security Step: Once installation is complete, delete the install folder from your root directory to prevent unauthorized access.
    http://127.0.0.1/install/
  6. Migrate Jizhicms to a New Server (Website Moving)

    2.0

    To move your existing Jizhicms installation to a new hosting environment, follow this procedure:

    1. Backup Database: Log in to the admin panel, navigate to 系统扩展 (System Extensions) $\rightarrow$ 数据库列表 (Database List), and click 备份数据库 (Backup Database).
    2. Prepare Files:
      • Delete all files inside the cache folder.
      • Place the original install folder from the official source code into your root directory.
    3. Download: Compress and download your entire root directory to your local machine.
    4. Upload: Upload the compressed package to the new server.
    5. Reinstall: Follow the standard Install Jizhicms steps.
    6. Restore Data: In the second step of the installation (where you enter database credentials), select your most recent database backup and proceed with the installation.
    7. Security Step: Delete the install folder from the root directory after completion.
  7. System Requirements for Jizhicms

    2.0

    To run Jizhicms, ensure your environment meets the following specifications:

    • PHP: Version 5.6 or higher (PHP 7.0+ is recommended; compatible up to PHP 7.4).
    • Database: MySQL 4.8 or higher. The database encoding must be utf-8 or utf8-general-ci.
    • Web Server: Supports Apache, Nginx, and IIS.
    • Configuration: The deployment environment must support pseudo-static (rewrite) rules.
    • OS: Linux is recommended, though Windows is supported. Using a control panel like BT (Baota) is suggested for cloud servers.
  8. Use custom template tags in HTML templates

    2.0

    The View engine supports several custom template tags that are parsed into PHP code during the rendering process. These allow for logic and data fetching directly within your HTML files.

    Supported Tags:

    • {include="filename"}: Includes another template file.
    • {loop table="name" ...}: A specialized loop for database tables.
    • {foreach $array as $item}: Standard PHP-style foreach loop.
    • {if condition} / {else if condition} / {else} / {/if}: Conditional logic.
    • {for start; condition; step} / {/for}: Standard for loops.
    • {screen molds="type" ...}: A powerful tag for filtering and displaying lists of items based on specific 'molds' (models/types).
    • {fun php_function()}: Executes a PHP function and echoes the result.
    • {__CONSTANT__}: Echoes a PHP constant.
    • {php php_code /}: Executes raw PHP code.
    • {$variable}: Echoes a PHP variable.
    • {!-- comment --}: Outputs the content inside the comment tags literally (useful for escaping).
    <!-- Example usage in a template -->
    <h1>{$title}</h1>
    
    {if $user_logged_in}
        <p>Welcome back!</p>
    {else}
        <p>Please log in.</p>
    {/if}
    
    {loop table="article" limit="10" as="v"}
        <div>{$v['title']}</div>
    {/loop}
  9. Identify the Admin URL

    2.0

    The administrator login URL is determined by the ADMIN_MODEL constant defined in the root index.php file. If ADMIN_MODEL is not defined, the default admin path is index.php/admins.

    To find the full URL, the system uses get_admin_url() which parses the root file for the constant.

  10. Verify Server Requirements for Jizhicms

    2.0

    Before installing, ensure your PHP environment meets the following criteria:

    • PHP Version: Must be 7.0 or higher.
    • Functions: The opendir function must not be disabled in your php.ini settings.
    • File Path: The $_SERVER['DOCUMENT_ROOT'] must not contain Chinese characters.
    • Permissions: The installation directory and database must be writable by the web server.