D dave11 Member Jan 28, 2015 #1 Hi, Within this condition: Code: <xen:if is="{$post.position} == 0"> How do I combine several different post position of 0 + 5 + 10 ?(instead of putting 3 rules). Thanks'.
Hi, Within this condition: Code: <xen:if is="{$post.position} == 0"> How do I combine several different post position of 0 + 5 + 10 ?(instead of putting 3 rules). Thanks'.
Paul B XenForo moderator Staff member Jan 28, 2015 #2 The simplest way is: Code: <xen:if is="{$post.position} == 0 OR {$post.position} == 5 OR {$post.position} == 10"> If you want to use an array: Code: <xen:if is="in_array({$post.position}, array(0, 5, 10))"> Upvote 0 Downvote
The simplest way is: Code: <xen:if is="{$post.position} == 0 OR {$post.position} == 5 OR {$post.position} == 10"> If you want to use an array: Code: <xen:if is="in_array({$post.position}, array(0, 5, 10))">
Jens1986 Active member Jan 29, 2015 #4 I want an ad in the ad_message_body on the 1st and 2nd post on each page. Currently I use this: Code: <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} == 1"> This only works on page 1, on other pages of the thread the ad only shows up in the 1st post. Any way to fix this? @Brogan Last edited: Jan 29, 2015 Upvote 0 Downvote
I want an ad in the ad_message_body on the 1st and 2nd post on each page. Currently I use this: Code: <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} == 1"> This only works on page 1, on other pages of the thread the ad only shows up in the 1st post. Any way to fix this? @Brogan
Paul B XenForo moderator Staff member Jan 29, 2015 #5 Code: <xen:if is="{$post.position} == 0 OR {$post.position} == 1"> Upvote 0 Downvote
Jens1986 Active member Jan 29, 2015 #6 Brogan said: Code: <xen:if is="{$post.position} == 0 OR {$post.position} == 1"> Click to expand... Still only shows on page 1 Edit: this works: <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} % {$xenOptions.messagesPerPage} == 1"> Last edited: Jan 29, 2015 Upvote 0 Downvote
Brogan said: Code: <xen:if is="{$post.position} == 0 OR {$post.position} == 1"> Click to expand... Still only shows on page 1 Edit: this works: <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} % {$xenOptions.messagesPerPage} == 1">
Jens1986 Active member Jan 30, 2015 #7 How do i Prevent this from showing on private messages? Upvote 0 Downvote
Paul B XenForo moderator Staff member Jan 30, 2015 #8 Explained here: Conditional Statements Upvote 0 Downvote