G 变量的使用方法:
直接复制下面的变量放到 Discuz X 模板需要的位置即可!
例如:$_G[‘style’][boardlogo] 刷新后就会 显示一张 logo

全局变量系统篇

$_G[‘uid’] => 当前登录 UID

$_G[‘username’] => 当前登录用户名

$_G[‘adminid’] => 当前登录 ID 管理组 ID

$_G[‘groupid’] => 当前登录 ID 用户组 ID

$_G[‘cookie’] => 客户端 cookie

$_G[‘formhash’] => 当前登录 ID 的【FORMHASH】主要用于表单提交

$_G[‘timestamp’] => 当前活动时间

$_G[‘starttime’] => 1317042440.3242

$_G[‘clientip’] => 当前访问者 IP 地址

$_G[‘referer’] => 当前请求的地址,主要用户表单提交

$_G[‘charset’] => 程序编码
$_G[‘PHP_SELF’] => 当前访问页面的相对地址

$_G[‘siteurl’] => 程序访问地址

$_G[‘siteroot’] => 程序所在域名的相对目录

$_G[‘fid’] => 当前版块 id【主题列表页、帖子页】出现

$_G[‘tid’] => 当前帖子 ID【帖子页】出现

$_G[‘basescript’] => 当前页面所在频道

$_G[‘basefilename’] => 当前页面 php 文件名

$_G[‘staticurl’] => 程序附件目录

$_G[‘mod’] => 当前页面的 MOD 值【例如:forum.php?mod=xxx】

$_G[‘inajax’] => 当前 ajax 请求的值【无-0 有-1】

$_G[‘page’] => 当前分页 ID

$_G[‘tpp’] => 当前分页每页显示数量

$_G[‘seokeywords’] => 当前页面 seo 关键词

$_G[‘seodescription’] => 当前页面 seo 介绍

$_G[‘timenow’] => Array
(
    [time] => 2011-9-26 21:07 当前服务器时间
    [offset] => +8 当前服务器时区
)

$_G[‘config’] => Array
(
    $_G[‘config’][db] => Array
        (
            $_G[‘config’][db][1] => Array
                (
                    $_G[‘config’][db][1][dbhost] => localhost 数据库连接地址
                    $_G[‘config’][db][1][dbuser] => root 数据库用户名
                    $_G[‘config’][db][1][dbpw] => 123456 数据库密码
                    $_G[‘config’][db][1][dbcharset] => utf8 数据库编码
                    $_G[‘config’][db][1][pconnect] => 0
                    $_G[‘config’][db][1][dbname] => dxutf 数据库名
                    $_G[‘config’][db][1][tablepre] => pre_ 数据表前缀
                )
        )
)