muggins wrote:OK. I'm on the verge of giving up.
I'm not a noob, nor am I stupid. The instructions for this are crappy. I installed a local copy under my web root as mathjax. Tried and failed. Copied the the directory to the forum root and reinstalled with no errors.
Configured the mod per instructions and all I get is [math] as the output. The local copy does indeed work; I tested it before taking all this time to test.
Maybe your install instructions need a rework, or this thing is just a turd. LaTeX works just fine for my main site.
Could you give a detailed description of where you put the files and how you specify the options for the bbCode? Otherwise I'll just stick with what works for me, and everyone else can help themselves.
The mathjax folder can be put anywhere in your site, but the path must be relative to your forum root path. For example if you place the files in
mysite.com/mathjax
and phpbb is at
mysite.com/forum/
then the path to enter in ACP is
../mathjax
.
Right now validation is simply done by checking if a file named MathJax.js exists inside the folder:
Code: Select all
file_exists($phpbb_root_path . $path . '/MathJax.js')
Clearly I have to add permission checks for the next version.
If you want to use URL's, its relatively easy by overriding the CDN URL's. They're stored in the database. Have a look with:
Code: Select all
SELECT *
FROM `phpbb_config`
WHERE `config_name` LIKE 'mathjax_%'
The bbcodes are normal bbcodes that you could create by hand, in Posting->Messages->BBCodes, with the exception that theres a column added to phpbb_bbcodes table, called 'is_math'. That column defaults to 0 and should be set to 1 for a math bbcode. Have a look at the generated bbcodes, they're not hidden by default (theres an optional mod to do that). The ones installed by default are: [latex] for LaTeX code, [math] for
MathML (XML) code.
When posts are being parsed for display, valid bbcodes are matched against phpbb_bbcodes. If the mod is enabled and one of the bbcodes have
is_math=1
then
S_ENABLED_MATHJAX
is set to true.
If you see [math] on the post (the preview text), then the bbcode was correctly detected as a normal bbcode and the template applied but only if
$rowset[$bbcode_id]['is_math']
evaluate to true that the template variable
S_ENABLED_MATHJAX
is set to true in this stage.
If dynamic loading is set to false and the mod is enabled then S_ENABLED_MATHJAX is always set to true, when pages are loaded.
What I just described can easly be followed by reading the modifications to core files in
install_mod.xml
.