The $_G variable is the global variable of the program, in order to make the program more efficient and reduce unnecessary data acquisition, so the program specially unifies the variables that are often used and puts them into the $_G variable, such as user login information, background setting information, server environment information, client CooKies, data cache, etc. are stored in the G variable.
$_G variable is initialized in the source/class/discuz/discuz_application.php file, and the $_G variable is used in the function, which must be declared as a global variable: global $_G;
(1) Global variable system
$_G['uid'] => Current login UID
$_G['username'] => The current logged-in username
$_G['adminid'] => Current login ID Management group ID
$_G['groupid'] => Current login ID, user group ID
$_G['cookie'] => client-side cookie
$_G['formhash'] => The [FORMHASH] of the current login ID is mainly used for form submission
$_G['timestamp'] => The current active time
$_G['starttime'] => 1317042440.3242
$_G['clientip'] => The current visitor's IP address
$_G['referer'] => The address of the current request, the primary user form submission
$_G['charset'] => program encoding
$_G['PHP_SELF'] => The relative address of the page currently visited
$_G['siteurl'] => program access address
$_G['siteroot'] => The relative directory of the domain name in which the program is located
$_G['fid'] => The current section ID [topic list page, post page] appears
$_G['tid'] => The current post ID [post page] appears
$_G['basescript'] => The channel where the current page is located
$_G['basefilename'] => php file name of the current page
$_G['staticurl'] => Program attachment directory
$_G['mod'] => The MOD value of the current page [e.g., :forum.php?mod=xxx]
$_G['inajax'] => The value of the current ajax request [None-0 Yes-1]
$_G['page'] => Current pagination ID
$_G['tpp'] => The current pagination shows the number per page
$_G['seokeywords'] => the current page SEO keyword
$_G['seodescription'] => The current page of the SEO description
$_G['timenow'] => Array
(
[time] => 2011-9-26 21:07 Current server time
[offset] => +8 The 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_ datatable prefix
)
)
)
(2) Global background settings
$_G['setting'][sitename] => Global-SiteInfo-SiteName
$_G['setting'][siteurl] => Global-SiteInfo-SiteURL
$_G['setting'][regname] => global-register-access-registration-registration-address
$_G['setting'][reglinkname] => global-register-access-registration-registration-link text
$_G['setting'][regverify] => global-register-access-registration-new user registration verification
$_G['setting'][icp] => Global-Site Information-Website Filing Information Code
$_G['setting'][imagelib] => Global-Upload Settings-Basic Settings-Image Processing Library Type
$_G['setting'][extcredits] => Points Print yourself
$_G['setting'][creditsformula] => Global-Points-Setting-Basics-Total Points
$_G['setting'][cacheindexlife] => Global-Performance Optimization-Forum Page Cache Settings-Cache Forum Homepage Validity
$_G['setting'][cachethreaddir] => global-performance-optimize-forum page cache settings-cache directory
$_G['setting'][cachethreadlife]=> global-performance-optimization-forum page cache settings-cache post expiration date
$_G['setting'][bbrulestxt] => Global-RegistrationAccess-Registration-Website Terms of Service
$_G['setting'][bbname] => Global-Site Info-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-anonymoususer's nickname
$_G['setting'][threadsticky] => Interface - Interface Settings - Theme List - Identifier of the pinned theme
$_G['setting'][defaultindex] => The default homepage file name forum.php
$_G['setting'][verify] => user-authentication settings
$_G['setting'][rewriterule] => The pseudo-static rule situation in the background
$_G['setting'][ucenterurl] => UCenter address
$_G['setting'][plugins] => Background plugin settings and enablement
$_G['setting'][navlogos] => Background Interface Settings - Navigation Settings - Logo Group with Built-in Navigation
$_G['setting'][navmn] => The navigation situation set in the background is mainly used for navigation judgment
$_G['setting'][navs] => header navigation array, which can be used to rewrite the header navigation
$_G['setting'][footernavs] => footer navigation
$_G['setting'][spacenavs] => Navigation on the left side of the home module
$_G['setting'][mynavs] => The content of the shortcut navigation button on the right side of the header navigation
$_G['setting'][topnavs] => Navigation content at the top of the page
$_G['setting'][forumpicstyle] => Array section theme cover
$_G['setting'][forumpicstyle][thumbwidth] => Topic 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-Extension Data Item Quantity
$_G['setting'][activitypp] => Global-Site Features-Campaign Topic-User ListEach page shows the number of people participating in the event
$_G['setting'][activitycredit]=> global-site-feature-activity-theme-usage credits
$_G['setting'][activitytype]=> Global-SiteFeature-ActivityTheme-Built-in Type
$_G['setting'][adminemail] => Global-Site Info-Admin Email
(3) Global current logged-in information
$_G['member'] => Array is currently logged in to the user's personal information
$_G['member'][uid] => UID
$_G['member'][email] => email address
$_G['member'][username] => username
$_G['member'][password] => password after MD5 (don't output randomly!! Remember)$_G['member'][status] => whether the user has been deleted
$_G['member'][emailstatus] => Email Verification Status 0 Not Verified 1 Verified Passed
$_G['member'][avatarstatus] => Avatar upload status 0 Not uploaded 1 Uploaded
$_G['member'][videophotostatus]=> Video Authentication 0 Unverified 1 Verified
$_G['member'][adminid] => The ID of the management group you are in
$_G['member'][groupid] => The user group ID in which it belongs
$_G['member'][groupexpiry] => The validity period of the user group it belongs to
$_G['member'][extgroupids] => Extend the user group
$_G['member'][regdate] => Registration time
$_G['member'][credits] => 214 total existing credits
$_G['member'][notifysound] => Short message sound
$_G['member'][timeoffset] => the time zone
$_G['member'][newpm] => Number of new SMS
$_G['member'][newprompt] => Number of new alerts
$_G['member'][accessmasks] => This seems to be an access right, uncertain
$_G['member'][allowadmincp] => Whether you have admin panel permissions 0 No 1 Yes
$_G['member'][onlyacceptfriendpm] => whether to only accept SMS from friends 0 No 1 Yes
$_G['member'][conisbind] => Whether to bind QQ 0 No 1 Yes
$_G['member'][lastvisit] => last visited time
(4) Style variables
$_G['style'] => Array(
$_G['style'][styleid] = > current style ID
$_G['style'][name] => the current style name
$_G['style'][templateid] => The current template system
$_G['style'][tpldir] => Current template directory
$_G['style'][menuhoverbgcolor] => Highlight the background color of the navigation menu
$_G['style'][lightlink] => Light link color
$_G['style'][floatbgcolor] => popup background property
$_G['style'][dropmenubgcolor] => dropdown menu background attribute $_G['style'][floatmaskbgcolor] => pop-up border color attribute
$_G['style'][dropmenuborder] => dropdown menu border color
$_G['style'][specialbg] => Colored area background color (post user info bar, emphasis header, etc.)
$_G['style'][specialborder] => Colored area border
$_G['style'][commonbg] => Universal display area background color
$_G['style'][commonborder] => Universal border color
$_G['style'][inputbg] => Input box background color
$_G['style'][inputborderdarkcolor] => The input border is dark
$_G['style'][headerbgcolor] => header background
$_G['style'][headerborder] => Header Split 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] => Highlightlink 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] => Theme list font
$_G['style'][threadtitlefontsize] => Theme 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] => Expand the image catalog
$_G['style'][imgdir] => The basic image directory of the interface
$_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] => Highlight text color for navigation menus
$_G['style'][wrapbg] => body table background color
$_G['style'][wrapbordercolor] => body table border color
$_G['style'][contentwidth] => Read area width
$_G['style'][contentseparate] => Post spacing color
$_G['style'][inputborder] => The input border is light
$_G['style'][menuhoverbgcode] => Highlight the background of the navigation menu
$_G['style'][floatbgcode] => pop-up background color
$_G['style'][dropmenubgcode] => dropdown menu background color
$_G['style'][floatmaskbgcode] => pop-up border color
$_G['style'][headerbgcode] => header background
$_G['style'][sidebgcode] => Home sidebar background attribute
$_G['style'][bgcode] => global background attribute attribute
$_G['style'][titlebgcode] => Section list title background $_G['style'][menubgcode]=> Navigation menu background properties
$_G['style'][boardlogo] => LOGO img code |