plgDir = __DIR__; // cannot be in the base class! $this->plgURL = plugin_dir_url(__FILE__); // cannot be in the base class! parent::__construct(); $this->name = $name; $this->key = $key; } static function install($dir = '', $mOptions = 'adsEz') { parent::install(__DIR__, 'adsEz'); } static function uninstall($mOptions = 'adsEz') { parent::uninstall('adsEz'); } function displayAd($atts, $content = '') { $query = "?wp"; $vars = array("cat" => "", "type" => "banner", "size" => "300x250"); $vars = shortcode_atts($vars, $atts); foreach ($vars as $k => $v) { if (!empty($v)) { $query .= "&$k=$v"; } } list($w, $h) = explode("x", $vars['size']); $adLink = ""; return $adLink; } } } //End Class AdsEZ if (class_exists("AdsEZ")) { $adsEz = new AdsEZ('Ads EZ', 'adsEz'); add_action('admin_menu', 'adsEz_admin_menu'); add_shortcode('adsez', array($adsEz, 'displayAd')); add_shortcode('adsEz', array($adsEz, 'displayAd')); add_shortcode('ads-ez', array($adsEz, 'displayAd')); if (!function_exists('adsEz_admin_menu')) { function adsEz_admin_menu() { global $adsEz; $mName = 'Ads EZ ' . $adsEz->strPro; add_options_page($mName, $mName, 'activate_plugins', basename(__FILE__), array($adsEz, 'printAdminPage')); } } $file = __DIR__ . '/ads-ez.php'; register_activation_hook($file, array("AdsEZ", 'install')); register_deactivation_hook($file, array("AdsEZ", 'uninstall')); }