The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Adding comma when needed in custom profile (postbit legacy)
I have created two custom profile fields.
the first one includes 20 teams and the user can choose only one the second has also 20 teams and the user can choose only one. This is my code : Code:
<if condition="$post['field11']"><div class="CommUserInfo">team : $post[field11] , $post[field12]</div></if> The problem with my code is that it always puts the comma , I want it to add the comma only if the user chooses two teams ( one from each group) , while if the user chooses only one team , it does not add the comma. |
#2
|
||||
|
||||
Do they have to choose something in each field - 11&12? Or only in one field - only in 11? Give us some of those details and then we can write up some conditions.
|
#3
|
|||
|
|||
Code:
<if condition="$post['field11']"><div class="CommUserInfo">team : $post[field11]<if condition="$post['field12']"> , $post[field12]</if></div></if> |
#5
|
||||
|
||||
Quote:
Code:
<if condition="$post['field11']"><div class="CommUserInfo">team : $post[field11] <if condition="$post['field11'] AND $post['field12']">, </if><if condition="$post['field12']">$post[field12]</if></div></if> |
#6
|
||||
|
||||
Actually, if field11 is left blank, nothing will show because of the initial condition around the whole line.
|
#7
|
||||
|
||||
Quote:
Code:
<div class="CommUserInfo">team : <if condition="$post['field11']">$post[field11]</if><if condition="$post['field11'] AND $post['field12']">, </if><if condition="$post['field12']">$post[field12]</if></div> Code:
<if condition="$post['field11'] OR $post['field12']"><div class="CommUserInfo">team : <if condition="$post['field11']">$post[field11]</if><if condition="$post['field11'] AND $post['field12']">, </if><if condition="$post['field12']">$post[field12]</if></div></if> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|