MyBB Community Forums

Full Version: TABLE_PREFIX."profilefields"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
color is one of my profile fields. and the id is fid5
Can i do this:
PHP Code:
$color "fid{$profilefield['fid5']}";
$username "<span style="color$color;">$mybb->user['username']</span>"


Is that correct?


i edited member.php

And i added the <html> <body> and </body> </html> tags.
Open member.php

Find
PHP Code:
        $formattedname format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']); 

Replace by
PHP Code:
    if($userfields['fid5'])
    {
        
$formattedname "<span style=\"color:{$userfields['fid5']}\">{$memprofile['username']}</span>";
    }
    else
    {
        
$formattedname format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']);
    } 
That doesnt work but this doesnt work too:
PHP Code:
if($profilefields['fid5'])
    {
        
$formattedname "<span style=\"color:{$profilefields['fid5']}\">{$username}</span>";
    }
    else
    {
        
$formattedname format_name($username$usergroup$displaygroup);
    } 

and this isnt working too:

PHP Code:
if($profilefields['fid5'])
    {
        
$formattedname "<span style=\"color:{$profilefields['fid5']}\">{$username}</span>";
    }
    else
    {
        
$formattedname format_name($username$usergroup$displaygroup);
    } 
On my board, my provided code works =P You sure its fid5 ? And if the user hasn't set a color, it will return the normal username format.

Edit :

Set Color:Red
http://thingiej.be/mybb/member.php?action=profile&uid=1

Set Color:Blue
http://thingiej.be/mybb/member.php?action=profile&uid=2

Set No Color
http://thingiej.be/mybb/member.php?action=profile&uid=3
´How do you know iwhat is the id?
i have firebug and then i click in the textbox ispect element adn then it says:
<input type="text" value="#00ff00" maxlength="10" size="0" class="textbox" name="profile_fields[fid5]"/>

so i think its fid5

O i found that i can know from the custom profile files panel, and it says 5.
And what color did you enter ? And i did use a "selectbox" with colors.
LeX- Wrote:And what color did you enter ? And i did use a "selectbox" with colors.

#00ff00 and my username its not green, its blue like the default, also should i put "Required" to yes?
No i use a text box
Pirata Nervo Wrote:
LeX- Wrote:And what color did you enter ? And i did use a "selectbox" with colors.

#00ff00 and my username its not green, its blue like the default, also should i put "Required" to yes?
No i use a text box

No aint necessary =P Will try it out with a textbox and hex code.

Edit:

Works also ; http://thingiej.be/mybb/member.php?action=profile&uid=1
ok thx

How did you do with the select box? didnt you use hex codes?
Pirata Nervo Wrote:ok thx

How did you do with the select box? didnt you use hex codes?

No =P Just filled in
Code:
red
green
blue
Pages: 1 2 3
Reference URL's