<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 網站公共文件 /common/common.php 在 PHP 文件的頂部,使用 `include` 方式加載 `common/common.php` 文件,即可使用配置文件中定義的常量和函數庫中的所有函數,并且使其校驗過程在當前頁面中生效。 網站公共文件的作用: > 設置 PHP的錯誤級別、網頁字符集; > 用于校驗站點是否已經安裝; > 加載 config 中的所有文件、及 helpers 中的所有文件; > 初始化SESSION和網站的公共變量; > 網站的開啟或關閉狀態; > 校驗禁止訪問的IP地址; > 獲取主導航的相關數據; ##公共文件包含關系 ![](https://box.kancloud.cn/2015-10-23_5629abb1dac8b.png) ##代碼詳解 ~~~ <?php error_reporting(E_ALL & ~E_NOTICE); header('content-type:text/html; charset=utf-8;'); //項目安裝 if(!file_exists('install.lock')) { header('location:install/index.php'); exit; } /** * 加載文件 */ include 'config/database.php'; //加載數據庫配置文件 include 'config/config.php'; //加載站點基礎配置文件 include 'helpers/mytpl.php'; //加載模板函數文件 include 'helpers/mysql.php'; //加載數據庫操作函數文件 include 'helpers/user.php'; //加載數據庫操作函數文件 include 'helpers/func.php'; //加載公共函數文件 include 'helpers/img.php'; //加載圖片處理函數文件 include 'helpers/fileupload.php'; //加載文件上傳函數文件 include 'helpers/code.php'; //加載圖片驗證碼函數文件 include 'helpers/page.php'; //加載分頁函數文件 $keyWords = include 'helpers/keywords.php'; //加載熱搜關鍵詞文件 session_start(); //啟動 SESSION //初始化變量 $web_name = WEB_NAME; $web_btm = WEB_BTM; $web_url = WEB_URL; $web_icp = WEB_ICP; $web_close = WEB_ISCLOSE; $web_reg = WEB_REG; $domain_resource = DOMAIN_RESOURCE; //獲取當前頁面地址 $fileName = explode('/',$_SERVER["PHP_SELF"]); $thispage = array_pop($fileName); //網站關閉,管理員可以登錄 if(empty($_POST['loginsubmit'])) { if($web_close && !$_COOKIE['udertype'] && $thispage!='logout.php') { echo $web_close.'---'.$_COOKIE['udertype'].'---'.$thispage; include 'close.php'; exit; } } //禁止IP $Uip = ip2long($_SERVER['REMOTE_ADDR']); $ip = dbSelect('closeip','*','ip='.$Uip.'','id desc',1); if ($ip) { exit('本站不歡迎你,請離開!'); } if ($_COOKIE['uid']) { $GGUser = dbSelect('user', 'grade,picture', 'uid=' . $_COOKIE['uid'], '', 1); if ($GGUser) { $GGgrade = $GGUser[0]['grade']; $GGpicture = $GGUser[0]['picture']; } } //讀取所有大版塊信息,做導航 $headMenu = dbSelect('category','cid,classname','parentid=0 and ispass=1','orderby desc,cid desc'); ~~~ ## 基礎配置 /config/config.php 包含以下配置項: > 1 基礎配置(時區|魔術轉譯) > 2 靜態資源 > 3 website > 4 模版引擎 > 5 獎勵 ~~~ <?php // 一 define('TIMEZONE', 'Asia/shanghai'); //時區 define('GPC', get_magic_quotes_gpc() ? 0 : 1); //魔術轉譯 // 二 define('DOMAIN_RESOURCE', 'http://funcbbs.yhsong.com/public'); //靜態資源目錄 // 三 define('WEB_NAME', 'PHP學院'); //站點名稱,將顯示在瀏覽器窗口標題等位置 define('WEB_BTM', 'NoAlike'); //網站名稱,將顯示在頁面底部的聯系方式處 define('WEB_URL', 'http://www.phpxy.com/'); //網站 URL,將作為鏈接顯示在頁面底部 define('WEB_ICP', '京ICP備 89273號'); //頁面底部可以顯示 ICP 備案信息 define('WEB_ISCLOSE', false); //true暫時將站點關閉,其他人無法訪問,但不影響管理員訪問 define('WEB_REG', true); //true開啟注冊功能 // 四 define('TPL_SKIN', 'theme/default'); //模版文件存放位置 define('TPL_CACHE', 'compiled'); //模版文件緩存位置 // 五 define('REWARD_LOGIN', 2); //每天首次登陸贈送2積分 define('REWARD_REG', 50); //注冊贈送50積分 define('REWARD_T', 2); //發帖贈送2積分 define('REWARD_H', 1); //回帖贈送1積分 ~~~ ## 數據庫連接配置 /config/database.php > 網站安裝過程中會重寫該文件 (確保該文件具有可寫權限) 的內容,無需手動修改配置。 ~~~ <?php define('DB_HOST','localhost'); //數據庫連接地址(IP) define('DB_USER','root'); //數據庫登陸賬號 define('DB_PASS','123456'); //數據庫登陸賬號對應的密碼 define('DB_NAME','apple_bbs'); //數據庫名稱 define('DB_CHARSET','utf8'); //數據庫字符集 define('DB_PREFIX','bbs_'); //數據表前綴 ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看