The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Making url with info from profile field
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? |
#2
|
||||
|
||||
What page do you want to show this on ?
|
#3
|
||||
|
||||
I've been trying to do this same thing.
I'd want to to show up in the postbit and the profile page. |
#4
|
|||
|
|||
In postbit you use: $post[]. I'm not sure about the profile page (for custom fields). I think it's either $userinfo[] or $profilefield[].
|
#5
|
||||
|
||||
So I'd use http://$post[11].site.com ?
|
#6
|
|||
|
|||
No, you'd need to use:
Code:
http://$post[field11].site.com Code:
http://$userinfo[field11].site.com |
#7
|
|||
|
|||
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. |
#8
|
|||
|
|||
Quote:
Should be $post[field11] |
#9
|
|||
|
|||
D0h
It works now, so i share my final code to show something in the postbit, only when the field is filled in: Code:
<if condition="!empty($post[field11])"><div><a href="http://www.site.com/profiles/$post[field11]/" TARGET="_blank">Your link text</a></div></if> |
#10
|
||||
|
||||
Firstly $post['field11'] should be $post[field11] in templates.
Secondly, !empty($post[field11]) is more efficient than $post[field11] != ''. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|