From: Alexander Ebert Date: Sun, 24 Mar 2019 22:11:02 +0000 (+0100) Subject: Ad support for articles X-Git-Tag: 5.2.0_Alpha_1~181^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85a85fb102091e6849de65b83bae283d90213f6f;p=GitHub%2FWoltLab%2FWCF.git Ad support for articles See #2707 --- diff --git a/com.woltlab.wcf/templates/article.tpl b/com.woltlab.wcf/templates/article.tpl index 9f1c05b944..5ff3bb2659 100644 --- a/com.woltlab.wcf/templates/article.tpl +++ b/com.woltlab.wcf/templates/article.tpl @@ -140,6 +140,10 @@
getReactionHandler()->getDataAttributes('com.woltlab.wcf.likeableArticle', $article->articleID)}>
+ {if MODULE_WCF_AD} + {@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.inArticle')} + {/if} + {@$articleContent->getFormattedContent()} {event name='htmlArticleContent'} diff --git a/com.woltlab.wcf/templates/articleListItems.tpl b/com.woltlab.wcf/templates/articleListItems.tpl index 410070a423..0ac8920fc1 100644 --- a/com.woltlab.wcf/templates/articleListItems.tpl +++ b/com.woltlab.wcf/templates/articleListItems.tpl @@ -1,6 +1,8 @@ +{if !$disableAds|isset}{assign var='disableAds' value=false}{/if} +
{foreach from=$objects item='article'} -
+ + {if MODULE_WCF_AD && !$disableAds} + {if $tpl[foreach][articles][iteration] === 1} + {hascontent} +
+ {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.after1stArticle')}{/content} +
+ {/hascontent} + {else} + {if $tpl[foreach][articles][iteration] % 2 === 0} + {hascontent} +
+ {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.afterEvery2ndArticle')}{/content} +
+ {/hascontent} + {/if} + + {if $tpl[foreach][articles][iteration] % 3 === 0} + {hascontent} +
+ {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.afterEvery3rdArticle')}{/content} +
+ {/hascontent} + {/if} + + {if $tpl[foreach][articles][iteration] % 5 === 0} + {hascontent} +
+ {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.afterEvery5thArticle')}{/content} +
+ {/hascontent} + + {if $tpl[foreach][articles][iteration] % 10 === 0} + {hascontent} +
+ {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.afterEvery10thArticle')}{/content} +
+ {/hascontent} + {/if} + {/if} + {/if} + {/if} {/foreach}