MyBB Support

Is there a function to get the actual username color?

Submitted by AndresXZ09, , Thread ID: 4743

Thread Closed
13-06-2015, 12:13 AM
#1
I want to know if there is a function to get the actual username color of a user, not the group, or the display group, but the actual username color being displayed.

Thank you Smile

RE: Is there a function to get the actual username color?

#2
Code:
{$formattedname}

I'm not sure.

RE: Is there a function to get the actual username color?

OP
#3
It works only on templates, I'm trying to code something in PHP Tongue

RE: Is there a function to get the actual username color?

#4
13-06-2015, 12:17 AM
AndresXZ09 Wrote:
It works only on templates, I'm trying to code something in PHP Tongue

No clue what you mean.

RE: Is there a function to get the actual username color?

This post was last modified: 13-06-2015, 12:36 AM by Akay
#5
PHP Code:
$userquery $db->query("
SELECT u.uid, u.username
FROM "
.TABLE_PREFIX."users u
"
);


if (
$db->num_rows($userquery) > 0)
{
    
$display "";
    while (
$users $db->fetch_array($userquery))
    {
$users['username'] = format_name($users['username']);
$users['profilelink'] = get_profile_link($users['uid']);

$display .= '<span><strong>'build_profile_link($users['username'], $users['uid']). '</strong></span></a></strong></span>'

}

?>

Something like that, too tired atm
1

RE: Is there a function to get the actual username color?

OP
#6
I'm retarded, it was

PHP Code:
format_name($post['username'], $post['usergroup'], $post['displaygroup']); 

Thank you guys.

RE: Is there a function to get the actual username color?

#7
13-06-2015, 12:57 AM
AndresXZ09 Wrote:
I'm retarded, it was

PHP Code:
format_name($post['username'], $post['usergroup'], $post['displaygroup']); 

Thank you guys.

Close enough, i guess.

RE: Is there a function to get the actual username color?

#8
13-06-2015, 12:58 AM
akay Wrote:
13-06-2015, 12:57 AM
AndresXZ09 Wrote:
I'm retarded, it was


PHP Code:
format_name($post['username'], $post['usergroup'], $post['displaygroup']); 

Thank you guys.

Close enough, i guess.

There is also a plugin which does it automatically :noh:

RE: Is there a function to get the actual username color?

#9
13-06-2015, 01:01 AM
Tropical Wrote:
13-06-2015, 12:58 AM
akay Wrote:
13-06-2015, 12:57 AM
AndresXZ09 Wrote:
I'm retarded, it was


PHP Code:
format_name($post['username'], $post['usergroup'], $post['displaygroup']); 

Thank you guys.

Close enough, i guess.

There is also a plugin which does it automatically :noh:

He didn't mean Mention stuff, if that's what you're thinking of.

RE: Is there a function to get the actual username color?

#10
13-06-2015, 01:02 AM
akay Wrote:
13-06-2015, 01:01 AM
Tropical Wrote:
13-06-2015, 12:58 AM
akay Wrote:
13-06-2015, 12:57 AM
AndresXZ09 Wrote:
I'm retarded, it was



PHP Code:
format_name($post['username'], $post['usergroup'], $post['displaygroup']); 

Thank you guys.

Close enough, i guess.

There is also a plugin which does it automatically :noh:

He didn't mean Mention stuff, if that's what you're thinking of.

Oh, whoops :noh:
I thought he did.

My bad :yus:

Users browsing this thread: 2 Guest(s)