コード例 #1
0
ファイル: firestats-wordpress.php プロジェクト: alx/blogsfera
    unset($_GET['fs_javascript']);
    // security check
    if (strpos($file, "..") !== false) {
        die(".. is not allowed in fs_javascript");
    }
    require_once "{$path}/{$file}";
    die;
}
// if WPLANG is defined, set FireStats's default language to it.
if (defined('WPLANG') && !defined('FS_DEFAULT_LANG')) {
    define('FS_DEFAULT_LANG', WPLANG);
}
global $FS_CONTEXT;
$FS_CONTEXT = array();
$FS_CONTEXT['TYPE'] = 'WORDPRESS';
$FS_CONTEXT['WP_PATH'] = fs_get_wp_config_path();
$FS_CONTEXT['JAVASCRIPT_URL'] = fs_get_js_url();
/**
 * Only initialize the plugin if not indirectly invoked from ajax plugin
 * to avoid wierd order of initialization problems caused by various wordpress versions.
 */
if (!defined('FS_AJAX_HANDLER')) {
    $is_wpmu = fs_is_wpmu();
    fs_initialize_wp_plugin($is_wpmu);
}
function fs_initialize_fs_callbacks()
{
    $FS_PATH = fs_get_firestats_path();
    if ($FS_PATH) {
        require_once $FS_PATH . '/php/plugins.php';
        fs_add_action("db_upgraded", "fs_plugin_db_update");
コード例 #2
0
ファイル: db-config-utils.php プロジェクト: alx/blogsfera
function fs_load_config()
{
    $db_config_type = fs_get_db_config_type();
    if ($db_config_type == FS_DB_CONFIG_FILE) {
        // note:
        // this is not require_once on purpose!
        // we need this to be included even if it was included before.
        require dirname(__FILE__) . '/fs-config.php';
    } else {
        if ($db_config_type == FS_DB_CONFIG_WORDPRESS) {
            require_once fs_get_wp_config_path();
            $fs_config['DB_NAME'] = DB_NAME;
            if (!fs_is_wpmu()) {
                global $table_prefix;
                $db_prefix = isset($table_prefix) ? $table_prefix : '';
            } else {
                global $wpmuBaseTablePrefix;
                $db_prefix = isset($wpmuBaseTablePrefix) ? $wpmuBaseTablePrefix : '';
            }
            $fs_config['DB_PREFIX'] = $db_prefix;
            $fs_config['DB_USER'] = DB_USER;
            $fs_config['DB_PASS'] = DB_PASSWORD;
            $fs_config['DB_HOST'] = DB_HOST;
            $GLOBALS['fs_config'] = $fs_config;
        } else {
            // load default values
            $fs_config['DB_NAME'] = 'firestats';
            $fs_config['DB_PREFIX'] = '';
            $fs_config['DB_USER'] = '';
            $fs_config['DB_PASS'] = '';
            $fs_config['DB_HOST'] = 'localhost';
            $GLOBALS['fs_config'] = $fs_config;
        }
    }
}