PDA

View Full Version : Custom Fields in Postbit...


Linue_DarkStar
01-08-2012, 09:44 AM
So I'm looking for a way to have Custom Profile Fields show up in the Postbit, but instead of text, an image.

So say someone chooses Cadet (Rank) in a Custom Profile Field I made, well in the Postbit an image would show up, and if you change the Rank the image changes too.

This is some coding I have thus far....

<center><vb:if condition="$post['field5']">
<div><img src="www.clanpf.com/forums/images/bTech/misc/$post['field5'].png" alt="$post['field5']" /></div></center>
</vb:if>

I found it from here...https://vborg.vbsupport.ru/archive/index.php/t-118896.html

kh99
01-08-2012, 02:24 PM
That looks like a good start, have you tried it? You need to create a custom profile field if you haven't already, then have the values be part or all of the image file names. Of course you'd change '5' to the number of your custom profile field.

Linue_DarkStar
01-08-2012, 09:08 PM
I've named the images the same as the ranks, and the field is 5. It still wants to error out.

kh99
01-08-2012, 09:31 PM
Oh..sorry. It's written for vb3. You need to change each $post['field5'] to {vb:raw post.field5}

Linue_DarkStar
01-09-2012, 02:18 AM
Each one?

So it should look like this?

<center><vb:if condition="{vb:raw post.field5}"><img src="www.clanpf.com/forums/images/misc/{vb:raw post.field5}.png" alt="{vb:raw post.field5}" /></center>
</vb:if>

--------------- Added 1326081495 at 1326081495 ---------------

Well I changed the coding to...

<center><vb:if condition="$post['field7']"><img src="www.clanpf.com/forums/images/misc/{vb:raw post.field7}.png" alt="{vb:raw post.field7}" /></center>
</vb:if>

And it seems to apply the Name, but still isn't finding the image with the same name.