ElkArte Community

Extending Elk => Addons => Topic started by: emanuele on June 18, 2014, 06:37:40 am

Title: [ADDON] Colored Names
Post by: emanuele on June 18, 2014, 06:37:40 am
Colored Names v0.0.3
Introduction
Many people like to be different, and this is the second step in the online world to be different: change the color of the display name.
At the moment the addon is very basic, it allows a fixed number of elements to be customized: color, background, size, border (style, width, color, border radius), but it already covers most of the needs.

Future development:



License
o This ElkArte Addon is subject to the terms of the BSD "3-clause" license. You can obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause

Repository / Download



Change log

Title: Re: [ADDON] Colored Names
Post by: Spuds on June 18, 2014, 07:31:44 am
Nice ! ... this is often asked for  ;D
Title: Re: [ADDON] Colored Names
Post by: emanuele on June 18, 2014, 07:39:55 am
I also decided to pick a slightly different path in respect to the "normal" way: the colored names are saved in real_name, so that they are available anywhere in the app without having to edit the code.
Drawback may play dirty with some stuff (e.g. the mention that will always show the colored form of the name at the time of the mention), but I think it's worth.
And if it is not... well, we will see. :P
Title: Re: [ADDON] Colored Names
Post by: Spuds on June 18, 2014, 07:52:50 am
Thats cool really, I think thats how it should work.
Title: Re: [ADDON] Colored Names
Post by: Allan on June 18, 2014, 09:19:42 pm
Great job, thank you for this.  :D
Title: Re: [ADDON] Colored Names
Post by: IchBin on June 20, 2014, 03:53:13 pm
Way better than altering the buffer too.
Title: Re: [ADDON] Colored Names
Post by: emanuele on July 02, 2014, 06:15:56 am
This morning I realised there is actually a bug with the quote, I have to fix it.
Title: Re: [ADDON] Colored Names
Post by: Allan on December 13, 2014, 08:08:46 am
Sorry to bring up an old topic here but where in the admin panel can I find and set the options.
Title: Re: [ADDON] Colored Names
Post by: emanuele on December 13, 2014, 09:01:44 am
I don't remember I added any option to set... I wouldn't even know what to let "set" and what not. O_o
Title: Re: [ADDON] Colored Names
Post by: Allan on December 13, 2014, 10:09:52 am
I was thinking there was a setting to enable or disable for certain members groups. So it could be used as a member upgrade.
Title: Re: [ADDON] Colored Names
Post by: emanuele on December 14, 2014, 08:10:15 am
So a permission.
I think it's possible. Oh, I wrote something about future development... I should read what I write. xD
Title: Re: [ADDON] Colored Names
Post by: Allan on December 14, 2014, 08:13:03 am
Quote from: emanuele – So a permission.
I think it's possible. Oh, I wrote something about future development... I should read what I write. xD
I was thinking that this would be a perfect premium member upgrade and allow user in that member group to make their own custom colors. So enable and disable based on member group would be a nice little feature.
Title: SPLIT: Member group color everywhere
Post by: emanuele on March 13, 2015, 06:00:30 pm
One or more of the messages of this topic have been moved to Feature Discussion (http://www.elkarte.net/community/index.php?board=1.0)

http://www.elkarte.net/community/index.php?topic=2530.0
Title: Re: [ADDON] Colored Names
Post by: Dadda on June 02, 2016, 07:19:17 am
Quote from: emanuele – One or more of the messages of this topic have been moved to Feature Discussion (http://www.elkarte.net/community/index.php?board=1.0)

http://www.elkarte.net/community/index.php?topic=2530.0 (http://www.elkarte.net/community/index.php?topic=2530.0)
hi there, I installed Colored Names in Elkarte forum, but i noticed it output errors in the error log as per:
home/“MYUSER”/public_html/sources/subs/ColoredNames.class.php
line:210

(where “MYUSER” replace  the cpanel user)

any advice will be appreciated.

Thanks
Title: Re: [ADDON] Colored Names
Post by: emanuele on June 02, 2016, 08:37:24 am
Hi Dadda and welcome. :)

It would be useful to know exactly what error gives you, usually there something more than just the line and the file, like a more or less detailed description or the error.
Title: Re: [ADDON] Colored Names
Post by: Dadda on June 02, 2016, 08:46:24 am
Quote from: emanuele – Hi Dadda and welcome. :)

It would be useful to know exactly what error gives you, usually there something more than just the line and the file, like a more or less detailed description or the error.

well. it says:
Type of error: General
8: Array to string conversion

there's anywhere in the root where i should check for logs?
Title: Re: [ADDON] Colored Names
Post by: emanuele on June 02, 2016, 11:00:16 am
That's about enough for the moment, at least to put up a workaround.
In the ... file, change:
Code: [Select]
	public static function cleanQuote($msg)
{
return preg_replace('~\[quote(.*?)author=<span [^\]]*?>([^\/]*?)</span>~i', '[quote$1author=$2',  $msg);
}
to:
Code: [Select]
	public static function cleanQuote($msg)
{
if (is_array($msg))
return $msg;

return preg_replace('~\[quote(.*?)author=<span [^\]]*?>([^\/]*?)</span>~i', '[quote$1author=$2',  $msg);
}
Title: Re: [ADDON] Colored Names
Post by: Dadda on June 02, 2016, 12:04:42 pm
Quote from: emanuele – That's about enough for the moment, at least to put up a workaround.
In the ... file, change:
Code: [Select]
	public static function cleanQuote($msg)
{
return preg_replace('~\[quote(.*?)author=<span [^\]]*?>([^\/]*?)</span>~i', '[quote$1author=$2',  $msg);
}
to:
Code: [Select]
	public static function cleanQuote($msg)
{
if (is_array($msg))
return $msg;

return preg_replace('~\[quote(.*?)author=<span [^\]]*?>([^\/]*?)</span>~i', '[quote$1author=$2',  $msg);
}

nope. it returns a fatal error. cannot see the member's list anymore. I put it back as it was and cleared the log. I'll see what happens, if the errors re-occurs.
I'm new to Elkarte,  if I need to uninstall the colored name plugin, should I take care of anything in particular or could I just do a straight uninstall?
Title: Re: [ADDON] Colored Names
Post by: emanuele on June 02, 2016, 04:59:57 pm
Quote from: Dadda – nope. it returns a fatal error. cannot see the member's list anymore.
Really odd.
I did a quick test and I wasn't able to reproduce this specific error (even though I noticed few mistakes I'll fix in the weekend), but I'd need some more info to being able to pinpoint the issue, like the specific action you were doing when the errors appeared in the log (in the error log there is an URL of "where" the error occurred, this would be very helpful, you don't have to post the domain if you don't, but at least all anything after index.php).
Also more details on the fatal error (i.e. the exact wording) would help. ;)

Quote from: Dadda – nope. it returns a fatal error. cannot see the member's list anymore. I put it back as it was and cleared the log. I'll see what happens, if the errors re-occurs.
Likely to happen again, errors do not fix for themselves... unfortunately. :(

Quote from: Dadda – I'm new to Elkarte,  if I need to uninstall the colored name plugin, should I take care of anything in particular or could I just do a straight uninstall?
From the package manager click uninstall, that will take care of reverting everything.
Title: Re: [ADDON] Colored Names
Post by: Dadda on June 04, 2016, 01:42:54 pm
Quote from: emanuele –
Quote from: Dadda – nope. it returns a fatal error. cannot see the member's list anymore.
Really odd.
I did a quick test and I wasn't able to reproduce this specific error (even though I noticed few mistakes I'll fix in the weekend), but I'd need some more info to being able to pinpoint the issue, like the specific action you were doing when the errors appeared in the log (in the error log there is an URL of "where" the error occurred, this would be very helpful, you don't have to post the domain if you don't, but at least all anything after index.php).
Also more details on the fatal error (i.e. the exact wording) would help. ;)

Quote from: Dadda – nope. it returns a fatal error. cannot see the member's list anymore. I put it back as it was and cleared the log. I'll see what happens, if the errors re-occurs.
Likely to happen again, errors do not fix for themselves... unfortunately. :(

Quote from: Dadda – I'm new to Elkarte,  if I need to uninstall the colored name plugin, should I take care of anything in particular or could I just do a straight uninstall?
From the package manager click uninstall, that will take care of reverting everything.

thanks Emanuele,

I ended up unistalling the plugin at the end.

thanks anyway.
Title: ColoredNames Error [SOLVED]
Post by: PALAUDIS on August 15, 2016, 11:23:18 am
I'm sorry, my english is weak.
I founded ElkArte forum on the local server. I was trying modification. ColoredNames is found to modification error...

seen in the pictures that errors are present.
(Link-4089)
(Link-4091)

Error Solution:
/sources/subs/Likes.subs.php in

Orginal Line; 65 of 74
Find
Code: [Select]
			m.real_name
FROM {db_prefix}message_likes AS l
LEFT JOIN {db_prefix}members AS m ON (m.id_member = l.id_member)
WHERE id_msg IN ({array_int:id_messages})',
array(
'id_messages' => $messages,
)
);
while ($row = $db->fetch_assoc($request))
$likes[$row['id_msg']]['member'][$row['id_member']] = $row['real_name'];

Change;
Code: [Select]
			m.member_name
FROM {db_prefix}message_likes AS l
LEFT JOIN {db_prefix}members AS m ON (m.id_member = l.id_member)
WHERE id_msg IN ({array_int:id_messages})',
array(
'id_messages' => $messages,
)
);
while ($row = $db->fetch_assoc($request))
$likes[$row['id_msg']]['member'][$row['id_member']] = $row['member_name'];
Title: Re: ColoredNames Error [SOLVED]
Post by: emanuele on August 15, 2016, 03:22:12 pm
Hi PALAUDIS and welcome to elk.net. :)

Thanks for the report, I'll try to find a way to fix it without having to modify the file, not today and probably not tomorrow.

In the meantime, I'll merge this topic with the one of the addon at:
http://www.elkarte.net/community/index.php?topic=1583.0
thanks again. :)
Title: Re: [ADDON] Colored Names
Post by: Genesis on September 23, 2016, 04:41:40 pm
I hope this is the right place to ask this question.

First I have a bug, I installed the mod and everything seemed to go as plan, then I edited the colors of my account but now this appears under thread titles:
QuoteStarted by The Staff Team" class="preview">The Staff Team
I'm not quite sure what I did wrong.

A second question would be, there was a mod like this but with not as many wonderful additions on an SMF site I used to help manage, but you could select different colors in your name, so:

Genesis, could be a rainbow gradient if you but the colors in the right order.

Is something like that possible with this addon? Or would it be more trouble then its wroth?

Thank you in advanced.

Title: Re: [ADDON] Colored Names
Post by: emanuele on September 24, 2016, 04:12:45 am
I have to put my hands again on that mod... :-\