Log in

View Full Version : Template Conditionals Problem


Fluke667
03-10-2012, 02:15 AM
I need a Template Conditional that Shows my $bbuserinfo[field12].png Profile Field choosen Image to all the Other Users and to me.

With all the Template Conditionals i did try, the Image was showing only to me :(

Lynne
03-10-2012, 04:07 PM
Please post what you tried and also tell us what template you tried it in.

Fluke667
03-10-2012, 05:16 PM
I got this in my Postbit_legacy Template. This should Display a Background Image for the Postbit_Legacy, for other Users and for me but it Displays the Background only for me and not for Other Users...







<if condition="$bbuserinfo[field12]">
<style type="text/css">
.postbit {
background: #212224 url(images/postbit/$bbuserinfo[field12].png);
background-repeat: repeat-y;
width:200;
border-left: solid 0px;
border-right: solid 0px;
}
</style>
<td class="postbit" width="175" style="border: $stylevar[cellspacing]px solid $stylevar [tborder_bgcolor]; border-top: 0px; border-bottom: 0px id="td_post_$post[postid]"></if>

<if condition="empty($bbuserinfo['field12'])">
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px"></if>

BirdOPrey5
03-10-2012, 06:37 PM
you need to use $post[field12] not $bbuserinfo[field12].

Fluke667
03-10-2012, 07:50 PM
you need to use $post[field12] not $bbuserinfo[field12].





<if condition="$post[field12]">
<style type="text/css">
.postbit {
background: #212224 url(images/postbit/$bbuserinfo[field12].png);
background-repeat: repeat-y;
width:200;
border-left: solid 0px;
border-right: solid 0px;
}
</style>
<td class="postbit" width="175" style="border: $stylevar[cellspacing]px solid $stylevar [tborder_bgcolor]; border-top: 0px; border-bottom: 0px id="td_post_$post[postid]"></if>

<if condition="empty($bbuserinfo['field12'])">
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px"></if>
Edit/Delete Message


Not working with <if condition="$post[field12]">

christon26
03-10-2012, 08:18 PM
There are two other incidences of $bbuserinfo[field12] in your code, did you try it with those replaced too?


<if condition="$post[field12]">
<style type="text/css">
.postbit {
background: #212224 url(images/postbit/$bbuserinfo[field12].png);
background-repeat: repeat-y;
width:200;
border-left: solid 0px;
border-right: solid 0px;
}
</style>
<td class="postbit" width="175" style="border: $stylevar[cellspacing]px solid $stylevar [tborder_bgcolor]; border-top: 0px; border-bottom: 0px id="td_post_$post[postid]"></if>

<if condition="empty($bbuserinfo['field12'])">
<td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px"></if>
Edit/Delete Message

Fluke667
03-10-2012, 09:08 PM
background: #212224 url(images/postbit/$post[field12].png);

Displays Nothing

BirdOPrey5
03-10-2012, 09:22 PM
Just put "Value: $post[field12]" in the message area and see what it says when you view the page, see what comes after value... Is it blank?

Are you sure you are using VB 3.x? This won't work on VB 4.x.

Fluke667
03-10-2012, 09:59 PM
the output is:

Postbit1


Postbit1 is the Image name defined in Profile Fields... Image is Postbit1.png

BirdOPrey5
03-11-2012, 12:10 AM
the output is:

Postbit1


Postbit1 is the Image name defined in Profile Fields... Image is Postbit1.png

Then:

background: #212224 url(images/postbit/$post[field12].png);

becomes

background: #212224 url(images/postbit/Postbit1.png);

So there must be something wrong with the css because the correct image name is being generated... I thought the url is supposed to be in quotes?

background: #212224 url("images/postbit/Postbit1.png");

Fluke667
03-11-2012, 12:30 AM
not working with the quotes :(

hmmmmmmmmm

BirdOPrey5
03-11-2012, 02:23 AM
Try putting the URL in the browser and make sure the image exists in the right place.

Lynne
03-11-2012, 06:44 PM
How about a link to the thread so we can see this?