AdSense ads in your WordPress Posts. Requires WordPress 1.5 or higer. Adjust your settings here. * Author: MaxBlogPress * Author URI: http://www.maxblogpress.com * * License: GNU General Public License * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 www.maxblogpress.com * * This is the improved version of "Adsense-Deluxe" plugin by Acme Technologies * */ $mbpad_path = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', __FILE__); $mbpad_path = str_replace('\\','/',$mbpad_path); $mbpad_dir = substr($mban_path,0,strrpos($mbpad_path,'/')); $mbpad_siteurl = get_bloginfo('wpurl'); $mbpad_siteurl = (strpos($mbpad_siteurl,'http://') === false) ? get_bloginfo('siteurl') : $mbpad_siteurl; $mbpad_fullpath = $mbpad_siteurl.'/wp-content/plugins/'.$mbpad_dir.''; $mbpad_fullpath = $mbpad_fullpath.'adsense-deluxe-revived/'; define('MBP_AD_LIBPATH', $mbpad_fullpath); define('MBP_AD_NAME', 'Adsense Deluxe Revived'); define('MBP_AD_VERSION', '3.0'); add_action('activate_'.$mbpad_path, 'adsense_active' ); //-- //-- You can select in the Adsense-Deluxe options page to give something back to this //-- plugin's author (me) by having 5% of the ads shown on your WP blog use my adsense //-- client ID. This is DISABLED by default, and I assure you I do nothing in the code //-- to subversively turn it on! The way it works is if you enable the option (and it's //-- just as easily disabled...), approximately 5% of the time an adsense ad block is //-- displayed, it will use my AdSense client-id, and if someone happens to click one of //-- those ads, I benefit from it and you've helped encourage me to continue supporting //-- this plugin. If you're going to enable this option, you can make me feel even happier //-- posting a comment on the blog page for this plugin to let mee know, and I can //-- personally thank you... //-- http://www.acmetech.com/blog/2005/07/26/adsense-deluxe-wordpress-plugin/ //-- $__ACMETECH_CLIENT_ID__ = "pub-6179066220764588"; $__ACMETECH_AD_PARTNER__ = "1881826992"; //-- //-- CONSTANTS //-- define('ADSDEL_OPTIONS_ID', 'acmetech_adsensedeluxe'); //-- //-- OUTPUTS debugging info in html comments on blog pages. //-- $__AdSDelx_Debug__ = false; //-- //-- If set to false, live adsense ads displayed in Post editing preview //-- $__AdSDelx_USE_PREV_PLACEHOLDER = true; /* adsense-deluxe This function replaces or tags with actual Google Adsense code */ if (function_exists('is_plugin_page') && is_plugin_page()) : AdsenseDeluxeOptionsPanel(); // check here to see if the broken 1.5 options page feature is fixed else : function adsense_active(){ update_option('mbp_remve_pwdby_adsense', 1 ); } function adsense_deluxe_insert_ads($data) { global $__AdSDelx_USE_PREV_PLACEHOLDER, $__ACMETECH_CLIENT_ID__, $__ACMETECH_AD_PARTNER__, $doing_rss, /* will be true if getting RSS feed */ $_adsdel_adcount; /* tracks number of posts we've processed on home page */ $MAX_ADS_PER_PAGE = 3; // MAX # of AdSense ads to allow on a given page $EDITING_PAGE = false; $PLACEHOLDER = '<!--@@-->'; $PLACEHOLDER_DISABLED = '<!--@@-->'; /* * For format of $options, see _AdsDel_CreateDefaultOptions() * */ $options = get_option(ADSDEL_OPTIONS_ID); //-- see if global switch is off if( ! $options['all_enabled'] ){ return "\n\n" . $data; } // NO ADSENSE IN FEEDS! if($doing_rss){ //return "\n\n" . $data; return $data; } if( strstr($_SERVER['PHP_SELF'], 'post.php') ){ // user is editing a page or post, show placeholders, not real ads $EDITING_PAGE = ($__AdSDelx_USE_PREV_PLACEHOLDER ? true : false); } // set up some variables we need $patts = array(); $subs = array(); $default = $options['default']; $rewardAut = $options['reward_author']; $qualifer = ''; $msg = "\n"; $msg .= "\n"; //DEBUGGING $msg .= "\n"; //DEBUGGING $msg .= "\n"; //DEBUGGING $msg .= "\n"; //DEBUGGING if( isset($_adsdel_adcount) ) $msg .= "\n"; //DEBUGGING //-- fill in stuff to search for ($patts) and substition blocks ($subs) foreach( $options['ads'] as $key => $vals ){ if( $key == $default ){ $msg .= "\n\n"; //DEBUGGING $patts[] = ""; $subs[] = ($vals['enabled'] ? stripslashes($vals['adsense']).ad_pwd_by() : "\n"); if($EDITING_PAGE) $subs[ sizeof($subs)-1] = str_replace('@@', 'adsense', ($vals['enabled'] ? $PLACEHOLDER : $PLACEHOLDER_DISABLED)); } $msg .= "\n"; //DEBUGGING $patts[] = ""; $subs[] = ($vals['enabled'] ? stripslashes($vals['adsense']).ad_pwd_by() : ""); if($EDITING_PAGE) $subs[ sizeof($subs)-1] = str_replace('@@', 'adsense#'.$key, ($vals['enabled'] ? $PLACEHOLDER : $PLACEHOLDER_DISABLED)); } /*if( rand(0, 100) >= 95 && ! $EDITING_PAGE && $rewardAut ){ if( is_single() || is_page() ){ $msg .= "\n"; //DEBUGGING $subbed = preg_replace ( '/pub-[0-9]+/', $__ACMETECH_CLIENT_ID__, $subs ); $subs = preg_replace ( '/google_ad_channel *= *\"[^"]*\"/', 'google_ad_channel = "1478884331"', $subbed ); $subbed = preg_replace ( '/ctxt_ad_partner *= *\"[^"]*\"/', 'ctxt_ad_partner = "' . $__ACMETECH_AD_PARTNER__ . '"', $subs ); $subs = preg_replace ( '/ctxt_ad_section *= *\"[^"]*\"/', 'ctxt_ad_section = "20007"', $subbed ); } }*/ // check that post contains adsense token so we can count # of times // we've shown ads in this page load $matchCount = 0; $matchCount = preg_match_all ( "//", $data, $matches , PREG_PATTERN_ORDER ); $show_ads = false; $msg .= "\n"; //DEBUGGING if( $matchCount > 0 ){ //-- //-- Have to take into account the fact that perhaps we've already shown //-- 2 ads for a page (not necessarily a single post page), but the current $data //-- contains 2 or more placeholder comments. //-- Since replacements in $data are done en_masse, we might go //-- over our limit for this post, but but we'll prefer that over //-- not showing at least $MAX_ADS_PER_PAGE ad blocks. //-- $show_ads = true; if( ! isset($_adsdel_adcount) ){ $_adsdel_adcount = $matchCount; }else{ if( $_adsdel_adcount > $MAX_ADS_PER_PAGE ) $show_ads = false; $_adsdel_adcount+=$matchCount; } } if( $show_ads ) { // NOTE: might have to use ksort() on patts,subs if wrong blocks are being subbed in. if( is_single() ) { if( $options['enabled_for']['posts'] ) return str_replace($patts, $subs, $data); //. $msg; return $data; } elseif ( is_home() ) { $msg .= "\n"; //DEBUGGING $msg .= "\n"; //DEBUGGING if( $options['enabled_for']['home'] ) return str_replace($patts, $subs, $data); return $data; } elseif( is_page() ) { $msg .= "\n"; //DEBUGGING if( $options['enabled_for']['page'] ) return str_replace($patts, $subs, $data); return $data; } elseif( is_archive() ) { $msg .= "\n"; //DEBUGGING if( $options['enabled_for']['archives'] ) return str_replace($patts, $subs, $data);// .$msg; return $data; } elseif( is_search() ) { $msg .= "\n"; //DEBUGGING if( $options['enabled_for']['archives'] ) return str_replace($patts, $subs, $data); return $data; // . $msg; } else { $msg .= "\n"; //DEBUGGING return str_replace($patts, $subs, $data); // . $msg; //return str_replace( $tag, '', $data ); } }else{// if( $show_ads ) return $data ; //. $msg; } } // function adsense_deluxe_insert_ads(...) function ad_pwd_by(){ $remove_pwd = get_option('mbp_remve_pwdby_adsense'); if( $remove_pwd != 1 ){ return $pwd_by ='
Powered by Adsense Deluxe Revived
'; } } /* * Can be used outside the loop. Prints the adsense code for a named Ad block. * Leave the parameter empty to output the default block. * example: for a block named "blue_banner", call adsense_deluxe_ads("blue_banner"); * or within your templates, use */ function adsense_deluxe_ads($adname='') { global $__AdSDelx_USE_PREV_PLACEHOLDER, $_adsdel_adcount; /* tracks number of posts we've processed on home page */ $MAX_ADS_PER_PAGE = 3; // MAX # of AdSense ads to allow on a given page $EDITING_PAGE = false; /* * For format of $options, see _AdsDel_CreateDefaultOptions() * */ $options = get_option(ADSDEL_OPTIONS_ID); //-- see if global switch is off if( ! $options['all_enabled'] ){ echo "\n\n"; return; } // set up some variables we need $patts = array(); $subs = array(); $default = $options['default']; if( $adname == '' ) $adname = $default; $show_ads = true; $msg = "\n"; //-- locate ad block foreach( $options['ads'] as $key => $vals ){ if( $key == $adname ){ $msg .= "\n"; if( ! isset($_adsdel_adcount) ){ $_adsdel_adcount = 0; }else{ if( $_adsdel_adcount > $MAX_ADS_PER_PAGE ) $show_ads = false; } $_adsdel_adcount+=1; $msg .= "\n"; //DEBUGGING //echo $msg; if( $show_ads ) echo ($vals['enabled'] ? stripslashes($vals['adsense']) : ""); return; } } $msg .= "\n"; echo $msg; } // function adsense_deluxe_ads(...) function add_adsense_deluxe_handle_head() { global $__ADSENSE_DELUXE_VERSION__; echo "\n".'' . "\n"; } function _AdsDel_GetVersion(){ global $__ADSENSE_DELUXE_VERSION__; return $__ADSENSE_DELUXE_VERSION__; } function _AdsDel_FormatVersion(){ return "v" . _AdsDel_GetVersion() . ""; } function _AdsDel_DisplayAvailUpdate($pi_vers=0.0) { $pi_vers+=0.0; $options = get_option(ADSDEL_OPTIONS_ID); // NEXT LINE ONLY FOR TESTING CODE, just ignore... //unset($options['next_update_check']); unset($options['latest_version']); update_option(ADSDEL_OPTIONS_ID, $options); return ''; if( isset($options) ){ $check = $options['next_update_check']; if( time() > (integer)$check ){ $next_week = time() + (7 * 24 * 60 * 60); $options['next_update_check'] = $next_week; $new_vers = _AdsDel_VersionCheck(); if( $new_vers != '' ){ $options['latest_version'] = floatval($new_vers); }else{ $options['latest_version'] = floatval($pi_vers); } update_option(ADSDEL_OPTIONS_ID, $options); } } if( isset($options) && isset($options['latest_version']) ){ $new_vers = $options['latest_version']; if( floatval($options['latest_version']) > $pi_vers ){ return "        DOWNLOAD LATEST UPDATE (v$new_vers)"; } }else{ return ''; } } function _AdsDel_VersionCheck() { $string = ''; $url = "http://software.acmetech.com/wordpress/plugins/adsense-deluxe-version.txt"; $url = parse_url ($url); if ($handle = @fsockopen ($url['host'], 80,$errno, $errstr,10)) { fwrite ($handle, "GET $url[path]?$url[query] HTTP/1.0\r\nHost: $url[host]\r\nConnection: Close\r\n\r\n"); while (!feof($handle)) { $string .= @fread($handle, 30); } $string = explode (" ", $string); $string = array_pop ($string); $string = trim($string); } fclose($handle); return 0+$string; // convert to float } /* ** ** Create default set of options and add to database **/ function _AdsDel_CreateDefaultOptions() { $ADSDEL_OPTIONS_ID = 'acmetech_adsensedeluxe'; $options = array(); $options['version'] = (string)_AdsDel_GetVersion(); //this is a string but casting it anyway $options['next_update_check'] = time(); // when to check for update to plugin next. $options['all_enabled'] = true; // controls whether all ads on/off; can also disable at ad-level //-- control whether ads are enabled for specific areas: //-- individual posts, Pages, home page or any archive page $options['enabled_for'] = array('home' => true,'posts' => true,'page'=>true,'archives' =>true); $options['default'] = NULL; // always have to check against NULL for default. $options['reward_author'] = false; // DO NOT reward author with 5% of adsense impressions $options['ads'] = array(); add_option(ADSDEL_OPTIONS_ID, $options, 'Options for AdSense-Deluxe from www.acmetech.com'); return $options; } function _AdsDel_CheckOptions($o) { if( ! isset($o['all_enabled']) ) $o['all_enabled'] = true; if( ! isset($o['ads']) ) $o['ads'] = array(); if( ! isset($o['default']) ) $o['default'] = NULL; if( ! isset($o['reward_author']) ) $o['reward_author'] = false; // DEFAULT IS TO not REWARD PLUGIN AUTHOR... foreach( $options['ads'] as $key => $vals ){ if( ! isset($vals['enabled']) ) $o['ads'][$key]['enabled'] = true; if( ! isset($vals['desc']) ) $o['ads'][$key]['desc'] = '(No Description)'; } } /* ** ** Output Top of Options page. **/ function _AdsDel_Header() { global $__ADSENSE_DELUXE_VERSION__; $get_url = $_SERVER[PHP_SELF] . '?page=adsense-deluxe-revived/' . basename(__FILE__); $def_url = $get_url . "&fn=debug"; echo "\n

".MBP_AD_NAME." ".MBP_AD_VERSION." (Add New)

"; ?> How to use it    Community


AdSense Deluxe Instructions


by MaxBlogPress

This plugin is the result of MaxBlogPress Revived project.


AdSense SandBox (Preview Tool)
View AdSense for:
  

Remove Option
/> Remove "Powered by Adsense Deluxe Revived"
'', 'code' => '', 'comment' => '', 'enabled' => '1', 'make_default' => '' ); } $name = $vals['name']; $enabled = ($vals['enabled'] == '1'); $code = htmlentities(stripslashes($vals['code']) , ENT_COMPAT); $comment = htmlentities(stripslashes($vals['comment']), ENT_COMPAT); $submit_text = "Add AdSense Block »"; if( isset($vals['edit_kw']) ){ $submit_text = "Edit AdSense Block »"; } // this url will scroll the page to the new ad form. //$action_url = $_SERVER[PHP_SELF] . '?page=adsense/' . basename(__FILE__) . "&#new_ad"; // this url reloads to unscrolled page. $action_url = $_SERVER[PHP_SELF] . '?page=adsense-deluxe-revived/' . basename(__FILE__); //-- //-- check for aleady defined _default item and if not, pre-fill the keyword //-- with that name //-- echo <<
New AdSense Block  
Name AdSense Code Description (optional)

  

END; }//_AdsDel_NewAdForm() /* ** ** Display existing ads. **/ function _AdsDel_ListAds($options=NULL) { function makeUrl($u, $anchor_text, $tt, $fragment='adsense_list') { return "$anchor_text"; } $action_url = $_SERVER[PHP_SELF] . '?page=adsense-deluxe-revived/' . basename(__FILE__); $get_url = $_SERVER[PHP_SELF] . '?page=adsense-deluxe-revived/' . basename(__FILE__); $def_url = $get_url . "&fn=default"; $edit_url = $get_url . "&fn=edit"; $delete_url = $get_url . "&fn=del"; $enable_url = $get_url . "&fn=enable"; echo <<
AdSense Blocks
END; if( !isset($options) ) : echo ''; else : $altclass = 'alternate'; echo ""; foreach( $options['ads'] as $key => $vals ){ // setup locals for on/off checkboxes $onOffChecked = ''; if( $vals['enabled'] ){ $onOffChecked = 'checked="checked"'; } if( $options['default'] == $key ) echo ""; else echo ""; echo ""; echo ''; echo '' ."\n"; // on/off checkbox echo '' ."\n"; $altclass = ($altclass == '' ? 'alternate' : ''); } endif; $all_on_checked = ''; $posts_on_checked = ''; $home_on_checked = ''; $archives_on_checked = ''; $page_on_checked = ''; if( $options['all_enabled'] ) $all_on_checked = 'checked="checked"'; if( $options['enabled_for']['home'] ) $home_on_checked = 'checked="checked"'; if( $options['enabled_for']['archives'] ) $archives_on_checked = 'checked="checked"'; if( $options['enabled_for']['page'] ) $page_on_checked = 'checked="checked"'; if( $options['enabled_for']['posts'] ) $posts_on_checked = 'checked="checked"'; echo <<
Internal Error: missing $options
NameDescriptionActionsOn
<!--adsense"; if( $options['default'] != $key ) echo '#' . $key; echo "-->' . ''.$vals['desc'] . ''; echo makeUrl($delete_url . '&kw=' . $key, 'delete', 'Delete AdSense') .' | '; echo makeUrl($def_url . '&kw=' . $key, 'default', 'Make this the default')."\n | "; echo makeUrl($edit_url. '&kw=' . $key, 'edit', 'Edit this configuration', 'template'); echo '
 The options below this line control where Ads will be shown.
Enable Ads on Individual Posts
Enable Ads on Home page
Enable Ads on "pages"
Enable Ads on any Archive page
Globally enable/disable all ads
END; }// _AdsDel_ListAds function _AdsDel_find_posts_with_ads() { /* // this locates all tokens in data // output looks like: // Array // ( // [0] => Array // ( // [0] => // [1] => // ) // ) $matches; preg_match_all( '//ismeU', $data, $matches , PREG_PATTERN_ORDER ); if( $matches ){ } */ } /* ** ** This is the main Options handling function. **/ function AdsenseDeluxeOptionsPanel() { global $_POST, $_GET; // check keyword name for only allowed characters function valid_kw_chars($text) { if( preg_match("/[^a-zA-Z0-9_]/",$text) ){ return false; } return true; } // delete specified keyword $kw from options and save the options if $saveOptions = true function _AdsDel_DeleteAdsenseBlock( &$options, $kw, $save_options=TRUE ) { $newVals = array(); $lastKey = NULL; foreach( $options['ads'] as $key => $vals ){ if( $key == $kw ){ echo "\n\n\n\n"; if( $options['default'] == $key ) $options['default'] = NULL; }else{ $newVals[$key] = $vals; $lastKey = $key; } } // deleted item may have been default AdSense code, so adjust to something else if( $options['default'] == NULL ){ $options['default'] = $lastKey; //lastKey may be NULL, it's OK. } $options['ads'] = $newVals; if( $save_options ) update_option(ADSDEL_OPTIONS_ID, $options); } // place to pass msgs back to user about state of form submission $submit_msgs = array(); $action_url = $_SERVER[PHP_SELF] . '?page=adsense-deluxe-revived/' . basename(__FILE__) . "&#new_ad"; // Create option in options database if not there already: $options = get_option(ADSDEL_OPTIONS_ID); if( !$options){ $options = _AdsDel_CreateDefaultOptions(); $submit_msgs[] = "» Created default options."; } //-- //-- Handle post (new adsense block definitions) //-- if ( isset($_POST['fn']) ) { if (get_magic_quotes_gpc()) { $_GET = array_map('stripslashes', $_GET); $_POST = array_map('stripslashes', $_POST); $_COOKIE= array_map('stripslashes', $_COOKIE); } if( $_POST['fn'] == 'new' ){ //_AdsDel_HandlePostNew(&$options,&$submit_msgs,&$newform_values); if( isset($_POST['name']) && $_POST['name'] != '' && isset($_POST['code']) && $_POST['code'] != '' ){ $kw = $_POST['name']; $theCode = $_POST['code']; $desc = $_POST['comment']; $enabled = true; $isDefault = false; if( valid_kw_chars($kw) ){ // if editing previous option, delete old first. // [ might be reasons not to do that at this point(?) ] if( isset($_POST['edit_kw']) && $_POST['edit_kw'] != $kw ){ $submit_msgs[] = '» Deleting old keyword ' . $_POST['edit_kw'] . '.'; _AdsDel_DeleteAdsenseBlock($options, $_POST['edit_kw'], FALSE); } if( (isset($_POST['make_default']) && $_POST['make_default'] == '1') || ! isset($options['default']) || $options['default'] == '' ){ $options['default'] = $kw; } if( isset($_POST['enabled']) && $_POST['enabled'] == '' ) $enabled = false; $options['ads'][$kw] = array('adsense' => $theCode, 'desc' => $desc, 'enabled' => $enabled); update_option(ADSDEL_OPTIONS_ID, $options); $submit_msgs[] = '» New AdSense block added (' . $kw . ').'; }else{ $submit_msgs[] = '» Invalid characters in Keyword; submission NOT saved'; $newform_values = array(); $newform_values['name'] = ''; $newform_values['code'] = $theCode; $newform_values['comment'] = $desc; $newform_values['make_default'] = ($isDefault ? '1' : ''); }//if( valid_kw_chars($kw) ) }else{ $submit_msgs[] = '» Missing Keyword or Code value; Nothing added.'; } //-- //-- plugin author mileage rewards program.... //-- }elseif( $_POST['fn'] == 'rewards' ){ $options['reward_author'] = (isset($_POST['reward_author']) && $_POST['reward_author'] == '1'); $submit_msgs[] = '» Author Rewards turned ' . ($options['reward_author'] ? 'ON' : 'OFF') . ''; //-- //-- Handle change in on/off status //-- }elseif( $_POST['fn'] == 'update' ){ // handle all on/off first $options['all_enabled'] = (isset($_POST['all_on']) && $_POST['all_on'] == '1'); $submit_msgs[] = '» AdSense ads globally ' .($options['all_enabled']?'enabled':'disabled') .'. Individual ads may still be disabled though.'; // update "areas" for turning ads on/off (Pages, Home, Archives) $areas = array('posts_on'=>'posts','page_on' => 'page', 'home_on' => 'home', 'archives_on'=>'archives'); foreach($areas as $form_fld => $option_name ) $options['enabled_for'][$option_name] = (isset($_POST[$form_fld]) && $_POST[$form_fld] == '1'); /* if((isset($_POST[$form_fld]) && $_POST[$form_fld] == '1') ){ $options['enabled_for'][$option_name] = true; }else{ $options['enabled_for'][$option_name] = false; } */ // do indivdidual entries now foreach($options[ads] as $key => $val ){ if( isset($_POST[$key]) ){ $options['ads'][$key]['enabled'] = true; //$submit_msgs[] = "Setting $key to ". $_POST[$key]; }else{ $options['ads'][$key]['enabled'] = false; } } $submit_msgs[] = "» Enabled status for all ad blocks updated!"; }else{ $submit_msgs[] = '» Unrecognized POST action.'; } // make sure we save the (possibly) changed options update_option(ADSDEL_OPTIONS_ID, $options); //-- //-- GET submissions (delete, make default, edit, on/off) //-- }elseif ( isset($_GET['fn']) ) { $fn = $_GET['fn']; $kw = $_GET['kw']; if( $fn == 'debug' ){ $submit_msgs[] = 'Number of ads: ' . sizeof($options['ads']) . "\n"; $submit_msgs[] = 'Prefs Version: ' . $options['version'] . "\n"; $submit_msgs[] = 'Latest Version: ' . $options['latest_version'] . "\n"; $submit_msgs[] = 'Next Version Check: ' . date('Y-m-d', $options['next_update_check']) . "\n"; $submit_msgs[] = 'Reward Author?: ' . (isset($options['reward_author']) && $options['reward_author'] == '1' ? 'YES' : 'NO') . "\n"; $submit_msgs[] = 'All Enabled?: ' . $options['all_enabled'] . "\n"; $submit_msgs[] = 'Ad Block set as default: ' . $options['default'] . "\n"; foreach( $options['ads'] as $key => $vals ){ $submit_msgs[] = 'BLOCK: ' . $key . ' -- Enabled: ' .$vals['enabled']. "\n"; $submit_msgs[] = 'Comment: ' . $vals['desc'] . "\n"; if( $key == $kw ){ $submit_msgs[] = "DEFAULT = => $key\n"; } } }elseif( $fn == 'default' ){ // while we could just set $options[default] to the $kw, let's be safe // and make sure it exists. foreach( $options['ads'] as $key => $vals ){ if( $key == $kw ){ $options['default'] = $key; $submit_msgs[] = "» Default changed to $key."; } } }elseif($fn == 'edit' ){ $newform_values = NULL; foreach( $options['ads'] as $key => $vals ){ if( $key == $kw ){ $newform_values = array(); $newform_values['name'] = $newform_values['edit_kw'] = $key; $newform_values['code'] = $vals['adsense']; $newform_values['comment'] = $vals['desc']; $newform_values['make_default'] = ($options['default'] == $key ? '1' :''); $newform_values['enabled'] = ($vals['enabled'] ? '1' :''); break; } } }elseif($fn == 'enable' ){ if( isset($_GET['flipit'] ) ){ $flipit = $_GET['flipit']; foreach( $options['ads'] as $key => $vals ){ if( $key == $kw ){ if( $flipit == 'on' ) $enable = true; else $enable = false; $options['ads'][$kw]['enabled'] = $enable; $submit_msgs[] = "» Ad block $key turned " .($enable ? 'on' : 'off'); } } }else{ $submit_msgs[] = "» Internal Error missing switch\n"; } }elseif($fn == 'del' ){ $newVals = array(); $lastKey = NULL; foreach( $options['ads'] as $key => $vals ){ if( $key == $kw ){ if( $options['default'] == $key ) $options['default'] = NULL; $submit_msgs[] = "» Removed AdSense block for $kw."; }else{ $newVals[$key] = $vals; $lastKey = $key; } } // deleted item may have been default AdSense code, so adjust to something else if( $options['default'] == NULL ){ $options['default'] = $lastKey; //lastKey may be NULL, it's OK. } $options['ads'] = $newVals; }else{ $submit_msgs[] = "» Unknown function: $fn ."; } // make sure we save the (possibly) changed options update_option(ADSDEL_OPTIONS_ID, $options); } // spit out status msgs first if ( count($submit_msgs) > 0 ) { echo '

' . implode('
', $submit_msgs ) . '

'; } global $wpdb; global $wp_version; global $lynkff_txt_dir, $lynkff_txt_gd, $lynkff_submit_ok; $adr_activate = get_option('adr_activate'); $reg_msg = ''; $adr_msg = ''; $form_1 = 'adr_reg_form_1'; $form_2 = 'adr_reg_form_2'; // Activate the plugin if email already on list if ( trim($_GET['mbp_onlist']) == 1 ) { $adr_activate = 2; update_option('adr_activate', $adr_activate); $reg_msg = 'Thank you for registering the plugin. It has been activated'; } // If registration form is successfully submitted if ( ((trim($_GET['submit']) != '' && trim($_GET['from']) != '') || trim($_GET['submit_again']) != '') && $adr_activate != 2 ) { update_option('adr_name', $_GET['name']); update_option('adr_email', $_GET['from']); $adr_activate = 1; update_option('adr_activate', $adr_activate); } if ( intval($adr_activate) == 0 ) { // First step of plugin registration global $userdata; adrRegisterStep1($form_1,$userdata); } else if ( intval($adr_activate) == 1 ) { // Second step of plugin registration $name = get_option('adr_name'); $email = get_option('adr_email'); adrRegisterStep2($form_2,$name,$email); } else if ( intval($adr_activate) == 2 ) { // Options page if ( trim($reg_msg) != '' ) { echo '

'.$reg_msg.'

'; } echo "
"; _AdsDel_Header(); _AdsDel_ListAds($options); //print_r($options); _AdsDel_NewAdForm($newform_values); _AdsDel_AdSense_sandbox(); remove_pwdby(); _AdsDel_RewardAuthor($options); _AdsDel_Footer(); echo "\n
"; } } /** * Plugin registration form */ function adrRegistrationForm($form_name, $submit_btn_txt='Register', $name, $email, $hide=0, $submit_again='') { $wp_url = get_bloginfo('wpurl'); $wp_url = (strpos($wp_url,'http://') === false) ? get_bloginfo('siteurl') : $wp_url; $plugin_pg = 'options-general.php'; $thankyou_url = $wp_url.'/wp-admin/'.$plugin_pg.'?page='.$_GET['page']; $onlist_url = $wp_url.'/wp-admin/'.$plugin_pg.'?page='.$_GET['page'].'&mbp_onlist=1'; if ( $hide == 1 ) $align_tbl = 'left'; else $align_tbl = 'center'; ?> onsubmit="return adrValidateForm_0()">
Name:
Email:
 

'.$msg.'

'; } ?>

Almost Done....

Step 1:

A confirmation email has been sent to your email "". You must click on the link inside the email to activate the plugin.
The confirmation email will look like:
 

Step 2:

Click on the button below to Verify and Activate the plugin.

Troubleshooting

The confirmation email is not there in my inbox!
Dont panic! CHECK THE JUNK, spam or bulk folder of your email.
 
It's not there in the junk folder either.
Sometimes the confirmation email takes time to arrive. Please be patient. WAIT FOR 6 HOURS AT MOST. The confirmation email should be there by then.
 
6 hours and yet no sign of a confirmation email!
Please register again from below:
Help! Still no confirmation email and I have already registered twice
Okay, please register again from the form above using a DIFFERENT EMAIL ADDRESS this time.
 
Why am I receiving an error similar to the one shown below?

You get that kind of error when you click on "Verify and Activate" button or try to register again.

This error means that you have already subscribed but have not yet clicked on the link inside confirmation email. In order to avoid any spam complain we don't send repeated confirmation emails. If you have not recieved the confirmation email then you need to wait for 12 hours at least before requesting another confirmation email.
 
But I've still got problems.
Stay calm. Contact us about it and we will get to you ASAP.

by MaxBlogPress

first_name.' '.$userdata->last_name); $email = trim($userdata->user_email); ?>

Please register the plugin to activate it. (Registration is free)

In addition you'll receive complimentary subscription to MaxBlogPress Newsletter which will give you many tips and tricks to attract lots of visitors to your blog.
Fill the form below to register the plugin:
[ Your contact information will be handled with the strictest confidence
and will never be sold or shared with third parties ]

by MaxBlogPress

'', 'ad_type'=>'', 'ad_width'=>250,'ad_height'=>250, 'color_border'=>'', 'color_bg'=>'', 'color_link'=>'', 'color_url'=>'', 'color_text'=>'', 'alternate_color'=>'FFFFFF' ); $params = array(); foreach( $items as $key => $val ){ if( preg_match ( '/' . $key . ' *= *\"?([^";]+)\"?/', $asBloc, $m ) ){ //echo "$key = $m[1] \n"; //$items[$key] = $m[1]; $params[$key] = $m[1]; }else{ $params[$key] = $items[$key]; // set to default } } //echo $as_url . "\n\n"; return true; // always true for now... } // creates the AdSense options page button under Options menu in WP-admin function add_adsense_deluxe_menu() { if (function_exists('add_options_page')) { add_options_page('AdSense Deluxe Revived', 'AdSense Deluxe Revived', 8, __FILE__); //'AdsenseDeluxeOptionsPanel'); // wp 1.5.1 version } } //-- //-- creates QuickTags button for Adsense-Del. in editor //-- function _AdsDel_InsertAdsenseButton() { $rich_editing = false; $tiger_style = 'float:left;padding:2px;margin-right:2px;margin-top:4px;'; $button_style = ''; if( strpos($_SERVER['REQUEST_URI'], 'post.php') || strstr($_SERVER['PHP_SELF'], 'page-new.php')) { if( function_exists('get_user_option') ) $rich_editing = (get_user_option('rich_editing') == 'true'); $check_plugins = get_settings('active_plugins'); foreach ($check_plugins as $pi) { if( false !== strpos($pi,'wp-admin-tiger') ) $button_style = $tiger_style; } if( function_exists('get_option') ) { $opt = get_option(ADSDEL_OPTIONS_ID); $js = ''; $js2 = ''; foreach( $opt['ads'] as $key => $vals ) { if( $key == $opt['default'] ) continue; $n = 'adsense#' . $key ; $js .= ''; $js2 .= ($js2 == '' ? "" : ',') . ' "' . $key . '"'; // no "adsense#" prepended } } //color:#006633; ?> = 2.8 ) { add_action('admin_menu','add_adsense_deluxe_menu'); } else { add_action('admin_head', 'add_adsense_deluxe_menu'); } add_action('wp_head', 'add_adsense_deluxe_handle_head'); } if( function_exists('add_filter') ) add_filter('the_content', 'adsense_deluxe_insert_ads'); endif; // if plugin_page() /* ============= NOTES ================= * v0.7 2006-01-09 - (see readme with plugin download for all release info) - First release for WordPress 2.0 WYSIWYG editor (rich editing) support. May be bugs. v0.4 2005-08- - Fixed ASD QuickTag when Tiger-Admin plugin is activated. - You can now click the descriptions in the ads list to preview the ad style. v0.3 2005-08-01 - Fixed problem of AdSense showing up in Full Text RSS feeds. - Fixed call-time pass-by-reference warnings from PHP. - No longer "rewarding author" on anything other than Post or Page pages. - Fixed problem with only two (2) ads being shown on a given page. - Added AdSense-Deluxe quicktag menu to post editor. - Stopped showing live adsense in post editing previews; now displays a placeholder - Added stripslashes() around calls to edit an ad and to display adsense code in posts. [axodys] reported his ads getting escaped on WP 1.5.3 (with magic_quotes_gpc Off). - Editing an ad which was disabled causes it to be enabled when saving (fixed). + ToDo: run some timing to see check overhead plugin ads to page serving. * =============== END NOTES ============ */ ?>