function _form_settings_help()
    {
        ?>
			<p>AdSense Manager supports most Ad networks including <?php 
        adsensem_admin::network_list(array('Ad_AdSenseAd', 'Ad_AdSenseReferral', 'Ad_Code'));
        ?>
.</p>
			<p>Any networks not supported directly will be can be managed as HTML Code units. You can re-attempt import of code units at any time using the Import Options.</p>
	<?php 
    }
 function _form_settings_ad_format()
 {
     //Google AdSense data
     $default = array('' => 'Use Default');
     $adtypes = $this->_var_ad_types_available();
     $formats = $this->_var_ad_formats_available();
     //Get permitted formats for the current network
     //UGLY HACK, TRY REMOVE THIS SOMEHOW
     $this->p['linkformat'] = $this->p['adformat'];
     $this->p['referralformat'] = $this->p['adformat'];
     adsensem_admin::_field_select('Ad Type', 'adtype', $adtypes);
     adsensem_admin::_field_select('<a href="https://www.google.com/adsense/adformats" target="_new">Format</a>', 'adformat', $formats['ads']);
     adsensem_admin::_field_select('<a href="https://www.google.com/adsense/adformats" target="_new">Format</a>', 'linkformat', $formats['links']);
     adsensem_admin::_field_select('<a href="https://www.google.com/adsense/adformats" target="_new">Format</a>', 'referralformat', $formats['referrals']);
 }
 function admin_manage_column3()
 {
     adsensem_admin::dbxoutput($this->_var_forms_column3());
 }
 function init_admin()
 {
     //Pull in the admin functions before triggering
     require_once 'class-admin.php';
     adsensem_admin::init_admin();
 }
 function adsense_deluxe_to_3_0()
 {
     global $_adsensem;
     $deluxe = get_option('acmetech_adsensedeluxe');
     foreach ($deluxe['ads'] as $key => $vals) {
         $ad = adsensem_admin::import_ad($vals['code']);
         $name = adsensem_admin::validate_name($vals['name']);
         $_adsensem['ads'][$name] = $ad;
         $_adsensem['ads'][$name]->name = $name;
         $_adsensem['ads'][$name]->p['show-home'] = $deluxe['enabled_for']['home'] == 1 ? 'yes' : 'no';
         $_adsensem['ads'][$name]->p['show-post'] = $deluxe['enabled_for']['posts'] == 1 ? 'yes' : 'no';
         $_adsensem['ads'][$name]->p['show-archive'] = $deluxe['enabled_for']['archives'] == 1 ? 'yes' : 'no';
         $_adsensem['ads'][$name]->p['show-page'] = $deluxe['enabled_for']['page'] == 1 ? 'yes' : 'no';
         if ($vals['make_default'] == 1) {
             $_adsensem['default-ad'] = $name;
         }
     }
     $_adsensem['ads'] = adsensem_admin::sort_ads_by_network($_adsensem['ads']);
 }
 function _form_settings_style()
 {
     $default = array('' => 'Use Default');
     $attitude = array('true' => 'Classic', 'false' => 'Basic', 'cool' => 'Cool Blue', 'fader' => 'Ad Fader', 'etched' => 'Etched');
     $yesno = array('yes' => 'Yes', 'no' => 'No');
     adsensem_admin::_field_select('Attitude', 'attitude', $yesno);
     adsensem_admin::_field_select('Open New Window', 'new-window', $yesno);
 }
 function _form_settings_link_options()
 {
     $default = array('' => 'Use Default');
     $yesno = array('yes' => 'Yes', 'no' => 'No');
     adsensem_admin::_field_input('Alternate Text', 'alt-text', 25, 'Alt text to display where images not shown.');
     adsensem_admin::_field_select('In New Window', 'new-window', $yesno);
     adsensem_admin::_field_select('Hide Link', 'hide-link', $yesno);
     adsensem_admin::_field_input('Display URL', 'hide-link-url', 25, 'Destination to display when mouse hovers link.');
 }
 function _form_settings_ad_format()
 {
     $formats = $this->_var_ad_formats_available();
     //Get permitted formats for the current network
     adsensem_admin::_field_select('<a href="https://www.google.com/adsense/adformats" target="_blank">Format</a>', 'adformat', $formats);
     adsensem_admin::_field_input('Referral Code (CPA)', 'alternate-referral', 25, 'Enter referral code from Google AdSense site.');
 }
 function _form_settings_ad_format()
 {
     $default = array('' => 'Use Default');
     $formats = $this->_var_ad_formats_available();
     //Get permitted formats for the current network
     adsensem_admin::_field_select('Format', 'adformat', $formats);
     adsensem_admin::_field_input('Channel', 'channel', 20, 'Enter multiple Channels separated by + signs.');
 }
 function admin_manage_column1()
 {
     adsensem_admin::dbxoutput($this->_var_forms_network());
     adsensem_admin::dbxoutput($this->_var_forms_unit());
     adsensem_admin::dbxoutput($this->_var_forms_column1());
 }
 function _form_settings_alternate_ads()
 {
     $default = array('' => 'Use Default');
     $alternates['Basic'] = array('benice' => 'Be Nice!', 'url' => 'URL (Enter)', 'color' => 'Color (Enter)', 'none' => 'None');
     $alternates['Defined Ads'] = $this->get_alternate_ads();
     adsensem_admin::_field_select('Alternates', 'alternate-ad', $alternates);
     adsensem_admin::_field_input('URL', 'alternate-url', 20, 'Enter URL to alternate Ad for display when Google Ad unavailable.');
     adsensem_admin::_field_input('Color', 'alternate-color', 20, 'Enter #RRGGBB color to display when Google Ad unavailable.');
 }
    function admin_options()
    {
        // Get our options and see if we're handling a form submission.
        global $_adsensem;
        if ($_POST['adsensem-submit']) {
            //$_adsensem['adsense-account']=preg_replace('/\D/','',$_POST['adsensem-adsense-account']);
            $_adsensem['be-nice'] = max(min($_POST['adsensem-be-nice'], 100), 0);
            if (!is_numeric($_adsensem['be-nice'])) {
                $_adsensem['be-nice'] = ADSENSEM_BE_NICE;
            }
            update_option('plugin_adsensem', $_adsensem);
        }
        // Here is our little form segment. Notice that we don't need a
        // complete form. This will be embedded into the existing form.
        ?>

		<div class="wrap">
         <h2>AdSense Manager Options</h2>

		<p>AdSense Manager has been redesigned to be as simple to use as possible. To get you started, the instructions below
				will guide you through the process of adding your first ad to AdSense Manager. Once you've created the first one
				you can simply repeat the process to add as many ads as you like!</p>
				
		<h3>Getting Started</h3>
				
		<ol>
		<li><script type="text/javascript"><!--
google_ad_client = "pub-3287067876809234";
//AdSense Text Link
google_ad_slot = "3788957769";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = ""; // on file
//--></script><script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> Or use <?php 
        adsensem_admin::network_list(array('Ad_AdSense', 'Ad_AdSenseAd', 'Ad_AdSenseReferral', 'Ad_Code'));
        ?>
.</li>
<li>Create a new ad unit using your network's ad online management system.</li>
<li>Copy the ad code generated (Edit &raquo; Copy, from within your browser)</li>
<li>Go to <a href="edit.php?page=adsense-manager-manage-ads">Manage &raquo; Ad Units</a> and paste the code into the box</li>
<li>Click <strong>Import to New Ad Unit&raquo;</strong>
</ol>

<p>If you need more help, there are <a href="http://www.mutube.com/mu/getting-started-with-adsense-manager-3x/" target="_blank">detailed instructions available on our website</a>,
or <a href="http://wordpress.org/tags/adsense-manager" target="_blank">check the forum</a> and <a href="http://wordpress.org/tags/adsense-manager#postform" target="_blank">ask a question</a>.</p>
				
   <form action="" method="post" id="adsensem-manage" enctype="multipart/form-data">
				
		<h3>Be Nice!</h3>
		<p style="text-align:justify;">
				Please support the developers of this plugin by either donating a small amount of your ad space to show our ads, or by making a donation:</p>
				
		<ol>
		<li>I'm Being Nice and donating <input style="text-align:right;" name="adsensem-be-nice" value="<?php 
        echo htmlspecialchars($_adsensem['be-nice'], ENT_QUOTES);
        ?>
"  size="1">% of my Ad space to support development of this plugin [<a href="http://wordpress.org/extend/plugins/adsense-manager/faq/">Eh?</a>]</li>
		<li>I've given a <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=martin%2efitzpatrick%40gmail%2ecom&item_name=Donation%20to%20mutube%2ecom&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8" target="_blank">a very generous donation through Paypal</a> and got a warm fuzzy feeling.</li>
		<li>I've ordered a random gift <a href="http://www.amazon.co.uk/gp/registry/wishlist/3GXT94HH08RAY?reveal=unpurchased&filter=all&sort=price&layout=standard&x=7&y=10" target="_blank">from your wishlist</a> so you don't need to waste valuable development time in the shops.
		</ol>
				
		<p>Thanks to all those that have shown their support, it really does make a difference!</p>
		
		<p class="submit"><input type="submit" value="Save changes &raquo;"></p>
		</div>
		<input type="hidden" id="adsensem-submit" name="adsensem-submit" value="1" />

		
		
	<input type="hidden" id="adsensem-submit" name="adsensem-submit" value="1" />				 
				 
				 </form>

		<?php 
    }
 function _form_settings_code_method()
 {
     $codemethods = array('javascript' => "Javascript", 'iframe' => "IFRAME");
     adsensem_admin::_field_select('Output Code', 'codemethod', $codemethods);
 }