Solved: 6 Years, 5 Months, 1 Week ago Is This Possible?
#1
Solved: 6 Years, 5 Months, 1 Week ago
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
[Image: misc.php?page=signature]
Reply
#2
Solved: 6 Years, 5 Months, 1 Week ago
I think you will need to edit templates and add your custom field manually with all the html link stuff.
New perceptions keep us inspired.
Reply
#3
Solved: 6 Years, 5 Months, 1 Week ago
(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?
[Image: misc.php?page=signature]
Reply
#4
Solved: 6 Years, 5 Months, 1 Week ago
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.)
Reply
#5
Solved: 6 Years, 5 Months, 1 Week ago
(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."
[Image: misc.php?page=signature]
Reply
#6
Solved: 6 Years, 5 Months, 1 Week ago
^ {$post['fidX']} works in postbit templates where X is the custom profile field ID
Reply
#7
Solved: 6 Years, 5 Months, 1 Week ago
This is related to this, what is the default setting for the 'member_profile_customfields_field' template?
[Image: misc.php?page=signature]
Reply
#8
Solved: 6 Years, 5 Months, 1 Week ago
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>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)