/** * Checks to see if the plugin is installed. * * If not, installs it. * * @access public * @static */ static function check() { $is_installed = get_option('bpfb_plugin', false); if (!$is_installed) { return BpfbInstaller::install(); } if (!BpfbInstaller::check_paths()) { return BpfbInstaller::install(); } return true; }
if (!defined('BPFB_IMAGE_LIMIT')) { define('BPFB_IMAGE_LIMIT', 5, true); } // Override link target preference in wp-config.php if (!defined('BPFB_LINKS_TARGET')) { define('BPFB_LINKS_TARGET', false, true); } $wp_upload_dir = wp_upload_dir(); define('BPFB_TEMP_IMAGE_DIR', $wp_upload_dir['basedir'] . '/bpfb/tmp/', true); define('BPFB_TEMP_IMAGE_URL', $wp_upload_dir['baseurl'] . '/bpfb/tmp/', true); define('BPFB_BASE_IMAGE_DIR', $wp_upload_dir['basedir'] . '/bpfb/', true); define('BPFB_BASE_IMAGE_URL', $wp_upload_dir['baseurl'] . '/bpfb/', true); // Hook up the installation routine and check if we're really, really set to go require_once BPFB_PLUGIN_BASE_DIR . '/lib/class_bpfb_installer.php'; register_activation_hook(__FILE__, array('BpfbInstaller', 'install')); BpfbInstaller::check(); if (file_exists(BPFB_PLUGIN_BASE_DIR . '/lib/external/wpmudev-dash-notification.php')) { require_once BPFB_PLUGIN_BASE_DIR . '/lib/external/wpmudev-dash-notification.php'; } /** * Helper functions for going around the fact that * BuddyPress is NOT multisite compatible. */ function bpfb_get_image_url($blog_id) { if (!defined('BP_ENABLE_MULTIBLOG') || !BP_ENABLE_MULTIBLOG) { return str_replace('http://', BPFB_PROTOCOL, BPFB_BASE_IMAGE_URL); } if (!$blog_id) { return str_replace('http://', BPFB_PROTOCOL, BPFB_BASE_IMAGE_URL); }