Tutorials Random Ads Code

Marks-Man

Administrator
Compatible XF Versions2.0 , 2.1 , 2.2
Write your ad code where it says banner.

It will randomly show an ad every time you refresh the page where you inserted the ad. It is the adaptation of the codes in Xenforo 1.x version for Xenforo 2.x.

Code:

Code:
<xf:comment>DEFINE AND RANDOMIZE YOUR BANNERS</xf:comment>
<xf:set var="$banners.1">banner 1</xf:set>
<xf:set var="$banners.2">banner 2</xf:set>
<xf:set var="$banners.3">banner 3</xf:set>
{$banners.{{ ($xf.time % 3) + 1 }}|raw}

Continue reading...
 
Top