- Joined
- May 13, 2021
- Messages
- 91
- Points
- 28
Reputation:
Hi, this code don't work to me, can someone tell me why???
I have an badge with ID=10 and I want it when the user receives this medal This text will be shown in his profile.
HTML:
<xf:if is="$user.badge_id == '10'">
This user have a golden badge.
</xf:if>
I have an badge with ID=10 and I want it when the user receives this medal This text will be shown in his profile.
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,529
- Points
- 523
Reputation:
- By BattleKing
Hi, this code don't work to me, can someone tell me why???
HTML:<xf:if is="$user.badge_id == '10'"> This user have a golden badge. </xf:if>
I have an badge with ID=10 and I want it when the user receives this medal This text will be shown in his profile.
so far as I know it is called $userBadge.badge_id
↑View previous replies…
SamuelHere the code to add
BattleKingThanks for answering and spending your time to find it , but !! do you test it in "member_view" ??? do it work to you ??
I used above code as you said but not worked, And also I changed the "$xf.visitor" values to "$user" but no....... again!
I used this code in different ways in "member_view" template. It does not work by any kind of changes. it never works to me.
Do you have a better suggestion to make it work?
SamuelYes all I post has been tested and it works fine. You did not placed the complete section in your modification!
BattleKingOh man, Thank you. it worked. You are a master of xenforo, i like you xD. I had a huge mistake in ID identification. The ID of the badge item was 110, I entered the value of 10. I am really crazy. you are perfect, i want to kiss u 😘🤣
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,529
- Points
- 523
Reputation:
- By BattleKing
I want to show up on members profile.
in member_view template
I inserted these variables in whatever way you think, but none of them worked. It seems that the creator of this add-one does not allow this at all.
I'd appreciate if you found a way to do this command. 🙏🏻❤️
HTML:
<xf:if contentcheck="true">
<span class="featuredBadges featuredBadges--account">
<xf:contentcheck>
<xf:if is="$xf.visitor.user_id">
<xf:if is="$xf.visitor.cached_featured_badges">
<xf:foreach loop="$user.cached_featured_badges" value="$userBadge" if="$userBadge.Badge is not empty">
<xf:if is="$userBadge.badge_id == 1">
This user have a golden badge.
</xf:if>
</xf:foreach>
<xf:else />
<xf:foreach loop="$xf.visitor.cached_badges" value="$userBadge" if="$userBadge.Badge is not empty">
<xf:if is="$userBadge.badge_id == 1">
This user have a golden badge.
</xf:if>
</xf:foreach>
</xf:if>
</xf:if>
</xf:contentcheck>
</span>
</xf:if>
- Joined
- May 13, 2021
- Messages
- 91
- Points
- 28
Reputation:
- By Samuel
Here the code to add
HTML:<xf:if contentcheck="true"> <span class="featuredBadges featuredBadges--account"> <xf:contentcheck> <xf:if is="$xf.visitor.user_id"> <xf:if is="$xf.visitor.cached_featured_badges"> <xf:foreach loop="$user.cached_featured_badges" value="$userBadge" if="$userBadge.Badge is not empty"> <xf:if is="$userBadge.badge_id == 1"> This user have a golden badge. </xf:if> </xf:foreach> <xf:else /> <xf:foreach loop="$xf.visitor.cached_badges" value="$userBadge" if="$userBadge.Badge is not empty"> <xf:if is="$userBadge.badge_id == 1"> This user have a golden badge. </xf:if> </xf:foreach> </xf:if> </xf:if> </xf:contentcheck> </span> </xf:if>
HTML:
<xf:if contentcheck="true">
<span class="featuredBadges featuredBadges--account">
<xf:contentcheck>
<xf:if is="$xf.visitor.user_id">
<xf:if is="$xf.visitor.cached_featured_badges">
<xf:foreach loop="$user.cached_featured_badges" value="$userBadge" if="$userBadge.Badge is not empty">
<xf:if is="$userBadge.badge_id == 10"> my badge id is 10
This user have a golden badge.
</xf:if>
</xf:foreach>
</xf:if>
</xf:if>
</xf:contentcheck>
</span>
</xf:if>
I used above code as you said but not worked, And also I changed the "$xf.visitor" values to "$user" but no....... again!
I used this code in different ways in "member_view" template. It does not work by any kind of changes. it never works to me.
Do you have a better suggestion to make it work?
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,529
- Points
- 523
Reputation:
- By BattleKing
Thanks for answering and spending your time to find it , but !! do you test it in "member_view" ??? do it work to you ??
HTML:<xf:if contentcheck="true"> <span class="featuredBadges featuredBadges--account"> <xf:contentcheck> <xf:if is="$xf.visitor.user_id"> <xf:if is="$xf.visitor.cached_featured_badges"> <xf:foreach loop="$user.cached_featured_badges" value="$userBadge" if="$userBadge.Badge is not empty"> <xf:if is="$userBadge.badge_id == 10"> my badge id is 10 This user have a golden badge. </xf:if> </xf:foreach> </xf:if> </xf:if> </xf:contentcheck> </span> </xf:if>
I used above code as you said but not worked, And also I changed the "$xf.visitor" values to "$user" but no....... again!
I used this code in different ways in "member_view" template. It does not work by any kind of changes. it never works to me.
Do you have a better suggestion to make it work?
- Joined
- May 13, 2021
- Messages
- 91
- Points
- 28
Reputation:
- By Samuel
Yes all I post has been tested and it works fine. You did not placed the complete section in your modification!
View attachment 33269