Version Description
Code clean up -- removing unused functions, indenting the code.
=
Download this release
Release Info
Developer | manojtd |
Plugin | Easy Plugin for AdSense |
Version | 5.06 |
Comparing to | |
See all releases |
Code changes from version 5.05 to 5.06
- easy-adsense-lite.php +115 -92
- readme.txt +6 -5
easy-adsense-lite.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Easy AdSense Lite
|
4 |
Plugin URI: http://www.thulasidas.com/adsense
|
5 |
Description: Easiest way to show AdSense and make money from your blog. Configure it at <a href="options-general.php?page=easy-adsense-lite.php">Settings → Easy AdSense Lite</a>.
|
6 |
-
Version: 5.
|
7 |
Author: Manoj Thulasidas
|
8 |
Author URI: http://www.thulasidas.com
|
9 |
*/
|
@@ -82,7 +82,6 @@ if (!class_exists("ezAdSense")) {
|
|
82 |
'<b>Easy Adsense Lite</b> in your langugage (<b>' . $locale .
|
83 |
"</b>)? <input type='submit' name='ezAds-translate' onmouseover=\"Tip('It is easy to have <b>Easy AdSense Lite</b> in your language. All you have to do is to translate some strings, and email the file to the author.<br /><br />If you would like to help, please use the translation interface. It picks up the translatable strings in <b>Easy AdSense Lite</b> and presents them (and their existing translations in <b>" . $this->locale .
|
84 |
"</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 ' /></font>" ;
|
85 |
-
|
86 |
}
|
87 |
}
|
88 |
}
|
@@ -357,7 +356,8 @@ if (!class_exists("ezAdSense")) {
|
|
357 |
$me = basename(dirname(__FILE__)) . '/' . basename(__FILE__);
|
358 |
$plugins = get_plugins() ;
|
359 |
if ($hide)
|
360 |
-
$str = "<!-- " . $plugins[$me]['Title'] . " V" .
|
|
|
361 |
else
|
362 |
$str = $plugins[$me]['Title'] . " V" . $plugins[$me]['Version'] ;
|
363 |
return $str ;
|
@@ -373,7 +373,7 @@ if (!class_exists("ezAdSense")) {
|
|
373 |
var $luMax = 4 ;
|
374 |
|
375 |
function plugin_action($links, $file) {
|
376 |
-
if ($file == plugin_basename(dirname(__FILE__).'/easy-adsense-lite.php')){
|
377 |
$settings_link = "<a href='options-general.php?page=easy-adsense-lite.php'>" .
|
378 |
__('Settings', 'easy-adsenser') . "</a>";
|
379 |
array_unshift( $links, $settings_link );
|
@@ -401,7 +401,8 @@ if (!class_exists("ezAdSense")) {
|
|
401 |
if ($tkey !== FALSE) {
|
402 |
$value = strtolower(trim($val[0])) ;
|
403 |
// ensure valid values for options
|
404 |
-
if ($value == 'left' || $value == 'right'
|
|
|
405 |
if ($value == 'left' || $value == 'right') $value = 'float:' . $value ;
|
406 |
if ($value == 'center') $value = 'text-align:' . $value ;
|
407 |
$metaOptions[$ezkeys[$tkey]] = $value ;
|
@@ -416,8 +417,10 @@ if (!class_exists("ezAdSense")) {
|
|
416 |
$ezAdOptions = $this->getAdminOptions();
|
417 |
global $post;
|
418 |
$meta = get_post_custom($post->ID);
|
419 |
-
$adkeys = array('adsense', 'adsense-widget',
|
420 |
-
|
|
|
|
|
421 |
$metaOptions = array() ;
|
422 |
// initialize to ezAdOptions
|
423 |
foreach ($ezkeys as $key => $optKey) {
|
@@ -431,9 +434,11 @@ if (!class_exists("ezAdSense")) {
|
|
431 |
if ($tkey !== FALSE) {
|
432 |
$value = strtolower(trim($val[0])) ;
|
433 |
// ensure valid values for options
|
434 |
-
if ($value == 'left' || $value == 'right'
|
|
|
435 |
if ($value != 'no') $value = 'text-align:' . $value ;
|
436 |
-
if ($ezkeys[$tkey] != 'title_gsearch')
|
|
|
437 |
}
|
438 |
}
|
439 |
}
|
@@ -441,10 +446,6 @@ if (!class_exists("ezAdSense")) {
|
|
441 |
return $metaOptions ;
|
442 |
}
|
443 |
|
444 |
-
function mc($mc, $ad, $size=false, $key='160x600') {
|
445 |
-
return $ad ;
|
446 |
-
}
|
447 |
-
|
448 |
function ezAdSense_content($content) {
|
449 |
// if (!$ezAdOptions['allow_feeds'] && is_feed()) return $content ;
|
450 |
if (is_feed()) return $content ;
|
@@ -463,7 +464,8 @@ if (!class_exists("ezAdSense")) {
|
|
463 |
if ($ezCount >= $this->ezMax) return $content ;
|
464 |
if(strpos($content, "<!--noadsense-->") !== false) return $content;
|
465 |
$metaOptions = $this->contentMeta() ;
|
466 |
-
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no')
|
|
|
467 |
$this->handleDefaults($ezAdOptions) ;
|
468 |
|
469 |
$wc = str_word_count($content) ;
|
@@ -493,15 +495,17 @@ if (!class_exists("ezAdSense")) {
|
|
493 |
$ezCount++;
|
494 |
$margin = $ezAdOptions['margin_leadin'] ;
|
495 |
if ($ezAdOptions['kill_inline'])
|
496 |
-
|
497 |
-
|
498 |
-
|
|
|
499 |
$leadin =
|
500 |
-
stripslashes($ezAdOptions['info'] .
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
|
|
505 |
}
|
506 |
}
|
507 |
|
@@ -528,15 +532,17 @@ if (!class_exists("ezAdSense")) {
|
|
528 |
$ezCount++;
|
529 |
$margin = $ezAdOptions['margin_midtext'] ;
|
530 |
if ($ezAdOptions['kill_inline'])
|
531 |
-
|
532 |
-
|
533 |
-
|
|
|
534 |
$midtext =
|
535 |
-
stripslashes($ezAdOptions['info'] .
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
|
|
540 |
$content = substr_replace($content, $midtext.$repchar, $pickme, 2);
|
541 |
}
|
542 |
}
|
@@ -549,15 +555,17 @@ if (!class_exists("ezAdSense")) {
|
|
549 |
$ezCount++;
|
550 |
$margin = $ezAdOptions['margin_leadout'] ;
|
551 |
if ($ezAdOptions['kill_inline'])
|
552 |
-
|
553 |
-
|
554 |
-
|
|
|
555 |
$leadout =
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
|
|
561 |
}
|
562 |
}
|
563 |
if ($ezAdOptions['header_leadin']) {
|
@@ -604,16 +612,18 @@ if (!class_exists("ezAdSense")) {
|
|
604 |
if ($show_leadin != 'no') {
|
605 |
$margin = $ezAdOptions['margin_leadin'] ;
|
606 |
if ($ezAdOptions['kill_inline'])
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
|
|
|
|
617 |
}
|
618 |
}
|
619 |
|
@@ -659,17 +669,20 @@ if (!class_exists("ezAdSense")) {
|
|
659 |
'target="_blank" title="Unreal Blog proudly brings you Easy AdSense Lite">' .
|
660 |
'Unreal</a></font></div>';
|
661 |
echo $before_widget;
|
662 |
-
if (!$ezAdOptions['kill_widget_title'])
|
|
|
663 |
$margin = $ezAdOptions['margin_widget'] ;
|
664 |
if ($ezAdOptions['kill_inline'])
|
665 |
$inline = '' ;
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
|
|
|
|
673 |
echo $after_widget;
|
674 |
}
|
675 |
|
@@ -679,7 +692,8 @@ if (!class_exists("ezAdSense")) {
|
|
679 |
$ezAdOptions['text_lu'] =
|
680 |
$this->handleDefaultText($ezAdOptions['text_lu'], '160x160') ;
|
681 |
$title = empty($ezAdOptions['title_lu']) ? '' :
|
682 |
-
$before_title . stripslashes(htmlspecialchars($ezAdOptions['title_lu'])) .
|
|
|
683 |
$metaOptions = $this->widgetMeta() ;
|
684 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
|
685 |
$show_lu = $metaOptions['show_lu'] ;
|
@@ -698,10 +712,12 @@ if (!class_exists("ezAdSense")) {
|
|
698 |
if ($ezAdOptions['kill_inline'])
|
699 |
$inline = '' ;
|
700 |
else
|
701 |
-
$inline = 'style="' . $show_widget .
|
702 |
-
|
703 |
-
|
704 |
-
|
|
|
|
|
705 |
echo $after_widget ;
|
706 |
}
|
707 |
}
|
@@ -729,9 +745,10 @@ if (!class_exists("ezAdSense")) {
|
|
729 |
$inline = '' ;
|
730 |
else
|
731 |
$inline = 'style="margin:' . $margin . 'px; "' ;
|
732 |
-
echo stripslashes('<div class="ezAdsense adsense adsense-search"><div ' .
|
733 |
-
|
734 |
-
|
|
|
735 |
echo $after_widget ;
|
736 |
}
|
737 |
}
|
@@ -754,20 +771,22 @@ if (!class_exists("ezAdSense")) {
|
|
754 |
if (function_exists('wp_register_sidebar_widget')) {
|
755 |
$widget_ops =
|
756 |
array('classname' => 'widget_ezAd_ads', 'description' =>
|
757 |
-
|
758 |
-
|
|
|
759 |
wp_register_sidebar_widget('ezAd_ads', 'Google Ads',
|
760 |
-
|
761 |
$widget_ops =
|
762 |
array('classname' => 'widget_ezAd_search', 'description' =>
|
763 |
-
|
764 |
-
|
|
|
765 |
wp_register_sidebar_widget('ezAd_search', 'Google Search',
|
766 |
-
|
767 |
wp_register_widget_control('ezAd_ads','Google Ads',
|
768 |
-
|
769 |
wp_register_widget_control('ezAd_search','Google Search',
|
770 |
-
|
771 |
}
|
772 |
}
|
773 |
|
@@ -778,12 +797,13 @@ if (!class_exists("ezAdSense")) {
|
|
778 |
$jd = $id + 1;
|
779 |
$widget_ops =
|
780 |
array('classname' => 'widget_ezAd_lu', 'description' =>
|
781 |
-
|
782 |
-
|
|
|
783 |
wp_register_sidebar_widget($reg_wid, 'Google Link Units' . " ($jd)",
|
784 |
-
|
785 |
wp_register_widget_control($reg_wid ,'Google Link Units' . " ($jd)",
|
786 |
-
|
787 |
}
|
788 |
}
|
789 |
}
|
@@ -811,7 +831,7 @@ if (class_exists("ezAdSense")) {
|
|
811 |
global $ez_ad ;
|
812 |
if (function_exists('add_options_page')) {
|
813 |
add_options_page('Easy AdSense Lite', 'Easy AdSense Lite', 9,
|
814 |
-
|
815 |
}
|
816 |
}
|
817 |
}
|
@@ -823,10 +843,11 @@ if (class_exists("ezAdSense")) {
|
|
823 |
function ezAdsWidget() {
|
824 |
$widget_ops =
|
825 |
array('classname' => 'ezAdsWidget',
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
$this->WP_Widget('ezAdsWidget', 'Easy AdSense Lite: Google Ads',
|
|
|
830 |
}
|
831 |
function widget($args, $instance) {
|
832 |
// outputs the content of the widget
|
@@ -846,17 +867,18 @@ if (class_exists("ezAdSense")) {
|
|
846 |
}
|
847 |
}
|
848 |
add_action('widgets_init',
|
849 |
-
|
850 |
|
851 |
// sidebar Search Widget
|
852 |
class ezAdsSearch extends WP_Widget {
|
853 |
function ezAdsSearch() {
|
854 |
$widget_ops =
|
855 |
array('classname' => 'ezAdsSearch',
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
$this->WP_Widget('ezAdsSearch', 'Easy AdSense Lite: Google Search',
|
|
|
860 |
}
|
861 |
function widget($args, $instance) {
|
862 |
// outputs the content of the widget
|
@@ -876,17 +898,18 @@ if (class_exists("ezAdSense")) {
|
|
876 |
}
|
877 |
}
|
878 |
add_action('widgets_init',
|
879 |
-
|
880 |
|
881 |
// sidebar Link Units
|
882 |
class ezAdsLU extends WP_Widget {
|
883 |
function ezAdsLU() {
|
884 |
$widget_ops =
|
885 |
array('classname' => 'ezAdsLU',
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
$this->WP_Widget('ezAdsLU', 'Easy AdSense Lite: Google Link Unit',
|
|
|
890 |
}
|
891 |
function widget($args, $instance) {
|
892 |
// outputs the content of the widget
|
@@ -927,7 +950,7 @@ if (class_exists("ezAdSense")) {
|
|
927 |
*/
|
928 |
add_action('admin_menu', 'ezAdSense_ap');
|
929 |
add_action('activate_' . basename(dirname(__FILE__)) . '/' . basename(__FILE__),
|
930 |
-
|
931 |
add_filter('plugin_action_links', array($ez_ad, 'plugin_action'), -10, 2);
|
932 |
if ($ezAdOptions['max_link'] == -1)
|
933 |
add_action('wp_footer', array($ez_ad, 'footer_action'));
|
3 |
Plugin Name: Easy AdSense Lite
|
4 |
Plugin URI: http://www.thulasidas.com/adsense
|
5 |
Description: Easiest way to show AdSense and make money from your blog. Configure it at <a href="options-general.php?page=easy-adsense-lite.php">Settings → Easy AdSense Lite</a>.
|
6 |
+
Version: 5.06
|
7 |
Author: Manoj Thulasidas
|
8 |
Author URI: http://www.thulasidas.com
|
9 |
*/
|
82 |
'<b>Easy Adsense Lite</b> in your langugage (<b>' . $locale .
|
83 |
"</b>)? <input type='submit' name='ezAds-translate' onmouseover=\"Tip('It is easy to have <b>Easy AdSense Lite</b> in your language. All you have to do is to translate some strings, and email the file to the author.<br /><br />If you would like to help, please use the translation interface. It picks up the translatable strings in <b>Easy AdSense Lite</b> and presents them (and their existing translations in <b>" . $this->locale .
|
84 |
"</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 ' /></font>" ;
|
|
|
85 |
}
|
86 |
}
|
87 |
}
|
356 |
$me = basename(dirname(__FILE__)) . '/' . basename(__FILE__);
|
357 |
$plugins = get_plugins() ;
|
358 |
if ($hide)
|
359 |
+
$str = "<!-- " . $plugins[$me]['Title'] . " V" .
|
360 |
+
$plugins[$me]['Version'] . " -->\n";
|
361 |
else
|
362 |
$str = $plugins[$me]['Title'] . " V" . $plugins[$me]['Version'] ;
|
363 |
return $str ;
|
373 |
var $luMax = 4 ;
|
374 |
|
375 |
function plugin_action($links, $file) {
|
376 |
+
if ($file == plugin_basename(dirname(__FILE__).'/easy-adsense-lite.php')) {
|
377 |
$settings_link = "<a href='options-general.php?page=easy-adsense-lite.php'>" .
|
378 |
__('Settings', 'easy-adsenser') . "</a>";
|
379 |
array_unshift( $links, $settings_link );
|
401 |
if ($tkey !== FALSE) {
|
402 |
$value = strtolower(trim($val[0])) ;
|
403 |
// ensure valid values for options
|
404 |
+
if ($value == 'left' || $value == 'right'
|
405 |
+
|| $value == 'center' || $value == 'no') {
|
406 |
if ($value == 'left' || $value == 'right') $value = 'float:' . $value ;
|
407 |
if ($value == 'center') $value = 'text-align:' . $value ;
|
408 |
$metaOptions[$ezkeys[$tkey]] = $value ;
|
417 |
$ezAdOptions = $this->getAdminOptions();
|
418 |
global $post;
|
419 |
$meta = get_post_custom($post->ID);
|
420 |
+
$adkeys = array('adsense', 'adsense-widget',
|
421 |
+
'adsense-search', 'adsense-linkunits') ;
|
422 |
+
$ezkeys = array('adsense', 'show_widget',
|
423 |
+
'title_gsearch', 'show_lu') ;
|
424 |
$metaOptions = array() ;
|
425 |
// initialize to ezAdOptions
|
426 |
foreach ($ezkeys as $key => $optKey) {
|
434 |
if ($tkey !== FALSE) {
|
435 |
$value = strtolower(trim($val[0])) ;
|
436 |
// ensure valid values for options
|
437 |
+
if ($value == 'left' || $value == 'right'
|
438 |
+
|| $value == 'center' || $value == 'no') {
|
439 |
if ($value != 'no') $value = 'text-align:' . $value ;
|
440 |
+
if ($ezkeys[$tkey] != 'title_gsearch')
|
441 |
+
$metaOptions[$ezkeys[$tkey]] = $value ;
|
442 |
}
|
443 |
}
|
444 |
}
|
446 |
return $metaOptions ;
|
447 |
}
|
448 |
|
|
|
|
|
|
|
|
|
449 |
function ezAdSense_content($content) {
|
450 |
// if (!$ezAdOptions['allow_feeds'] && is_feed()) return $content ;
|
451 |
if (is_feed()) return $content ;
|
464 |
if ($ezCount >= $this->ezMax) return $content ;
|
465 |
if(strpos($content, "<!--noadsense-->") !== false) return $content;
|
466 |
$metaOptions = $this->contentMeta() ;
|
467 |
+
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no')
|
468 |
+
return $content;
|
469 |
$this->handleDefaults($ezAdOptions) ;
|
470 |
|
471 |
$wc = str_word_count($content) ;
|
495 |
$ezCount++;
|
496 |
$margin = $ezAdOptions['margin_leadin'] ;
|
497 |
if ($ezAdOptions['kill_inline'])
|
498 |
+
$inline = '' ;
|
499 |
+
else
|
500 |
+
$inline = 'style="' . $show_leadin .
|
501 |
+
';margin:' . $margin . 'px;' . $border. '"' ;
|
502 |
$leadin =
|
503 |
+
stripslashes($ezAdOptions['info'] .
|
504 |
+
"<!-- Post[count: " . $ezCount . "] -->\n" .
|
505 |
+
'<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
|
506 |
+
$ezAdOptions['text_leadin'] .
|
507 |
+
($urCount++ < $this->urMax ? $unreal : '') .
|
508 |
+
"</div>\n" . $ezAdOptions['info'] . "\n") ;
|
509 |
}
|
510 |
}
|
511 |
|
532 |
$ezCount++;
|
533 |
$margin = $ezAdOptions['margin_midtext'] ;
|
534 |
if ($ezAdOptions['kill_inline'])
|
535 |
+
$inline = '' ;
|
536 |
+
else
|
537 |
+
$inline = 'style="' . $show_midtext .
|
538 |
+
';margin:' . $margin . 'px;' . $border. '"' ;
|
539 |
$midtext =
|
540 |
+
stripslashes($ezAdOptions['info'] .
|
541 |
+
"<!-- Post[count: " . $ezCount . "] -->\n" .
|
542 |
+
'<div class="ezAdsense adsense adsense-midtext" ' . $inline . '>' .
|
543 |
+
$ezAdOptions['text_midtext'] .
|
544 |
+
($urCount++ < $this->urMax ? $unreal : '') .
|
545 |
+
"</div>\n" . $ezAdOptions['info'] . "\n") ;
|
546 |
$content = substr_replace($content, $midtext.$repchar, $pickme, 2);
|
547 |
}
|
548 |
}
|
555 |
$ezCount++;
|
556 |
$margin = $ezAdOptions['margin_leadout'] ;
|
557 |
if ($ezAdOptions['kill_inline'])
|
558 |
+
$inline = '' ;
|
559 |
+
else
|
560 |
+
$inline = 'style="' . $show_leadout .
|
561 |
+
';margin:' . $margin . 'px;' . $border. '"' ;
|
562 |
$leadout =
|
563 |
+
stripslashes($ezAdOptions['info'] .
|
564 |
+
"<!-- Post[count: " . $ezCount . "] -->\n" .
|
565 |
+
'<div class="ezAdsense adsense adsense-leadout" ' . $inline . '>' .
|
566 |
+
$ezAdOptions['text_leadout'] .
|
567 |
+
($urCount++ < $this->urMax ? $unreal : '') .
|
568 |
+
"</div>\n" . $ezAdOptions['info'] . "\n") ;
|
569 |
}
|
570 |
}
|
571 |
if ($ezAdOptions['header_leadin']) {
|
612 |
if ($show_leadin != 'no') {
|
613 |
$margin = $ezAdOptions['margin_leadin'] ;
|
614 |
if ($ezAdOptions['kill_inline'])
|
615 |
+
$inline = '' ;
|
616 |
+
else
|
617 |
+
$inline = 'style="' . $show_leadin .
|
618 |
+
';margin:' . $margin . 'px;' . $border. '"' ;
|
619 |
+
$this->leadin =
|
620 |
+
stripslashes($ezAdOptions['info'] .
|
621 |
+
"<!-- Post[count: " . $ezCount . "] -->\n" .
|
622 |
+
'<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
|
623 |
+
$ezAdOptions['text_leadin'] .
|
624 |
+
($urCount++ < $this->urMax ? $unreal : '') .
|
625 |
+
"</div>\n" . $ezAdOptions['info'] . "\n") ;
|
626 |
+
echo $this->leadin ;
|
627 |
}
|
628 |
}
|
629 |
|
669 |
'target="_blank" title="Unreal Blog proudly brings you Easy AdSense Lite">' .
|
670 |
'Unreal</a></font></div>';
|
671 |
echo $before_widget;
|
672 |
+
if (!$ezAdOptions['kill_widget_title'])
|
673 |
+
echo $before_title . $title . $after_title;
|
674 |
$margin = $ezAdOptions['margin_widget'] ;
|
675 |
if ($ezAdOptions['kill_inline'])
|
676 |
$inline = '' ;
|
677 |
+
else
|
678 |
+
$inline = 'style="' . $show_widget .
|
679 |
+
';margin:' . $margin . 'px;' . $border. '"' ;
|
680 |
+
echo stripslashes($ezAdOptions['info'] .
|
681 |
+
"<!-- Widg[count: " . $ezCount . "] -->\n" .
|
682 |
+
'<div class="ezAdsense adsense adsense-widget"><div ' . $inline. '>' .
|
683 |
+
$ezAdOptions['text_widget'] .
|
684 |
+
($urCount++ < $this->urMax ? $unreal : '') .
|
685 |
+
"</div></div>\n" . $ezAdOptions['info'] . "\n") ;
|
686 |
echo $after_widget;
|
687 |
}
|
688 |
|
692 |
$ezAdOptions['text_lu'] =
|
693 |
$this->handleDefaultText($ezAdOptions['text_lu'], '160x160') ;
|
694 |
$title = empty($ezAdOptions['title_lu']) ? '' :
|
695 |
+
$before_title . stripslashes(htmlspecialchars($ezAdOptions['title_lu'])) .
|
696 |
+
$after_title ;
|
697 |
$metaOptions = $this->widgetMeta() ;
|
698 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
|
699 |
$show_lu = $metaOptions['show_lu'] ;
|
712 |
if ($ezAdOptions['kill_inline'])
|
713 |
$inline = '' ;
|
714 |
else
|
715 |
+
$inline = 'style="' . $show_widget .
|
716 |
+
';margin:' . $margin . 'px;' . $border. '"' ;
|
717 |
+
echo stripslashes('<div class="ezAdsense adsense adsense-lu"><div ' .
|
718 |
+
$inline. '>' . "\n" .
|
719 |
+
$ezAdOptions['text_lu'] . "\n" .
|
720 |
+
'</div></div>') ;
|
721 |
echo $after_widget ;
|
722 |
}
|
723 |
}
|
745 |
$inline = '' ;
|
746 |
else
|
747 |
$inline = 'style="margin:' . $margin . 'px; "' ;
|
748 |
+
echo stripslashes('<div class="ezAdsense adsense adsense-search"><div ' .
|
749 |
+
$inline . '>' . "\n" .
|
750 |
+
$ezAdOptions['text_gsearch'] . "\n" .
|
751 |
+
'</div></div>') ;
|
752 |
echo $after_widget ;
|
753 |
}
|
754 |
}
|
771 |
if (function_exists('wp_register_sidebar_widget')) {
|
772 |
$widget_ops =
|
773 |
array('classname' => 'widget_ezAd_ads', 'description' =>
|
774 |
+
'Easy AdSense Lite: ' .
|
775 |
+
__('Show a Google AdSense block in your sidebar as a widget',
|
776 |
+
'easy-adsenser'));
|
777 |
wp_register_sidebar_widget('ezAd_ads', 'Google Ads',
|
778 |
+
array(&$this, 'widget_ezAd_ads'), $widget_ops);
|
779 |
$widget_ops =
|
780 |
array('classname' => 'widget_ezAd_search', 'description' =>
|
781 |
+
'Easy AdSense Lite: ' .
|
782 |
+
__('Show a Google Search Box in your sidebar as a widget',
|
783 |
+
'easy-adsenser'));
|
784 |
wp_register_sidebar_widget('ezAd_search', 'Google Search',
|
785 |
+
array(&$this, 'widget_ezAd_search'), $widget_ops);
|
786 |
wp_register_widget_control('ezAd_ads','Google Ads',
|
787 |
+
array(&$this, 'widget_ezAd_control'));
|
788 |
wp_register_widget_control('ezAd_search','Google Search',
|
789 |
+
array(&$this, 'widget_ezAd_control'));
|
790 |
}
|
791 |
}
|
792 |
|
797 |
$jd = $id + 1;
|
798 |
$widget_ops =
|
799 |
array('classname' => 'widget_ezAd_lu', 'description' =>
|
800 |
+
'Easy AdSense Lite: ' .
|
801 |
+
__('Show a Google Links Unit in your sidebar as a widget',
|
802 |
+
'easy-adsenser') . " ($jd)");
|
803 |
wp_register_sidebar_widget($reg_wid, 'Google Link Units' . " ($jd)",
|
804 |
+
array(&$this, 'widget_ezAd_lu'), $widget_ops);
|
805 |
wp_register_widget_control($reg_wid ,'Google Link Units' . " ($jd)",
|
806 |
+
array(&$this, 'widget_ezAd_lu_control'));
|
807 |
}
|
808 |
}
|
809 |
}
|
831 |
global $ez_ad ;
|
832 |
if (function_exists('add_options_page')) {
|
833 |
add_options_page('Easy AdSense Lite', 'Easy AdSense Lite', 9,
|
834 |
+
basename(__FILE__), array(&$ez_ad, 'printAdminPage'));
|
835 |
}
|
836 |
}
|
837 |
}
|
843 |
function ezAdsWidget() {
|
844 |
$widget_ops =
|
845 |
array('classname' => 'ezAdsWidget',
|
846 |
+
'description' =>
|
847 |
+
__('Show a Google AdSense block in your sidebar as a widget',
|
848 |
+
'easy-adsenser') );
|
849 |
+
$this->WP_Widget('ezAdsWidget', 'Easy AdSense Lite: Google Ads',
|
850 |
+
$widget_ops);
|
851 |
}
|
852 |
function widget($args, $instance) {
|
853 |
// outputs the content of the widget
|
867 |
}
|
868 |
}
|
869 |
add_action('widgets_init',
|
870 |
+
create_function('', 'return register_widget("ezAdsWidget");'));
|
871 |
|
872 |
// sidebar Search Widget
|
873 |
class ezAdsSearch extends WP_Widget {
|
874 |
function ezAdsSearch() {
|
875 |
$widget_ops =
|
876 |
array('classname' => 'ezAdsSearch',
|
877 |
+
'description' =>
|
878 |
+
__('Show a Google Search Box in your sidebar as a widget',
|
879 |
+
'easy-adsenser') );
|
880 |
+
$this->WP_Widget('ezAdsSearch', 'Easy AdSense Lite: Google Search',
|
881 |
+
$widget_ops);
|
882 |
}
|
883 |
function widget($args, $instance) {
|
884 |
// outputs the content of the widget
|
898 |
}
|
899 |
}
|
900 |
add_action('widgets_init',
|
901 |
+
create_function('', 'return register_widget("ezAdsSearch");'));
|
902 |
|
903 |
// sidebar Link Units
|
904 |
class ezAdsLU extends WP_Widget {
|
905 |
function ezAdsLU() {
|
906 |
$widget_ops =
|
907 |
array('classname' => 'ezAdsLU',
|
908 |
+
'description' =>
|
909 |
+
__('Show a Google Links Unit in your sidebar as a widget',
|
910 |
+
'easy-adsenser') );
|
911 |
+
$this->WP_Widget('ezAdsLU', 'Easy AdSense Lite: Google Link Unit',
|
912 |
+
$widget_ops);
|
913 |
}
|
914 |
function widget($args, $instance) {
|
915 |
// outputs the content of the widget
|
950 |
*/
|
951 |
add_action('admin_menu', 'ezAdSense_ap');
|
952 |
add_action('activate_' . basename(dirname(__FILE__)) . '/' . basename(__FILE__),
|
953 |
+
array(&$ez_ad, 'init'));
|
954 |
add_filter('plugin_action_links', array($ez_ad, 'plugin_action'), -10, 2);
|
955 |
if ($ezAdOptions['max_link'] == -1)
|
956 |
add_action('wp_footer', array($ez_ad, 'footer_action'));
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://buy.ads-ez.com/easy-adsense
|
|
4 |
Tags: adsense, ad, ads, advertising, google
|
5 |
Requires at least: 2.6
|
6 |
Tested up to: 3.2
|
7 |
-
Stable tag: 5.
|
8 |
|
9 |
Easy AdSense manages all aspects of Google AdSense for your blog: insert ads into posts and sidebar, and add a Google Search box. Easy and complete!
|
10 |
|
@@ -30,15 +30,15 @@ Easy AdSense provides a very easy way to generate revenue from your blog using G
|
|
30 |
|
31 |
Easy AdSense Lite is the freely distributed version of a premium plugin. The [Pro version](http://buy.ads-ez.com/easy-adsense/ "Pro version of the Easy AdSense plugin") gives you more benefits. It gives you filter to ensure that your ads show only on those pages that seem to comply with Google AdSense policies, which can be important since some comments may render your pages inconsistent with those policies. It also lets you specify a list of computers where your ads will not be shown, in order to prevent accidental clicks on your own ads -- one of the main reasons AdSense bans you. These features will minimize your chance of getting banned. Also in the works for the Pro version is a compatibility mode, which solves the issue of the ad insertion messing up your page appearances when using some themes.
|
32 |
|
33 |
-
= New in 5.
|
34 |
|
35 |
-
|
36 |
|
37 |
== Upgrade Notice ==
|
38 |
|
39 |
-
= 5.
|
40 |
|
41 |
-
|
42 |
|
43 |
== Screenshots ==
|
44 |
|
@@ -143,6 +143,7 @@ A big "Thank You" to all my translators. Easy AdSense V2.6+ sports an *Easy Tran
|
|
143 |
|
144 |
== Change Log ==
|
145 |
|
|
|
146 |
* V5.05: Minor bug fixes. [Nov 15, 2011]
|
147 |
* V5.04: Updating Korean translation [.mo file was missing in V5.03]. [Nov 13, 2011]
|
148 |
* V5.03: Releasing Korean translation and updating Thai translation. Admin interface changes. [Nov 12, 2011]
|
4 |
Tags: adsense, ad, ads, advertising, google
|
5 |
Requires at least: 2.6
|
6 |
Tested up to: 3.2
|
7 |
+
Stable tag: 5.06
|
8 |
|
9 |
Easy AdSense manages all aspects of Google AdSense for your blog: insert ads into posts and sidebar, and add a Google Search box. Easy and complete!
|
10 |
|
30 |
|
31 |
Easy AdSense Lite is the freely distributed version of a premium plugin. The [Pro version](http://buy.ads-ez.com/easy-adsense/ "Pro version of the Easy AdSense plugin") gives you more benefits. It gives you filter to ensure that your ads show only on those pages that seem to comply with Google AdSense policies, which can be important since some comments may render your pages inconsistent with those policies. It also lets you specify a list of computers where your ads will not be shown, in order to prevent accidental clicks on your own ads -- one of the main reasons AdSense bans you. These features will minimize your chance of getting banned. Also in the works for the Pro version is a compatibility mode, which solves the issue of the ad insertion messing up your page appearances when using some themes.
|
32 |
|
33 |
+
= New in 5.06 =
|
34 |
|
35 |
+
Code clean up -- removing unused functions, indenting the code.
|
36 |
|
37 |
== Upgrade Notice ==
|
38 |
|
39 |
+
= 5.06 =
|
40 |
|
41 |
+
Code clean up -- removing unused functions, indenting the code.
|
42 |
|
43 |
== Screenshots ==
|
44 |
|
143 |
|
144 |
== Change Log ==
|
145 |
|
146 |
+
* V5.06: Code clean up -- removing unused functions, indenting the code. [Nov 15, 2011]
|
147 |
* V5.05: Minor bug fixes. [Nov 15, 2011]
|
148 |
* V5.04: Updating Korean translation [.mo file was missing in V5.03]. [Nov 13, 2011]
|
149 |
* V5.03: Releasing Korean translation and updating Thai translation. Admin interface changes. [Nov 12, 2011]
|