hoatnd
Member
How can i check user have permission edit thread? Plz help me.<xf:if is="$xf.visitor.is_admin OR $xf.visitor.is_moderator">
How can i check user have permission edit thread? Plz help me.<xf:if is="$xf.visitor.is_admin OR $xf.visitor.is_moderator">
if you have access toHow can i check user have permission edit thread? Plz help me.
$thread
, then it's easy:<xf:if is="$thread.canEdit()">
...
</xf:if>
Thanks <3.if you have access to$thread
, then it's easy:
HTML:<xf:if is="$thread.canEdit()"> ... </xf:if>
I never worked with the modulo operator. You can easily get what you want and be more flexible with an array. Something like:it shows only after the second post, but i want it repeating and I'm struggeling with the right code
<xf:if is="in_array($post.position, [2,5,9,15])">
Show content...
</xf:if>
<xf:if is="$post.position % X == 0">
Show content...
</xf:if>
X
is for "every X post"; e.g. 2 for every second post.I never worked with the modulo operator. You can easily get what you want and be more flexible with an array. Something like:
HTML:<xf:if is="in_array($post.position, [2,5,9,15])"> Show content... </xf:if>
Edit: You should be able to use the modulo operator in that way:
->HTML:<xf:if is="$post.position % X == 0"> Show content... </xf:if>
X
is for "every X post"; e.g. 2 for every second post.
<xf:if is="$user.like_count|number > x">
Show content...
</xf:if>
This list is outdated. In the current XF version, there is noIs it only the number of likes (thumb-up) or the number of positive reactions (the total reaction score in fact) that is taken into account?
likes_count
column in the xf_user
table anymore. You should use reaction_score
instead (which takes the "score" into account).Yeah, should work.Correct ?
the corresponding headline is:In what case do we use it? I don't quite understand its interest, how it works and in which template this code should be written.
I never worked with that condition, but it seems that it givesHow can I show content on pages with a sidebar?
true
(no matter where you place it) if the output contains a (right) sidebar in the end.<xf:else />
, <xf:elseif is="...">
and OR
, AND
, etc...Is there a condition to check, if a widget is located in the sidebar or on any other position of the page?the corresponding headline is:
I never worked with that condition, but it seems that it givestrue
(no matter where you place it) if the output contains a (right) sidebar in the end.
We use essential cookies to make this site work, and optional cookies to enhance your experience.