Warning: The author of this contribution does not provide support for it anymore.

th23 Autolinks

Colored User name? - th23 Autolinks

Colored User name?

by keikune » Mon Jun 25, 2012 11:01 am

sry for my bad englisch . !google translator!

Is it possible the linked user name
to color in the color of the corresponding ranks

may you can help me ^^
keikune
Registered User
Posts: 5
Joined: Mon Jun 25, 2012 10:58 am
Contact:

Re: Colored User name?

by Nuramon » Tue Sep 11, 2012 11:17 am

Yeah. It needs a few changes, but i found it out.
Bit complicated, i think you can make it smarter with the get_username_string-Function, but it works for me.

Just do the following steps:

open includes/cache.php

Find:

Code: Select all

$sql 'SELECT username, user_id, FROM ' USERS_TABLE ' WHERE user_type <> ' USER_IGNORE;   

REPLACE WITH:

Code: Select all

$sql 'SELECT username, user_id, user_colour FROM ' USERS_TABLE ' WHERE user_type <> ' USER_IGNORE;   

Find:

Code: Select all

$th23_autolinks['replacement'][strtolower($row['username'])] = 'th23autolink_rootmemberlist.php?mode=viewprofile&u=' $row['user_id'] . 'th23autolink_sid_and';   

ADD AFTER:

Code: Select all

$th23_autolinks['color'][strtolower($row['username'])] = $row['user_colour'];   


open includes/th23_autolinks.php

Find:

Code: Select all

return ' th23autolink_encode_start_' $th23_autolinks_uid base64_encode('<a href="' str_replace($th23_autolinks_local['search'], $th23_autolinks_local['replace'], $th23_autolinks['replacement'][strtolower($match[1])]) . '"' $th23_autolinks_css $th23_autolinks_title '>' $match[1] . '</a>') . 'th23autolink_encode_end_' $th23_autolinks_uid ' ';
   

REPLACE WITH:

Code: Select all

return ' th23autolink_encode_start_' $th23_autolinks_uid base64_encode('<a href="' str_replace($th23_autolinks_local['search'], $th23_autolinks_local['replace'], $th23_autolinks['replacement'][strtolower($match[1])]) . '"' $th23_autolinks_css $th23_autolinks_title '>' . ((isset($th23_autolinks['color'][strtolower($match[1])])) ? '<b class="postauthor" style="color:#' $th23_autolinks['color'][strtolower($match[1])] . '">' $match[1] . '</b></a>' $match[1] . '</a>')) . 'th23autolink_encode_end_' $th23_autolinks_uid ' ';
   


Please someone tell me, if it works (:
My MODs (Development Forum): dev.pinkes-forum.de
My own Forum: Pinkes Forum
User avatar
Nuramon
Registered User
Posts: 15
Joined: Wed Feb 15, 2012 10:50 am
Name: Clemens
Contact:

Re: Colored User name?

by eric0279 » Mon Mar 25, 2013 7:40 pm

doesn't work's your fix :(
eric0279
Registered User
Posts: 244
Joined: Fri Apr 13, 2007 9:22 pm