本文整理汇总了PHP中td_util::get_td_ads方法的典型用法代码示例。如果您正苦于以下问题:PHP td_util::get_td_ads方法的具体用法?PHP td_util::get_td_ads怎么用?PHP td_util::get_td_ads使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类td_util
的用法示例。
在下文中一共展示了td_util::get_td_ads方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* 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;
}
示例2: render
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;
}
示例3: __construct
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', '');
}
}