Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Rock Lee on August 09, 2019, 05:42:26 AM

Title: Member Color
Post by: Rock Lee on August 09, 2019, 05:42:26 AM
Link al mod (https://custom.simplemachines.org/mods/index.php?mod=4207)

Member Color
Custom Member Color | Version 2.3
Developer: Rock Lee (https://www.bombercode.net/foro/index.php?action=profile;u=1)

(https://www.bombercode.net/img/MemberColor_2.jpg)

(https://www.bombercode.net/img/MemberColor_1.jpg)

(https://www.bombercode.net/img/MemberColor_3.jpg)

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:

Compatibility

Prepared to work with the branch 2.0.x of SMF, it is tested only with the default theme.

Support

Support topic in English: Member Color (https://www.simplemachines.org/community/index.php?topic=569081.0)
Tema de soporte en Español: Member Color (https://www.bombercode.net/foro/soporte-smf-en-espanol/member-color-(mod)/new/#new)

License

Copyright 2014-2019 (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.
Title: Re: Member Color
Post by: Diego Andrés on August 09, 2019, 11:28:26 AM
Nice mod
Title: Re: Member Color
Post by: Rock Lee on August 11, 2019, 11:37:29 AM
Trank you :D
Title: Re: Member Color
Post by: Steve on August 13, 2019, 03:50:20 PM
Hey Rock Lee, is this permission based or does it show up in everyone's profile so the members can change their own color?
Title: Re: Member Color
Post by: Rock Lee on August 13, 2019, 09:16:36 PM
@Steve They can choose their own color as long as the option for groups or for all is activated.
Title: Re: Member Color
Post by: Steve on August 14, 2019, 07:18:51 AM
Works beautifully ... great job!
Title: Re: Member Color
Post by: Rock Lee on August 14, 2019, 12:18:03 PM
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
Title: Re: Member Color
Post by: shadav on August 23, 2019, 06:51:17 PM
thank you for this :) works great on 2.0.15

question, how can I get it to work on the profile page?
Title: Re: Member Color
Post by: GigaWatt on August 23, 2019, 06:58:29 PM
Hmmm... will definitely try it :). Great job BTW Rock Lee :).

PS: Is your avatar by any chance a guy wearing a Scorpio costume?
Title: Re: Member Color
Post by: 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 (https://en.m.wikipedia.org/wiki/Mate_(drink)) > Fernet (https://en.m.wikipedia.org/wiki/Fernet)


Regards!
Title: Re: Member Color
Post by: shadav on August 23, 2019, 08:53:49 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 (https://en.m.wikipedia.org/wiki/Mate_(drink)) > Fernet (https://en.m.wikipedia.org/wiki/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:
Title: Re: Member Color
Post by: 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:

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

Code: [Select]
<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!
Title: Re: Member Color
Post by: shadav on August 26, 2019, 05:26:02 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:

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

Code: [Select]
<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
Code: [Select]
<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>
Title: Re: Member Color
Post by: Rock Lee on August 27, 2019, 08:31:06 AM
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
Code: [Select]
<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!
Title: Re: Member Color
Post by: shadav on August 28, 2019, 12:59:13 PM
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
Code: [Select]
<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 :)
Title: Re: Member Color
Post by: Rock Lee on August 28, 2019, 09:10:27 PM
Glad to read that it works, sometimes the server takes time to take the changes ::)!


Regards!