Exemple #1
0
/**
 * This function handles building up the configuration array for the program
 * @return array
 */
function GetConfig()
{
    $config = GetDBConfig();
    if (!ConfirmTrailingDirectorySeperator($config["PHOTOSDIR"])) {
        $config["PHOTOSDIR"] .= DIRECTORY_SEPARATOR;
    }
    if (!ConfirmTrailingDirectorySeperator($config["FILESDIR"])) {
        $config["FILESDIR"] .= DIRECTORY_SEPARATOR;
    }
    //These should only be modified if you are testing
    $config["DELETE_MAIL_AFTER_PROCESSING"] = true;
    $config["POST_TO_DB"] = true;
    $config["TEST_EMAIL"] = false;
    $config["TEST_EMAIL_ACCOUNT"] = "blog.test";
    $config["TEST_EMAIL_PASSWORD"] = "";
    //include(POSTIE_ROOT . "/../postie-test.php");
    // These are computed
    #$config["TIME_OFFSET"] = get_option('gmt_offset');
    if ($config["USE_IMAGEMAGICK"]) {
        if (!file_exists($config["IMAGEMAGICK_IDENTIFY"]) || !file_exists($config["IMAGEMAGICK_CONVERT"])) {
            $config["RESIZE_LARGE_IMAGES"] = false;
        }
    } else {
        if (!HasGDInstalled(false)) {
            $config["RESIZE_LARGE_IMAGES"] = false;
        }
    }
    $config["POSTIE_ROOT"] = POSTIE_ROOT;
    $config["URLPHOTOSDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["PHOTOSDIR"]);
    $config["REALPHOTOSDIR"] = realpath(ABSPATH . $config["PHOTOSDIR"]) . DIRECTORY_SEPARATOR;
    $config["URLFILESDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["FILESDIR"]);
    $config["REALFILESDIR"] = realpath(ABSPATH . $config["FILESDIR"]) . DIRECTORY_SEPARATOR;
    for ($i = 0; $i < count($config["AUTHORIZED_ADDRESSES"]); $i++) {
        $config["AUTHORIZED_ADDRESSES"][$i] = strtolower($config["AUTHORIZED_ADDRESSES"][$i]);
    }
    return $config;
}
/**
 * This function handles building up the configuration array for the program
 * @return array
 */
function GetConfig()
{
    $config = GetDBConfig();
    if (!ConfirmTrailingDirectorySeperator($config["PHOTOSDIR"])) {
        $config["PHOTOSDIR"] .= DIRECTORY_SEPARATOR;
    }
    if (!ConfirmTrailingDirectorySeperator($config["FILESDIR"])) {
        $config["FILESDIR"] .= DIRECTORY_SEPARATOR;
    }
    //These should only be modified if you are testing
    $config["DELETE_MAIL_AFTER_PROCESSING"] = true;
    //no delete change to false BF-CHANGED
    $config["POST_TO_DB"] = true;
    $config["TEST_EMAIL"] = false;
    $config["TEST_EMAIL_ACCOUNT"] = "blog.test";
    $config["TEST_EMAIL_PASSWORD"] = "";
    //include(POSTIE_ROOT . "/../postie-test.php");
    // These are computed
    #$config["TIME_OFFSET"] = get_option('gmt_offset');
    if ($config["USE_IMAGEMAGICK"]) {
        if (!file_exists($config["IMAGEMAGICK_IDENTIFY"]) || !file_exists($config["IMAGEMAGICK_CONVERT"])) {
            $config["RESIZE_LARGE_IMAGES"] = false;
        }
    } else {
        if (!HasGDInstalled(false)) {
            $config["RESIZE_LARGE_IMAGES"] = false;
        }
    }
    $config["POSTIE_ROOT"] = POSTIE_ROOT;
    $config["URLPHOTOSDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["PHOTOSDIR"]);
    $config["REALPHOTOSDIR"] = realpath(ABSPATH . $config["PHOTOSDIR"]) . DIRECTORY_SEPARATOR;
    $config["URLFILESDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["FILESDIR"]);
    $config["REALFILESDIR"] = realpath(ABSPATH . $config["FILESDIR"]) . DIRECTORY_SEPARATOR;
    for ($i = 0; $i < count($config["AUTHORIZED_ADDRESSES"]); $i++) {
        $config["AUTHORIZED_ADDRESSES"][$i] = strtolower($config["AUTHORIZED_ADDRESSES"][$i]);
    }
    if (!isset($config["AJAX_SELECT"])) {
        $config["AJAX_SELECT"] = "0";
    } else {
        if (!current_user_can('config_postie') && $config["AJAX_SELECT"] == "1") {
            die("Must have admin rights to use ajax");
        }
    }
    if (!isset($config["POST_TYPE"])) {
        $config["POST_TYPE"] = "publish";
    }
    // BF-CHANGED was draft
    if (!isset($config["DEFAULT_TAG"])) {
        $config["DEFAULT_TAG"] = DEFAULT_TAGS;
    }
    return $config;
}