$CONFIG['site_url'] =& $CONFIG['ecards_more_pic_target'];
// Set the site_url in js_vars so that it can be used in js
set_js_var('site_url', rtrim($CONFIG['site_url'], '/'));
// Set a constant for the default language and theme (in the gallery config), since it might get replaced during runtime
define('DEFAULT_LANGUAGE', $CONFIG['lang']);
define('DEFAULT_THEME', $CONFIG['theme']);
// Check for GD GIF Create support
if ($CONFIG['thumb_method'] == 'im' || function_exists('imagecreatefromgif')) {
    $CONFIG['GIF_support'] = 1;
} else {
    $CONFIG['GIF_support'] = 0;
}
// Include plugin API
require 'include/plugin_api.inc.php';
if ($CONFIG['enable_plugins'] == 1) {
    CPGPluginAPI::load();
}
// Set UDB_INTEGRATION if enabled in admin
if ($CONFIG['bridge_enable'] == 1 && !defined('BRIDGEMGR_PHP')) {
    $BRIDGE = cpg_get_bridge_db_values();
} else {
    $BRIDGE['short_name'] = 'coppermine';
    $BRIDGE['recovery_logon_failures'] = 0;
    $BRIDGE['use_post_based_groups'] = false;
}
define('UDB_INTEGRATION', $BRIDGE['short_name']);
require_once 'bridge/' . UDB_INTEGRATION . '.inc.php';
// Start output buffering
ob_start('cpg_filter_page_html');
// Parse cookie stored user profile
user_get_profile();