Simple mentions

Simple Mention conflict with native phpbb quote post - Simple mentions

Simple Mention conflict with native phpbb quote post

by GOLX » Sat Jul 28, 2018 1:29 pm

Hello guys

Please someone know how can i fix this problem?

After install simple mention can note several messages are published with desconfigured text, only if the post has a quote with a user mention.

Ext Simple mention are going some conflite when a user quote a post if inside this quote post have a Simple mention "@username", the system mention recognizes that the user want mention that user AGAIN, and display for every side of the post, when click, a dropdown from Ext Simple mention with this user again, that was write in the quote. So user when write press enter to change line and a new mention is addided in the post replacing many words of the post. So the quote are being publish with lot of iqual Mention from the same user, from that use was mention in a quote. Can undastand?
Please try you some times, quote a post with there is a valid mention user "@username", after it click to write in some parts of de message, and see if acour to you too please, displey the dropdown from that user again.

i hope it can be save becouse this extention is icrerible

thanks so much for your contrituition dear

Have a nice day!
User avatar
GOLX
Registered User
Posts: 162
Joined: Tue Aug 02, 2016 1:17 am
Contact:

Re: Simple Mention conflict with native phpbb quote post

by Paul » Sun Jul 29, 2018 10:36 am

It is a known bug caused by a library used in this extension. It has been reported there but not yet fixed.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28616
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Simple Mention conflict with native phpbb quote post

by GOLX » Mon Jul 30, 2018 2:38 pm

Paul wrote:It is a known bug caused by a library used in this extension. It has been reported there but not yet fixed.
Thanks for this information Paul! Nice to know it! SO i am waiting to fix this problem. Thanks!!
User avatar
GOLX
Registered User
Posts: 162
Joined: Tue Aug 02, 2016 1:17 am
Contact:

Re: Simple Mention conflict with native phpbb quote post

by GOLX » Sat Sep 01, 2018 9:36 am

Paul wrote:It is a known bug caused by a library used in this extension. It has been reported there but not yet fixed.
Hello @Paul!

All nice?!

PLease, Do you can say me where (a link) I can follow the fix for this question? Some prevision to fix?
I will be very grateful!
Thanks so much!
User avatar
GOLX
Registered User
Posts: 162
Joined: Tue Aug 02, 2016 1:17 am
Contact:

Re: Simple Mention conflict with native phpbb quote post

by GOLX » Mon Sep 03, 2018 8:15 pm

Paul wrote:It is a known bug caused by a library used in this extension. It has been reported there but not yet fixed.
Paul,

Is possible to do a javascript to solve this questions?

I have been thinking here some things to solve this problem.
I dont know well JS but say me please if it is possible, use js to transformer the caracter "@" or "[mention]" when in page of posting only, into quote only, is where the problem occours: page class .section-posting.

like a js do a space where see "@username", and do it "@ username", this way the Mention extention do not reconize as a mention more into quote, when in the posting page.

Something like it is possible to fix?


Maybe this can be insane or not, only you can tell me.


hope I help to fix this great extention guys

tell me please. thanks for your effort!

Good luck!
Last edited by GOLX on Sat Sep 15, 2018 1:07 pm
User avatar
GOLX
Registered User
Posts: 162
Joined: Tue Aug 02, 2016 1:17 am
Contact:

Re: Simple Mention conflict with native phpbb quote post

by dingus33 » Mon Sep 10, 2018 9:27 am

GOLX wrote:
Paul wrote:It is a known bug caused by a library used in this extension. It has been reported there but not yet fixed.
like js do a space where see "@username", and do it "@ username", this way the Mention extention do note reconize as a mention more into quote, when in the posting page.
thanks for the idea. it's a pretty ugly hack, but it works. i think now i can actually use the extension.

if you'd like to try it for yourself:

this shows the line in main_listener.php you need to edit:
https://github.com/paul999/mention/blob ... r.php#L291

so in remove_mention_in_quote(), change this:

Code: Select all

$page_data['MESSAGE'] = preg_replace('#\[mention\](.*?)\[\/mention\]#uis', '@\\1', $page_data['MESSAGE']);
to this:

Code: Select all

$page_data['MESSAGE'] = preg_replace('#\[mention\](.*?)\[\/mention\]#uis', '@ \\1', $page_data['MESSAGE']);
it's just adding a space.

another option (which is what i did) is to simply remove the at sign like this:

Code: Select all

$page_data['MESSAGE'] = preg_replace('#\[mention\](.*?)\[\/mention\]#uis', '\\1', $page_data['MESSAGE']);
PS: not sure if you saw my other post, paul.. but again, can you please show us specifically where it's been reported? like which github issue?
User avatar
dingus33
Registered User
Posts: 136
Joined: Fri Sep 29, 2017 11:11 am
Contact:

Re: Simple Mention conflict with native phpbb quote post

by GOLX » Sat Sep 15, 2018 12:49 pm

dingus33 wrote:
GOLX wrote:
Paul wrote:It is a known bug caused by a library used in this extension. It has been reported there but not yet fixed.
like js do a space where see "@username", and do it "@ username", this way the Mention extention do note reconize as a mention more into quote, when in the posting page.
thanks for the idea. it's a pretty ugly hack, but it works. i think now i can actually use the extension.

if you'd like to try it for yourself:

this shows the line in main_listener.php you need to edit:
https://github.com/paul999/mention/blob ... r.php#L291

so in remove_mention_in_quote(), change this:

Code: Select all

$page_data['MESSAGE'] = preg_replace('#\[mention\](.*?)\[\/mention\]#uis', '@\\1', $page_data['MESSAGE']);
to this:

Code: Select all

$page_data['MESSAGE'] = preg_replace('#\[mention\](.*?)\[\/mention\]#uis', '@ \\1', $page_data['MESSAGE']);
it's just adding a space.

another option (which is what i did) is to simply remove the at sign like this:

Code: Select all

$page_data['MESSAGE'] = preg_replace('#\[mention\](.*?)\[\/mention\]#uis', '\\1', $page_data['MESSAGE']);
PS: not sure if you saw my other post, paul.. but again, can you please show us specifically where it's been reported? like which github issue?

Great dingus33 !!!

Thanks so much for your contribuition!!

Yes I do the changes and it work very well now!

Increrible!

Thank you so much for using my insane thinking and turning it into a solution.

:idea: :idea: :idea: :idea: :idea:
:ugeek: :ugeek: :ugeek: :ugeek:

:D :D :D :D :D :D Very Happy becouse this extention is great and now i can continue to use too!!!


Thanks all guys
User avatar
GOLX
Registered User
Posts: 162
Joined: Tue Aug 02, 2016 1:17 am
Contact:

Re: Simple Mention conflict with native phpbb quote post

by IoHL-be » Sat Feb 02, 2019 8:55 pm

Thank you so much for this solution dingus33, I just implemented it on my forum and it worked like a charm :). It definitely needs to be corrected in the next version of Simple Mentions.
IoHL-be
Registered User
Posts: 46
Joined: Tue Oct 09, 2018 3:50 pm
Contact:

Re: Simple Mention conflict with native phpbb quote post

by eselva » Tue May 28, 2019 11:41 am

I found the way to keep the @ without space:

Create this custom bbcode:

Image

You can add the class mention if you want.

Then on the function remove_mention_in_quote() on file main_listener.php , replace the @ with the bbcode tag like this:

$page_data['MESSAGE'] = preg_replace('#\[mention\](.*?)\[\/mention\]#uis', '[qmention]\\1[/qmention]', $page_data['MESSAGE']);

it works perfect for me!
eselva
Registered User
Posts: 8
Joined: Tue Oct 16, 2018 11:43 am
Contact:

Re: Simple Mention conflict with native phpbb quote post

by dingus33 » Sat Jun 01, 2019 5:45 am

eselva wrote:I found the way to keep the @ without space:

Create this custom bbcode:

Image

You can add the class mention if you want.

Then on the function remove_mention_in_quote() on file main_listener.php , replace the @ with the bbcode tag like this:

$page_data['MESSAGE'] = preg_replace('#\[mention\](.*?)\[\/mention\]#uis', '[qmention]\\1[/qmention]', $page_data['MESSAGE']);

it works perfect for me!
great job, that is an even nicer solution.
User avatar
dingus33
Registered User
Posts: 136
Joined: Fri Sep 29, 2017 11:11 am
Contact:

Re: Simple Mention conflict with native phpbb quote post

by Paul » Sat Jun 01, 2019 8:47 am

You really should not change the code. If you want to do changes like this, just edit the original BBCode that was added with the extension.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28616
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Simple Mention conflict with native phpbb quote post

by dingus33 » Fri Aug 02, 2019 6:31 pm

i don't see how editing the original BBcode could fix this issue. editing remove_mention_in_quote() was for sure necessary because that's where the problematic at sign gets inserted when you quote
User avatar
dingus33
Registered User
Posts: 136
Joined: Fri Sep 29, 2017 11:11 am
Contact: