[HowTo] Mention user by clicking on nickname

Support area for phpBB's mChat extension
User avatar
BanterFace
Posts: 51
Joined: 01 Feb 2017, 12:42

[HowTo] Mention user by clicking on nickname

Post by BanterFace »

Whith this feature, clicking on nickname of message's author will inserts mention code into text field (textarea\input). Jumping to profile when clicking on avatar remains.

In /ext/dmzx/mchat/styles/prosilver/template/mchat_messages.html replace

Code: Select all

{{ mchatrow.MCHAT_USERNAME_FULL }}
or

Code: Select all

{ mchatrow.MCHAT_USERNAME_FULL }
with

Code: Select all

<span onclick="$('#mchat-input').val($('#mchat-input').val() + '[ref]{mchatrow.MCHAT_USERNAME}[/ref], '); $('#mchat-input').focus();" title="{L_MCHAT_RESPOND}" style="font-weight: bold; cursor: pointer; color: {mchatrow.MCHAT_USERNAME_COLOR}">{mchatrow.MCHAT_USERNAME}</span>
and all work is done.

You can replace ref with i or b or whatever you use to highlight nicknames. Of course, if you're didn't have ref-code, add it (in ACP -> Messages -> BBcodes)(I recommend use it to have ability to change nickname's highlight in messages).

Hope these instuctions would be useful for somebody...
terry2
Posts: 227
Joined: 22 Oct 2016, 18:22
Location: My castle

Re: [HowTo] Mention user by clicking on nickname

Post by terry2 »

Am i missing some thing here ? why not just click on the "@" it auto inserts or are you just suppling code for lazy ppl to click on the name ?.
User avatar
kasimi
mChat developer
Posts: 1107
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: [HowTo] Mention user by clicking on nickname

Post by kasimi »

For those who like a clean interface it saves an icon. :P

Thanks @BanterFace, stickied. :+1:
Tigers
Posts: 36
Joined: 25 Nov 2016, 09:42

Re: [HowTo] Mention user by clicking on nickname

Post by Tigers »

have you the code for the BBcode [ref] please

edit: the language key allready exist

Code: Select all

{{ lang('MCHAT_RESPOND') }}
User avatar
BanterFace
Posts: 51
Joined: 01 Feb 2017, 12:42

Re: [HowTo] Mention user by clicking on nickname

Post by BanterFace »

Am i missing some thing here ? why not just click on the "@" it auto inserts or are you just suppling code for lazy ppl to click on the name ?.
Kasimi replied right
have you the code for the BBcode [ref] please
Well, I use just that:

Code: Select all

[ref={COLOR;optional}]{TEXT}[/ref]

Code: Select all

<span style="font-style: italic; color: {COLOR};">{TEXT}</span>
You can change from "font-style: italic" to "font-weight: bold" or "text-decoration: underline". Also, with this BB-code and that

Code: Select all

<span onclick="$('#mchat-input').val($('#mchat-input').val() + '[ref=\'{mchatrow.MCHAT_USERNAME_COLOR}\']{mchatrow.MCHAT_USERNAME}[/ref], '); $('#mchat-input').focus();" title="{L_MCHAT_REPLY}" style="font-weight: bold; cursor: pointer; color: {mchatrow.MCHAT_USERNAME_COLOR}">{mchatrow.MCHAT_USERNAME}</span>
code instead of default, you can make your mentions colored in group color!
edit: the language key allready exist
Ohh. Find it, but I can't edit my old messages... @kasimi, can you please delete that part and replace "_REPLY" with "_RESPOND"? :)
User avatar
kasimi
mChat developer
Posts: 1107
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: [HowTo] Mention user by clicking on nickname

Post by kasimi »

BanterFace wrote: 17 Jul 2018, 15:36 Ohh. Find it, but I can't edit my old messages... @kasimi, can you please delete that part and replace "_REPLY" with "_RESPOND"? :)
Done. :+1:
Tigers
Posts: 36
Joined: 25 Nov 2016, 09:42

Re: [HowTo] Mention user by clicking on nickname

Post by Tigers »

Thanks
teufel
Posts: 5
Joined: 08 Dec 2017, 22:43
Location: baden würtenberg

Re: [HowTo] Mention user by clicking on nickname

Post by teufel »

Great work is also available with a @ before username to click and with color in
mortalites
Posts: 8
Joined: 30 Jul 2018, 17:20

Re: [HowTo] Mention user by clicking on nickname

Post by mortalites »

So once again Im confused on how to make this change to Mention someone. Specifically using the @ symbol or using the code in the first Place. I also do not know how to add the [ref] bbcode? I need lots of guidance LOL

Thanks again for everything.
User avatar
BanterFace
Posts: 51
Joined: 01 Feb 2017, 12:42

Re: [HowTo] Mention user by clicking on nickname

Post by BanterFace »

Specifically using the @ symbol or using the code in the first Place.
Please rephrase, I don't understand the question ;_;
I also do not know how to add the [ref] bbcode?
Well, ACP → Messages → BBcodes → Add BBcode (at bottom of the list)
at first textarea:

Code: Select all

[ref]{TEXT}[/ref]
at second:

Code: Select all

<span style="font-style: italic;">{TEXT}</span>
optionally set desctiption and add on BBcodes-panel, tap "Send" button and code is added. You can change from "font-style: italic" to "font-weight: bold" or "text-decoration: underline" for other effects for this code.

Who is online

Users browsing this forum: CCBot [Bot] and 0 guests