News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Member Color

Started by -Rock Lee-, August 09, 2019, 05:42:26 AM

Previous topic - Next topic

-Rock Lee-

Link to the mod

Member Color
Custom Member Color | Version 2.4
Developer: Rock Lee

Introduction


This simple modification allows you to choose the user name color, on topic display. Which you can do comfortably from Profile => Forum Profile.

Language


Is available in:
  • English
  • Latin Spanish

Compatibility


Prepared to work with the branch 2.0.x of SMF, it is tested only with the default theme.
    +Now you are also ready to work with the 2.1.x branch.

Support


Support topic in English: Member Color
Tema de soporte en Español: Member Color

License


Copyright 2014-2022 (c) Bomber Code

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

-Rock Lee-

¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Steve

Hey Rock Lee, is this permission based or does it show up in everyone's profile so the members can change their own color?
DO NOT pm me for support!

-Rock Lee-

@Steve They can choose their own color as long as the option for groups or for all is activated.
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Steve

Works beautifully ... great job!
DO NOT pm me for support!

-Rock Lee-

Thank you, now I'm trying to do the same in 2.1 it took me some time to achieve because of the failures it gives me :P
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

shadav

thank you for this :) works great on 2.0.15

question, how can I get it to work on the profile page?

GigaWatt

Hmmm... will definitely try it :). Great job BTW Rock Lee :).

PS: Is your avatar by any chance a guy wearing a Scorpio costume?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

-Rock Lee-

@shadav You just have to adapt / copy what is added in display.template.php to profile.template.php and it should work without problems. At this moment I am connected from my cell phone and I cannot do tests to confirm what you have to edit but when I am on the computer I will do tests and I will tell you :D.

@GigaWatt thanks I hope you enjoy it :laugh:. If it is a scorpion costume priming some mates (infusion very taken in Argentina / Paraguay and southern Brazil). It emerged from a large event and just made a journalistic note about the video game costumes in addition to the Argentine association that was made (Even then Ermac appeared as a fernet preparer although he did not have the same impact).

References of what I say:
Mate > Fernet


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

shadav

Quote from: Rock Lee on August 23, 2019, 08:16:37 PM
@shadav You just have to adapt / copy what is added in display.template.php to profile.template.php and it should work without problems. At this moment I am connected from my cell phone and I cannot do tests to confirm what you have to edit but when I am on the computer I will do tests and I will tell you :D.

@GigaWatt thanks I hope you enjoy it :laugh:. If it is a scorpion costume priming some mates (infusion very taken in Argentina / Paraguay and southern Brazil). It emerged from a large event and just made a journalistic note about the video game costumes in addition to the Argentine association that was made (Even then Ermac appeared as a fernet preparer although he did not have the same impact).

References of what I say:
Mate > Fernet


Regards!

thank you :) no rush, just whenever you get time, it's not a big issue, just would be nice ;) I tried but I failed only managed to turn the member name into #  :laugh:

-Rock Lee-

Sorry @shadav for the delay is that I am with the university delivering final papers, I managed to have some time and I tried it with the theme default. You have to look in the Profile.template.php file on line 63 that you should see something like:

<h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4>

and you have to leave it:

<h4><span style="color: ' . $context['member']['color_member'] . '">', $context['member']['name'], '</span> <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4>

It should work without problems as you wish if you have a custom theme and you cannot achieve it let me know to help you :).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

shadav

Quote from: Rock Lee on August 26, 2019, 02:11:29 PM
Sorry @shadav for the delay is that I am with the university delivering final papers, I managed to have some time and I tried it with the theme default. You have to look in the Profile.template.php file on line 63 that you should see something like:

<h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4>

and you have to leave it:

<h4><span style="color: ' . $context['member']['color_member'] . '">', $context['member']['name'], '</span> <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4>

It should work without problems as you wish if you have a custom theme and you cannot achieve it let me know to help you :).


Regards!

thank you... and it's ok :) I appreciate you trying to help ;) education comes first
mines a bit different but not working this is what I did
<div class="username"><h4><span style="color: ' . $context['member']['color_member'] . '">', $context['member']['name'], '</span> <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '<br />', (!empty($context['member']['group_stars']) ? $context['member']['group_stars'] : ''), '</span></h4>

-Rock Lee-

Quote from: shadav on August 26, 2019, 05:26:02 PMthank you... and it's ok :) I appreciate you trying to help ;) education comes first
mines a bit different but not working this is what I did
<div class="username"><h4><span style="color: ' . $context['member']['color_member'] . '">', $context['member']['name'], '</span> <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '<br />', (!empty($context['member']['group_stars']) ? $context['member']['group_stars'] : ''), '</span></h4>

It would have to work since I tested it (as the attached image looks like), did you clear the browser cache? Can you pass me the site url?


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

shadav

Quote from: Rock Lee on August 27, 2019, 08:31:06 AM
Quote from: shadav on August 26, 2019, 05:26:02 PMthank you... and it's ok :) I appreciate you trying to help ;) education comes first
mines a bit different but not working this is what I did
<div class="username"><h4><span style="color: ' . $context['member']['color_member'] . '">', $context['member']['name'], '</span> <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '<br />', (!empty($context['member']['group_stars']) ? $context['member']['group_stars'] : ''), '</span></h4>

It would have to work since I tested it (as the attached image looks like), did you clear the browser cache? Can you pass me the site url?


Regards!
hm strange, I had cleared cache and hit ctrl f5, but it didn't work, now today it is working  ???
thank you again for your help :)

-Rock Lee-

Glad to read that it works, sometimes the server takes time to take the changes ::)!


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

-Rock Lee-

+Added Support for SMF 2.1.1
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Advertisement: