From 85a85fb102091e6849de65b83bae283d90213f6f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 24 Mar 2019 23:11:02 +0100 Subject: [PATCH] Ad support for articles See #2707 --- com.woltlab.wcf/templates/article.tpl | 4 ++ .../templates/articleListItems.tpl | 46 ++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) 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}
-- 2.20.1