plgDir = dirname(__FILE__); $this->plgURL = plugin_dir_url(__FILE__); $this->isPro = file_exists("{$this->plgDir}/admin/options-advanced.php"); $this->strPro = ' Lite'; if ($this->isPro) { $this->strPro = ' Pro'; } if (is_admin()) { require_once($this->plgDir . '/EzTran.php'); $this->domain = 'ads-ez'; $this->ezTran = new EzTran(__FILE__, "Ads EZ{$this->strPro}", $this->domain); $this->ezTran->setLang(); } } 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; } static function install() { $mOptions = "adsEz"; $ezOptions = get_option($mOptions); if (empty($ezOptions)) { // create the necessary tables $isInstallingWP = true; chdir(dirname(__FILE__) . '/admin'); require_once('dbSetup.php'); $ezOptions['isSetup'] = true; } update_option($mOptions, $ezOptions); } static function uninstall() { $mOptions = "adsEz"; delete_option($mOptions); } function printAdminPage() { $testFile = plugins_url("admin/promo.php", __FILE__); if (!@file_get_contents($testFile)) { // index cannot be used for testing ?>
This plugin needs direct access to its files so that they can be loaded in an iFrame. Looks like you have some security setting denying the required access. If you have an .htaccess file in your wp-content folder, please remove it or modify it to allow access to the php files in plgDir; ?>/.
"; } } } //End Class AdsEZ if (class_exists("AdsEZ")) { $adsEz = new 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 = dirname(__FILE__) . '/ads-ez.php'; register_activation_hook($file, array("AdsEZ", 'install')); register_deactivation_hook($file, array("AdsEZ", 'uninstall')); }