Log in

View Full Version : Questions why this happen when i adding a new Profile Field ?


Connector
05-01-2006, 06:23 AM
Hello

I have add many Profile Field .. just when i add one called "I am here for: " i get some problem when try to select one of the options is avalible


Here is the info of the profile Field

==============
I am here for: -- Multiple-Selection Menu

-Serious Relationships
-Friends
-Networking
-Dating

==============

and in the template memberinfo i add this

<if condition="$userinfo[field15]">
<TD width="133" valign="top" class="alt1"><strong>I am here for:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field15]</if></TD>
</tr>
<tr>

know if i try to go to edit profile and i select any one this options it give me a number if i select more it give me diffrents number .. such "15,9,1" etc.. it should show me the "Serious Relationships " etc.. not a number..

any idea why this happen ?

Thankyou

Freesteyelz
05-01-2006, 06:36 AM
Instead of:


<if condition="$userinfo[field15]">


Try:


<if condition="$show['field15']">

or

<if condition="$post['field15']">


Also, if the <if> tag is on the outside of the <td> tags keep the closing </if> tag outside the <td> tags to maintain consistency.

Connector
05-01-2006, 06:51 AM
i try the above code and it dont show me at all the profile field .

i have created many of them and all is working just fine just this one here is the example of the code i have

<TABLE align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="348">
<TR>
<TD class="thead" COLSPAN=2 width="342">$userinfo[username]'s Details</TD>
</TR>
<tr>
<if condition="$userinfo[field20]">
<TD width="133" valign="top" class="alt1"><strong>Real Name:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field20]</if></TD>
</tr>
<tr>
<if condition="$userinfo[field8]">
<TD width="133" valign="top" class="alt1"><strong>Gender:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field8]</if></TD>
</tr>
<tr>
<if condition="$userinfo[field11]">
<TD width="133" valign="top" class="alt1"><strong>Home Country:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field11]</if></TD>
</tr>
<tr>
<if condition="$userinfo[field16]">
<TD width="133" valign="top" class="alt1"><strong>Ethnicity:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field16]</if></TD>
</tr>
<tr>
<if condition="$userinfo[field17]">
<TD width="133" valign="top" class="alt1"><strong>Marital Status:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field17]</if></TD>
</tr>
<tr>
<if condition="$userinfo[field15]">
<TD width="133" valign="top" class="alt1"><strong>I am here for:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field15]</if></TD>
</tr>
<tr>
<if condition="$userinfo[field29]">
<TD width="133" valign="top" class="alt1"><strong>Orientation:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field29]</if></TD>
</tr>
<tr>
<if condition="$userinfo[field2]">
<TD width="133" valign="top" class="alt1"><strong>Hometown:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field2]</if></TD>
</tr>
<tr>
<if condition="$show['zodiacsign']">
<TD width="133" valign="top" class="alt1"><strong>Zodiac Sign:</strong></TD>
<TD width="205" valign="top" class="alt1">$zodiacsign</if></TD>
</tr>
<tr>
<if condition="$userinfo[field30]">
<TD width="133" valign="top" class="alt1"><strong>Smoke / Drink:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field30] / $post[field31]</if></TD>
</tr>
<tr>
<if condition="$userinfo[field18]">
<TD width="133" valign="top" class="alt1"><strong>Education:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field18]</if></TD>
</tr>
<tr>
</TABLE>


see all of them work fine just the I'm here for :

Hopefully there is away to fix it ..

Thankyou

Freesteyelz
05-01-2006, 07:20 AM
You may find the answer in this thread posted by Steve Machol (http://www.vbulletin.com/forum/showthread.php?t=168741) (post #2 and #3).

Connector
05-01-2006, 08:19 AM
Hello

thankyou for that thread it was very usefull.. but it seem to me i dont understand it

here what i try

<if condition="$comma = ''"></if>
<if condition="$userinfo[field15] & 1">
<TD width="133" valign="top" class="alt1"><strong>I am here for:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field15]$comma<if condition="$comma = ', '"></if></if></TD>
</tr>
<tr>

and

<if condition="$comma = ''"></if>
<if condition="$userinfo[field15] & 1">
<TD width="133" valign="top" class="alt1"><strong>I am here for:</strong></TD>
<TD width="205" valign="top" class="alt1">$post[field15]<if condition="$comma = ', '"></if></if></TD>
</tr>
<tr>


i try to do this way and it dont work .. any idea :surprised:

Freesteyelz
05-02-2006, 02:10 AM
From what I've gathered you'll have to manually translate each option accordingly. Placing $post[field15] will only show the "binary" number. So there will be a bit of work if you have a lot of selections.

If for example you want to show the 4 options, "Serious Relationships", "Friends", "Networking" and "Dating" you'll need to set a conditional for each. Such as:


<if condition="$post['field15'] & 1">
Serious Relationships
</if>
<if condition="$post['field15'] & 2">
Friends
</if>
<if condition="$post['field15'] & 4">
Networking
</if>
<if condition="$post['field15'] & 8">
Dating
</if>

And so forth...


Check the numbers correctly. Notice that:

1 = Option 1 (Serious Relationships)
2 = Option 2 (Friends)
4 = Option 3 (Networking)
8 = Option 4 (Dating)

So options 5 would be "16" and option 6 would be "32". In post #3 the $comma is only if you want a comma placed after each selection when you allow multiple selections.

I hope that I've explained it properly. :)

Connector
05-02-2006, 03:07 AM
Thanks alot that work fine :)

there is just a small error know when i try to add the code like this..

<if condition="$userinfo[field15]">
<TD width="133" valign="top" class="alt1"><strong>I am here for:</strong></TD>
<TD width="205" valign="top" class="alt1"><if condition="$post['field15'] & 8">Dating </if><if condition="$post['field15'] & 4">Networking</if><if condition="$post['field15'] & 2">Friends</if><if condition="$post['field15'] & 1">Serious Relationships</if></if></TD>
</tr>
<tr>

know you can see if i select more then one options it give me like this way

Serious RelationshipsNetworkingDatingFriends


i was think maybe there is anther better way where i can do comma for each options ? any seggestion about this..

thanks alot for help :)

Freesteyelz
05-02-2006, 03:25 AM
Yeah. You'll need to add the $comma to separate each selection. It's not that much of an edit but you'll probably want to replace what you have with:


<if condition="$comma = ''"></if>

<if condition="$post['field15'] & 1">
$comma Serious Relationships
<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field15'] & 2">
$comma Friends
<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field15'] & 4">
$comma Networking
<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field15'] & 8">
$comma Dating
<if condition="$comma = ', '"></if>
</if>


See if that helps. :)