Successful ads between nth post
This commit is contained in:
parent
648a91a6e5
commit
9e7b33f7c1
|
@ -36,7 +36,7 @@ function loadGoogle(settings) {
|
||||||
googletag.defineSlot(settings.dfp_topic_above_suggested_code, [parseInt(settings.dfp_size_topic_above_suggested_width_code), parseInt(settings.dfp_size_topic_above_suggested_height_code)], 'div-gpt-ad-topic-above-suggested').addService(googletag.pubads());
|
googletag.defineSlot(settings.dfp_topic_above_suggested_code, [parseInt(settings.dfp_size_topic_above_suggested_width_code), parseInt(settings.dfp_size_topic_above_suggested_height_code)], 'div-gpt-ad-topic-above-suggested').addService(googletag.pubads());
|
||||||
}
|
}
|
||||||
if (settings.dfp_post_bottom_code && !settings.dfp_show_post_bottom) {
|
if (settings.dfp_post_bottom_code && !settings.dfp_show_post_bottom) {
|
||||||
googletag.defineSlot(settings.dfp_post_bottom_code, [parseInt(settings.dfp_size_post_bottom_width_code), parseInt(settings.dfp_size_post_bottom_height_code)], 'div-gpt-ad-post-bottom').addService(googletag.pubads());
|
googletag.defineSlot(settings.dfp_post_bottom_code, [parseInt(settings.dfp_size_post_bottom_width_code), parseInt(settings.dfp_size_post_bottom_height_code)], 'div-gpt-ad-post-bottom').addService(googletag.pubads());
|
||||||
}
|
}
|
||||||
googletag.pubads().enableSingleRequest();
|
googletag.pubads().enableSingleRequest();
|
||||||
googletag.enableServices();
|
googletag.enableServices();
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
export default Ember.Model.extend({
|
|
||||||
|
|
||||||
PostSpecificCount: function() {
|
|
||||||
return this.get('post_number') % 5 === 0;
|
|
||||||
}.property('post_number'),
|
|
||||||
|
|
||||||
})
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
{{#if postSpecificCount}}
|
||||||
{{#if Discourse.PostSpecificCount}}
|
{{google-dfp-ad placement="post-bottom"}}
|
||||||
{{google-dfp-ad placement="post-bottom"}}
|
{{/if}}
|
||||||
{{/if}}
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import PostModel from 'discourse/models/post';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'extend-post-model',
|
||||||
|
initialize() {
|
||||||
|
PostModel.reopen({
|
||||||
|
postSpecificCount: function() {
|
||||||
|
return this.get('post_number') % 2 === 0;
|
||||||
|
}.property('post_number')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue