示例#1
0
文件: index.php 项目: hardkap/pritlog
function readConfig()
{
    /* Read config information from file. */
    global $config, $user, $user1;
    //echo $user.' '.$user1.'<br>';
    $configFile = getcwd() . "/data/" . $user . "/config.php";
    //$configFile = "/home/tipsfor1/public_html/pritlog.com/labs/pritlog8/data/user/config.php";
    //echo $configFile.'<br>';
    //die();
    if (!file_exists($configFile)) {
        $configFile = getcwd() . "/data/" . $user1 . "/config.php";
        $user = $user1;
        if (!file_exists($configFile)) {
            //@header("Location: index.html");
            //die("Please contact prit@pritlog.com to setup an account for you");
            die("Your config file does not exist");
        }
    }
    $contents = file($configFile);
    $contents[0] = trim(str_replace("<?php /*", "", $contents[0]));
    $contents[0] = trim(str_replace("*/ ?>", "", $contents[0]));
    if ($contents[0]) {
        $tempConfigs = explode('|', $contents[0]);
        $configKeys = array('blogTitle', 'Password', 'sendMailWithNewComment', 'sendMailWithNewCommentMail', 'about', 'postDir', 'commentDir', 'menuEntriesLimit', 'textAreaCols', 'textAreaRows', 'entriesPerPage', 'maxPagesDisplayed', 'commentsMaxLength', 'commentsSecurityCode', 'onlyNumbersOnCAPTCHA', 'CAPTCHALength', 'randomString', 'commentsForbiddenAuthors', 'statsDontLog', 'dbFilesExtension', 'usersOnlineTimeout', 'entriesOnRSS', 'authorEditPost', 'authorDeleteComment', 'metaDescription', 'metaKeywords', 'menuLinks', 'blogLanguage', 'blogPath', 'showCategoryCloud', 'allowRegistration', 'sendRegistMail', 'timeoutDuration', 'theme', 'commentModerate', 'limitLogins', 'privacy', 'cleanUrl');
        for ($i = 0; $i < count($tempConfigs); $i++) {
            $key = $configKeys[$i];
            $config[$key] = $tempConfigs[$i];
        }
        setConfigDefaults();
    }
}
示例#2
0
function readConfig()
{
    /* Read config information from file. */
    global $config, $user;
    $configFile = getcwd() . "/data/" . $user . "/config.php";
    $contents = file($configFile) or die("Config file not found in the 'data' subfolder");
    $contents[0] = trim(str_replace("<?php /*", "", $contents[0]));
    $contents[0] = trim(str_replace("*/ ?>", "", $contents[0]));
    if ($contents[0]) {
        $tempConfigs = explode('|', $contents[0]);
        $configKeys = array('blogTitle', 'Password', 'sendMailWithNewComment', 'sendMailWithNewCommentMail', 'about', 'postDir', 'commentDir', 'menuEntriesLimit', 'textAreaCols', 'textAreaRows', 'entriesPerPage', 'maxPagesDisplayed', 'commentsMaxLength', 'commentsSecurityCode', 'onlyNumbersOnCAPTCHA', 'CAPTCHALength', 'randomString', 'commentsForbiddenAuthors', 'statsDontLog', 'dbFilesExtension', 'usersOnlineTimeout', 'entriesOnRSS', 'authorEditPost', 'authorDeleteComment', 'metaDescription', 'metaKeywords', 'menuLinks', 'blogLanguage', 'blogPath', 'showCategoryCloud', 'allowRegistration', 'sendRegistMail', 'timeoutDuration', 'theme', 'commentModerate', 'limitLogins', 'cleanUrl');
        for ($i = 0; $i < count($tempConfigs); $i++) {
            $key = $configKeys[$i];
            $config[$key] = $tempConfigs[$i];
        }
        setConfigDefaults();
    }
}