class_core.php Module Effectiveness White Paper

Source: Internet
Author: User
class_core.php Module Features white paper

Source/class/class_core.php is discuz!. General initialization Module program, which is almost referenced by all external code, before you start the plug-in design, you can first understand the approximate function of the module. Class_core.php has mainly completed the following tasks:

    • Different PHP and operating system environment to make a judgment and compatibility processing, so that discuz! Can run in a variety of different configurations of the server environment.
    • Initializes the constant in_discuz to TRUE, which is used for the judgment of the include or require follow-up program to avoid other programs being illegally referenced.
    • Read the absolute path of the community program, stored in the constant discuz_root.
    • Load the required base Function library source/function/function_core.php.
    • The database connection is established through the database account information provided in the config/config_global.php. discuz! Support the prefix of the data table, if you want to get the full name of the table, you can use "db::table (' tablename ')" mode.
    • Determine if the user is logged in, such as login tag $_g[' uid '] is not 0, and will be $_g[' username ' (added addslashes user name, can be used for non-modified insert database), $_g[' member ' [' username '] (The original user name, can be used for the page display), $_g[' member ' [' Password '] (user password MD5 string) and other user information assignment, other users information stored in $_g[' member '], more information can be through the "getuserprofile () Gets
    • To determine the user administrative rights, mark the administrative permission $_g[' Adminid '] as the middle value. 0 for ordinary users, 1 for forum administrators, 2 for Super moderators, 3 for forum moderators. The user rights are marked as $_g[' GroupID ' according to their primary user group ID, and the relevant permissions are read from the system cache corresponding to the $_g[' GroupID '] and stored in the $_g[' group '.
    • The Presets read the various settings variables for each module.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.