[HowTo] Mention user by clicking on nickname

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

[HowTo] Mention user by clicking on nickname

#1

Post by BanterFace » 16 Jul 2018, 07:52

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
Donor
Posts: 152
Joined: 22 Oct 2016, 18:22
Location: My castle

Re: [HowTo] Mention user by clicking on nickname

#2

Post by terry2 » 16 Jul 2018, 12:47

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: 737
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: [HowTo] Mention user by clicking on nickname

#3

Post by kasimi » 16 Jul 2018, 20:45

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

Thanks @BanterFace, stickied. :+1:

Tigers
Donor
Posts: 25
Joined: 25 Nov 2016, 09:42

Re: [HowTo] Mention user by clicking on nickname

#4

Post by Tigers » 17 Jul 2018, 09:28

have you the code for the BBcode [ref] please

edit: the language key allready exist

Code: Select all

{{ lang('MCHAT_RESPOND') }}

User avatar
BanterFace
Donor
Posts: 51
Joined: 01 Feb 2017, 12:42

Re: [HowTo] Mention user by clicking on nickname

#5

Post by BanterFace » 17 Jul 2018, 15:36

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: 737
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: [HowTo] Mention user by clicking on nickname

#6

Post by kasimi » 17 Jul 2018, 17:29

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
Donor
Posts: 25
Joined: 25 Nov 2016, 09:42

Re: [HowTo] Mention user by clicking on nickname

#7

Post by Tigers » 18 Jul 2018, 03:08

Thanks

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

Re: [HowTo] Mention user by clicking on nickname

#8

Post by teufel » 18 Jul 2018, 09:04

Great work is also available with a @ before username to click and with color in

mortalites
Donor
Posts: 3
Joined: 30 Jul 2018, 17:20

Re: [HowTo] Mention user by clicking on nickname

#9

Post by mortalites » 01 Aug 2018, 18:32

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
Donor
Posts: 51
Joined: 01 Feb 2017, 12:42

Re: [HowTo] Mention user by clicking on nickname

#10

Post by BanterFace » 05 Aug 2018, 15:28

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest