MyBB Community Forums
Is This Possible? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Is This Possible? (/thread-163494.html)



Is This Possible? - MI-6 - 2014-11-29

So in the "Regular Expression" option when you're creating a new custom profile field, is it possible to have it where it puts whatever the user answers with into a link?

So basically can this happen:

User input: Example
Results displayed: @Example


RE: Is This Possible? - Adriano - 2014-11-29

I think you will need to edit templates and add your custom field manually with all the html link stuff.


RE: Is This Possible? - MI-6 - 2014-11-29

(2014-11-29, 12:50 AM)Adriano Wrote: I think you will need to edit templates and add your custom field manually with all the html link stuff.

Any idea on where I could start with this?


RE: Is This Possible? - user25 - 2014-11-29

It would depend on where you wanted the link to go and if that link was represented with the custom ID

As example of your text @example which would link to a twitter account:

custom field input: twitter name


Wherever you want it to display in your template put the following:
<a href="http://twitter.com/{$post['fid"custom_id_number']}">@{$post['fid"custom_id_number']}</a>

(you can find the field number by going to the ACP---->Configuration---->Custom Fields, then hover over the field name.  The last number in the url is the field id number.)


RE: Is This Possible? - MI-6 - 2014-11-29

(2014-11-29, 01:43 AM)user25 Wrote: It would depend on where you wanted the link to go and if that link was represented with the custom ID

As example of your text @example which would link to a twitter account:

custom field input: twitter name


Wherever you want it to display in your template put the following:
<a href="http://twitter.com/{$post['fid"custom_id_number']}">@{$post['fid"custom_id_number']}</a>

(you can find the field number by going to the ACP---->Configuration---->Custom Fields, then hover over the field name.  The last number in the url is the field id number.)

I got this when I tried to put that in the template:

"The following errors were encountered:
A potential security issue was found in the template. Please review your changes or contact the MyBB Group for support."


RE: Is This Possible? - .m. - 2014-11-29

^ {$post['fidX']} works in postbit templates where X is the custom profile field ID


RE: Is This Possible? - MI-6 - 2014-11-29

This is related to this, what is the default setting for the 'member_profile_customfields_field' template?


RE: Is This Possible? - .m. - 2014-11-29

you mean original code of the template ?

MyBB 1.8.x
<tr>
<td class="{$bgcolor}"><strong>{$customfield['name']}:</strong></td>
<td class="{$bgcolor} scaleimages">{$customfieldval}</td>
</tr>

MyBB 1.6.x
<tr>
<td class="{$bgcolor}" width="40%"><strong>{$customfield['name']}:</strong></td>
<td class="{$bgcolor}" width="60%">{$customfieldval}</td>
</tr>