Exemple #1
0
                echo bsa_space($id, 'template');
            } elseif ($type == 'domain') {
                echo plugins_url();
            } else {
                echo '(error 707) No access to the API.';
            }
        } else {
            echo '(error 706) No access to the API.';
        }
    } else {
        echo '(error 705) No access to the API.';
    }
} elseif (isset($_GET['i'])) {
    // iframe
    if (isset($id) && $id != '' && bsa_space($id, 'id') != NULL && bsa_space($id, 'status') == 'active' && bsa_site(bsa_space($id, 'site_id'), 'status') == 'active') {
        echo bsa_pro_ad_space($id, $max_width, $delay, $padding_top, $attachment, $crop);
        // Print items
        ?>
<style>
	.bsaProContainer .bsaProItemInner__copy { font-family: Verdana, Arial, sans-serif; }
	<?php 
        echo get_option('bsa_pro_plugin_custom_css') != '' ? get_option('bsa_pro_plugin_custom_css') : null;
        ?>
	<?php 
        echo file_get_contents(plugin_dir_path(__FILE__) . '/../frontend/css/asset/style.css');
        ?>
	<?php 
        if (strpos(bsa_space($id, 'template'), 'material-design') !== false) {
            ?>
		<?php 
            echo file_get_contents(plugin_dir_path(__FILE__) . '/../frontend/css/asset/material-design.css');
Exemple #2
0
function tbr_top_ads() { ?>
  <div class="tm-top tm-media-block">
    <?php echo bsa_pro_ad_space('1'); ?>
  </div>
<? }
function ads_pro_ad_space_function($atts, $content = null)
{
    extract(shortcode_atts(array('id' => $atts['id'], 'max_width' => isset($atts['max_width']) ? $atts['max_width'] : null, 'delay' => isset($atts['delay']) ? $atts['delay'] : null, 'padding_top' => isset($atts['padding_top']) ? $atts['padding_top'] : null, 'attachment' => isset($atts['attachment']) ? $atts['attachment'] : null, 'crop' => isset($atts['crop']) ? $atts['crop'] : null, 'hide_for_id' => isset($atts['hide_for_id']) ? $atts['hide_for_id'] : null, 'if_empty' => isset($atts['if_empty']) ? $atts['if_empty'] : null), $atts));
    $content = wpb_js_remove_wpautop($content, true);
    // fix unclosed/unwanted paragraph tags in $content
    $id = "{$id}";
    $max_width = "{$max_width}";
    $delay = "{$delay}";
    $padding_top = "{$padding_top}";
    $attachment = "{$attachment}";
    $crop = "{$crop}";
    $hide_for_id = "{$hide_for_id}";
    $if_empty = "{$if_empty}";
    ob_start();
    if (get_option('bsa_pro_plugin_' . 'hide_if_logged') != 'yes' && is_user_logged_in() && in_array(get_the_ID(), explode(',', $hide_for_id), false) !== true || !is_user_logged_in() && in_array(get_the_ID(), explode(',', $hide_for_id), false) !== true) {
        // Hide for logged users or specific pages
        if ($content != null && bsa_space($id, 'display_type') == 'link') {
            ?>
			<style>
				.bsaProLink-<?php 
            echo $id;
            ?>
 .bsaProLinkHover-<?php 
            echo $id;
            ?>
 {
					left: 0;
					width: <?php 
            echo $max_width . 'px';
            ?>
;
				}
			</style>
			<?php 
            echo '<div class="bsaProLink bsaProLink-' . $id . '">' . $content . '<div class="bsaProLinkHover bsaProLinkHover-' . $id . '">';
        }
        $ad_space_1 = bsa_pro_ad_space($id, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id, $if_empty);
        $ad_space_2 = null;
        if (isset($if_empty)) {
            $ad_space_2 = bsa_pro_ad_space($if_empty, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id);
        }
        if ($ad_space_1 != null) {
            bsa_pro_ad_space($id, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id, $if_empty);
        } elseif ($ad_space_2 != null) {
            bsa_pro_ad_space($if_empty, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id);
        }
        //		bsa_pro_ad_space($id, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id);
        if ($content != null && bsa_space($id, 'display_type') == 'link') {
            echo '</div></div>';
        }
    }
    return ob_get_clean();
}