I would like to integrate Mathjax
(http://www.mathjax.org/). This is quite simple
(i did it on many websites) but phpmyChat removes all the back slash from
Latex commands like:
\
Do you have a solution and can you integrate and special prefix that allows
the use of Mathjax.
Thanks for your answer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So to understand: you want to post messages containing commands that will be
used by others with copy&paste to get the right formulas using mathjax? And
the only issue is the removal of backslashes?
As far as I remember, backslashes are removed for a good reason (not sure now,
but I guess it's a security related thing).
Which version of phpMyChat you're trying to patch? Standard or Plus?
I'll take a look to see where and why the removal happens. Meantime, answer my
questions.
Ciprian M.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On Google Chrome 16.0.912.63 and Opera 11.6.1185 only Latex command like: $$
x^2 $$ works. When i use Latex commands with back slash like \ or
$$f(x)=\mathop{\int}{-\infty}^x~e^{-t^2}dt$$ he doubles all the slashes.
On Firefox 9.0.1 and Internet Explorer 9.0.8112 .16421 nothing works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I would like to integrate Mathjax
(http://www.mathjax.org/). This is quite simple
(i did it on many websites) but phpmyChat removes all the back slash from
Latex commands like:
\
Do you have a solution and can you integrate and special prefix that allows
the use of Mathjax.
Thanks for your answer
I'm really confused about this.
So to understand: you want to post messages containing commands that will be
used by others with copy&paste to get the right formulas using mathjax? And
the only issue is the removal of backslashes?
As far as I remember, backslashes are removed for a good reason (not sure now,
but I guess it's a security related thing).
Which version of phpMyChat you're trying to patch? Standard or Plus?
I'll take a look to see where and why the removal happens. Meantime, answer my
questions.
Ciprian M.
After a few tests, I found this:
Files: loader.php and messagesL.php
Comment out this line:
$Message = stripslashes($Message);
Files: input.php and handle_inputH.php
Search for this stripslashes($M) and replace with $M
Please be aware that this could lead to some other errors, so if you keep
getting frozen windows after posting... this could be a reason.
Let me know how this is going for you.
I'm still waiting to know of your version.
Ciprian M.
Thanks for your quick answer.
The stripslash is effectively for security reason (if i remember it's against
SQL Injection).
Your proposition works now. I still not render in Latex but i will found why.
It but be a minor problem i think.
Thanks for your help.
I'm glad it helped somehow. Let us know your final solution to implement this
plugin.
Ciprian M.
I just tested the Latex and it works. After the patches I described above, you
<script type="text/javascript" src="[http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS- MML_HTMLorMML](http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX- AMS-MML_HTMLorMML)"></script>need to add this line in both loader.php and messagesL.php
... right before the tag </HEAD> (after the <LINK REL="..."> line)
Give me your chat url so I can check together.
Ciprian M.
I made the changes you indicated (it was difficult to guess...)
http://www.sciences.ch/htmlfr/php/chat/index.php
On Google Chrome 16.0.912.63 and Opera 11.6.1185 only Latex command like: $$
x^2 $$ works. When i use Latex commands with back slash like \ or
$$f(x)=\mathop{\int}{-\infty}^x~e^{-t^2}dt$$ he doubles all the slashes.
On Firefox 9.0.1 and Internet Explorer 9.0.8112 .16421 nothing works.
Hmm, that's why I needed to know your chat version, to test and suggest the
right patches.
I've read a bit mathjax forums and they said IE9 it's incompatible, it must be
run in IE7 compatibility mode or something.
I confess, I only tested with Chrome. Let's go deeper now.
I'm in your chat and I'll let you other contact data.
ciprian M.
Can you check your both emails please?
Ciprian