Ejemplo n.º 1
0
function foundation_ad_settings($page_options)
{
    wptouch_add_sub_page(FOUNDATION_PAGE_ADVERTISING, 'foundation-page-advertising', $page_options);
    if (!foundation_advertising_enabled()) {
        return $page_options;
    }
    wptouch_add_page_section(FOUNDATION_PAGE_ADVERTISING, __('Service', 'wptouch-pro'), 'service', array(wptouch_add_pro_setting('radiolist', 'advertising_type', __('Choose a service', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0', array('none' => __('None', 'wptouch-pro'), 'google' => __('Google Adsense', 'wptouch-pro'), 'custom' => _x('Custom', 'Refers to a custom advertising service', 'wptouch-pro')))), $page_options, FOUNDATION_SETTING_DOMAIN);
    wptouch_add_page_section(FOUNDATION_PAGE_ADVERTISING, __('Google AdSense', 'wptouch-pro'), 'google-adsense', array(wptouch_add_pro_setting('text', 'google_adsense_id', __('Publisher ID', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('text', 'google_slot_id', __('Slot ID', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('list', 'google_code_type', __('Code Type', 'wptouch-pro'), '', WPTOUCH_SETTING_ADVANCED, '1.0.6', array('sync' => 'Synchronous', 'async' => 'Asynchronous'))), $page_options, FOUNDATION_SETTING_DOMAIN);
    wptouch_add_page_section(FOUNDATION_PAGE_ADVERTISING, __('Custom Ads', 'wptouch-pro'), 'custom-ads', array(wptouch_add_pro_setting('textarea', 'custom_advertising_mobile', __('Mobile advertising script', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
    wptouch_add_page_section(FOUNDATION_PAGE_ADVERTISING, __('Ad Presentation', 'wptouch-pro'), 'ad-presentation', array(wptouch_add_pro_setting('list', 'advertising_location', __('Theme location', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0', array('header' => __('In the header', 'wptouch-pro'), 'top-content' => __('Above the page content', 'wptouch-pro'), 'bottom-content' => __('Below the page content', 'wptouch-pro')))), $page_options, FOUNDATION_SETTING_DOMAIN);
    wptouch_add_page_section(FOUNDATION_PAGE_ADVERTISING, __('Active Pages', 'wptouch-pro'), 'active-pages', array(wptouch_add_pro_setting('checkbox', 'advertising_blog_listings', __('Blog listings', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('checkbox', 'advertising_single', __('Single posts', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('checkbox', 'advertising_pages', __('Static pages', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('checkbox', 'advertising_taxonomy', __('Taxonomy', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0'), wptouch_add_pro_setting('checkbox', 'advertising_search', __('Search results', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
    return $page_options;
}
Ejemplo n.º 2
0
function foundation_handle_advertising()
{
    if (!foundation_advertising_enabled()) {
        return;
    }
    $settings = foundation_get_settings();
    if (foundation_advertising_can_show_ads()) {
        switch ($settings->advertising_type) {
            case 'admob':
                echo '<div class="wptouch-showcase">' . foundation_get_admob_ad() . '</div>';
                break;
            case 'google':
                echo '<div class="wptouch-showcase">' . foundation_get_google_ad() . '</div>';
                break;
            case 'custom':
                echo '<div class="wptouch-custom-showcase">' . $settings->custom_advertising_mobile . '</div>';
                break;
            case 'default':
                // Try to get this advertising type from a plugin
                do_action('wptouch_advertising_' . $settings->advertising_type);
                break;
        }
    }
}