/** * renders the ads * @param $atts * @return string */ function render($atts) { extract(shortcode_atts(array('spot_id' => '', 'align' => ''), $atts)); if (empty($spot_id)) { return; } $ad_array = td_util::get_td_ads($spot_id); // return if the ad for a specific spot id is empty if (empty($ad_array[$spot_id]) or empty($ad_array[$spot_id]['ad_code'])) { return; } $buffy = ''; if (!empty($ad_array[$spot_id]['current_ad_type'])) { switch ($ad_array[$spot_id]['current_ad_type']) { case 'other': //render the normal ads $buffy .= $this->render_ads($ad_array[$spot_id], $atts); break; case 'google': //render the magic google ads :) $buffy .= $this->render_google_ads($ad_array[$spot_id], $atts); break; } } //print_r($ad_array); return $buffy; }
function render($atts, $content = null) { // @todo check for correctly removal of ad code for tablet landscape ; by Radu A extract(shortcode_atts(array('spot_id' => '', 'align' => '', 'spot_title' => ''), $atts)); if (empty($spot_id)) { return; } $ad_array = td_util::get_td_ads($spot_id); // return if the ad for a specific spot id is empty if (empty($ad_array[$spot_id]['ad_code'])) { return; } $buffy = ''; if (!empty($spot_title)) { $buffy .= '<div class="td-adspot-title">' . $spot_title . '</div>'; } if (!empty($ad_array[$spot_id]['current_ad_type'])) { switch ($ad_array[$spot_id]['current_ad_type']) { case 'other': //render the normal ads $buffy .= $this->render_ads($ad_array[$spot_id], $atts); break; case 'google': //render the magic google ads :) $buffy .= $this->render_google_ads($ad_array[$spot_id], $atts); break; } } //print_r($ad_array); return $buffy; }
function __construct() { $this->background_click_td_option_array = td_util::get_td_ads('background_click'); //adds the javascript variables with background click options if (!empty($this->background_click_td_option_array) and !empty($this->background_click_td_option_array['background_click']['link'])) { td_js_buffer::add_variable('td_ad_background_click_link', $this->background_click_td_option_array['background_click']['link']); } else { //add empty variables to prevent errors in js (js dosn't check for undefined ! ) @todo fix this td_js_buffer::add_variable('td_ad_background_click_link', ''); } //adds the javascript variables with background click options if (!empty($this->background_click_td_option_array) and !empty($this->background_click_td_option_array['background_click']['target'])) { td_js_buffer::add_variable('td_ad_background_click_target', $this->background_click_td_option_array['background_click']['target']); } else { //add empty variables to prevent errors in js (js dosn't check for undefined ! ) @todo fix this td_js_buffer::add_variable('td_ad_background_click_target', ''); } }