Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Diego Andrés on June 26, 2011, 10:03:48 PM

Title: Simple Colorizer
Post by: Diego Andrés on June 26, 2011, 10:03:48 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=3067)

(https://smftricks.com/logos/logo.png) (https://smftricks.com/)

(https://img.shields.io/badge/License-MIT-248049) (https://img.shields.io/badge/Hooks%20Only-Yes-6041a3) (https://img.shields.io/badge/SMF-2.1-3f73a0)

Simple Colorizer
Developed by Diego Andrés (https://smftricks.com/index.php?action=profile;u=1)
Original Developer: Berat "grafitus" Dogan (https://www.simplemachines.org/community/index.php?action=profile;u=113776)




Introduction
Simple Colorizer will color all member names with the color of their respective member group (or post group) on the forum.


Changelog (https://github.com/SMFTricks/SimpleColorizer/blob/master/CHANGELOG.md)
GitHub (https://github.com/SMFTricks/SimpleColorizer)
Title: Re: SimpleColorizer
Post by: Dramber on June 26, 2011, 10:28:13 PM
Very nice!
Thank you, it works great on my forums.
Title: Re: SimpleColorizer
Post by: R-one on June 27, 2011, 06:09:25 AM
this mod 'just works'

well done. and thanks
Title: Re: SimpleColorizer
Post by: Apllicmz on June 27, 2011, 06:53:27 AM
Nice work
good mod
thanks
Title: Re: SimpleColorizer
Post by: oldrow on June 27, 2011, 12:49:39 PM
great job this mod works perfectly!!!
Title: Re: SimpleColorizer
Post by: razors edge on June 27, 2011, 01:39:28 PM
Very nicely done. Thank You!
Title: Re: SimpleColorizer
Post by: Jessica. on June 27, 2011, 01:53:57 PM
isn't this pretty much similar to Member Color Link?
Title: Re: SimpleColorizer
Post by: vbgamer45 on June 27, 2011, 02:19:42 PM
Quote from: Jessica. on June 27, 2011, 01:53:57 PM
isn't this pretty much similar to Member Color Link?
Very similar but does not do any file edits!
Title: Re: SimpleColorizer
Post by: akbora on June 27, 2011, 02:34:12 PM
Thanks this is a very good mod but it is not for post count members.

Member color link was for all member position...
Title: Re: SimpleColorizer
Post by: grafitus on June 27, 2011, 03:56:43 PM
Thank you guys. :P

Quote from: Jessica. on June 27, 2011, 01:53:57 PM
isn't this pretty much similar to Member Color Link?
Yes, very similar; but this works with output control functions.

Quote from: akbora on June 27, 2011, 02:34:12 PM
Thanks this is a very good mod but it is not for post count members.

Member color link was for all member position...
I didn't understand you. Can you explain?
Title: Re: SimpleColorizer
Post by: Jaysyn on June 28, 2011, 10:52:06 AM
Quote from: akbora on June 27, 2011, 02:34:12 PM
Thanks this is a very good mod but it is not for post count members.

Works in my forum, somehow it also uses the old Member Color Link info as well, which was unexpected but nice.
Title: Re: SimpleColorizer
Post by: live627 on June 28, 2011, 08:03:15 PM
This is an excellent example of using the output buffer to add new functionality to the forum. Very well done!
Title: Re: SimpleColorizer
Post by: Suki on June 28, 2011, 10:03:55 PM
Indeed this is an awesome mod :)
Title: Re: SimpleColorizer
Post by: ZerK on June 28, 2011, 10:48:35 PM
Great mod, i ve seen some mods using hooks and they are awesome.
Title: Re: SimpleColorizer
Post by: ~DS~ on June 29, 2011, 02:52:55 AM
Quote from: live627 on June 28, 2011, 08:03:15 PM
This is an excellent example of using the output buffer to add new functionality to the forum. Very well done!
Doesn't this mod do the same thing in Dream Portal before?
Title: Re: SimpleColorizer
Post by: live627 on June 29, 2011, 02:57:32 AM
Nope. I reviewed it before commenting. This mod's code and vision are entirely different from that of DP.
Title: Re: SimpleColorizer
Post by: ~DS~ on June 29, 2011, 03:00:02 AM
@grafitus, this doesn't give colors for post based grupos.
Title: Re: SimpleColorizer
Post by: Nibogo on June 29, 2011, 02:32:53 PM
Quote from: Jessica. on June 27, 2011, 01:53:57 PM
isn't this pretty much similar to Member Color Link?

Almost, the difference is that Member Color Link gives admin the choice to select which areas he/she wants to colorize.
Title: Re: SimpleColorizer
Post by: grafitus on June 29, 2011, 03:20:20 PM
Quote from: ~DS~ on June 29, 2011, 03:00:02 AM
@grafitus, this doesn't give colors for post based grupos.
Yeah, I have solved that issue. I will release a new version for this.
Title: Re: SimpleColorizer
Post by: ZerK on June 29, 2011, 06:50:42 PM
Quote from: grafitus on June 29, 2011, 03:20:20 PM
Quote from: ~DS~ on June 29, 2011, 03:00:02 AM
@grafitus, this doesn't give colors for post based grupos.
Yeah, I have solved that issue. I will release a new version for this.

im installing that for sure after the new release s out :D
Title: Re: SimpleColorizer
Post by: hcfwesker on June 30, 2011, 02:52:49 AM
This MOD is beautiful.   I was dreading trying to fix install error with Member Color Link after updating to smf 2.0

This mod just saved me a lot of headache.

Thank You
Title: Re: SimpleColorizer
Post by: ZerK on July 04, 2011, 07:09:39 AM
i just installed it and didnt ve any error all ok.

PS1:there is an error the banned members doesnt appear black.
PS2: the username in the profile is always black.
PS3: is better than the xbox 360 (ok its a bad joke xD)
Title: Re: SimpleColorizer
Post by: grafitus on July 04, 2011, 06:45:53 PM
Quote from: ElPlayer on July 04, 2011, 07:09:39 AMPS1:there is an error the banned members doesnt appear black.
You should create a group, name etc. "Banned". Then you know what to do. 8)

Quote from: ElPlayer on July 04, 2011, 07:09:39 AMPS2: the username in the profile is always black.
This mod colors only member *links*. But you said field is a text...

Quote from: ElPlayer on July 04, 2011, 07:09:39 AMPS3: is better than the xbox 360 (ok its a bad joke xD)
Lol. ;D
Title: Re: SimpleColorizer
Post by: Daygo on August 23, 2011, 01:55:07 PM
I get the icon, but the balls do not come out as little girls do that
Title: Re: SimpleColorizer
Post by: Suki on August 23, 2011, 03:41:11 PM
Quote from: Daygo on August 23, 2011, 01:55:07 PM
I get the icon, but the balls do not come out as little girls do that


???

Daygo

feel free to post your issue in the Español (Spanish) (http://www.simplemachines.org/community/index.php?board=16.0) support boards
Title: Re: SimpleColorizer
Post by: IanF2 on September 15, 2011, 10:36:32 PM
Sorry for this basic question, but....
Where are the settings for the colors ? I don't see where I can set them ?


PS (Also on the question of a BANNED memebr group... How do I select the banned members in order to move them into this new group?)

Title: Re: SimpleColorizer
Post by: live627 on September 15, 2011, 10:42:15 PM
The colors are simply the membergroup colors.
Title: Re: SimpleColorizer
Post by: ozo on September 23, 2011, 06:19:58 AM
This MOD is not compatible with SMF 2.0.1 ?
Title: Re: SimpleColorizer
Post by: Suki on September 23, 2011, 11:11:52 AM
Quote from: ozo on September 23, 2011, 06:19:58 AM
This MOD is not compatible with SMF 2.0.1 ?

It is, you can do one of this 2 things:

unzip the mod and change 2.0  for 2.0.1 in the package-info.xml file,  zip it all again.

use the emulate feature on the packager manager,  click on advance, on the text file type SMF 2.0.1   click on apply,  install the mod, once installed, click on advance then click on revert.
Title: Re: SimpleColorizer
Post by: ozo on September 23, 2011, 02:43:54 PM
I'm testing the first thing, but it doesn't work & i don't understand your second possibility (i'm French & my English is bad)

EDIT : Ok, the second version work. Thanks Mate  :D
Title: Re: SimpleColorizer
Post by: H3lioz on October 07, 2011, 06:22:46 AM
Is there any way to only have the color in: Profile, Posts/threads, Who's online & member list? I don't want the color in the "Unread posts" thingy.
Title: Re: SimpleColorizer
Post by: gebekzor on October 24, 2011, 01:59:30 PM
It is possible to work with a ', $ message ['member'] ['name'],' ??
Title: Re: SimpleColorizer
Post by: Adrek on November 12, 2011, 10:19:36 AM
Why after I moved forum to new host SimpleColorizer don't work? All other mods with hooks working fine, except this one :/

Anyway it's not a big problem, I uninstalled and instaleld again mod and works.
Title: Re: SimpleColorizer
Post by: Maxtor on November 12, 2011, 04:18:22 PM
i get this error:

Apply Filter: Only show the error messages of this URL
http://....../forum/index.php?action=admin;area=forumfirewall
Apply Filter: Only show the errors with the same message
2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'c'
Apply Filter: Only show the errors from this file
File: /home/......./public_html/forum/Sources/Subs-SimpleColorizer.php
Line: 18
Title: Re: SimpleColorizer
Post by: live627 on November 12, 2011, 08:06:33 PM
Quote from: maxtor on November 12, 2011, 04:18:22 PM
i get this error:

Apply Filter: Only show the error messages of this URL
http://....../forum/index.php?action=admin;area=forumfirewall
Apply Filter: Only show the errors with the same message
2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'c'
Apply Filter: Only show the errors from this file
File: /home/......./public_html/forum/Sources/Subs-SimpleColorizer.php
Line: 18
What is your PHP version?
Title: Re: SimpleColorizer
Post by: cameranutzII on November 26, 2011, 03:37:23 PM
Love this mod...thanks!  ;)
Title: Re: SimpleColorizer
Post by: Willie.csgamer on January 06, 2012, 02:42:15 AM
Guuys, can anyone help? give me link to download it to my PC plz!
Title: Re: SimpleColorizer
Post by: hcfwesker on January 06, 2012, 01:07:36 PM
First post in this topic would be a good place to start ;)

http://www.simplemachines.org/community/index.php?topic=439878.msg3089621#msg3089621
Title: Re: SimpleColorizer
Post by: BaghdadGhost on July 21, 2012, 02:42:04 AM
Quote from: Suki on September 23, 2011, 11:11:52 AM
Quote from: ozo on September 23, 2011, 06:19:58 AM
This MOD is not compatible with SMF 2.0.1 ?

It is, you can do one of this 2 things:

unzip the mod and change 2.0  for 2.0.1 in the package-info.xml file,  zip it all again.

use the emulate feature on the packager manager,  click on advance, on the text file type SMF 2.0.1   click on apply,  install the mod, once installed, click on advance then click on revert.

Hi Suki,

I am trying to install on smf 2.0.2

I tried the above but it did not work. I get this error after I click install

QuoteAn Error Has Occurred!
Back

I also tried

unzip the mod and change 2.0  for 2.0.2 in the package-info.xml file,  zip it all again then install without emulate and it gave me the same error.

any idea?

thanks
Title: Re: SimpleColorizer
Post by: BaghdadGhost on July 21, 2012, 02:50:21 AM
by the way, the above not happens when I try to upload the package to installation manager. so what I did just downloaded the mod, used FTP to upload it to /packages folder then installed normally.

I browsed the board index than message index then when I clicked on topic I get this


QuoteDatabase Error
Got error 28 from storage engine - check database storage space or contact the server administrator.
File: /Sources/Load.php
Line: 1054

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.2, while your database is at version 2.0.1. The above error might possibly go away if you execute the latest version of upgrade.php.
I tired to uninstall mod it did but it stopped the forum from working

the Memory Usage and Entry Processes are full now


please help


Title: Re: SimpleColorizer
Post by: BaghdadGhost on July 21, 2012, 04:14:50 AM
suki I created a new topic for this error  :(


http://www.simplemachines.org/community/index.php?topic=482190.0

Title: Re: SimpleColorizer
Post by: BaghdadGhost on July 21, 2012, 05:34:54 PM
well, this is what I got from the host


QuoteWe believe the issue is the permissions on your files. If you take a look at the file structure on any FTP client, you'll notice that the files and folders have strange chmods on them. As a rule of thumb, files should have a chmod of 644 and folders should be 755. Did you recently try to make a manual backup, or have SMF take a backup for you? Most backup programs will change the chmod before changing it back to what it was previously.

I did not do any backup or any changes to the files or database. do you guys think it is the backup done by smf before installing this mod?

I know this was installed by other members successfully. I am not blaming the mod here. I am just trying to figure out what was the cause.


thanks
Title: Re: SimpleColorizer
Post by: BaghdadGhost on July 21, 2012, 07:08:51 PM
mod installed correctly.

I will leave the above replies for couple of day, if nothing happens I will delete them in order not to confuse other members

Title: Re: SimpleColorizer
Post by: revail on August 27, 2012, 06:15:01 AM
guys i installed this mod...all good with the install
but i cant find from where i can active the mod from the forum
if someone know anything that can help me tell me :)
Title: Re: SimpleColorizer
Post by: Adrek on August 27, 2012, 06:22:05 AM
This mod does not have any settings. Just install and it should work.
Title: Re: SimpleColorizer
Post by: revail on August 27, 2012, 06:27:30 AM
I installed it but it didnt work..
first i had test it on my wamp server and there was a setting to active it on the modifications>miscallenious
but know on my live forum there is no setting and didnt work
Title: Re: SimpleColorizer
Post by: stylusss on August 27, 2012, 10:08:11 PM
Could this be done for 1.x.
Title: Re: SimpleColorizer
Post by: Suki on August 28, 2012, 12:15:11 PM
Quote from: revail on August 27, 2012, 06:27:30 AM
I installed it but it didnt work..
first i had test it on my wamp server and there was a setting to active it on the modifications>miscallenious
but know on my live forum there is no setting and didnt work

How exactly did you installed it?  via the Package Manager (http://wiki.simplemachines.org/smf/Packages)?

Quote from: stylusss on August 27, 2012, 10:08:11 PM
Could this be done for 1.x.

No possible unless a total rewrite is done, I recall a similar mod for 1.1.x, can't remember the name. membercolor something.
Title: Re: SimpleColorizer
Post by: revail on August 28, 2012, 12:16:28 PM
now is working i had problem at sources folders..
Title: Re: SimpleColorizer
Post by: Adrek on August 28, 2012, 12:41:15 PM
Quote from: stylusss on August 27, 2012, 10:08:11 PM
Could this be done for 1.x.

Quote from: Suki on August 28, 2012, 12:15:11 PM
(...) I recall a similar mod for 1.1.x, can't remember the name. membercolor something.

For SMF 1.1.x => http://custom.simplemachines.org/mods/index.php?mod=111 :)
Title: Re: SimpleColorizer
Post by: far2slow on December 13, 2012, 03:37:30 PM
for some reason its declaring the color attribute twice


style="color: orange;" style="color: orange;">membername</a>, <a href="...

any one help with this
Title: Re: SimpleColorizer
Post by: live627 on December 13, 2012, 05:04:30 PM
I'd say the hook is registered twice.
Title: Re: SimpleColorizer
Post by: far2slow on December 14, 2012, 07:44:25 AM
how do if fix it if that is the case


still trying to work out how hooks work, i uninstalled the mod then installed it without running the hooks.php but that didn't work
Title: Re: SimpleColorizer
Post by: iDevGrow on December 21, 2012, 11:48:28 PM
Thank alot

;)
Title: Re: SimpleColorizer
Post by: DarkT3rror on December 22, 2012, 03:44:43 AM
Quote from: ~DS~ on June 29, 2011, 03:00:02 AM
@grafitus, this doesn't give colors for post based grupos.

It gives membergroup color automatically, i install it to my forum and works perfect!!!!!! Maybe you didn't add the color code to your groups m8..
Title: Re: SimpleColorizer
Post by: live627 on December 29, 2012, 06:01:13 PM
lol
Title: Re: SimpleColorizer
Post by: hcfwesker on December 30, 2012, 03:35:36 AM
them epic quote bumps from a year and a half ago .... too good.
Title: Re: SimpleColorizer
Post by: ZerK on December 31, 2012, 03:25:40 AM
Quote from: far2slow on December 13, 2012, 03:37:30 PM
for some reason its declaring the color attribute twice


style="color: orange;" style="color: orange;">membername</a>, <a href="...

any one help with this

that only happens on the who s online list
Title: Re: SimpleColorizer
Post by: FragaCampos on January 29, 2013, 12:08:21 AM
Simply awesome.
This hooks stuff is just great, when all the mods get like this I'll be in heaven.

Thank you so much, grafitus.
Title: Re: SimpleColorizer
Post by: Werldklass on January 29, 2013, 01:57:02 AM
i want it to show color at ssi function. T_T
Title: Re: SimpleColorizer
Post by: Aome on April 14, 2013, 11:10:07 PM
Hello guys!

I installed this mod, I use smf 2.0.4, but its not working. The subs.simplecolorizer.php file is there in sources but apparently does nothing, the name of the users appears with the regular color of the theme, not with the colour of their membergroup, do I need to change something? Thank you in advance.  :-*
Title: Re: SimpleColorizer
Post by: hcfwesker on April 14, 2013, 11:59:01 PM
does the membergroup name color change to what color you edit it to be?  like when viewing the Membergroups page in Admin in the Ex below.  are you using html colors like,   #ff9933
Title: Re: SimpleColorizer
Post by: Aome on April 15, 2013, 12:51:25 AM
Quote from: hcfwesker on April 14, 2013, 11:59:01 PM
does the membergroup name color change to what color you edit it to be?  like when viewing the Membergroups page in Admin in the Ex below.  are you using html colors like,   #ff9933

Hello!

Yes, the membergroups name appear in the color I set for them, using hex codes like cd0000 red for the banned and blue for the admin group. In the boards, where it says Topic started by Aome, the name Aome does appear with the color, but once in, seeing the actual posts, the username has no color :(

Im thinking might have something to do with other mods I have installed... I will check them and post them here as a reference. Thank you
Title: Re: SimpleColorizer
Post by: hcfwesker on April 15, 2013, 12:55:56 AM
as long as you have no other MODs that affect membergroup color that shouldn't be the issue.  The MOD uses Hook Integrations, maybe your hosting's php is out of date and isn't calling for the hooks.  I've heard this happen before.
Title: Re: SimpleColorizer
Post by: Aome on April 15, 2013, 09:12:37 AM
Hello, I detected these that somehow do something to the membergroups style, in some way. I think the second and third may be canceling one to another, but one of them works in part, because I can see the colour in the members username in the main forum part, but not in the posts and profile, that is why I have not uninstalled any of them, cause I don't know which one is working... :)

   Slashout Banned Members    1.2 
   Group Color in Posts and Profile    1.4 
   SimpleColorizer    1.0 
Title: Re: SimpleColorizer
Post by: hcfwesker on April 15, 2013, 09:28:09 AM
Quote from: Aome on April 15, 2013, 09:12:37 AMGroup Color in Posts and Profile    1.4

I'd start with removing that one first ( Uinstall).  That's why colors dont show on post or profiles, but does elsewhere, cause that MOD is interferring.
Title: Re: SimpleColorizer
Post by: Aome on April 15, 2013, 12:02:03 PM
Quote from: hcfwesker on April 15, 2013, 09:28:09 AM
Quote from: Aome on April 15, 2013, 09:12:37 AMGroup Color in Posts and Profile    1.4

I'd start with removing that one first ( Uinstall).  That's why colors dont show on post or profiles, but does elsewhere, cause that MOD is interferring.

I removed it, and it was good since apparently wasn't doing anything :) and I still have the colors in the main forum, doesn't show the colours in the posts or in the profile though... but hey, is not that bad...

I noticed in my code that the style is not showing in that part only calls the link to View the profile, but doesn't show the style for that piece of code...

Anyway, thank you, at least I got rid of an extra mod :)
Title: Re: SimpleColorizer
Post by: Chen Zhen on April 18, 2013, 12:03:13 AM
grafitus,

  I'm not positive if you are still supporting/updating this mod but I was debugging someone's forum today and noticed an issue. Where a user link already has style attributes, this mod adds a second style tag that causes a html warning/error.

  Imo a suggested fix would be to use the dom parser to only insert style tags within user profile hyperlinks that are void of style tags to begin with.

ie.
file: Subs-SimpleColorizer.php

possibly replace your ob_colorizer function with the following:

function ob_colorizer($buffer)
{
global $context, $scripturl, $sourcedir, $modSettings;

if (isset($_REQUEST['xml']))
return $buffer;

$regex = array(
'~href="' . preg_quote($scripturl) . '\?action=profile;u=(\d+)"~',
'~(href="' . preg_quote($scripturl) . '\?action=profile\;u={$user_id}"[^>]*)~'
);

$user_ids = preg_match_all($regex[0], $buffer, $matches) ? array_unique($matches[1]) : array();

if (empty($user_ids))
return $buffer;

if (($user_colors = sc_loadColors($user_ids)) !== false)
{
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML($buffer);
libxml_use_internal_errors(false);
$xp = new DOMXpath($dom);

foreach ($user_colors as $user_id => $user_color)
{
foreach ($xp->query('//a[@style]') as $item)
{
if (strpos($item->getAttribute("href"), $scripturl . '?action=profile;u='.$user_id) !== false && strpos($item->getAttribute("style"), 'color') === false)
$buffer = preg_replace(str_replace('{$user_id}', $user_id, $regex[1]), '$1 style="color: ' . $user_color . ';"', $buffer);
}

}
}

return $buffer;
}
   

  One could refine the dom query a little better to only gather the hyperlink href matching the user id whilst in the loop but I think my example shows the general idea.
Title: Re: SimpleColorizer
Post by: FireDitto on October 12, 2013, 04:54:31 AM
I wonder if anyone would be able to help me? I've installed this mod - 'Group color to CSS Class (http://custom.simplemachines.org/mods/index.php?mod=3102) - but I don't know how to make it work nicely with this mod, which I love dearly xD

They seem to use different classes in the coding; eg, 'user_color' and the Group CSS uses 'online_color' - how can I make them view the same? Is it possible?

Thank you!
Title: Re: SimpleColorizer
Post by: Suki on October 12, 2013, 10:02:15 AM
Well, essentially, you only need the css stuff from the "group color to class" mod, all the other template edits are pretty much redundant since simpleColorizer will take care of it.

So, first thing you need is to uninstall that css mod and just leave the code in index.css file then open Subs-SimpleColorizer.php and find:

         $buffer = preg_replace(str_replace('{$user_id}', $user_id, $regex[1]), '$1 style="color: ' . $user_color . ';"', $buffer);


and replace with:

$buffer = preg_replace(str_replace('{$user_id}', $user_id, $regex[1]), '$1 class="group-member' . (empty($user_color) ? '' : ' group-' . $user_color) . '"', $buffer);


This is totally untested so do a back up first.


Theres also one bug on this mod, the regex also caches the canonical link tag in the profile page, haven't had the time to make a proper fix for it.
Title: Re: SimpleColorizer
Post by: FireDitto on October 12, 2013, 06:12:16 PM
Worked  beautifully!

Only thing it isn't changing is the Group Legend in the index, and it doesn't colour the membergroups in the Admin page where you add/edit them.

Thank you!
Title: Re: SimpleColorizer
Post by: FireDitto on October 13, 2013, 04:17:31 AM
Ahh, came across another thing that isn't colouring any more.

I use the [user] BBC Tag (http://custom.simplemachines.org/mods/index.php?mod=1367). It used to colour the links the same colour as their group through the SimpleColorizer; it no longer is. Would you happen to know where I'd need to edit to make that work again?

Thank you so much!
Title: Re: SimpleColorizer
Post by: Suki on October 13, 2013, 08:58:06 AM
In Subs.php find


array(
'tag' => 'user',
'type' => 'unparsed_content',
'content' => '<a href="' . $scripturl . '?action=profile;user=$1" class="bbc_link">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(
'tag' => 'user',
'type' => 'unparsed_equals',
'before' => '<a href="' . $scripturl . '?action=profile;user=$1" class="bbc_link">',
'after' => '</a>',
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
array(
'tag' => 'id',
'type' => 'unparsed_content',
'content' => '<a href="' . $scripturl . '?action=profile;u=$1" class="bbc_link">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(
'tag' => 'id',
'type' => 'unparsed_equals',
'before' => '<a href="' . $scripturl . '?action=profile;u=$1" class="bbc_link">',
'after' => '</a>',
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',


and on each content key you will see theres an class="bbc"  just remove that part, simplecolizer should be able to pick the link.


As for the other parts where the mod no longer works, just manually apply the group class mod to those specific parts. basically you just add the class group-member followed by the group Id:

class="group-member'. $some_var_wth the group_id .'"

Or follow the parser for that mod and only apply the changes to those specific parts.
Title: Re: SimpleColorizer
Post by: FireDitto on October 13, 2013, 06:08:53 PM
Worked beautifully; thank you for all your help, I really appreciate it!
Title: Re: SimpleColorizer
Post by: Dave J on October 23, 2013, 04:45:09 PM

Quote from: maxtor on November 12, 2011, 04:18:22 PM
i get this error:

Apply Filter: Only show the error messages of this URL
http://....../forum/index.php?action=admin;area=forumfirewall
Apply Filter: Only show the errors with the same message
2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'c'
Apply Filter: Only show the errors from this file
File: /home/......./public_html/forum/Sources/Subs-SimpleColorizer.php
Line: 18

I'm getting the same error except my unknown modifier is 'g'. Did anyone find out what is causing his?
Title: Re: SimpleColorizer
Post by: Dave J on November 01, 2013, 04:50:00 AM
Quote from: -Underdog- on April 18, 2013, 12:03:13 AM
grafitus,

  I'm not positive if you are still supporting/updating this mod but I was debugging someone's forum today and noticed an issue. Where a user link already has style attributes, this mod adds a second style tag that causes a html warning/error.

  Imo a suggested fix would be to use the dom parser to only insert style tags within user profile hyperlinks that are void of style tags to begin with.

ie.
file: Subs-SimpleColorizer.php

possibly replace your ob_colorizer function with the following:

function ob_colorizer($buffer)
{
global $context, $scripturl, $sourcedir, $modSettings;

if (isset($_REQUEST['xml']))
return $buffer;

$regex = array(
'~href="' . preg_quote($scripturl) . '\?action=profile;u=(\d+)"~',
'~(href="' . preg_quote($scripturl) . '\?action=profile\;u={$user_id}"[^>]*)~'
);

$user_ids = preg_match_all($regex[0], $buffer, $matches) ? array_unique($matches[1]) : array();

if (empty($user_ids))
return $buffer;

if (($user_colors = sc_loadColors($user_ids)) !== false)
{
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML($buffer);
libxml_use_internal_errors(false);
$xp = new DOMXpath($dom);

foreach ($user_colors as $user_id => $user_color)
{
foreach ($xp->query('//a[@style]') as $item)
{
if (strpos($item->getAttribute("href"), $scripturl . '?action=profile;u='.$user_id) !== false && strpos($item->getAttribute("style"), 'color') === false)
$buffer = preg_replace(str_replace('{$user_id}', $user_id, $regex[1]), '$1 style="color: ' . $user_color . ';"', $buffer);
}

}
}

return $buffer;
}
   

  One could refine the dom query a little better to only gather the hyperlink href matching the user id whilst in the loop but I think my example shows the general idea.

I tried this fix and the colour stopped showing altogether. Would it need to be changed proir to install or, as I did, just replace the code in the php file.

Quote from: davejo on October 23, 2013, 04:45:09 PM

Quote from: maxtor on November 12, 2011, 04:18:22 PM
i get this error:

Apply Filter: Only show the error messages of this URL
http://....../forum/index.php?action=admin;area=forumfirewall
Apply Filter: Only show the errors with the same message
2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'c'
Apply Filter: Only show the errors from this file
File: /home/......./public_html/forum/Sources/Subs-SimpleColorizer.php
Line: 18

I'm getting the same error except my unknown modifier is 'g'. Did anyone find out what is causing his?

Can anyone help with this error please?  My php version is 5.2.17
Title: Re: SimpleColorizer
Post by: PokémonS on January 09, 2014, 02:35:40 PM
I tried -Underdog-'s code, but like Davejo said that the the color stopped showing altogether.
Someone can help me to remove the duplicate style?
Title: Re: SimpleColorizer
Post by: PokémonS on January 09, 2014, 03:25:07 PM
Ah, I finally find my own solution for my previous post.

If you're using SimpleColorizer forever, just delete member color code from Subs-MembersOnline.php and Display.php.

SimplePortal has ability to disable member color, but it doesn't affect for Shoutbox.
So, If you're using it, delete member color code from Subs-Portal.php and Portal.js.

And finally, I valid my W3C. (http://validator.w3.org/check?uri=http%3A%2F%2Fpokemonstars.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices)
Title: Re: SimpleColorizer
Post by: Michael Pfaff on January 27, 2014, 12:26:19 PM
Amazing mod! Thank you.

One question:

Is there any way to tweak this slightly so that on posts the color changes the color of the membergroup title and not the username? I love that it changes the color of the username everywhere else, but on posts it's clashing with my theme.
Title: Re: SimpleColorizer
Post by: Arantor on January 27, 2014, 12:27:17 PM
Pretty much impossible because this looks for a *link* to the profile, the member group name is not a link.
Title: Re: SimpleColorizer
Post by: Michael Pfaff on January 27, 2014, 12:30:42 PM
Quote from: Sir Cumber-Patcher on January 27, 2014, 12:27:17 PM
Pretty much impossible because this looks for a *link* to the profile, the member group name is not a link.

Right on. Thanks for the quick reply. Maybe I'll get used to the way it looks.
Title: Re: SimpleColorizer
Post by: Mac2213 on June 23, 2014, 03:44:26 PM
hello is there a way to put in this mod that user profile be also colorized depend on which group user have? thanks
Title: Re: SimpleColorizer
Post by: Badboy on June 23, 2014, 03:54:34 PM
Open Profile.template.php

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

Code (REPLACE) Select
<div class="username"><h4>', $context['member']['link'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4><>
Title: Re: SimpleColorizer
Post by: Dave J on June 28, 2014, 01:46:55 PM
For those who get this error or similar

QuoteApply Filter: Only show the error messages of this URL
http://....../forum/index.php?action=admin;area=forumfirewall
Apply Filter: Only show the errors with the same message
2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'c'
Apply Filter: Only show the errors from this file
File: /home/......./public_html/forum/Sources/Subs-SimpleColorizer.php
Line: 18

Uninstall it and install this

http://custom.simplemachines.org/mods/index.php?mod=111

Go into 'Admin' / 'Features & Options' / 'Member Color Link' in admin  Check out which options you want to select.

I did as in the attached image

No more errors



Title: Re: SimpleColorizer
Post by: FragaCampos on June 28, 2014, 04:38:03 PM
Quote from: Badboy on June 23, 2014, 03:54:34 PM
Open Profile.template.php

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

Code (REPLACE) Select
<div class="username"><h4>', $context['member']['link'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4><>

This was very useful. Thanks, Badboy!
Title: Re: SimpleColorizer
Post by: Rain Forest on October 14, 2014, 01:11:03 PM
2: preg_match_all(): Unknown modifier 'g'
Apply Filter: Only show the errors from this file
File: ../Sources/Subs-SimpleColorizer.php
Line: 18


Line 18:


$user_ids = preg_match_all($regex[0], $buffer, $matches) ? array_unique($matches[1]) : array();


:-\
Title: Re: SimpleColorizer
Post by: Deprecated on August 02, 2015, 03:11:48 PM
This is one of the most puzzling mods I have ever seen, mainly because the only description is "it just works!"

But strange enough, I installed it and I think it did work! :) -- That's SMF 2.1.10

I think what it is doing is go to Admin -> Membergroups -> Modify (for the group you want to change the color) and set "Color in online list" to the color you want.

The setting does change your color in the online list (duh!) but I wanted it to change my username color in posts and the setting didn't do that. But I installed the mod package and bam!!! Got my user color name right in posts too!!!

I had also changed the star image to the new color (that worked) and I've ended up with the result I wanted. I am the owner of the forum and also admin of course, but I wanted MY username and stars to be a unique color (different from other admins), and the changes to the Membergroup setting + creating a new colored star + this mod package got it done! :D

Now all I have to do is get a few members signed up and verify it works for them too.

Thank you very much for this mod! :D
Title: Re: SimpleColorizer
Post by: Rogerd on June 26, 2016, 10:50:57 AM
I know this is an old thread but could someone tell me how to get rid of this error, I'm using  2.0.11

2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'r'

File: /home/************/public_html/Sources/Subs-SimpleColorizer.php
Line: 18
Title: Re: SimpleColorizer
Post by: Dave J on June 26, 2016, 10:56:01 AM
Quote from: Rogerd on June 26, 2016, 10:50:57 AM
I know this is an old thread but could someone tell me how to get rid of this error, I'm using  2.0.11

2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'r'

File: /home/************/public_html/Sources/Subs-SimpleColorizer.php
Line: 18


If you look up a couple of posts you'll see the answer....or at least it worked for me.
Title: Re: SimpleColorizer
Post by: Rogerd on June 26, 2016, 11:00:35 AM
Quote from: davejo on June 26, 2016, 10:56:01 AM
Quote from: Rogerd on June 26, 2016, 10:50:57 AM
I know this is an old thread but could someone tell me how to get rid of this error, I'm using  2.0.11

2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'r'

File: /home/************/public_html/Sources/Subs-SimpleColorizer.php
Line: 18


If you look up a couple of posts you'll see the answer....or at least it worked for me.

Thank's very much, I must be going blind.
Title: Re: SimpleColorizer
Post by: Rogerd on June 26, 2016, 02:26:49 PM
No that didn't work, still getting this error, it's strange that the bold part of the error wasn't there when I copied the error from the log, it appeared when I pasted it here.

2: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Unknown modifier 'r'Apply Filter: Only show the errors from this file File: /home/************/public_html/Sources/Subs-SimpleColorizer.php
Line: 18
Title: Re: SimpleColorizer
Post by: -Rock Lee- on June 26, 2016, 06:32:35 PM
Hello @Diego Andrés as you can see in the Spanish forum (http://www.simplemachines.org/community/index.php?topic=546497.0) raised the problem but I can not fix testing variants and different things, not problem because it takes the host variables null or empty

8: Undefined index: post_group_colorAplicar filtro: Solamente muestra los errores de este archivo Archivo: /***/public_html/Themes/default/Display.template.php
Línea: 238


Basically the line is:
if ($shown)
echo '
</ul>
</li>';
}


The problem arose basically to be a registered user to delete your account and generandome this error, as will several pages. Try any form even looking at the page php but simply gives me error syntasis or seems not directly take me exepcion ...


Regards!
Title: Re: SimpleColorizer
Post by: Diego Andrés on June 27, 2016, 12:18:27 PM
Quote from: Rock Lee on June 26, 2016, 06:32:35 PM
Hello @Diego Andrés as you can see in the Spanish forum (http://www.simplemachines.org/community/index.php?topic=546497.0) raised the problem but I can not fix testing variants and different things, not problem because it takes the host variables null or empty

8: Undefined index: post_group_colorAplicar filtro: Solamente muestra los errores de este archivo Archivo: /***/public_html/Themes/default/Display.template.php
Línea: 238


Basically the line is:
if ($shown)
echo '
</ul>
</li>';
}


The problem arose basically to be a registered user to delete your account and generandome this error, as will several pages. Try any form even looking at the page php but simply gives me error syntasis or seems not directly take me exepcion ...


Regards!

I'll take a look during the week
Title: Re: SimpleColorizer
Post by: FireDitto on July 19, 2016, 01:44:52 AM
Hi all,

I'm using this mod, in combination with this mod (http://"http://custom.simplemachines.org/mods/index.php?mod=3102") - however, between the two of them, nothing is colouring the users when viewing the forum or boards.

I'm way out of the loop with coding so I'm failing miserably at figuring out what is wrong and how to fix it and make it work.

forum link (http://pern.second-pass.net/forum/index.php?board=34.0) - honey love should be blue and Bjin should be purple but obviously neither are coloured outside the default

Does anyone have any idea how to fix it?

(I checked the default Curve layout, and it is also not working properly on that one.)

Thanks in advance!
Title: Re: SimpleColorizer
Post by: Diego Andrés on July 19, 2016, 01:55:51 AM
I see the colors just as you stated, honey is blue and the other one is purple
Title: Re: SimpleColorizer
Post by: Grammy on July 19, 2016, 07:04:38 AM
Quote from: Diego Andrés on July 19, 2016, 01:55:51 AM
I see the colors just as you stated, honey is blue and the other one is purple


That's odd; for me, they're both purple.   :-\

Actually, on the board, they're both purple.  On the second screenshot (Online users) one is blue.  Not sure why they're different in different locations....
Title: Re: SimpleColorizer
Post by: FireDitto on July 19, 2016, 01:31:32 PM
Yes. They are coloured on the Online list but that is the only place they rae coloured properly.
They should be coloured on the Forum as well, but they are not - see my included image.

How do I get them to colour on the forum?

Title: Re: SimpleColorizer
Post by: Grammy on July 19, 2016, 02:37:19 PM
Quote from: FireDitto on July 19, 2016, 01:31:32 PM
Yes. They are coloured on the Online list but that is the only place they rae coloured properly.
They should be coloured on the Forum as well, but they are not - see my included image.

How do I get them to colour on the forum?


If you switch back to the default theme, are the colors correct?
Title: Re: SimpleColorizer
Post by: FireDitto on July 19, 2016, 02:47:08 PM
nope; I tested that last night :( It isn't working on the default either.


ETA: If I change the "Shorthand name (used for CSS class):" to #000000 everything will go black, across the board.

It appears that the CSS mod and the Colourize mod are not working together.


ETA2; I'm a dork. The answers to my questions were a page back. Hurpderp

Thanks guys <3
Title: Re: SimpleColorizer
Post by: Grammy on July 19, 2016, 03:32:44 PM
Quote from: FireDitto on July 19, 2016, 02:47:08 PM


ETA2; I'm a dork. The answers to my questions were a page back. Hurpderp

Thanks guys <3

:D
Title: Re: SimpleColorizer
Post by: SMiFFER on November 02, 2016, 03:22:48 PM
I got a bug - in fact I can reproduce it.

I can provide you the text that I tried to post.
If you are interested, see: http://www.simplemachines.org/community/index.php?topic=549710
Title: Re: SimpleColorizer
Post by: Steve on November 03, 2016, 09:17:20 AM
Odd that I've been using this mod for years now and have never had an issue. Possibly a conflict with another mod? I have 70+ mods on my forum and it still never gives me an error.
Title: Re: SimpleColorizer
Post by: Dave J on November 03, 2016, 01:46:43 PM
Quote from: Steve on November 03, 2016, 09:17:20 AM
Odd that I've been using this mod for years now and have never had an issue. Possibly a conflict with another mod? I have 70+ mods on my forum and it still never gives me an error.

Nope me neither
Title: Re: SimpleColorizer
Post by: lurkalot on November 03, 2016, 02:41:34 PM
Quote from: Steve on November 03, 2016, 09:17:20 AM
Odd that I've been using this mod for years now and have never had an issue. Possibly a conflict with another mod? I have 70+ mods on my forum and it still never gives me an error.

And me. Don't think it's ever caused me a problem, and use it on all my sites. 
Title: Re: SimpleColorizer
Post by: Deprecated on November 09, 2016, 11:01:49 PM
Works perfectly for me. Did from day one and keeps on ticking. My compliments to the package author!

It is entirely hooks. There is a slight possibility you may have a name conflict. You should clear your error log, then do whatever causes the problem, then look at your error log before it gets polluted by unrelated errors.

If not that then I don't know what. Possibility that you misunderstand what the package does and does not do.
Title: Re: SimpleColorizer
Post by: SMiFFER on November 12, 2016, 11:54:08 PM
A conflict could also be the reason.

The most irritating thing on this though is that when I remove SimpleColorizer ONLY then it all works - and when I activate SimpleColorizer ONLY things go weird again.

So the only thing I change is activating/deactivating SimpleColorizer.
Title: Re: SimpleColorizer
Post by: Steve on November 13, 2016, 12:51:19 PM
Quote from: SMiFFER on November 12, 2016, 11:54:08 PMA conflict could also be the reason.

As you say. Removing the mod removes the conflict allowing everything to work and reinstalling recreates the conflict so the problem may not necessarily be with this mod.

Could you list your other mods so we can see if there is indeed a conflict?
Title: Re: SimpleColorizer
Post by: SMiFFER on November 15, 2016, 05:16:46 AM
Quote from: Steve on November 13, 2016, 12:51:19 PM
Could you list your other mods so we can see if there is indeed a conflict?

Of course. And I already did in Share MOD-lists (http://www.simplemachines.org/community/index.php?topic=549338.0)
My post there is: http://www.simplemachines.org/community/index.php?topic=549338.msg3897433#msg3897433

Sidenote:
Hardly anybody would search for a thread with that subject in "chat" (rather in Modifications).
Title: Re: SimpleColorizer
Post by: Deprecated on November 19, 2016, 10:48:04 PM
Quote from: Steve on November 13, 2016, 12:51:19 PM
Quote from: SMiFFER on November 12, 2016, 11:54:08 PMA conflict could also be the reason.

As you say. Removing the mod removes the conflict allowing everything to work and reinstalling recreates the conflict so the problem may not necessarily be with this mod.

Could you list your other mods so we can see if there is indeed a conflict?

This is almost a textbook example of mod package conflict. Much harder when using hooks but obviously nothing is perfect.

My advice is to uninstall all mods then reinstall one at a time until you find the conflict.

Also, my advice has always been to have two forums: your production forum and a cloned test forum. Use SQL backups to keep them in sync and always install the same mods in the same order.

Or even more than one test forum. When I was into heavy mod package writing I often had several test forums...

If you don't have a test forum I suggest you clone your production forum and fix it until it works, then experiment there. I suggest if your forum is example.com then make a test.example.com or even a test1.example.com, test2.example.com, etc. Use the usual tools to get the paths fixed and of course define separate databases.
Title: Re: SimpleColorizer
Post by: SMiFFER on November 20, 2016, 12:09:11 PM
Good ideas! Thanks.

And what I wrote was that I did just that - and AT THE POINT WHEN I REINSTALLED SIMPLE COLORIZER the bug came back.

So S.C. is causing the problem. The problem is NOT THERE before installing S.C.
Title: Re: SimpleColorizer
Post by: Dave J on November 20, 2016, 01:24:25 PM
Quote from: SMiFFER on November 20, 2016, 12:09:11 PM
Good ideas! Thanks.

And what I wrote was that I did just that - and AT THE POINT WHEN I REINSTALLED SIMPLE COLORIZER the bug came back.

So S.C. is causing the problem. The problem is NOT THERE before installing S.C.

Does the same happen if you fresh start with SMF and then install SC as the first mod? If not then what other mods does it conflict with when you add them individually?
Title: Re: SimpleColorizer
Post by: GigaWatt on March 27, 2018, 09:46:13 PM
This mod seems to be interfering with the Slash through Banned Usernames (https://www.simplemachines.org/community/index.php?topic=347716.0) mod.

(http://www.mediafire.com/convkey/a145/mmei55tqpbl19zqzg.jpg)

Is there any way to fix this?
Title: Re: SimpleColorizer
Post by: GigaWatt on April 30, 2018, 11:08:42 AM
Just an update on the problem... I uninstalled SimpleColorizer.
Title: Re: SimpleColorizer
Post by: phoenixphyre on July 18, 2019, 07:16:11 PM
Any plans to update this for 2.1?
Title: Re: SimpleColorizer
Post by: Diego Andrés on July 19, 2019, 12:45:07 AM
I believe it installs just fine on 2.1, and working as it should but I haven't tested it.
Title: Re: SimpleColorizer
Post by: GigaWatt on July 19, 2019, 06:27:23 AM
Quote from: GigaWatt on March 27, 2018, 09:46:13 PM
This mod seems to be interfering with the Slash through Banned Usernames (https://www.simplemachines.org/community/index.php?topic=347716.0) mod.

(http://www.mediafire.com/convkey/a145/mmei55tqpbl19zqzg.jpg)

Is there any way to fix this?

I kinda gave up on this, but is there a way to fix this?
Title: Re: SimpleColorizer
Post by: Suki on July 19, 2019, 10:26:55 AM
You could merge both mods, use this one as a base, modify the function where the color is added, add a check to see if the user is banned and apply the slash. This way you don't actually need the slash mod anymore.

Edit, I knew I did something similar with this mod already: https://www.simplemachines.org/community/index.php?topic=439878.msg3621157#msg3621157
Title: Re: SimpleColorizer
Post by: phoenixphyre on July 19, 2019, 03:56:32 PM
When I tried to install on 2.1, it seemed to crash everything. I couldn't load the index or any of the boards.
Title: Re: SimpleColorizer
Post by: Diego Andrés on July 19, 2019, 04:06:09 PM
I installed fine, no errors in the log either.

Title: Re: SimpleColorizer
Post by: GigaWatt on July 21, 2019, 09:52:43 PM
Quote from: Suki on July 19, 2019, 10:26:55 AM
You could merge both mods, use this one as a base, modify the function where the color is added, add a check to see if the user is banned and apply the slash. This way you don't actually need the slash mod anymore.

Edit, I knew I did something similar with this mod already: https://www.simplemachines.org/community/index.php?topic=439878.msg3621157#msg3621157

Hmmm... this is actually a good idea :). Though I think this one uses hooks and the other one uses patches, but still, it's doable :).

Thanks for the idea :).
Title: Re: SimpleColorizer
Post by: Suki on July 22, 2019, 10:44:52 AM
Indeed this one uses hooks while the other one makes code edits. Since this mod is OS, you can fork it, commit your changes and have an installable mod with those changes already included. This way you have control over what changes you add to your forum.
Title: Re: SimpleColorizer
Post by: phoenixphyre on July 22, 2019, 04:00:50 PM
Quote from: Diego Andrés on July 19, 2019, 04:06:09 PM
I installed fine, no errors in the log either.

Hmm... must be conflicting with something. I'll just need to figure out what. Thanks for checking into it!

Edit: I installed it on a clean install and when I navigated to the index it had the same issue as before and wouldn't load the page at all. It seems to work fine on the admin pages but not the rest.
Title: Re: SimpleColorizer
Post by: GigaWatt on July 24, 2019, 07:53:27 PM
Quote from: Suki on July 22, 2019, 10:44:52 AM
Indeed this one uses hooks while the other one makes code edits. Since this mod is OS, you can fork it, commit your changes and have an installable mod with those changes already included. This way you have control over what changes you add to your forum.

Really? Cool :). Didn't know it was on GitHub :).

Well, I'll try... I'll probably need some help, but still, it's a start :).
Title: Re: SimpleColorizer
Post by: jsx on April 16, 2020, 12:07:34 PM
@Diego Andrés

I use a modification Say Thanks and Simple Colorizer on the forum, so when someone thanks for a post, the user's name in the thanks does not appear in color.

(https://i.imgur.com/3P7VfVG.png)

After refreshing the page, the username color is displayed correctly.

(https://i.imgur.com/sH6GRoY.png)

Maybe this is some mistake from modification Say Thanks. Could you check it out?
Title: Re: SimpleColorizer
Post by: Diego Andrés on April 16, 2020, 12:56:13 PM
It's because thanks mod is likely using ajax.
The mod colors the names right before the user gets them in the content.
Title: Re: SimpleColorizer
Post by: jsx on April 18, 2020, 12:16:13 PM
Thanks for the clarification. :)
Title: Re: SimpleColorizer
Post by: pocttopus on May 30, 2020, 08:25:41 AM
It's not working on 2.1RC2.
There is no field for color change on profile page like in 2.0.17.
Title: Re: SimpleColorizer
Post by: Diego Andrés on May 30, 2020, 11:22:01 AM
Mod has never had such feature.
Title: Re: SimpleColorizer
Post by: Diego Andrés on October 23, 2021, 04:28:46 PM
1.3 - 23 October 2021
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed uninstall.
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed applying style to links that already have a style.
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed adding empty styles when the group had no color.
Title: Re: SimpleColorizer
Post by: Steve on October 24, 2021, 09:26:16 AM
Thanks Diego. :)
Title: Re: Simple Colorizer
Post by: pikeman on February 23, 2022, 12:45:15 PM
Works well with 2.1.1. (https://vukovisadunava.com/Smileys/mojismajliji/thumbup.gif)
Title: Re: Simple Colorizer
Post by: peter_mein on March 20, 2022, 05:38:53 AM
Hello
I have a conflict between simple colorizer and avatars display integration.
If i install avatars display integration it is all ok. See
picture error2.
when i install both mods it looks like this. See picture error1.
They disturb each other.
Title: Re: Simple Colorizer
Post by: Diego Andrés on March 21, 2022, 07:14:28 PM
Sorry for the late response, I forgot about your post.
It's an issue with the avatar display integration mod.
Simple Colorizer already prevents double styles or overwriting styles, but in case of the latter the mod expects any previous styles to have a proper line ending ;

To fix it, you'd need to edit Sources/AvatarsDisplayIntegration.php
Code (Search) Select
return ('style="background-color: rgb('.$r.','.$g.','.$b.')"');
Code (Replace) Select
return ('style="background-color: rgb('.$r.','.$g.','.$b.');"');
Pinging @Pipke just in case they want to sort it in a future update.
Title: Re: Simple Colorizer
Post by: peter_mein on March 22, 2022, 05:37:39 AM
Thanks. Now everything is correct
Another question. Is it possible to change the guest color ?
The guest color is red.
Title: Re: Simple Colorizer
Post by: Diego Andrés on March 22, 2022, 10:00:41 AM
Guest color is not a link, it will use the color provided by your theme for that specific element.
Title: Re: Simple Colorizer
Post by: jsx on September 20, 2022, 01:14:33 PM
@Diego Andrés

Have you thought about implementing member name coloring in Who's Online? This is missing here.
Title: Re: Simple Colorizer
Post by: @rjen on September 20, 2022, 01:28:21 PM
Quote from: jsx on September 20, 2022, 01:14:33 PM@Diego Andrés

Have you thought about implementing member name coloring in Who's Online? This is missing here.

You are using TonyPortal, right?

That is a standard functionality in TinyPortal...
Title: Re: Simple Colorizer
Post by: Diego Andrés on September 20, 2022, 01:59:09 PM
For the actual list? It should work in 2.1.3 with no additional changes required.
See: https://github.com/SimpleMachines/SMF/pull/7500

You could manually do this tiny change and it would work.
Title: Re: Simple Colorizer
Post by: Steve on September 20, 2022, 02:32:27 PM
Just tried it and yep, works like a charm.
Title: Re: Simple Colorizer
Post by: jsx on September 21, 2022, 04:33:01 AM
Quote from: @rjen on September 20, 2022, 01:28:21 PMThat is a standard functionality in TinyPortal...

Thanks for the information, I didn't know about it.

This is this feature:

"Use membergroup color for user names throughout the forum"

Quote from: Diego Andrés on September 20, 2022, 01:59:09 PMFor the actual list? It should work in 2.1.3 with no additional changes required.
See: https://github.com/SimpleMachines/SMF/pull/7500

You could manually do this tiny change and it would work.

Thanks for the information.
Title: Re: Simple Colorizer
Post by: jsx on November 22, 2022, 04:46:34 AM
Quote from: Diego Andrés on September 20, 2022, 01:59:09 PMFor the actual list? It should work in 2.1.3 with no additional changes required.
See: https://github.com/SimpleMachines/SMF/pull/7500 (https://github.com/SimpleMachines/SMF/pull/7500)

I want to share such a suggestion. It's nice that in 2.1.3 this possibility appeared, but maybe in 2.1.4 developers could implement nick colors in the post?

Simple Colorizer is a great mod, but I feel like there should be some consistency and if 2.1.3 implemented nick coloring in the online list, I think nicks in posts should be colorized by the software as well.
Title: Re: Simple Colorizer
Post by: Diego Andrés on November 22, 2022, 07:43:14 AM
I'm not sure what you are referring to
Title: Re: Simple Colorizer
Post by: jsx on November 22, 2022, 12:51:48 PM
In SMF 2.1.3 it was implemented that nicks display in color in "Who's Online?" So I wanted to leave an idea here, so that you think about implementing in version 2.1.4 the possibility of displaying nicks in color in the post. I mean what your mod does. I refer to it: https://github.com/SimpleMachines/SMF/pull/7500

Just wanted to share this thought of mine. :)
Title: Re: Simple Colorizer
Post by: Diego Andrés on November 22, 2022, 03:14:17 PM
I thought it already displayed names in colors, that's why I don't understand what one thing has to do with another.
Do you have a screenshot of what area you are referring to?

Also keep in mind the mod only colors links, it will not color plain text.
Title: Re: Simple Colorizer
Post by: Speed King on November 23, 2022, 04:34:45 AM
Installed Simple Colorizer version 1.3.1 on my SMF 2.1.3 forum.
This 1.3.1 version has conflict with Mentions feature, the mentioned members are displayed with different color instead of their membergroup. Problem appears when editing already submitted post including mentions.

Installed version 1.1 works fine with SMF 2.1.3 :)
Title: Re: Simple Colorizer
Post by: jsx on November 23, 2022, 06:25:46 AM
I meant that in SMF 2.1.3 was implemented that the nick of e.g., admin, moderator is displayed in color in Who is online?

(https://i.imgur.com/FHniiEF.png)

So, I just shared an idea to take it a step further and, for example, in SMF 2.1.4, implement the display of nickname colors in the post. Exactly what your mod does. :)

(https://i.imgur.com/DRzngDD.png)
Title: Re: Simple Colorizer
Post by: Steve on November 23, 2022, 09:42:17 AM
Quote from: Speed King on November 23, 2022, 04:34:45 AMThis 1.3.1 version has conflict with Mentions feature, the mentioned members are displayed with different color instead of their membergroup.
I've noticed this as well. But it's not always constant (at least for me). Sometimes the color is right, sometimes it's not.
Title: Re: Simple Colorizer
Post by: Diego Andrés on November 23, 2022, 06:19:11 PM
Quote from: jsx on November 23, 2022, 06:25:46 AMSo, I just shared an idea to take it a step further and, for example, in SMF 2.1.4, implement the display of nickname colors in the post. Exactly what your mod does. :)

(https://i.imgur.com/DRzngDD.png)

It already does this, because it colors the links. Not sure if that's an issue you have with other mod?
Screenshot_29.png



Quote from: Speed King on November 23, 2022, 04:34:45 AMThis 1.3.1 version has conflict with Mentions feature, the mentioned members are displayed with different color instead of their membergroup. Problem appears when editing already submitted post including mentions.

I can't reproduce it.
Screenshot_30.png
Screenshot_31.png
Title: Re: Simple Colorizer
Post by: jsx on November 24, 2022, 06:50:53 AM
Quote from: Diego Andrés on November 23, 2022, 06:19:11 PMIt already does this, because it colors the links. Not sure if that's an issue you have with other mod?

[url="https://www.simplemachines.org/community/index.php?action=dlattach;attach=284582;type=preview;file"]Screenshot_29.png[/url]

You mean that SMF 2.1.3 has username coloring where you showed it on screen or do you mean Simple Colorizer mod does it?
Title: Re: Simple Colorizer
Post by: Diego Andrés on November 24, 2022, 07:37:40 AM
The mod does it, always had it.
Title: Re: Simple Colorizer
Post by: jsx on November 25, 2022, 09:33:34 AM
I know and appreciate your mod.

I meant that in SMF 2.1.3 the admin, moderator is displayed in his color in the Who is online list, so I just gave an idea to, for example, in version 2.1.4 implement the color display right here:

(https://i.imgur.com/DRzngDD.png)

I wrote this idea in your mod topic because I referenced this quote:

Quote from: jsx on September 20, 2022, 01:14:33 PM@Diego Andrés

Have you thought about implementing member name coloring in Who's Online? This is missing here.

Quote from: Diego Andrés on September 20, 2022, 01:59:09 PMFor the actual list? It should work in 2.1.3 with no additional changes required.
See: https://github.com/SimpleMachines/SMF/pull/7500
Title: Re: Simple Colorizer
Post by: jsx on December 28, 2022, 05:23:46 PM
@Diego Andrés

I noticed that the color of the username of e.g. admin stops working in the post when a post is merged and the post merge information is displayed. I am using Merge double posts mod to merge posts: https://custom.simplemachines.org/index.php?mod=4286
Title: Re: Simple Colorizer
Post by: jsx on December 29, 2022, 07:38:01 AM
And I noticed one more thing that Simple Colorizer doesn't show the color of my nick in "The following users thanked this post" from the Say Thanks mod, if I'm logged in to the forum I can't see my nick color there, if I log out of the forum I see that my nick is displayed in red.

When I'm logged into the forum and enter a post, I see it like this:

(https://i.imgur.com/NbDryMN.png)

When I am logged out of the forum and enter a post as a guest, I see it like this:

(https://i.imgur.com/AMT8E4O.png)
Title: Re: Simple Colorizer
Post by: Diego Andrés on December 29, 2022, 07:40:13 PM
Quote from: jsx on December 28, 2022, 05:23:46 PM@Diego Andrés

I noticed that the color of the username of e.g. admin stops working in the post when a post is merged and the post merge information is displayed. I am using Merge double posts mod to merge posts: https://custom.simplemachines.org/index.php?mod=4286

I don't know what you mean, I tested it and the color is displayed correctly.



Quote from: jsx on December 29, 2022, 07:38:01 AMAnd I noticed one more thing that Simple Colorizer doesn't show the color of my nick in "The following users thanked this post" from the Say Thanks mod, if I'm logged in to the forum I can't see my nick color there, if I log out of the forum I see that my nick is displayed in red.

When I'm logged into the forum and enter a post, I see it like this:

(https://i.imgur.com/NbDryMN.png)

When I am logged out of the forum and enter a post as a guest, I see it like this:

(https://i.imgur.com/AMT8E4O.png)

This is not an issue with the mod, it's because the current thanker is inside <strong>tag</strong> and it has a higher specificity in the css.
You could add this to the css to work around it.
a > strong {
  color: inherit;
}
Title: Re: Simple Colorizer
Post by: jsx on January 01, 2023, 06:53:15 AM
Quote from: Diego Andrés on December 29, 2022, 07:40:13 PMI don't know what you mean, I tested it and the color is displayed correctly.

@Diego Andrés please look at it.

I mentioned my second admin account:

(https://i.imgur.com/SOOE8au.png)

The red color of the admin nick is displayed correctly, but after adding a second post, when "Merge double posts" mod will merge these posts, the red admin nick is no longer displayed.

(https://i.imgur.com/v9fq8Fm.png)

Why do you think the "Merge double posts" mod affects the Simple Colorizer mod here?

Quote from: Diego Andrés on December 29, 2022, 07:40:13 PMThis is not an issue with the mod, it's because the current thanker is inside <strong>tag</strong> and it has a higher specificity in the css.
You could add this to the css to work around it.

Thank you for providing the solution, this code to which css should I add? Do you mean saythanks.css file from this mod?
Title: Re: Simple Colorizer
Post by: Diego Andrés on January 01, 2023, 02:49:27 PM
Any css file, it doesn't matter.
Title: Re: Simple Colorizer
Post by: Diego Andrés on January 01, 2023, 09:57:48 PM
Quote from: jsx on January 01, 2023, 06:53:15 AMThank you for providing the solution, this code to which css should I add? Do you mean saythanks.css file from this mod?
Added it as a 'feature'. It's not an issue from any mod.

Quote from: jsx on January 01, 2023, 06:53:15 AMThe red color of the admin nick is displayed correctly, but after adding a second post, when "Merge double posts" mod will merge these posts, the red admin nick is no longer displayed.
Fixed the logic.

1.4 - 01 January 2023


Title: Re: Simple Colorizer
Post by: jsx on January 02, 2023, 04:26:45 AM
Thank you Diego for this release. :)
Title: Re: Simple Colorizer
Post by: Steve on January 02, 2023, 09:21:03 AM
Thanks from me as well, Diego.
Title: Re: Simple Colorizer
Post by: macklij on August 16, 2023, 08:33:50 AM
Hi all
I just tried to install this mod and got "The package you are trying to install is either corrupt or not compatible with this version of SMF". I am on SMF 2.0.19.

I am technically competent but not overly familiar with SMF. I note the package says its compatible up to v2.1.4 so should be OK. I uploaded the package by downloading the zip locally and then used 'upload a package in SMF.

I'd be grateful for any pointers.  Thanks.
Title: Re: Simple Colorizer
Post by: Diego Andrés on August 16, 2023, 08:40:52 AM
2.0.x is no longer supported by the mod as you can see on the page.
You could use an older version: https://github.com/SMFTricks/SimpleColorizer/releases/tag/v1.3
Title: Re: Simple Colorizer
Post by: macklij on August 16, 2023, 11:01:16 AM
Quote from: Diego Andrés on August 16, 2023, 08:40:52 AM2.0.x is no longer supported by the mod as you can see on the page.
You could use an older version: https://github.com/SMFTricks/SimpleColorizer/releases/tag/v1.3
Ooops - I missed the bit about it not working on 2.0.x.
I've installed 1.3 successfully and it seems to work beautifully.  Thank you :)