View Full Version : User Profile Field Help
n00bl3t
07-22-2009, 08:06 PM
Well I posted this up at vbulletin.com but they said to maybe try asking here, vbulletin.org
^^
Well I created a field for users to select their gamer tag so the are recognized by other community members of what they belong to because I run a multi gaming community and I am expanding into other games; WoW, Counter Strike, steam games and what not.
So I have this profile field that works just great, the people can choose their gamer position. Example, i just registered and picked Counter Strike Source. So now when I go to my profile, and click "About Me" my Gaming Field says: Counter-Strike Source.
That is all great and stuff, but I am trying to make it so when I make a new post or thread, on the side, under my name, will display a picture that I would give that field. I hope someone understands this and can send a link that helps with this.
It is kinda like a user rank, but nothing within the user ranks can fix this and the user doesnt belong to a usergroup so it can't use user ranks.
So again, brief explanation: user picks his "Gaming Field" and then when he posts, a picture will display under his name his gaming field. ^^
James Birkett
07-22-2009, 10:02 PM
<if condition="$post['fieldX']"><img src="path/to/image" /></if>? If you want their custom option to appear also:
<if condition="$post['fieldX']">$post[fieldX]<br /><img src="path/to/image" /></if>
Put that in the template postbit/postbit legacy depending on what you use. Replace X with the field number (can be found in profile fields in ACP). Remember, in the actual code, $post[fieldX] has no '' around it.
Lynne
07-22-2009, 10:03 PM
What kind of profile field did you create? Do they select the field from a dropdown? If so, see the second post in here - How To Add A Profile Field To The Postbit (http://www.vbulletin.com/forum/showthread.php?t=108785)
n00bl3t
07-22-2009, 11:30 PM
<if condition="$post['fieldX']">$post[fieldX]<br /><img src="path/to/image" /></if>
Put that in the template postbit/postbit legacy depending on what you use. Replace X with the field number (can be found in profile fields in ACP). Remember, in the actual code, $post[fieldX] has no '' around it.
Is there a specific spot to put this or at the bottom should do it?
James Birkett
07-22-2009, 11:35 PM
Depends on where you want it to appear. Under Postcount? Location? Usertitle? I don't know if this works for drop-downs.. so if not you'll have to come back.
n00bl3t
07-22-2009, 11:41 PM
Okay, so the code worked, field 6, blah blah and the image comes up however as soon as I added it I noticed a problem. Within field 6 the user has many different options to pick from and from those options need to display the picture, not from the field. Know what I mean?
Edit: I got it to post under the avatar and again it works, just need to know have the picture depending on what the user picks within the field 6.
H3C x Nevz
07-22-2009, 11:43 PM
If you want to pick a specific spot, tell me and I'll show you where to put the code.
One way to answer your above dilemma would be to make a dropdown box for the games, and label the images the same as the field. For instance, one of the options for your users is Counterstrike, so upload all of your images to the same spot, and label the image "Counterstrike.png" so you can just do <img src="pathtoimage.com/$post[fieldX].png">. Get what I'm saying?
n00bl3t
07-22-2009, 11:51 PM
Okay I created a Single-Selection Menu and right now it has 3 example options:
Counter Strike: Source
WarCraft 3
Other
.................................................. .................
A user selects CS:S and then his/her posts will display a CS:S image under his/her avatar. I know where to know set the stuff to display it under the avatar, I just do not know how to make it so the image displays the persons selection they made.
If the person made the WarCraft 3 selection, how would I display that specific image, etc, etc with other options?
H3C x Nevz
07-23-2009, 12:17 AM
If you wanted to do my method, you'd need to delete the colon in CounterStrike Source. Then, upload your image as "Counterstrike Source.png" with the space. Then upload a corresponding image for Warcraft as "WarCraft 3.png", uploaded at the SAME spot. Then a corresponding image at "Other.png", but you'd still need an image. Then, use this code:
<img src="pathtoimage.com/$post[fieldX].png">
Of course, replacing pathtoimage.com with wherever you uploaded the images, and the X with the field number.
James Birkett
07-23-2009, 10:16 AM
If you wanted to do my method, you'd need to delete the colon in CounterStrike Source. Then, upload your image as "Counterstrike Source.png" with the space. Then upload a corresponding image for Warcraft as "WarCraft 3.png", uploaded at the SAME spot. Then a corresponding image at "Other.png", but you'd still need an image. Then, use this code:
<img src="pathtoimage.com/$post[fieldX].png">
Of course, replacing pathtoimage.com with wherever you uploaded the images, and the X with the field number.
What he's trying to say is. Upload your images with exactly the same name as the option (don't add the extension) they choose, and then when they choose that option it will automatically select the image using path/to/image/$post[fieldX].png">
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.