$_G saves all preprocessed data in Discuz!
Caching can greatly improve the performance of the program. There is no need to query the database every time for some configuration data. You only need to update the cache when it is modified.
All caches in Discuz! are stored in $_G[cache]
$_G[member] Member information data
$_G[uid] User uid
$_G[username] User name
$_G[adminid] User management group id
$_G[groupid] User group id
$_G[setting] Setting data
$_G[cache] System cache
$_G[cache] [plugin] Plug-in cache
To load the cache, you can use the loadcache() function to load the cache into the $_G[cache] array
(1) Global Variable System
$_G['uid'] => Current login UID
$_G['username'] => Current login username
$_G[' adminid'] => Current login ID Management group ID
$_G['groupid'] => Current login ID User group ID
$_G['cookie'] => Client cookie
$_G['formhash'] => The [FORMHASH] of the current login ID is mainly used for form submission
$_G['timestamp' ] => Current activity time
$_G['starttime'] => 1317042440.3242
$_G['clientip'] => Current visitor IP address
$_G['referer'] = > Current requested address, main user form submission
$_G['charset'] => Program encoding
$_G['PHP_SELF'] => Relative address of the currently visited page
$_G ['siteurl'] => Program access address
$_G['siteroot'] => Relative directory of the domain name where the program is located
$_G['fid'] => Current section id [topic list page , Post page] appears
$_G['tid'] => Current post ID [Post page] appears
$_G['basescript'] => The channel where the current page is located
$_G[' basefilename'] => Current page php file name
$_G['staticurl'] => Program attachment directory
$_G['mod'] => The MOD value of the current page [for example: forum. php?mod=xxx】
$_G['inajax'] => The value of the current ajax request [None -0 Yes -1]
$_G['page'] => The current paging ID
$_G['tpp'] => The number displayed on each page of the current page
$_G['seokeywords'] => The current page's seo keywords
$_G['seodescription'] => The current page seo introduction
$_G['timenow'] => Array
(
[time] => 2011-9-26 21:07 Current server time
[offset] => 8 Current server time zone
)
$_G['config'] => Array(
$_G['config'][db] => Array(
$_G['config'] [db][1] => Array(
$_G['config'][db][1][dbhost] => localhost database connection address
$_G['config'][db] [1][dbuser] => root database username
$_G['config'][db][1][dbpw] => 123456 database password
$_G['config'][db ][1][dbcharset] => utf8 database encoding
$_G['config'][db][1][pconnect] => 0
$_G['config'][db][ 1][dbname] => dxutf database name
$_G['config'][db][1][tablepre] => pre_ data table prefix
)
)
)
(2) Global background settings
$_G['setting'][sitename] => Global-Site Information-Site Name
$_G[' setting'][siteurl] => Global-Site Information-Website URL
$_G['setting'][regname] => Global-Registration Access-Registration-Registration Address
$_G['setting'][reglinkname] => Global-Register Access-Register-Register Link Text
$_G['setting'][regverify] => Global-Register Access-Register-New User registration verification
$_G['setting'][icp] => Global-Site Information-Website Registration Information Code
$_G['setting'][imagelib] => Global-Upload Settings-Basic Settings-Image Processing Library Type
$_G['setting'][extcredits] => Print the points by yourself
$_G['setting'][creditsformula ] => Global - Points Settings - Basic Settings - Total Points Calculation Formula
$_G['setting'][cacheindexlife] => Global - Performance Optimization - Forum Page Cache Settings - Cache Forum Homepage Validity Period
$_G['setting'][cachethreaddir] => Global - Performance Optimization - Forum Page Cache Settings - Cache Directory
$_G['setting'][cachethreadlife] => Global - Performance Optimization - Forum page cache settings - Cache post validity period
$_G['setting'][bbrulestxt] => Global - Register for access - Registration - Website terms of service
$_G['setting' ][bbname] => Global-Site Information-Site Name
$_G['setting'][attachurl] => Global-Upload Settings-Basic Settings-Local Attachment URL Address
$_G['setting'][attachdir] => Global-Upload Settings-Basic Settings-Local Attachment Save Location
$_G['setting'][anonymoustext] => Interface-Interface Settings- Global - Anonymous user's nickname
$_G['setting'][threadsticky] => Interface - Interface settings - Topic list - Identity of the sticky topic
$_G['setting'] [defaultindex] => Default homepage file name forum.php
$_G['setting'][verify] => User-Authentication Settings
$_G['setting'][ rewriterule] => Background pseudo-static rule situation
$_G['setting'][ucenterurl] => UCenter address
$_G['setting'][plugins] => Background plug-in settings and activation
$_G['setting'][navlogos] => Backend interface settings - navigation settings - built-in navigation logo group
$_G['setting'] [navmn] => Navigation status set in the background, mainly used for navigation judgment
$_G['setting'][navs] => Page header navigation array, you can refer to this array to rewrite the page header navigation
$_G['setting'][footernavs] => Footer navigation
$_G['setting'][spacenavs] => Home module left navigation
$_G['setting'][mynavs] => Content of the shortcut navigation button on the right side of the page header
$_G['setting'][topnavs] => >$_G['setting'][forumpicstyle] => Array section theme cover
(
$_G['setting'][forumpicstyle][thumbwidth] => Theme cover width
$_G['setting'][forumpicstyle][thumbheight] => Theme cover height
)
$_G['setting'][activityfield] => Global - site function - activity theme - initiator required information
$_G['setting'][activityextnum] => Global - site function -Activity theme-Number of expanded data items
$_G['setting'][activitypp] => Global-Site function-Activity theme-User list shows the number of people participating in the activity on each page
$_G['setting'][activitycredit] => Global-Site Function-Activity Theme-Use Points
$_G['setting'][activitytype] => Global-Site Function-Activity Theme- Built-in type
$_G['setting'][adminemail] => Global-Site Information-Administrator Email
(3) Global Current Login User Information
$_G['member'] => Array Personal information of the currently logged in user
(
$_G['member'][uid] => UID
$_G['member'][email] => Email address
$_G['member'][username] => Username
$_G['member'][password] => Password after MD5 (don't input it randomly!! ! Remember) $_G['member'][status] => Whether the user has been deleted
$_G['member'][emailstatus] => Email verification status 0 Unverified 1 Verified
$_G ['member'][avatarstatus] => Avatar upload status 0 not uploaded 1 uploaded
$_G['member'][videophotostatus] => Video authentication 0 not authenticated 1 authenticated
$_G[ 'member'][adminid] => Management group ID
$_G['member'][groupid] => User group ID
$_G['member'][groupexpiry] => Validity period of the user group
$_G['member'][extgroupids] => Extended user group
$_G['member'][regdate] => Registration time
$_G['member' ][credits] => 214 Total existing points
$_G['member'][notifysound] => SMS sound
$_G['member'][timeoffset] => Time zone
$_G['member'][newpm] => Number of new short messages
$_G['member'][newprompt] => Number of new reminders
$_G['member'][accessmasks ] => This looks like access permissions, not sure
$_G['member'][allowadmincp] => Do you have management panel permissions 0 No 1 Yes
$_G['member'][onlyacceptfriendpm] = > Whether to only accept short messages from friends 0 No 1 Yes
$_G['member'][conisbind] => Whether to bind QQ 0 No 1 Yes
$_G['member'][lastvisit] = > Last visit time
);
(4) Style Variables
$_G['style'] => Array(
$_G['style'][styleid] => Current style ID
$_G[' style'][name] => Current style name
$_G['style'][templateid] => Current template system
$_G['style'][tpldir] => Current template directory
$_G['style'][menuhoverbgcolor] => Navigation menu highlight background color
$_G['style'][lightlink] => Light link color
$_G['style '][floatbgcolor] => Pop-up window background attribute
$_G['style'][dropmenubgcolor] => Drop-down menu background attribute $_G['style'][floatmaskbgcolor] => Pop-up window border color attribute
$_G['style'][dropmenuborder] => Drop-down menu border color
$_G['style'][specialbg] => Colored area background color (post user information bar, tables that need to be emphasized First class)
$_G['style'][specialborder] => Colored area border
$_G['style'][commonbg] => Common display area background color
$_G['style '][commonborder] => Common border color
$_G['style'][inputbg] => Input box background color
$_G['style'][inputborderdarkcolor] => Input box border Dark
$_G['style'][headerbgcolor] => Header background
$_G['style'][headerborder] => Header dividing line height
$_G['style '][sidebgcolor] => Home side background
$_G['style'][msgfontsize] => Post content font size
$_G['style'][bgcolor] => Page background
$_G['style'][noticetext] => Prompt message color
$_G['style'][highlightlink] => Highlight link color
$_G['style'][link ] => Link text color
$_G['style'][lighttext] => Light text
$_G['style'][midtext] => Medium text color
$_G ['style'][tabletext] => Normal text color
$_G['style'][smfontsize] => Small font size
$_G['style'][threadtitlefont] => Topic list font
$_G['style'][threadtitlefontsize] => Topic list font size
$_G['style'][smfont] => Small font
$_G['style '][titlebgcolor] => Section list title font color $_G['style'][fontsize] => Normal font size
$_G['style'][font] => Normal font
$_G['style'][styleimgdir] => Extended picture directory
$_G['style'][imgdir] => Interface basic picture directory
$_G['style'][boardimg] = > The path where the logo is located
$_G['style'][headertext] => Header text color
$_G['style'][footertext] => Footer text color
$_G ['style'][menubgcolor] => Navigation menu background color
$_G['style'][menutext] => Navigation menu text color
$_G['style'][menuhovertext] => ; Navigation menu highlighted text color
$_G['style'][wrapbg] => Main table background color
$_G['style'][wrapbordercolor] => Main table border color
$_G['style'][contentwidth] => Reading area width
$_G['style'][contentseparate] => Post separation color
$_G['style'][inputborder] => ; Input box border light color
$_G['style'][menuhoverbgcode] => Navigation menu highlight background
$_G['style'][floatbgcode] => Pop-up window background color
$_G['style'][dropmenubgcode] => Drop-down menu background color
$_G['style'][floatmaskbgcode] => Pop-up window border color
$_G['style'][headerbgcode] => Header background
$_G['style'][sidebgcode] => Home sidebar background attribute
$_G['style'][bgcode] => Global background attribute
$_G['style'][titlebgcode] => Section list title background$_G['style'][menubgcode] => Navigation menu background attribute
$_G['style'][boardlogo] => ; LOGO img code
)