Log in

View Full Version : Need help with phrases and profile fields...


ab420
09-08-2007, 01:55 PM
I have the MySpace profile's thing going on my site, and I have designed several styles that I would like to offer in a drop down menu in "edit profile"

I added a user profile field (field83) that contains the list of styles
I added phrases (using the names from above) that contain the css needed for each style

Now... I'm trying to code this into the memberinfo template... and can't figure it out...

I know the code below doesn't work... but I'm hoping you can see from it what I'm trying to do:
<style type="text/css">$vbphrase[$userinfo[field83]]</phrase></style>

I want it to use a vbphrase for css... but it has to look at user profile field #83, as that contains the name of the phrase it needs to use...

is this possible, and how do I code this?

Thanks you VERY much in advance, I'm not very good at this stuff, and my head is close to exploding now lol.

djdonx
09-08-2007, 02:16 PM
Have you actually got the phrase in place?

ab420
09-08-2007, 02:22 PM
What do you mean? Did I already make the phrase in vBulletin? Yes... the problem is: the above code gives me the whole:
Parse error: syntax error, unexpected '[', expecting ']' in /home/customfi/public_html/forums/includes/adminfunctions_template.php(3596) : eval()'d code on line 6

I just don't know how to write the code properly so it doesn't toss an error....

Thanks for your help, this is driving me nuts!

djdonx
09-08-2007, 02:23 PM
Could you post the lines around line 6 then?

ab420
09-08-2007, 02:30 PM
This is line 6:
<style type="text/css">$vbphrase[$userinfo[field83]]</phrase></style>

The problem is:

$vbphrase[$userinfo[field83]]</phrase>

I just don't know how to code it properly...

djdonx
09-08-2007, 02:34 PM
Why do you have a closing </phrase> tag? Phrases are usually PHP variables and it shouldn't need a tag..

ab420
09-08-2007, 02:36 PM
Oh really? Hahaha... like I said, I'm not that good at this stuff... I just took it out, but it still gives me the error.... I think it just doesn't like having the user profile field inside the phrase? I just don't know... any ideas?

djdonx
09-08-2007, 02:39 PM
$vbphrase[$userinfo[field83] - You had two ]]'s

EDIT: I don't think thats right

I'm hardly a leet coder xD

ab420
09-08-2007, 02:40 PM
thats not it either, because 1 of them was for the $vbphrase, and the other is for the $userinfo...

so it still gives an error

djdonx
09-08-2007, 02:47 PM
$vbphrase['$userinfo[field83]']

What about that? :S

ab420
09-08-2007, 02:49 PM
lol, that is exactly what i just finished trying, and it didn't work either... this has me really stumped... :confused:

djdonx
09-08-2007, 02:50 PM
$vbphrase['$userinfo['field83']']

$vbphrase[$userinfo['field83']]

Try those two xD

ab420
09-08-2007, 02:53 PM
Nope... see the original error says unexpected [

it was expecting a ]

so... we need to figure out how to get it to parse the $userinfo first, then the phrase, right now its doing it the other way around, which is where the issue is coming from.... i think... :confused:

Paul M
09-08-2007, 03:17 PM
Try ;

{$vbphrase[$userinfo[field83]]}

ab420
09-08-2007, 03:19 PM
Try ;

{$vbphrase[$userinfo[field83]]}

Thank you SOOOO much! :D