Repentless
02-22-2007, 03:38 AM
THIS HAS OVER 17 VIEWS AND ZERO REPLIES. DO NOT READ IF YOU'RE NOT REPLYING!
--------------------
Hi. I've been writing a VERY crude addon to my forum which is basically a PHP/AJAX chat system. It's not deeply integrated with vB, and is using its own tables while being a templated PHP file. However, I've been trying to make it so that users can enter BBcode and have it parsed in the chat, ex:
Jimmy bob, did you even HEAR WHAT I SAID?? Well?
Should appear with the proper HTML instead of BBcode.
I've been using this (https://vborg.vbsupport.ru/showthread.php?t=82693) tutorial for the BBCode parsing.
However, a *LOT* of funky stuff happens. Here's how the chat itself works, in a nutshell.
AJAX refreshes chat every XX seconds, PHP file returns latest XX messages pulled from DB, executing bbcode_parse on each of them before returning.
If user sends message, PHP file inserts message into DB.
The chat itself works fine, the problem is that the bbcode_parse will horribly mutilate the message. Example:
<<<<<<<<<<<<<>>>>>>>>>>>>>>> <b>test!</b> test!
turns into
<<<<<<<<<<<<<>?ƒ????>>ˆ??\?O؏ˆ?—]\?V??—
If the message had htmlentities() run on it before insertion into DB, the text is *slightly* less mutilated.
Is there some bbcode_parsed_decode or something I'm missing here? Any help would be greatly appreciated!
--------------------
Hi. I've been writing a VERY crude addon to my forum which is basically a PHP/AJAX chat system. It's not deeply integrated with vB, and is using its own tables while being a templated PHP file. However, I've been trying to make it so that users can enter BBcode and have it parsed in the chat, ex:
Jimmy bob, did you even HEAR WHAT I SAID?? Well?
Should appear with the proper HTML instead of BBcode.
I've been using this (https://vborg.vbsupport.ru/showthread.php?t=82693) tutorial for the BBCode parsing.
However, a *LOT* of funky stuff happens. Here's how the chat itself works, in a nutshell.
AJAX refreshes chat every XX seconds, PHP file returns latest XX messages pulled from DB, executing bbcode_parse on each of them before returning.
If user sends message, PHP file inserts message into DB.
The chat itself works fine, the problem is that the bbcode_parse will horribly mutilate the message. Example:
<<<<<<<<<<<<<>>>>>>>>>>>>>>> <b>test!</b> test!
turns into
<<<<<<<<<<<<<>?ƒ????>>ˆ??\?O؏ˆ?—]\?V??—
If the message had htmlentities() run on it before insertion into DB, the text is *slightly* less mutilated.
Is there some bbcode_parsed_decode or something I'm missing here? Any help would be greatly appreciated!