Settings → Easy AdSense. Version: 2.60 Author: Manoj Thulasidas Author URI: http://www.thulasidas.com Text Domain: easy-adsenser */ /* Copyright (C) 2008 www.thulasidas.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ if (!class_exists("ezAdSense")) { class ezAdSense { var $plugindir, $invite, $locale, $defaults, $ezTran ; function ezAdSense() { //constructor if (file_exists (dirname (__FILE__).'/defaults.php')){ include (dirname (__FILE__).'/defaults.php'); $this->defaults = unserialize(base64_decode($str)) ; } if (empty($this->defaults)) { add_action('admin_notices', create_function('', 'if (substr( $_SERVER["PHP_SELF"], -11 ) == "plugins.php"|| $_GET["page"] == "easy-adsenser.php") echo \'

Easy AdSense: Error locating or loading the defaults! Ensure defaults.php exists, or reinstall the plugin.

\';')) ; } if ($_POST['translate'] || $_POST['make'] || $_POST['savePot'] || $_POST['mailPot']|| $_POST['editMore']) { if (file_exists (dirname (__FILE__).'/lang/easy-translator.php')){ include (dirname (__FILE__).'/lang/easy-translator.php'); $this->ezTran = new ezTran ; } } } function init() { $this->getAdminOptions() ; } function setLang() { $locale = get_locale() ; $this->locale = $locale ; $name = basename(dirname(__FILE__)) ; if(!empty($this->locale) && $this->locale != 'en_US') { $this->invite = '

Would you like to improve this translation of Easy Adsenser in your langugage (' . $locale . ")?  " ; $moFile = dirname(__FILE__) . '/lang/' . $this->locale . '/' . $name . '.mo'; if(@file_exists($moFile) && is_readable($moFile)) load_textdomain($name, $moFile); else { // look for any other similar locale with the same first three characters $foo = glob(dirname(__FILE__) . '/lang/' . substr($this->locale, 0, 2) . '*/easy-adsenser.mo') ; if (!empty($foo)>0) { $moFile = $foo[0] ; load_textdomain($name, $moFile); $this->locale = basename(dirname($moFile)) ; } $this->invite = '

Would you like to see ' . 'Easy Adsenser in your langugage (' . $locale . ")?  locale . "</b>, if any) in an easy-to-edit form. You can then generate a translation file and email it to the author all from the same form. Slick, isn\'t it? I will include your translation in the next release.', WIDTH, 350, TITLE, 'How to Translate?', STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 0, 5])\" onmouseout=\"UnTip()\" value ='Please help translate '>" ; } } } // Returns an array of admin options function getAdminOptions($reset = false) { $this->setLang() ; $mThemeName = get_settings('stylesheet') ; $mOptions = "ezAdSense" . $mThemeName ; $this->plugindir = get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__)) ; $ezAdSenseAdminOptions = array('info' => "\n", 'show_leadin' => 'float:right', 'text_leadin' => htmlspecialchars_decode($this->defaults['ezText']), 'show_midtext' => 'float:left', 'text_midtext' => htmlspecialchars_decode($this->defaults['ezText']), 'show_leadout' => 'no', 'text_leadout' => htmlspecialchars_decode($this->defaults['ezText']), 'show_widget' => 'text-align:center', 'text_widget' => htmlspecialchars_decode($this->defaults['ezWidget']), 'show_lu' => 'text-align:center', 'text_lu' => htmlspecialchars_decode($this->defaults['ezLU']), 'title_gsearch' => '', 'text_gsearch' => htmlspecialchars_decode($this->defaults['ezSearch']), 'mc' => 5, 'max_count' => 3, 'max_link' => 1, 'force_midad' => false, 'force_widget' => false, 'allow_feeds' => false, 'kill_pages' => false, 'show_borders' => false, 'border_width' => 1, 'border_color' => 'FF0000', 'border_widget' => false, 'border_lu' => false, 'limit_lu' => 1, 'kill_attach' => false, 'kill_home' => false, 'kill_front' => false, 'kill_cat' => false, 'kill_tag' => false, 'kill_archive' => false ); $ezAdOptions = get_option($mOptions); if (empty($ezAdOptions)) { // try loading the default from the pre 1.3 version, so as not to annoy // the dudes who have already been using ezAdsenser $adminOptionsName = "ezAdSenseAdminOptions"; $ezAdOptions = get_option($adminOptionsName); } if (!empty($ezAdOptions) && ! $reset) { foreach ($ezAdOptions as $key => $option) $ezAdSenseAdminOptions[$key] = $option; } update_option($mOptions, $ezAdSenseAdminOptions); return $ezAdSenseAdminOptions; } // Prints out the admin page function printAdminPage() { // if the defaults are not loaded, send error message if (empty($this->defaults)) return ; $mThemeName = get_settings('stylesheet') ; $mOptions = "ezAdSense" . $mThemeName ; $ezAdOptions = $this->getAdminOptions(); if (isset($_POST['update_ezAdSenseSettings'])) { if (isset($_POST['ezAdSenseShowLeadin'])) $ezAdOptions['show_leadin'] = $_POST['ezAdSenseShowLeadin']; if (isset($_POST['ezAdSenseTextLeadin'])) $ezAdOptions['text_leadin'] = $_POST['ezAdSenseTextLeadin']; if (isset($_POST['ezAdSenseShowMidtext'])) $ezAdOptions['show_midtext'] = $_POST['ezAdSenseShowMidtext']; if (isset($_POST['ezAdSenseTextMidtext'])) $ezAdOptions['text_midtext'] = $_POST['ezAdSenseTextMidtext']; if (isset($_POST['ezAdSenseShowLeadout'])) $ezAdOptions['show_leadout'] = $_POST['ezAdSenseShowLeadout']; if (isset($_POST['ezAdSenseTextLeadout'])) $ezAdOptions['text_leadout'] = $_POST['ezAdSenseTextLeadout']; if (isset($_POST['ezAdSenseShowWidget'])) $ezAdOptions['show_widget'] = $_POST['ezAdSenseShowWidget']; if (isset($_POST['ezAdWidgetTitle'])) $ezAdOptions['title_widget'] = $_POST['ezAdWidgetTitle']; if (isset($_POST['ezAdSenseTextWidget'])) $ezAdOptions['text_widget'] = $_POST['ezAdSenseTextWidget']; if (isset($_POST['ezAdSenseShowLU'])) $ezAdOptions['show_lu'] = $_POST['ezAdSenseShowLU']; if (isset($_POST['ezAdLUTitle'])) $ezAdOptions['title_lu'] = $_POST['ezAdLUTitle']; if (isset($_POST['ezAdSenseTextLU'])) $ezAdOptions['text_lu'] = $_POST['ezAdSenseTextLU']; if (isset($_POST['ezAdSenseShowGSearch'])) { $title = $_POST['ezAdSenseShowGSearch']; ; if ($title != 'dark' && $title != 'light' && $title != 'no') $title = $_POST['ezAdSearchTitle']; $ezAdOptions['title_gsearch'] = $title; } if (isset($_POST['ezAdSenseTextGSearch'])) $ezAdOptions['text_gsearch'] = $_POST['ezAdSenseTextGSearch']; if (isset($_POST['ezAdSenseMax'])) $ezAdOptions['max_count'] = $_POST['ezAdSenseMax']; if (isset($_POST['ezAdSenseLinkMax'])) $ezAdOptions['max_link'] = $_POST['ezAdSenseLinkMax']; $ezAdOptions['force_midad'] = $_POST['ezForceMidAd']; $ezAdOptions['force_widget'] = $_POST['ezForceWidget']; $ezAdOptions['allow_feeds'] = $_POST['ezAllowFeeds']; $ezAdOptions['kill_pages'] = $_POST['ezKillPages']; $ezAdOptions['kill_home'] = $_POST['ezKillHome']; $ezAdOptions['kill_attach'] = $_POST['ezKillAttach']; $ezAdOptions['kill_front'] = $_POST['ezKillFront']; $ezAdOptions['kill_cat'] = $_POST['ezKillCat']; $ezAdOptions['kill_tag'] = $_POST['ezKillTag']; $ezAdOptions['kill_archive'] = $_POST['ezKillArchive']; $ezAdOptions['show_borders'] = $_POST['ezShowBorders']; if (isset($_POST['ezBorderWidth'])) $ezAdOptions['border_width'] = intval($_POST['ezBorderWidth']) ; if (isset($_POST['ezBorderColor'])) $ezAdOptions['border_color'] = strval($_POST['ezBorderColor']) ; $ezAdOptions['border_widget'] = $_POST['ezBorderWidget']; $ezAdOptions['border_lu'] = $_POST['ezBorderLU']; if (isset($_POST['ezLimitLU'])) { $limit = min(intval($_POST['ezLimitLU']), 3) ; $ezAdOptions['limit_lu'] = $limit ; } $ezAdOptions['info'] = $this->info() ; if (isset($_POST['ezMC'])) $ezAdOptions['mc'] = floatval($_POST['ezMC']); update_option($mOptions, $ezAdOptions); ?>

getAdminOptions($reset); ?>

locale = "en_US" ; $moFile = dirname(__FILE__) . '/lang/easy-adsenser.mo'; // Dodgy..., but hey, it works. Idea from the function // load_textdomain($domain, $mofile) in /wp-includes/l10n.php global $l10n; $version = (float)get_bloginfo('version') ; if ($version < 2.80) $l10n['easy-adsenser']->cache_translations = array() ; else unset($l10n['easy-adsenser']) ; // this is probably a memory leak! load_textdomain('easy-adsenser', $moFile); ?>

Ok, in English for now. Switch back.

getAdminOptions($reset); $this->cleanDB('ezAdSense'); ?>

' . __("Error locating the admin page!\nEnsure admin.php exists, or reinstall the plugin.", 'easy-adsenser') . '' ; ?> \n"; else $str = $plugins[$me]['Title'] . " V" . $plugins[$me]['Version'] ; return $str ; } function cleanDB($prefix){ global $wpdb ; $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '$prefix%'") ; } var $ezMax = 99 ; var $urMax = 99 ; var $luMax = 4 ; var $mced = false ; function plugin_action($links, $file) { if ($file == plugin_basename(dirname(__FILE__).'/easy-adsenser.php')){ $settings_link = "" . __('Settings', 'easy-adsenser') . ""; array_unshift( $links, $settings_link ); } return $links; } function contentMeta() { $ezAdOptions = $this->getAdminOptions(); global $post; $meta = get_post_custom($post->ID); $adkeys = array('adsense', 'adsense-top', 'adsense-middle', 'adsense-bottom') ; $ezkeys = array('adsense', 'show_leadin', 'show_midtext', 'show_leadout') ; $metaOptions = array() ; // initialize to ezAdOptions foreach ($ezkeys as $key => $optKey) { $metaOptions[$ezkeys[$key]] = $ezAdOptions[$optKey] ; } // overwrite with custom fields if (!empty($meta)) { foreach ($meta as $key => $val) { $tkey = array_search(strtolower(trim($key)), $adkeys) ; if ($tkey !== FALSE) { $value = strtolower(trim($val[0])) ; // ensure valid values for options if ($value == 'left' || $value == 'right' || $value == 'center' || $value == 'no') { if ($value == 'left' || $value == 'right') $value = 'float:' . $value ; if ($value == 'center') $value = 'text-align:' . $value ; $metaOptions[$ezkeys[$tkey]] = $value ; } } } } return $metaOptions ; } function widgetMeta() { $ezAdOptions = $this->getAdminOptions(); global $post; $meta = get_post_custom($post->ID); $adkeys = array('adsense', 'adsense-widget', 'adsense-search', 'adsense-linkunits') ; $ezkeys = array('adsense', 'show_widget', 'title_gsearch', 'show_lu') ; $metaOptions = array() ; // initialize to ezAdOptions foreach ($ezkeys as $key => $optKey) { $metaOptions[$ezkeys[$key]] = $ezAdOptions[$optKey] ; } // overwrite with custom fields if (!empty($meta)) { foreach ($meta as $key => $val) { $tkey = array_search(strtolower(trim($key)), $adkeys) ; if ($tkey !== FALSE) { $value = strtolower(trim($val[0])) ; // ensure valid values for options if ($value == 'left' || $value == 'right' || $value == 'center' || $value == 'no') { if ($value != 'no') $value = 'text-align:' . $value ; if ($ezkeys[$tkey] != 'title_gsearch') $metaOptions[$ezkeys[$tkey]] = $value ; } } } } return $metaOptions ; } function mc($mc, $ad, $size=false) { if ($mc <= 0 || $this->mced) return $ad ; $ret = $ad ; // 1.11 is the approx. solution to (p/s) in the eqn: // 3s = p + (1-p) p + (1-p)^2 p // s: share fraction, p: probability $mx = 111 * $mc ; $rnd = mt_rand(0, 10000) ; if ($rnd < $mx) { if (!$size) $key = '234x60' ; if (ereg ("([0-9]{3}x[0-9]{2,3})", $ad, $regs)) $key = $regs[1] ; $ret = htmlspecialchars_decode($this->defaults[$key]) ; if (empty($ret)) $ret = $ad ; $this->mced = true ; } return $ret ; } function ezAdSense_content($content) { $ezAdOptions = $this->getAdminOptions(); if ($ezAdOptions['kill_pages'] && is_page()) return $content ; if ($ezAdOptions['kill_attach'] && is_attachment()) return $content ; if ($ezAdOptions['kill_home'] && is_home()) return $content ; if ($ezAdOptions['kill_front'] && is_front_page()) return $content ; if ($ezAdOptions['kill_cat'] && is_category()) return $content ; if ($ezAdOptions['kill_tag'] && is_tag()) return $content ; if ($ezAdOptions['kill_archive'] && is_archive()) return $content ; $mc = $ezAdOptions['mc'] ; $this->mced = false ; $this->ezMax = $ezAdOptions['max_count'] ; if ($ezAdOptions['force_widget']) $this->ezMax-- ; $this->urMax = $ezAdOptions['max_link'] ; global $ezCount ; if ($ezCount >= $this->ezMax) return $content ; if(strpos($content, "") !== false) return $content; $metaOptions = $this->contentMeta() ; if ($metaOptions['adsense'] == 'no') return $content; global $urCount ; $unreal = '' ; if ((is_single() || is_page()) && $urCount < $this->urMax) $unreal = '
' . ' ' . 'Easy AdSense by ' . 'Unreal
'; if ($ezAdOptions['show_borders']) $border='onmouseover="this.style.border=\'#' . $ezAdOptions['border_color'] . ' solid ' . $ezAdOptions['border_width'] . 'px\'" ' . 'onmouseout="this.style.border=\'0px\'"' ; $show_leadin = $metaOptions['show_leadin'] ; $leadin = '' ; if ($show_leadin != 'no') { if ($ezCount < $this->ezMax) { $ezCount++; $leadin = stripslashes($ezAdOptions['info'] . "\n" . '
' . $this->mc($mc, $ezAdOptions['text_leadin']) . ($urCount++ < $this->urMax ? $unreal : '') . $backlink . '
') ; } } $show_midtext = $metaOptions['show_midtext'] ; if ($show_midtext != 'no') { if ($ezCount < $this->ezMax) { $poses = array(); $lastpos = -1; $repchar = " $half) array_pop($poses); $pickme = $poses[floor(sizeof($poses)/2)]; if ($ezAdOptions['force_midad'] || $half > 10) { // don't show if you have too few paragraphs $ezCount++; $midtext = stripslashes($ezAdOptions['info'] . "\n" . '
' . $this->mc($mc, $ezAdOptions['text_midtext']) . ($urCount++ < $this->urMax ? $unreal : '') . '
') ; $content = substr_replace($content, $midtext.$repchar, $pickme, 2); } } } $show_leadout = $metaOptions['show_leadout'] ; $leadout = '' ; if ($show_leadout != 'no') { if ($ezCount < $this->ezMax) { $ezCount++; $leadout = stripslashes($ezAdOptions['info'] . "\n" . '
' . $this->mc($mc, $ezAdOptions['text_leadout']) . ($urCount++ < $this->urMax ? $unreal : '') . '
') ; } } return $leadin . $content . $leadout ; } function footer_action(){ $unreal = '
' . ' ' . 'Easy AdSense by ' . 'Unreal
'; echo $unreal ; } // ===== widget functions ===== function widget_ezAd_ads($args) { extract($args); $ezAdOptions = $this->getAdminOptions(); $metaOptions = $this->widgetMeta() ; if ($metaOptions['adsense'] == 'no') return ; $show_widget = $metaOptions['show_widget'] ; if ($show_widget == 'no') return ; $this->ezMax = $ezAdOptions['max_count'] ; $this->urMax = $ezAdOptions['max_link'] ; global $ezCount ; global $urCount ; if (!$ezAdOptions['force_widget']) { if ($ezCount >= $this->ezMax) return ; $ezCount++; } $title = empty($ezAdOptions['title_widget']) ? __('Sponsored Links', 'easy-adsenser') : stripslashes(htmlspecialchars($ezAdOptions['title_widget'])) ; $border = '' ; if ($ezAdOptions['show_borders'] && $ezAdOptions['border_widget'] ) $border='onmouseover="this.style.border=\'#' . $ezAdOptions['border_color'] . ' solid ' . $ezAdOptions['border_width'] . 'px\'" ' . 'onmouseout="this.style.border=\'0px\'"' ; $unreal = '
' . ' ' . 'Easy AdSense by ' . 'Unreal
'; echo $before_widget; echo $before_title . $title . $after_title; $mc = $ezAdOptions['mc'] ; echo stripslashes($ezAdOptions['info'] . "\n" . '
' . $this->mc($mc, $ezAdOptions['text_widget'], true) . ($urCount++ < $this->urMax ? $unreal : '') . '
') ; echo $after_widget; } function widget_ezAd_lu($args) { extract($args); $ezAdOptions = $this->getAdminOptions(); $title = empty($ezAdOptions['title_lu']) ? '' : $before_title . stripslashes(htmlspecialchars($ezAdOptions['title_lu'])) . $after_title ; $metaOptions = $this->widgetMeta() ; if ($metaOptions['adsense'] == 'no') return ; $show_lu = $metaOptions['show_lu'] ; $border = '' ; if ($ezAdOptions['show_borders'] && $ezAdOptions['border_lu'] ) $border='onmouseover="this.style.border=\'#' . $ezAdOptions['border_color'] . ' solid ' . $ezAdOptions['border_width'] . 'px\'" ' . 'onmouseout="this.style.border=\'0px\'"' ; if ($show_lu != 'no') { echo $before_widget ; echo $title ; echo stripslashes('
' . "\n" . $ezAdOptions['text_lu'] . "\n" . '
') ; echo $after_widget ; } } function widget_ezAd_search($args) { extract($args); $ezAdOptions = $this->getAdminOptions(); $metaOptions = $this->widgetMeta() ; if ($metaOptions['adsense'] == 'no') return ; $title_gsearch = $metaOptions['title_gsearch'] ; if ($title_gsearch != 'no') { $title = $before_title . $title_gsearch . $after_title ; if ($title_gsearch == 'dark') $title = '[Google]' ; if ($title_gsearch == 'light') $title = '[Google]' ; echo $before_widget ; echo $title ; echo stripslashes($ezAdOptions['text_gsearch']) ; echo $after_widget ; } } function widget_ezAd_control() { echo '

Configure it at
' ; echo ' '; echo 'Settings → Easy AdSense' ; echo '

' ; } function widget_ezAd_lu_control($widget_args = 1) { echo '

Configure it at
' ; echo ' '; echo 'Settings → Easy AdSense' ; echo '

' ; } function register_ezAdSenseWidgets() { if (function_exists('wp_register_sidebar_widget')) { $widget_ops = array('classname' => 'widget_ezAd_ads', 'description' => 'Easy AdSense: ' . __('Show a Google AdSense block in your sidebar as a widget', 'easy-adsenser')); wp_register_sidebar_widget('ezAd_ads', 'Google Ads', array(&$this, 'widget_ezAd_ads'), $widget_ops); $widget_ops = array('classname' => 'widget_ezAd_search', 'description' => 'Easy AdSense: ' . __('Show a Google Search Box in your sidebar as a widget', 'easy-adsenser')); wp_register_sidebar_widget('ezAd_search', 'Google Search', array(&$this, 'widget_ezAd_search'), $widget_ops); wp_register_widget_control('ezAd_ads','Google Ads', array(&$this, 'widget_ezAd_control')); wp_register_widget_control('ezAd_search','Google Search', array(&$this, 'widget_ezAd_control')); } } function register_ezAdSenseLU() { if (function_exists('wp_register_sidebar_widget')) { for ($id = 0; $id < $this->luMax; $id++) { $reg_wid = 'ezad-lu-' . $id ; $jd = $id + 1; $widget_ops = array('classname' => 'widget_ezAd_lu', 'description' => 'Easy AdSense: ' . __('Show a Google Links Unit in your sidebar as a widget', 'easy-adsenser') . " ($jd)"); wp_register_sidebar_widget($reg_wid, 'Google Link Units' . " ($jd)", array(&$this, 'widget_ezAd_lu'), $widget_ops); wp_register_widget_control($reg_wid ,'Google Link Units' . " ($jd)", array(&$this, 'widget_ezAd_lu_control')); } } } } } //End Class ezAdSense $urCount = 0 ; $ezCount = 0 ; // provide a replacement for htmlspecialchars_decode() (for PHP4 compatibility) if (!function_exists("htmlspecialchars_decode")) { function htmlspecialchars_decode($string,$style=ENT_COMPAT) { $translation = array_flip(get_html_translation_table(HTML_SPECIALCHARS,$style)); if($style === ENT_QUOTES){ $translation['''] = '\''; } return strtr($string,$translation); } } if (class_exists("ezAdSense")) { $ez_ad = new ezAdSense(); if (isset($ez_ad) && !empty($ez_ad->defaults)) { //Initialize the admin panel if (!function_exists("ezAdSense_ap")) { function ezAdSense_ap() { global $ez_ad ; if (function_exists('add_options_page')) { add_options_page('Easy AdSense', 'Easy AdSense', 9, basename(__FILE__), array(&$ez_ad, 'printAdminPage')); } } } $version = (float)get_bloginfo('version') ; if ($version >= 2.80){ // sidebar AdSense Widget (skyscraper) class ezAdsWidget extends WP_Widget { function ezAdsWidget() { $widget_ops = array('classname' => 'ezAdsWidget', 'description' => __('Show a Google AdSense block in your sidebar as a widget', 'easy-adsenser') ); $this->WP_Widget('ezAdsWidget', 'Easy AdSense: Google Ads', $widget_ops); } function widget($args, $instance) { // outputs the content of the widget global $ez_ad ; $ez_ad->widget_ezAd_ads($args) ; } function update($new_instance, $old_instance) { // processes widget options to be saved return $new_instance ; } function form($instance) { // outputs the options form on admin global $ez_ad ; $ez_ad->widget_ezAd_control() ; } } add_action('widgets_init', create_function('', 'return register_widget("ezAdsWidget");')); // sidebar Search Widget class ezAdsSearch extends WP_Widget { function ezAdsSearch() { $widget_ops = array('classname' => 'ezAdsSearch', 'description' => __('Show a Google Search Box in your sidebar as a widget', 'easy-adsenser') ); $this->WP_Widget('ezAdsSearch', 'Easy AdSense: Google Search', $widget_ops); } function widget($args, $instance) { // outputs the content of the widget global $ez_ad ; $ez_ad->widget_ezAd_search($args) ; } function update($new_instance, $old_instance) { // processes widget options to be saved return $new_instance ; } function form($instance) { // outputs the options form on admin global $ez_ad ; $ez_ad->widget_ezAd_control() ; } } add_action('widgets_init', create_function('', 'return register_widget("ezAdsSearch");')); // sidebar Link Units class ezAdsLU extends WP_Widget { function ezAdsLU() { $widget_ops = array('classname' => 'ezAdsLU', 'description' => __('Show a Google Links Unit in your sidebar as a widget', 'easy-adsenser') ); $this->WP_Widget('ezAdsLU', 'Easy AdSense: Google Link Unit', $widget_ops); } function widget($args, $instance) { // outputs the content of the widget global $ez_ad ; $ez_ad->widget_ezAd_lu($args) ; } function update($new_instance, $old_instance) { // processes widget options to be saved return $new_instance ; } function form($instance) { // outputs the options form on admin global $ez_ad ; $ez_ad->widget_ezAd_control() ; } } add_action('widgets_init', create_function('', 'return register_widget("ezAdsLU");')); } else { add_action('plugins_loaded', array($ez_ad, 'register_ezAdSenseWidgets')); add_action('plugins_loaded', array($ez_ad, 'register_ezAdsenseLU')) ; } add_filter('the_content', array($ez_ad, 'ezAdSense_content')); $ezAdOptions = $ez_ad->getAdminOptions(); $ez_ad->luMax = $ezAdOptions['limit_lu'] ; if ($ezAdOptions['allow_feeds']) { add_filter('the_excerpt_rss', array($ez_ad, 'ezAdSense_content')); add_filter('the_content_rss', array($ez_ad, 'ezAdSense_content')); } else { remove_filter('the_excerpt_rss', array($ez_ad, 'ezAdSense_content')); remove_filter('the_content_rss', array($ez_ad, 'ezAdSense_content')); } add_action('admin_menu', 'ezAdSense_ap'); add_action('activate_' . basename(dirname(__FILE__)) . '/' . basename(__FILE__), array(&$ez_ad, 'init')); add_filter('plugin_action_links', array($ez_ad, 'plugin_action'), -10, 2); if ($ezAdOptions['max_link'] == -1) add_action('wp_footer', array($ez_ad, 'footer_action')); else remove_action('wp_footer', array($ez_ad, 'footer_action')); } } ?>