Advertisement:

Author Topic: Applying membergroup color to every username  (Read 28355 times)

Offline Alexandre P.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,044
  • Gender: Male
    • LivreSansPage
Applying membergroup color to every username
« on: November 14, 2004, 02:57:20 PM »
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.

Offline Meriadoc

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,263
  • Gender: Male
  • For the world is changing
    • Philip Renich: Websites
Re: Applying membergroup color to every username
« Reply #1 on: November 15, 2004, 12:22:11 AM »
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

Offline Alexandre P.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,044
  • Gender: Male
    • LivreSansPage
Re: Applying membergroup color to every username
« Reply #2 on: November 15, 2004, 12:54:32 AM »
It's him ;)
Thanks for checking, Merry :)
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Offline Meriadoc

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,263
  • Gender: Male
  • For the world is changing
    • Philip Renich: Websites
Re: Applying membergroup color to every username
« Reply #3 on: November 15, 2004, 06:53:13 PM »
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

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Applying membergroup color to every username
« Reply #4 on: November 15, 2004, 08:53:17 PM »
I'd like seeing this too...
Don't have a clue on how to do this w/o modifying a lot of files though...

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Applying membergroup color to every username
« Reply #5 on: November 16, 2004, 02:21:57 AM »
Can't it be done from Load.php before it's saved in $context?
Cristián Lávaque http://cristianlavaque.com

Offline Meriadoc

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,263
  • Gender: Male
  • For the world is changing
    • Philip Renich: Websites
Re: Applying membergroup color to every username
« Reply #6 on: November 16, 2004, 03:14:41 AM »
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

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Applying membergroup color to every username
« Reply #7 on: November 17, 2004, 03:32:20 PM »
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:

Code: [Select]
'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...

Offline Meriadoc

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,263
  • Gender: Male
  • For the world is changing
    • Philip Renich: Websites
Re: Applying membergroup color to every username
« Reply #8 on: November 17, 2004, 03:54:59 PM »
replace
Code: [Select]
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',with
Code: [Select]
'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

Offline shockeye

  • Newbie
  • *
  • Posts: 3
Re: Applying membergroup color to every username
« Reply #9 on: February 06, 2005, 03:45:27 PM »
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?

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Applying membergroup color to every username
« Reply #10 on: February 07, 2005, 05:52:17 AM »
Did you upload the right files? Did you modify the right theme? Did you remember to save before upload?

Offline shockeye

  • Newbie
  • *
  • Posts: 3
Re: Applying membergroup color to every username
« Reply #11 on: February 07, 2005, 11:09:29 AM »
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.

Offline ShadowStriker

  • Jr. Member
  • **
  • Posts: 365
Re: Applying membergroup color to every username
« Reply #12 on: May 27, 2005, 06:58:29 PM »
u have to edit the theme? all i did was edit load.php and it worked fine...

Offline mank

  • Semi-Newbie
  • *
  • Posts: 31
Re: Applying membergroup color to every username
« Reply #13 on: June 01, 2005, 11:56:17 AM »
I maually eddited alot of files on my site but it now works a treat. Thanks

Offline ディン1031

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,599
  • Gender: Male
  • はるひ! :P
    • ~DIN1031
Re: Applying membergroup color to every username
« Reply #14 on: June 08, 2005, 03:52:14 PM »
i would us this mod -> http://mods.simplemachines.org/index.php?mod=111 *runsandhid*
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