Log in

View Full Version : Making a profile field format into a link


pjkcards
05-12-2008, 03:53 AM
Hello,
While registering, I want users to have a field that states this:
Enter your WCA profile code here (if available):
[example: for http://www.worldcubeassociation.org/results/p.php?i=1234ABCD12, the profile code would be "1234ABCD12"]

When the user inputs the profile code, I want it to format into a link which I can put below the Avatars called "WCA Profile" (and that links goes to the WCA profile, such as the link shown above). I want the link to appear in the "Public Profile", as well as underneath the avatar by every post that person makes. How would I go about this?

Thanks.

Boofo
05-12-2008, 04:02 AM
<a href="https://www.worldcubeassociation.org/results/p.php?i=fieldxx" target="_blank">http://www.worldcubeassociation.org/....php?i=fieldxx</a> for the link (with the xx the profile field number).

In the postbit, use $post[fieldxx]. It should show up in the profile if you have it set to do that.

pjkcards
05-12-2008, 05:10 AM
Excellent, thanks. I love your sig btw.

Boofo
05-12-2008, 05:26 AM
I've had that forever I think. ;)

pjkcards
05-12-2008, 05:31 PM
Nice.

Another question, how do I make the link appear under the avatar only if they entered in a value into the field?

Boofo
05-12-2008, 05:37 PM
<if condition="$post['fieldxx']">
code
</if>

pjkcards
05-12-2008, 05:50 PM
Okay. I found this one just a second ago:
<if condition="$post[field5]!=''">

Does that work just as good, or do you recommend changing it?

Boofo
05-12-2008, 06:19 PM
Try it and see. Both ways should work.