/**
 * This handles the configs that are stored in the data base
 * You should never call this outside of the library
 * @return array
 * @access private
 */
function GetDBConfig()
{
    $config = ReadDBConfig();
    if (!isset($config["ADMIN_USERNAME"])) {
        $config["ADMIN_USERNAME"] = '******';
    }
    if (!isset($config["PREFER_TEXT_TYPE"])) {
        $config["PREFER_TEXT_TYPE"] = "plain";
    }
    if (!isset($config["DEFAULT_TITLE"])) {
        $config["DEFAULT_TITLE"] = "Live From The Field";
    }
    if (!isset($config["INPUT_PROTOCOL"])) {
        $config["INPUT_PROTOCOL"] = "pop3";
    }
    if (!isset($config["IMAGE_PLACEHOLDER"])) {
        $config["IMAGE_PLACEHOLDER"] = "#img%#";
    }
    if (!isset($config["IMAGES_APPEND"])) {
        $config["IMAGES_APPEND"] = true;
    }
    if (!isset($config["ALLOW_SUBJECT_IN_MAIL"])) {
        $config["ALLOW_SUBJECT_IN_MAIL"] = true;
    }
    if (!isset($config["DROP_SIGNATURE"])) {
        $config["DROP_SIGNATURE"] = true;
    }
    if (!isset($config["MESSAGE_START"])) {
        $config["MESSAGE_START"] = ":start";
    }
    if (!isset($config["MESSAGE_END"])) {
        $config["MESSAGE_END"] = ":end";
    }
    if (!isset($config["FORWARD_REJECTED_MAIL"])) {
        $config["FORWARD_REJECTED_MAIL"] = true;
    }
    if (!isset($config["RETURN_TO_SENDER"])) {
        $config["RETURN_TO_SENDER"] = false;
    }
    if (!isset($config["CONFIRMATION_EMAIL"])) {
        $config["CONFIRMATION_EMAIL"] = false;
    }
    if (!isset($config["ALLOW_HTML_IN_SUBJECT"])) {
        $config["ALLOW_HTML_IN_SUBJECT"] = true;
    }
    if (!isset($config["ALLOW_HTML_IN_BODY"])) {
        $config["ALLOW_HTML_IN_BODY"] = true;
    }
    if (!isset($config["START_IMAGE_COUNT_AT_ZERO"])) {
        $config["START_IMAGE_COUNT_AT_ZERO"] = false;
    }
    if (!isset($config["MESSAGE_ENCODING"])) {
        $config["MESSAGE_ENCODING"] = "UTF-8";
    }
    if (!isset($config["MESSAGE_DEQUOTE"])) {
        $config["MESSAGE_DEQUOTE"] = true;
    }
    if (!isset($config["TURN_AUTHORIZATION_OFF"])) {
        $config["TURN_AUTHORIZATION_OFF"] = false;
    }
    if (!isset($config["CUSTOM_IMAGE_FIELD"])) {
        $config["CUSTOM_IMAGE_FIELD"] = false;
    }
    if (!isset($config["CONVERTNEWLINE"])) {
        $config["CONVERTNEWLINE"] = false;
    }
    if (!isset($config["SIG_PATTERN_LIST"])) {
        $config["SIG_PATTERN_LIST"] = array('--', '- --');
    }
    if (!isset($config["BANNED_FILES_LIST"])) {
        $config["BANNED_FILES_LIST"] = array();
    }
    if (!isset($config["SUPPORTED_FILE_TYPES"])) {
        $config["SUPPORTED_FILE_TYPES"] = array("video", "application");
    }
    if (!isset($config["AUTHORIZED_ADDRESSES"])) {
        $config["AUTHORIZED_ADDRESSES"] = array();
    }
    if (!isset($config["MAIL_SERVER"])) {
        $config["MAIL_SERVER"] = NULL;
    }
    if (!isset($config["MAIL_SERVER_PORT"])) {
        $config["MAIL_SERVER_PORT"] = NULL;
    }
    if (!isset($config["MAIL_USERID"])) {
        $config["MAIL_USERID"] = NULL;
    }
    if (!isset($config["MAIL_PASSWORD"])) {
        $config["MAIL_PASSWORD"] = NULL;
    }
    if (!isset($config["DEFAULT_POST_CATEGORY"])) {
        $config["DEFAULT_POST_CATEGORY"] = NULL;
    }
    if (!isset($config["DEFAULT_POST_TAGS"])) {
        $config["DEFAULT_POST_TAGS"] = NULL;
    }
    if (!isset($config["TIME_OFFSET"])) {
        $config["TIME_OFFSET"] = get_option('gmt_offset');
    }
    if (!isset($config["WRAP_PRE"])) {
        $config["WRAP_PRE"] = 'no';
    }
    if (!isset($config["CONVERTURLS"])) {
        $config["CONVERTURLS"] = true;
    }
    if (!isset($config["SHORTCODE"])) {
        $config["SHORTCODE"] = false;
    }
    if (!isset($config["ADD_META"])) {
        $config["ADD_META"] = 'no';
    }
    $config['ICON_SETS'] = array('silver', 'black', 'white', 'custom', 'none');
    if (!isset($config["ICON_SET"])) {
        $config["ICON_SET"] = 'silver';
    }
    $config['ICON_SIZES'] = array(32, 48, 64);
    if (!isset($config["ICON_SIZE"])) {
        $config["ICON_SIZE"] = 32;
    }
    if (!isset($config["AUDIOTEMPLATE"])) {
        $config["AUDIOTEMPLATE"] = $simple_link;
    }
    if (!isset($config["SELECTED_AUDIOTEMPLATE"])) {
        $config['SELECTED_AUDIOTEMPLATE'] = 'simple_link';
    }
    include 'templates/audio_templates.php';
    $config['AUDIOTEMPLATES'] = $audioTemplates;
    if (!isset($config["SELECTED_VIDEO1TEMPLATE"])) {
        $config['SELECTED_VIDEO1TEMPLATE'] = 'simple_link';
    }
    include 'templates/video1_templates.php';
    $config['VIDEO1TEMPLATES'] = $video1Templates;
    if (!isset($config["VIDEO1TEMPLATE"])) {
        $config["VIDEO1TEMPLATE"] = $simple_link;
    }
    if (!isset($config["VIDEO1TYPES"])) {
        $config['VIDEO1TYPES'] = array('mp4', 'mpeg4', '3gp', '3gpp', '3gpp2', '3gp2', 'mov');
    }
    if (!isset($config["AUDIOTYPES"])) {
        $config['AUDIOTYPES'] = array('m4a', 'mp3', 'ogg', 'wav');
    }
    if (!isset($config["SELECTED_VIDEO2TEMPLATE"])) {
        $config['SELECTED_VIDEO2TEMPLATE'] = 'simple_link';
    }
    include 'templates/video2_templates.php';
    $config['VIDEO2TEMPLATES'] = $video2Templates;
    if (!isset($config["VIDEO2TEMPLATE"])) {
        $config["VIDEO2TEMPLATE"] = $simple_link;
    }
    if (!isset($config["VIDEO2TYPES"])) {
        $config['VIDEO2TYPES'] = array('x-flv');
    }
    if (!isset($config["POST_STATUS"])) {
        $config["POST_STATUS"] = 'publish';
    }
    if (!isset($config["IMAGE_NEW_WINDOW"])) {
        $config["IMAGE_NEW_WINDOW"] = false;
    }
    if (!isset($config["FILTERNEWLINES"])) {
        $config["FILTERNEWLINES"] = true;
    }
    include 'templates/image_templates.php';
    $config['IMAGETEMPLATES'] = $imageTemplates;
    if (!isset($config["SELECTED_IMAGETEMPLATE"])) {
        $config['SELECTED_IMAGETEMPLATE'] = 'wordpress_default';
    }
    if (!isset($config["IMAGETEMPLATE"])) {
        $config["IMAGETEMPLATE"] = $wordpress_default;
    }
    if (!isset($config["SMTP"])) {
        $config["SMTP"] = array();
    }
    return $config;
}
示例#2
0
/**
 * This handles the configs that are stored in the data base
 * You should never call this outside of the library
 * @return array
 * @access private
 */
function GetDBConfig()
{
    $config = ReadDBConfig();
    if (!isset($config["PHOTOSDIR"])) {
        $config["PHOTOSDIR"] = DIRECTORY_SEPARATOR . "wp-photos" . DIRECTORY_SEPARATOR;
    }
    if (!isset($config["FILESDIR"])) {
        $config["FILESDIR"] = DIRECTORY_SEPARATOR . "wp-filez" . DIRECTORY_SEPARATOR;
    }
    if (!isset($config["PREFER_TEXT_TYPE"])) {
        $config["PREFER_TEXT_TYPE"] = "plain";
    }
    if (!isset($config["RESIZE_LARGE_IMAGES"])) {
        $config["RESIZE_LARGE_IMAGES"] = true;
    }
    if (!isset($config["MAX_IMAGE_WIDTH"])) {
        $config["MAX_IMAGE_WIDTH"] = 400;
    }
    if (!isset($config["MAX_IMAGE_HEIGHT"])) {
        $config["MAX_IMAGE_HEIGHT"] = "";
    }
    if (!isset($config["DEFAULT_TITLE"])) {
        $config["DEFAULT_TITLE"] = "Live From The Field";
    }
    if (!isset($config["INPUT_PROTOCOL"])) {
        $config["INPUT_PROTOCOL"] = "pop3";
    }
    if (!isset($config["IMAGE_PLACEHOLDER"])) {
        $config["IMAGE_PLACEHOLDER"] = "#img%#";
    }
    if (!isset($config["IMAGES_APPEND"])) {
        $config["IMAGES_APPEND"] = true;
    }
    if (!isset($config["IMAGECLASS"])) {
        $config["IMAGECLASS"] = "postie-image";
    }
    if (!isset($config["IMAGEDIV"])) {
        $config["IMAGEDIV"] = "postie-image-div";
    }
    if (!isset($config["3GPDIV"])) {
        $config["3GPDIV"] = "postie-3gp-div";
    }
    if (!isset($config["ATTACHMENTDIV"])) {
        $config["ATTACHMENTDIV"] = "postie-attachment-div";
    }
    if (!isset($config["3GPCLASS"])) {
        $config["3GPCLASS"] = "postie-video";
    }
    if (!isset($config["IMAGESTYLE"])) {
        $config["IMAGESTYLE"] = "border: none;";
    }
    if (!isset($config["JPEGQUALITY"])) {
        $config["JPEGQUALITY"] = 80;
    }
    if (!isset($config["AUTO_SMART_SHARP"])) {
        $config["AUTO_SMART_SHARP"] = false;
    }
    if (!isset($config["ALLOW_SUBJECT_IN_MAIL"])) {
        $config["ALLOW_SUBJECT_IN_MAIL"] = true;
    }
    if (!isset($config["DROP_SIGNATURE"])) {
        $config["DROP_SIGNATURE"] = true;
    }
    if (!isset($config["MESSAGE_START"])) {
        $config["MESSAGE_START"] = ":start";
    }
    if (!isset($config["MESSAGE_END"])) {
        $config["MESSAGE_END"] = ":end";
    }
    if (!isset($config["FORWARD_REJECTED_MAIL"])) {
        $config["FORWARD_REJECTED_MAIL"] = true;
    }
    if (!isset($config["ALLOW_HTML_IN_SUBJECT"])) {
        $config["ALLOW_HTML_IN_SUBJECT"] = true;
    }
    if (!isset($config["ALLOW_HTML_IN_BODY"])) {
        $config["ALLOW_HTML_IN_BODY"] = true;
    }
    if (!isset($config["START_IMAGE_COUNT_AT_ZERO"])) {
        $config["START_IMAGE_COUNT_AT_ZERO"] = false;
    }
    if (!isset($config["MESSAGE_ENCODING"])) {
        $config["MESSAGE_ENCODING"] = "UTF-8";
    }
    if (!isset($config["MESSAGE_DEQUOTE"])) {
        $config["MESSAGE_DEQUOTE"] = true;
    }
    if (!isset($config["TURN_AUTHORIZATION_OFF"])) {
        $config["TURN_AUTHORIZATION_OFF"] = false;
    }
    if (!isset($config["USE_IMAGEMAGICK"])) {
        $config["USE_IMAGEMAGICK"] = false;
    }
    if (!isset($config["IMAGEMAGICK_CONVERT"])) {
        $config["IMAGEMAGICK_CONVERT"] = "/usr/bin/convert";
    }
    if (!isset($config["IMAGEMAGICK_IDENTIFY"])) {
        $config["IMAGEMAGICK_IDENTIFY"] = "/usr/bin/identify";
    }
    if (!isset($config["SIG_PATTERN_LIST"])) {
        $config["SIG_PATTERN_LIST"] = array('--', '- --', "\\?--");
    }
    if (!isset($config["BANNED_FILES_LIST"])) {
        $config["BANNED_FILES_LIST"] = array();
    }
    if (!isset($config["SUPPORTED_FILE_TYPES"])) {
        $config["SUPPORTED_FILE_TYPES"] = array("video", "application");
    }
    if (!isset($config["AUTHORIZED_ADDRESSES"])) {
        $config["AUTHORIZED_ADDRESSES"] = array();
    }
    //if (!isset($config["MAIL_SERVER"])) { $config["MAIL_SERVER"] = get_option('mailserver_url'); }
    //if (!isset($config["MAIL_SERVER_PORT"])) { $config["MAIL_SERVER_PORT"] =  get_option('mailserver_port'); }
    //if (!isset($config["MAIL_USERID"])) { $config["MAIL_USERID"] =  get_option('mailserver_login'); }
    //if (!isset($config["MAIL_PASSWORD"])) { $config["MAIL_PASSWORD"] =  get_option('mailserver_pass'); }
    //if (!isset($config["DEFAULT_POST_CATEGORY"])) { $config["DEFAULT_POST_CATEGORY"] =  get_option('default_email_category'); }
    if (!isset($config["MAIL_SERVER"])) {
        $config["MAIL_SERVER"] = NULL;
    }
    if (!isset($config["MAIL_SERVER_PORT"])) {
        $config["MAIL_SERVER_PORT"] = NULL;
    }
    if (!isset($config["MAIL_USERID"])) {
        $config["MAIL_USERID"] = NULL;
    }
    if (!isset($config["MAIL_PASSWORD"])) {
        $config["MAIL_PASSWORD"] = NULL;
    }
    if (!isset($config["DEFAULT_POST_CATEGORY"])) {
        $config["DEFAULT_POST_CATEGORY"] = NULL;
    }
    if (!isset($config["TIME_OFFSET"])) {
        $config["TIME_OFFSET"] = get_option('gmt_offset');
    }
    if (!isset($config["3GP_QT"])) {
        $config["3GP_QT"] = true;
    }
    if (!isset($config["3GP_FFMPEG"])) {
        $config["3GP_FFMPEG"] = "/usr/bin/ffmpeg";
    }
    if (!isset($config["WRAP_PRE"])) {
        $config["WRAP_PRE"] = 'no';
    }
    if (!isset($config["ADD_META"])) {
        $config["ADD_META"] = 'no';
    }
    return $config;
}