|
|
|
@ -76,51 +76,51 @@ function loadGoogle(settings) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (settings.dfp_topic_list_top_code && !settings.dfp_show_topic_list_top && settings.topic_list_top_ad_sizes) {
|
|
|
|
|
const_width = parseInt(splitWidthInt(settings.topic_list_top_ad_sizes));
|
|
|
|
|
const_height = parseInt(splitHeightInt(settings.topic_list_top_ad_sizes));
|
|
|
|
|
if (settings.dfp_topic_list_top_code && !settings.dfp_show_topic_list_top && settings.dfp_topic_list_top_ad_sizes) {
|
|
|
|
|
const_width = parseInt(splitWidthInt(settings.dfp_topic_list_top_ad_sizes));
|
|
|
|
|
const_height = parseInt(splitHeightInt(settings.dfp_topic_list_top_ad_sizes));
|
|
|
|
|
if (Discourse.Mobile.mobileView) {
|
|
|
|
|
var topic_list_top_mobile = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_list_top_code, [320,50], 'div-gpt-ad-topic-list-top').addService(googletag.pubads());
|
|
|
|
|
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_value_code)), topic_list_top_mobile)
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var topic_list_top = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_list_top_code, [parseInt(splitWidthInt(Discourse.SiteSettings.topic_list_top_ad_sizes)), parseInt(splitHeightInt(Discourse.SiteSettings.topic_list_top_ad_sizes))], 'div-gpt-ad-topic-list-top').addService(googletag.pubads());
|
|
|
|
|
var topic_list_top = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_list_top_code, [parseInt(splitWidthInt(Discourse.SiteSettings.dfp_topic_list_top_ad_sizes)), parseInt(splitHeightInt(Discourse.SiteSettings.dfp_topic_list_top_ad_sizes))], 'div-gpt-ad-topic-list-top').addService(googletag.pubads());
|
|
|
|
|
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_topic_list_top_value_code)), topic_list_top)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (settings.dfp_topic_above_post_stream_code && !settings.dfp_show_topic_above_post_stream && settings.topic_above_post_stream_ad_sizes) {
|
|
|
|
|
const_width = parseInt(splitWidthInt(settings.topic_above_post_stream_ad_sizes));
|
|
|
|
|
const_height = parseInt(splitHeightInt(settings.topic_above_post_stream_ad_sizes));
|
|
|
|
|
if (settings.dfp_topic_above_post_stream_code && !settings.dfp_show_topic_above_post_stream && settings.dfp_topic_above_post_stream_ad_sizes) {
|
|
|
|
|
const_width = parseInt(splitWidthInt(settings.dfp_topic_above_post_stream_ad_sizes));
|
|
|
|
|
const_height = parseInt(splitHeightInt(settings.dfp_topic_above_post_stream_ad_sizes));
|
|
|
|
|
if (Discourse.Mobile.mobileView) {
|
|
|
|
|
var topic_above_post_stream_mobile = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_above_post_stream_code, [320,50], 'div-gpt-ad-topic-above-post-stream').addService(googletag.pubads());
|
|
|
|
|
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_above_post_stream_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_topic_above_post_stream_value_code)), topic_above_post_stream_mobile)
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var topic_above_post_stream = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_post_stream_code, [parseInt(splitWidthInt(Discourse.SiteSettings.topic_above_post_stream_top_ad_sizes)), parseInt(splitHeightInt(Discourse.SiteSettings.topic_above_post_stream_ad_sizes))], 'div-gpt-ad-topic-above-post-stream').addService(googletag.pubads());
|
|
|
|
|
var topic_above_post_stream = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_post_stream_code, [parseInt(splitWidthInt(Discourse.SiteSettings.dfp_topic_above_post_stream_ad_sizes)), parseInt(splitHeightInt(Discourse.SiteSettings.dfp_topic_above_post_stream_ad_sizes))], 'div-gpt-ad-topic-above-post-stream').addService(googletag.pubads());
|
|
|
|
|
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_above_post_stream_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_topic_above_post_stream_value_code)), topic_above_post_stream)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (settings.dfp_topic_above_suggested_code && !settings.dfp_show_topic_above_suggested && settings.topic_above_suggested_ad_sizes) {
|
|
|
|
|
const_width = parseInt(splitWidthInt(settings.topic_above_suggested_ad_sizes));
|
|
|
|
|
const_height = parseInt(splitHeightInt(settings.topic_above_suggested_ad_sizes));
|
|
|
|
|
if (settings.dfp_topic_above_suggested_code && !settings.dfp_show_topic_above_suggested && settings.dfp_topic_above_suggested_ad_sizes) {
|
|
|
|
|
const_width = parseInt(splitWidthInt(settings.dfp_topic_above_suggested_ad_sizes));
|
|
|
|
|
const_height = parseInt(splitHeightInt(settings.dfp_topic_above_suggested_ad_sizes));
|
|
|
|
|
if (Discourse.Mobile.mobileView) {
|
|
|
|
|
var topic_above_suggested_mobile = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_topic_above_suggested_code, [320,50], 'div-gpt-ad-topic-above-suggested').addService(googletag.pubads());
|
|
|
|
|
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_above_suggested_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_topic_above_suggested_value_code)), topic_above_suggested_mobile)
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var topic_above_suggested = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_suggested_code, [parseInt(splitWidthInt(Discourse.SiteSettings.topic_above_suggested_ad_sizes)), parseInt(splitHeightInt(Discourse.SiteSettings.topic_above_suggested_ad_sizes))], 'div-gpt-ad-topic-above-suggested').addService(googletag.pubads());
|
|
|
|
|
var topic_above_suggested = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_topic_above_suggested_code, [parseInt(splitWidthInt(Discourse.SiteSettings.dfp_topic_above_suggested_ad_sizes)), parseInt(splitHeightInt(Discourse.SiteSettings.dfp_topic_above_suggested_ad_sizes))], 'div-gpt-ad-topic-above-suggested').addService(googletag.pubads());
|
|
|
|
|
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_topic_above_suggested_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_topic_above_suggested_value_code)), topic_above_suggested)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (settings.dfp_post_bottom_code && !settings.dfp_show_post_bottom && settings.post_bottom_ad_sizes) {
|
|
|
|
|
const_width = parseInt(splitWidthInt(settings.post_bottom_ad_sizes));
|
|
|
|
|
const_height = parseInt(splitHeightInt(settings.post_bottom_ad_sizes));
|
|
|
|
|
if (settings.dfp_post_bottom_code && !settings.dfp_show_post_bottom && settings.dfp_post_bottom_ad_sizes) {
|
|
|
|
|
const_width = parseInt(splitWidthInt(settings.dfp_post_bottom_ad_sizes));
|
|
|
|
|
const_height = parseInt(splitHeightInt(settings.dfp_post_bottom_ad_sizes));
|
|
|
|
|
if (Discourse.Mobile.mobileView) {
|
|
|
|
|
var post_bottom_mobile = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_mobile_post_bottom_code, [320,50], 'div-gpt-ad-post-bottom').addService(googletag.pubads());
|
|
|
|
|
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_post_bottom_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_post_bottom_value_code)), post_bottom_mobile)
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var post_bottom = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_post_bottom_code, [parseInt(splitWidthInt(Discourse.SiteSettings.post_bottom_ad_sizes)), parseInt(splitHeightInt(Discourse.SiteSettings.post_bottom_ad_sizes))], 'div-gpt-ad-post-bottom').addService(googletag.pubads());
|
|
|
|
|
var post_bottom = googletag.defineSlot('/' + settings.dfp_publisher_id + '/' + settings.dfp_post_bottom_code, [parseInt(splitWidthInt(Discourse.SiteSettings.dfp_post_bottom_ad_sizes)), parseInt(splitHeightInt(Discourse.SiteSettings.dfp_post_bottom_ad_sizes))], 'div-gpt-ad-post-bottom').addService(googletag.pubads());
|
|
|
|
|
custom_targeting((keyParse(Discourse.SiteSettings.dfp_target_post_bottom_key_code)), (keyParse(Discourse.SiteSettings.dfp_target_post_bottom_value_code)), post_bottom)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|