XF 2.0 DEFINE AND RANDOMIZE YOUR BANNERS

How does it work in version 2.0?

PHP:
<xf:comment>DEFINE AND RANDOMIZE YOUR BANNERS</xf:comment>

<xf:set var="$rand">(xf:calc '({$serverTime} % 3) + 1')</xf:set>

<xf:if is="($rand) == 1">
banner one
</xf:if>

<xf:if is="($rand) == 2">
    banner two
</xf:if>

<xf:if is="{$rand} == 3">
    banner three
</xf:if>
 
Last edited:

this is not the plugin I'm looking for
I want to show different ads on every renewal

Code:
<xen:comment>DEFINE AND RANDOMIZE YOUR BANNERS</xen:comment>

<xen:set var="$banners.1">banner one</xen:set>
<xen:set var="$banners.2">banner two</xen:set>
<xen:set var="$banners.3">banner three</xen:set>

{xen:raw '$banners.{xen:calc '({$serverTime} % 3) + 1'}'}

This happens in version 1, Not at 2.0
 
HTML:
<xf:comment>DEFINE AND RANDOMIZE YOUR BANNERS</xf:comment>

<xf:set var="$banners.1">banner one</xf:set>
<xf:set var="$banners.2">banner two</xf:set>
<xf:set var="$banners.3">banner three</xf:set>

{$banners.{{ ($xf.time % 3) + 1 }}|raw}
 
Last edited:
HTML:
<xf:comment>DEFINE AND RANDOMIZE YOUR BANNERS</xf:comment>

<xf:set var="$banners.1">banner one</xf:set>
<xf:set var="$banners.2">banner two</xf:set>
<xf:set var="$banners.3">banner three</xf:set>

{$background.{{ ($xf.time % 3) + 1 }}|raw}

Code:
<xf:comment>DEFINE AND RANDOMIZE YOUR BANNERS</xf:comment>

<xf:set var="$banners.1">banner one</xf:set>
<xf:set var="$banners.2">banner two</xf:set>
<xf:set var="$banners.3">banner three</xf:set>

{$banners.{{ ($xf.time % 3) + 1 }}|raw}

Such regulation is necessary, thanks (y)(y)(y)
 
Back
Top Bottom