PDA

View Full Version : Need help with a minor condition or maybe rewriting this


demo7up
12-04-2011, 10:13 PM
<vb:if condition="$post['fieldxx']">

<div class="jdm_plate" style="background-image:url(http://path-to/license_plates/{vb:raw post.fieldxx}.png);">
<p><b>{vb:raw post.fieldyy}</b></p>
</div>
</vb:if>


i need this to change fieldxx just for the one user. because when any given user sets the xx id it changes xx across the board.

Specifically for


style="background-image:url(http://path-to/license_plates/{vb:raw post.fieldxx}.png

so what happens is when a user sets that id it changes a bg in a postbit but all the postbits will look identical because its chaging it for the div its not a per user thing.

How can i make this so that its different per user instead of the same background for who ever has a xx value.

Make sense?


demo page http://www.nycjdm.com/showthread.php?2365-2002-2003-Acura-tl-front-lip

i want the license plates which is fieldxx to be unique to one another not be all the same

kh99
12-04-2011, 10:23 PM
I'm not sure I understand, but I don't see why one user setting fieldxx would change it for all users because you have a </div> at the end. But I suppose something in fieldyy could be interfering.

demo7up
12-04-2011, 10:31 PM
thanks for the quick response but

style="background-image:url(http://path-to/license_plates/{vb:raw post.fieldxx}.png);

is added to the div to make the background change depending on the xx input. the problem is it doesnt just apply to the users posts it applys to anyone who has an entry in that custom field.

So everyone has the same div bg instead of each user div having its own bg depending on xx inserted into their profile.

kh99
12-04-2011, 10:39 PM
OK, maybe I misunderstood - I was assuming this goes in the postbit (or postbit_legacy) template, and you want it to reflect the value of fieldxx from the post author's profile? It looks like that's what should be happening.

demo7up
12-04-2011, 10:47 PM
yeah i wrapped it like this now it works

<vb:if condition="$post['userid']">
<vb:if condition="$post['field44']">

<div class="jdm_plate" style="background-image:url(http://nycjdm.com/images/styles/blackstealth/misc/license_plates/{vb:raw post.field44}.png);">
<p><b>{vb:raw post.field45}</b></p>
</div>
</vb:if>
</vb:if>