define_constants(); $this->load_options(); $this->load_dependencies(); // Init options & tables during activation & deregister init option register_activation_hook( dirname(__FILE__) . '/nggimageflow.php', array(&$this, 'activate') ); // make it multilingual add_action('init', array(&$this, 'load_textdomain') ); if ( function_exists('register_uninstall_hook') ) register_uninstall_hook( dirname(__FILE__) . '/admin/install.php', 'nggflow_uninstall' ); // load styles and scripts into the head add_action('wp_head', array(&$this, 'load_head') ); } function define_constants() { // Pre-2.6 compatibility if ( !defined('WP_CONTENT_URL') ) define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // define URL define('NGGIMAGEFLOW_URLPATH', WP_CONTENT_URL.'/plugins/'.plugin_basename( dirname(__FILE__)).'/' ); } function load_dependencies() { if ( is_admin() ) { require_once (dirname (__FILE__) . '/admin/admin.php'); $nggflowAdminPanel = new nggflowAdminPanel(); } else { require_once (dirname (__FILE__).'/lib/shortcodes.php'); require_once (dirname (__FILE__).'/lib/functions.php'); } } function load_textdomain() { if (function_exists('load_plugin_textdomain')) { load_plugin_textdomain('nggflow','wp-content/plugins/'.dirname(plugin_basename(__FILE__)).'/langs'); } } function load_options() { // Load the options $this->options = get_option('ngg_if_options'); } function activate() { include_once (dirname (__FILE__) . '/admin/install.php'); ngg_if_default_options(); } function load_head() { if ($this->options['ngg_if_use_style'] == "true") { wp_enqueue_style( 'imageflow', NGGIMAGEFLOW_URLPATH.'imageflow/imageflow.css', false, '2.5.0', 'screen' ); } echo ''."\n"; } } // Let's get the show on the road global $nggflow; $nggflow = new nggflowloader(); } ?>