MyBB Support

Is there a function to get the actual username color?

Submitted by AndresXZ09, , Thread ID: 4743

Thread Closed
AndresXZ09
Closed Account
Level:
0
Reputation:
30
Posts:
1.22K
Likes:
139
Credits:
1.51K
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?

Aoki
retired
Level:
83
Reputation:
348
Posts:
7.89K
Likes:
2.3K
Credits:
1.7K
13-06-2015, 12:15 AM
#2
Code:
{$formattedname}

I'm not sure.

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

AndresXZ09
Closed Account
Level:
0
Reputation:
30
Posts:
1.22K
Likes:
139
Credits:
1.51K
OP
13-06-2015, 12:17 AM
#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?

Aoki
retired
Level:
83
Reputation:
348
Posts:
7.89K
Likes:
2.3K
Credits:
1.7K
13-06-2015, 12:22 AM
#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?

Akay
We are!
Level:
0
Reputation:
28
Posts:
946
Likes:
109
Credits:
2.05K
13-06-2015, 12:36 AM
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?

AndresXZ09
Closed Account
Level:
0
Reputation:
30
Posts:
1.22K
Likes:
139
Credits:
1.51K
OP
13-06-2015, 12:57 AM
#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?

Akay
We are!
Level:
0
Reputation:
28
Posts:
946
Likes:
109
Credits:
2.05K
13-06-2015, 12:58 AM
#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?

Tropical
Fulltime Member
Level:
0
Reputation:
35
Posts:
1.04K
Likes:
54
Credits:
117
13-06-2015, 01:01 AM
#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?

Akay
We are!
Level:
0
Reputation:
28
Posts:
946
Likes:
109
Credits:
2.05K
13-06-2015, 01:02 AM
#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?

Tropical
Fulltime Member
Level:
0
Reputation:
35
Posts:
1.04K
Likes:
54
Credits:
117
13-06-2015, 01:05 AM
#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: 1 Guest(s)