QTE Extension Support?

Support area for phpBB's mChat extension
User avatar
kasimi
mChat developer
Posts: 791
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: QTE Extension Support?

#11

Post by kasimi » 25 Feb 2018, 22:19

I created a ticket for the BBCode bug: https://github.com/kasimi/mChat/issues/23

Tarantino
Distinguished Donor
Posts: 69
Joined: 21 Oct 2016, 12:59

Re: QTE Extension Support?

#12

Post by Tarantino » 08 Apr 2018, 13:00

Some more info about this:

I've added on ACP global mchat settings, some disallowed bbcodes: hr|tr|br

If I send a message, it will not parse them and fix the problem, but on the automatic notifications, they are being parsed. Any easy way to fix this so automatic notifications will too disallowed those bbcodes?

User avatar
kasimi
mChat developer
Posts: 791
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: QTE Extension Support?

#13

Post by kasimi » 11 Apr 2018, 15:19

By default there are no BBCodes in notification messages. Unless you added some, you can disable BBCode parsing completely by commenting this line: https://github.com/kasimi/mChat/blob/2. ... .php#L1265

Tarantino
Distinguished Donor
Posts: 69
Joined: 21 Oct 2016, 12:59

Re: QTE Extension Support?

#14

Post by Tarantino » 11 Apr 2018, 16:38

Well, the notification of a new message will send a notification message of a new topic created, so the topic title since it has sometimes [br] or [tr] or [hd] and since I've those as bbcodes, they're being parsed too. And it shouldnt since I added them to the disallowed bbcodes.

EDIT: I shouldnt call "notification", since phpbb has a notification system. What I mean is the automatic messages.

User avatar
kasimi
mChat developer
Posts: 791
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: QTE Extension Support?

#15

Post by kasimi » 11 Apr 2018, 16:51

It should not only not render your forbidden BBCodes, but it should not render any BBCodes at all. What you're asking for requires lots of code changes, whereas commenting that one line should work just fine. I'm not even sure it's worth putting more effort into this. Are BBCodes in mChat's notification messages actually a much needed feature?

Tarantino
Distinguished Donor
Posts: 69
Joined: 21 Oct 2016, 12:59

Re: QTE Extension Support?

#16

Post by Tarantino » 11 Apr 2018, 19:50

Let me start again, I beleive we're not talking about the same thing. Forget about notifications, I shouldnt used that word lol

On mchat we can send manually a message, let use this message as example:

New Topic: [url=https://domain.com]Topic Title here with this code [HR][TR][BR] on the title[/url] in [url=https://domain.com]Forum Name[/url]

If I send this to my chat manually, it will process the [HR] [TR] and [BR] (because I've created those custom bbcodes). And to try to fix this, I've added those to the disallaowed list: br|hr|tr

After adding those to the disallowed list, and try to send again the same line, now it works perfectly and it doesnt parse that bbcode, it still parse the [url] ofc, thats what we want xD So all great so far.

Now, if we create a new topic with the same text above "Topic Title here with this code [HR][TR][BR] on the title", mchat system will automatically send a new message on the chat (exactly as our text above used as example) but it bugs on those bbcodes... on the [br] one it ads an enter, it parse the bbcode instead of ignoring it.

User avatar
kasimi
mChat developer
Posts: 791
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: QTE Extension Support?

#17

Post by kasimi » 11 Apr 2018, 21:14

Thanks for clarifying, but we are in fact talking about the same thing, though I should have been more precise. :)

Instead of looking at the disallowed BBCodes, BBCode rendering should be skipped completely for both Topic Title here with this code [HR][TR][BR] on the title and Forum Name because post subjects and forum names don't support BBCodes in the first place.

The solution could look like this:

Code: Select all

$message = lang('MCHAT_NEW_REPLY', '[url=http://...]%POST_SUBJECT%[/url]', '[url=http://...]%FORUM_NAME%[/url]');
$message = parse_bbcodes($message);
$message = str_replace('%POST_SUBJECT%', 'Topic Title here with this code [HR][TR][BR] on the title', $message);
$message = str_replace('%FORUM_NAME%', 'Forum Name', $message);
Doing it this way, parsing happens before the topic title and forum name are added and therefore they won't be rendered.

Post Reply

Who is online

Users browsing this forum: Yandex [Bot] and 1 guest