XF 2.2 Where do I store the JPG for a custom user badge?

thedunes

Member
I had a custom user badge created that will be given to supporting users who donate to the forum, but I can't figure out where to store the photo of the badge on the Xenforo cloud server. My buddy has a forum and said the below but he self-host his Xenforo software.

"You'll have to upload that image file to the server. I think with Xenforo cloud you can use the file manager to do that. I'm not exactly sure what the image path would be using the cloud version. I'm still self hosting all of my sites. You might need to ask XF's support about that."

Where would I store the image? My buddy did something similar and said I needed to add some code, like the one below. Does that make sense? I just want the badge to be added automatically after the user pays for the user upgrade. Am I making this harder than it needs to be?

To add the user badge, it's a custom piece of code I've added in the "message_macros" template after the line that has:
Code:

<xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="{{ $includeMicrodata ? 'jobTitle' : '' }}" />

You would need to add this code and change the url and image path to your badge:

Code:
&lt;xf:if is="{{$user &amp;&amp; ($user.isMemberOf('3') OR $user.isMemberOf('4') OR $user.isMemberOf('6'))}}"&gt;<br>&lt;div style="padding-bottom:2px;"&gt;&lt;/div&gt;&lt;a href="https://www.fordtremor.com/account/upgrades"&gt;&lt;img src="/img/tremor-sm-badge1.png" /&gt;&lt;/a&gt;<br>&lt;/xf:if&gt;
Thanks, John
 
Upload the file.

Click on the link to get the path.

View attachment 297007

Use the path for whatever you need it for.

So I created the folder and grabbed the file below. Can you point me in the right direction in the admin panel so it will insert this badge into the user's profile automatically after they donate using the PayPal upgrade I created? Is this only possible using coding skills, or can it be done via the admin panel? It probably doesn't sound like it, but I am actually starting to get the hang of it, Maybe.


/data/files/SupportingMemberBadge/cmyk_logo.jpg
 

Attachments

  • cmyk_logo.webp
    cmyk_logo.webp
    34.7 KB · Views: 4
Back
Top Bottom