Applying membergroup color to every username

Started by Alexandre P., November 14, 2004, 02:57:20 PM

Previous topic - Next topic

Alexandre P.

Hi all,

I got someone who would like to know if it's possible to apply the membergroups colors (the ones shown on names in the section Who's Online) to every usernames, everywhere they appear ? (so, not only in Who's Online, but also in post display, etc.)

I believe you will need to modify the source code directly, not only the theme...

Thanks
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Meriadoc

yeah, shouldn't be a semi-easy line by line bit - just in a lot of places. I can try to find all the places and post it for him/her (didn't check :)) tomorrow. Feel free to modify my french then ;)
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Alexandre P.

Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Meriadoc

on second look, it isn't quite a simple find/add bit. some places would require either a modified query or added query (the way of doing member group colors has changed since I last saw). plus there are a whole lot of places that would need these changes. It'd probably be better of as a mod, but I'm not sure how well it would go over because it changes a lot of files (think of all the places a membername shows up!)

so unless anyone else has any ideas...?
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Burpee

I'd like seeing this too...
Don't have a clue on how to do this w/o modifying a lot of files though...

Anguz

Can't it be done from Load.php before it's saved in $context?
Cristián Lávaque http://cristianlavaque.com

Meriadoc

unless I've missed something, $context is, at least in this area, for the user browsing - ie, it's for your info. Not everyone else's.
So that'd be a no, I'll ask [unknown] if there is a nice way like this though
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Grudge

This can normally be used by accessing the 'group_color' index for the member. Basically, whenever a user is loaded via loadMemberContext, 'group_color' will be available, this means (for example) MessageIndex, BoardIndex, Display, InstantMessage. Probably the easiest way to mod this is to edit this line of the function:


'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',


To do the color as well - that one change will probably propagate to *most* of the board. Note that the color to do that is in $profile['member_group_color'] (In that function)
I'm only a half geek really...

Meriadoc

replace
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',
with
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '"><span style="color: ' . $profile['member_group_color'] . '">' . $profile['realName'] . '</span></a>',

this will change the username links in the Display (individual threads) and InstantMessage for each personal message.

Thanks Grudge
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

shockeye

I made this change and nothing happened. I then went in and changed it from a span tag to a style tag inside the <a> and still nothing.

When I pull up the source for the renedered page, neither the style or the span tags appear. Am I missing something?

Burpee

Did you upload the right files? Did you modify the right theme? Did you remember to save before upload?

shockeye

It seems to be working. I didn't read exactly where the color would appear. It appears inside threads as advertised, I was expecting (hoping) it would appear in topic view I guess. My bad.

ShadowStriker

u have to edit the theme? all i did was edit load.php and it worked fine...

mank

I maually eddited alot of files on my site but it now works a treat. Thanks

ディン1031

Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Advertisement: