XF 2.2 Show ads (or announcements) at a certain date?

Black Tiger

Well-known member
In IPB we had an option to put in dates for showing ads. So you could show an ad (for example a banner ad) for example from january 10 until january 20th and it would automatically start and stop on those dates.
I also used that for certain announcements and also used it to display like eastern and new years whishes.

Is that also possible with Xenforo. And if not with advertisements, maybe with widgets? Or some other way?
 
Solution
You could probably use a conditional statement with the server time.

To show something after a specific date:
Code:
<xf:if is="$xf.time > 1234567890">
    Content
</xf:if>

To show something between two specific dates:
Code:
<xf:if is="$xf.time > 1234567890 && $xf.time < 9876543210">
    Content
</xf:if>

You can use this site to convert a normal date and time into UNIX time (the 1234567890) - https://www.unixtimestamp.com/index.php
You could probably use a conditional statement with the server time.

To show something after a specific date:
Code:
<xf:if is="$xf.time > 1234567890">
    Content
</xf:if>

To show something between two specific dates:
Code:
<xf:if is="$xf.time > 1234567890 && $xf.time < 9876543210">
    Content
</xf:if>

You can use this site to convert a normal date and time into UNIX time (the 1234567890) - https://www.unixtimestamp.com/index.php
 
Solution
Top Bottom