View Full Version : Making url with info from profile field
Freezerator
03-04-2007, 02:25 PM
Hi Guys,
I have setup a profile field where a user can put a name in.
Then i try to creat a link with that info, say:
www.site.com/$bbuserinfo['field11']/
and then i would create a link with the info out of field11. But whatever i try, i can't seem to get it to work. Can someone give me some pointers to resolve this?
Zachariah
03-04-2007, 02:39 PM
What page do you want to show this on ?
Brent H
03-04-2007, 08:13 PM
I've been trying to do this same thing.
I'd want to to show up in the postbit and the profile page.
MarkPW
03-04-2007, 10:25 PM
In postbit you use: $post[]. I'm not sure about the profile page (for custom fields). I think it's either $userinfo[] or $profilefield[].
Brent H
03-05-2007, 12:38 PM
So I'd use http://$post[11].site.com ?
Gray Matter
03-05-2007, 05:02 PM
So I'd use http://$post[11].site.com ?
No, you'd need to use:
http://$post[field11].site.com
And if you wanted this to work on the member info page, you would use:
http://$userinfo[field11].site.com
Freezerator
03-06-2007, 07:44 AM
And in postbit $postbit[field11]
Ill give it a try :)
<a href="http://$post[field11].site.com">Sitename</a>
works :)
Thanks!
<!--scooterbase-->
<a href="http://www.scooterbase.net/profiles/$post[field11/">ScooterbaseID</a>
This doesn't work. I get this error:
vBulletin Message
The following error occurred when attempting to evaluate this template:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/forum/public_html/forum/forum/includes/adminfunctions_template.php(3596) : eval()'d code on line 54
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
MarkPW
03-06-2007, 11:56 PM
Parse error:...expecting ']'
You missed an ] after $post[field11
Should be $post[field11]
Freezerator
03-07-2007, 07:00 AM
D0h
It works now, so i share my final code to show something in the postbit, only when the field is filled in:
<if condition="!empty($post[field11])"><div><a href="http://www.site.com/profiles/$post[field11]/" TARGET="_blank">Your link text</a></div></if>
Maybe someone has also a use for this in the future :)
Dismounted
03-07-2007, 07:43 AM
Firstly $post['field11'] should be $post[field11] in templates.
Secondly, !empty($post[field11]) is more efficient than $post[field11] != ''.
Freezerator
03-07-2007, 09:31 AM
Thanks, i have corrected my code :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.