/**
 *This handles actually reading the config from the database
 * @return array
 */
function ReadDBConfig()
{
    SetupConfiguration();
    $config = array();
    global $wpdb;
    $data = $wpdb->get_results("SELECT label,value FROM " . POSTIE_TABLE . ";");
    if (is_array($data)) {
        foreach ($data as $row) {
            if (in_array($row->label, GetListOfArrayConfig())) {
                $config[$row->label] = unserialize($row->value);
            } else {
                $config[$row->label] = $row->value;
            }
        }
    }
    return $config;
}
Example #2
0
/**
 *This function retrieves the old-format config (pre 1.4) from the database
 * @return array
 */
function ReadDBConfig()
{
    $config = array();
    global $wpdb;
    $data = $wpdb->get_results("SELECT label,value FROM " . $GLOBALS["table_prefix"] . "postie_config;");
    if (is_array($data)) {
        foreach ($data as $row) {
            if (in_array($row->label, GetListOfArrayConfig())) {
                $config[$row->label] = unserialize($row->value);
            } else {
                $config[$row->label] = $row->value;
            }
        }
    }
    return $config;
}