MyBB Community Forums

Full Version: Links in Custom Profile Fields
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I created several custom profile fields for users to provide their links to Facebook, Twitter, etc.
The problem is, the address comes out as plain text instead of clickable links. Can anyone suggest a fix? Thank you.

[attachment=26429]
Go to:

member_profile template and scroll down to this line:
{$profilefields}

You can either leave that there if you dont mind duplicates or remove it completely.

If you remove {$profilefields} (also if you dont and just want to have two of the exact same things below each other you will have to use this code), you want to replace it with:

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tbody>
<tr>
<td colspan="2" class="thead">
<strong>{$lang->users_additional_info}</strong></td>
</tr>

<tr>
<td class="trow1" width="40%"><strong>(name of the field)</strong></td>
<td class="trow1" width="60%">{$userfields['fidX']}</td>
</tr>

etc.

</tbody>
</table>

You can do this now for every single one of the custom fields. By using:

{$userfields['fidX']}

Where X = the ID number from the custom profile field (you can find this on the ACP page for custom profile fields in the column ID )

And simply placing it in:

<tr>
<td class="trow1" width="40%"><strong>Bio:</strong></td>
<td class="trow1" width="60%">{$userfields['fid2']}</td>
</tr>
(The name you will have to input yourself like shown above)

For you for example (tumblr) it would be something like this:

<tr>
<td class="trow1" width="40%"><strong>Tumblr:</strong></td>
<td class="trow1" width="60%"><a href="{$userfields['fidX']}">{$userfields['fidX']}</a></td>
</tr>

To make it a link simply do it like the code above:

<a href="{$userfields['fidX']}">{$userfields['fidX']}</a>

Where X is ofcourse again the ID from the custom profile field (in that case the tumblr profile field)

Your end code if you replace {$profilefields} with specified above will look something like this:

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tbody>
<tr>
<td colspan="2" class="thead">
<strong>{$lang->users_additional_info}</strong></td>
</tr>

<tr>
<td class="trow1" width="40%"><strong>Gender:</strong></td>
<td class="trow1" width="60%">{$userfields['fidX']}</td>
</tr>

<tr>
<td class="trow1" width="40%"><strong>Location:</strong></td>
<td class="trow1" width="60%">{$userfields['fidX']}</td>
</tr>

<tr>
<td class="trow1" width="40%"><strong>Tumblr:</strong></td>
<td class="trow1" width="60%"><a href="{$userfields['fidX']}">{$userfields['fidX']}</a></td>
</tr>

<tr>
<td class="trow1" width="40%"><strong>Twitter:</strong></td>
<td class="trow1" width="60%"><a href="{$userfields['fidX']}">{$userfields['fidX']}</a></td>
</tr>

<tr>
<td class="trow1" width="40%"><strong>Facebook:</strong></td>
<td class="trow1" width="60%"><a href="{$userfields['fidX']}">{$userfields['fidX']}</a></td>
</tr>

</tbody>
</table>


Make sure to use the right ID's for each of them to make it work.
Brilliant. Thank you so much!
(2012-05-30, 10:15 AM)Adora Wrote: [ -> ]Brilliant. Thank you so much!

Glad it worked Smile