Conditional Statements

Conditional Statements

That was really fast! I didn't know those terms, good to know them now :)
I tried, but ads are still there. Maybe some errors related to "Rotating Ads" addon or just cache.
I'll take a look tomorrow.
Thanks a lot!
 
Still not working.
I guess it's something related to "Rotating Ads" addon.
2013-10-10_1438.png

Code is:
Code:
<xen:if is="!in_array({$contentTemplate}, array('error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'login', 'error_with_login', 'thread_view'))">BANNER
</xen:if>

And target user groups: non-registered.
Any idea what can be wrong? I'll also ask at the addon discussion :)
 
Is there a conditional for the current time?

in vb I could do simple ad-A/B testing with this (checking if the current timestamp is odd or even):

Code:
<if condition="(TIMENOW % 2)">

show ad #1

<else />

show ad #2

</if>
 
What is the correct conditional for showing content in all forums under a specific category? There is <xen:if is="{$forum.parent_node_id} == x"> but it is for forums, not categories.
 
I'm new to Xenforo, but I know a lot of coding languages. I'm wondering where would you put these for only certain threads.

Like on this thread http://forums.piratesofthehighseas.com/index.php?threads/ocean-testing.35/ I have the downloads, but I want only members to be able to download links. How would I go about making it only visible to members? I know the line of code I need, just don't know where it goes.

Sorry if I sound a little noobish, I'm just very new to Xenforo.
 
Is the link within the actual message?

I have the downloads hyperlinked to .zip files on my webserver, I want just to hide the links.

Code:
Ahoy all!  Just a ocean test for FPS testing.  Remember to post your, resolution, graphic settings, FPS, and how good your computer is!

[B]Download:[/B]
[COLOR=#141414][URL='http://piratesofthehighseas.com/downloads/Pirates%20Of%20The%20High%20Seas%20Ocean%20(Win).zip']Windows[/URL] | [URL='http://piratesofthehighseas.com/downloads/Pirates%20Of%20The%20High%20Seas%20Ocean%20(Mac).zip']Mac[/URL] | [URL='http://piratesofthehighseas.com/downloads/Pirates%20Of%20The%20High%20Seas%20Ocean%20(Linux).zip']Linux[/URL][/COLOR]
 
Since the links are within the actual post, you won't be able to use a conditional to do what you want and will require a full add-on to change the output based on viewer's user group.
 
This one is not working out for me...

How can I show content after post x on every page in a thread or conversation?
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x">
This content will show after post x on every page
</xen:if>

Its correctly showing the content after the first post(I replaced X with 0) in every thread page but its showing the content after every single message in a conversation instead of just after the first message. Any ideas?

BTW, this code is being used in the "ad_message_below" template.
 
Last edited:
I believe the code has changed recently (or since this was written) so I'll look into that.
 
For some reason, $post.position and $message.position are no longer available in the conversation view, which means the 0 is matching the NULL value for each message.

I'm not quite sure why that change was made, I will need to install an older version and check the code (or ask Mike).
 
Hi Brogan, is there a conditional statement to check if the user is using a responsive layout of the site rather than desktop view?
 
Top Bottom