I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Products » LaTeX Equation Editor » PHP BB »

Equation Editor Installation instructions on Phpbb3

humongous\′s Photo
1 Dec 09, 1:14PM
(30 replies)
Equation Editor Installation instructions on Phpbb3
This is a short tutorial on how to install equation editor on phpbb.

The mod is separated into two, for prosilver or subsilver2 so please choose your styles accordingly.

In addition you also need to create a new bbcode which applies to both styles.

Please report any errors. Thanks

For prosilver Go to ACP>Styles>Templates>Edit (choose your style accordingly)

1. In overall_header.html, FIND (Ctrl+F)
<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>

Add After

<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>

2. In posting_buttons.html, Find
<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
	<!-- END custom_tags -->

Add AFTER
<input type="button" class="button2" onclick="javascript:OpenLatexEditor('message','phpBB','')" value="Equation Editor"/>

For subsilver2 Go to ACP>Styles>Templates>Edit (choose your style accordingly)

1. In posting_buttons.html, Find
<script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>

Add After
<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>

2. In posting_buttons.html, Find
<input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')"<!-- ENDIF --> />
		<!-- END custom_tags -->
Add AFTER
<input type="button" class="btnbbcode" onclick="javascript:OpenLatexEditor('message','phpBB','')" value="Equation Editor"/>

3. In posting_editor.html, Find

<textarea name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);"
onkeyup="storeCaret(this);" style="width: 98%;">{MESSAGE}</textarea>

Replace with
<textarea id="message" name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" style="width: 98%;">{MESSAGE}</textarea>

Below are the instruction on how to install the BBCode, therefore it is similar for both styles.

Go to ACP>Posting>BBCode

Use these settings:

BBCode: [tex]{TEXT}[/tex] HTML Replacement:
<img style="vertical-align: middle" src="http://latex.codecogs.com/png.latex?{TEXT}"/>
Helpline: [tex]your equation[/tex] Tick "display on posting page"

Submit. Go start a new topic, see if it works. An "Equation Editor" should appear next to your bbcodes and it will popup the equation editor when clicked. Please let me know of any errors

Cheers

heavenshock1\′s Photo
3 Jul 10, 5:59AM
Hello thank you for this post. All works fine for me. But I want to work around a limitation.

Suppose I post a matrix in my bulletin board using the tex tag, it seems that I have to write the LaTex code with no newline; if not any newline will leave a "br /" (between <> here) in my equation. This problem does not appear when you use the equation editor since it removes the newlines before it copies into the document. But it would be usefull to be able to push return in the code to make it more easy to write.

Thanks in advance for any help.
CodeCogs\′s Photo
3 Jul 10, 3:31PM
A good observation that we'll bare in mind in mind for the next update. I image this is something we should address generally since it'll impact more than just PHPBB.

Thanks for the thought
heavenshock1\′s Photo
3 Jul 10, 5:51PM
It seems that this is not a problem on the CodeCogs side since the equation editor works fine with many spaces or newlines. In fact it seem that the part where you copy to document from the equation editor was designed to translate (by removing/cleaning the extra newlines) for phpBB.

I guess I simply have to learn that "copy to document" function/button and implement it in phpBB for the tex tag.
CodeCogs\′s Photo
4 Jul 10, 2:00AM
You right on this regard if it is the conversion from [tex]x+y+z[/tex[ to an image tag that is the challenge?

I've not used PHPBB for many years, so I'm not sure how much control there is within plugins. Is the problem that PHPBB doesn't find the closing [/tex] tag when you add new lines, or that the image tag it creates has newlines characters within the source attribute.

I'd be surprised if the later caused a problem. However I would have though there must be many other plugins that hit similar problems. There might be a simple hack that can be implemented - thats what we used to do with PHPBB v1 when I used it. Eventually we decided it was easier to write our own forum (that you see today).
humongous\′s Photo
11 Jul 10, 8:43PM
I know your problem. If you want to post say:

x+7<br/>x+8

It will turn into:

The workaround to this is to use double backslash ( \\ ). Double backslash acts similar like a p tag in html. So if you have more than two lines of equations, use double backslash at the start of every line of your equation.

Like in this example:

My code is:
\\ x+7
\\ x+8

Hopefully codecogs could make this automatic in their next update i.e. recognize br tag as a linebreak instead of rendering them to

heavenshock1\′s Photo
14 Jul 10, 12:51PM
phpBB has not problem with the tex tags. I can generate any equation in the codecogs editor and copy to document and post it with no problems. But if I edit a post in phpBB and I enter spaces the the html "br/" codes appear. So ultimately everything works but it's annoying to not be able to put some space (in phpBB) after the initial cut and paste.

When you type thing in Latex spaces and new lines are ignored, so codecogs editors behaves properly. If it was programed to ignore br html tags it would be nice.

Here an example of what I'm doing; On my forum if I type;

[tex]\\x+7\\x+6[/tex] I get (this one is good)

<img src="http://latex.codecogs.com/png.latex?\x+7\x+6">

but if I type

[tex]\\x+7<br/> \\x+6[/tex]

then I get (it should be the same)

<img src="http://latex.codecogs.com/png.latex?\x+7%3Cbr%20/%3E\x+6">

I know a reply to my post now is simply to say "Well remove all spaces!". This is what I'm doing now to make it work but when you type long solution to questions (I'm a math teacher) online without the freedom of editing your code with spaces it makes it very annoying. It was actually working on my old YaBB forum perfectly... so again I think it's an issue on the phpBB side. I a find a solution I will post it here.

Thanks again for all your replies! :)

boB.
CodeCogs\′s Photo
15 Jul 10, 12:20AM
Just a thought, but why can't we do a search an replace within the phpBB plugin and remove all <br/> ? Is there a danger here of removing something we want to keep?
heavenshock1\′s Photo
15 Jul 10, 5:50PM
This would fix my problem for sure! :) I cannot think of an example where this would erase good latex equation.
CodeCogs\′s Photo
16 Jul 10, 4:32AM
I'll set up a demo installation of phpBB at some point. It would be good to play around with the methodology being used to integrate the equations. If that fails, then we can hard code in a filter at the CodeCogs server side.
heavenshock1\′s Photo
16 Jul 10, 8:29AM
Thanks keep me posted. I'm looking forward for this.
paklenizmaj\′s Photo
24 Jul 10, 5:35PM
I can't find "posting_editor.html", and I have a phpbb3 v.3.0.6 How to solve this prolbem?
CodeCogs\′s Photo
25 Jul 10, 3:22PM
I take it you've searched for this file? I'll install a fresh copy of phpbb3 soon - but not for at least a week.
paklenizmaj\′s Photo
25 Jul 10, 4:34PM
Problem sloved! In "posting_body.html"

Find:
<textarea name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" style="width: 98%;">{MESSAGE}</textarea>
Replace with:
<textarea id="message" name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);"
onclick="storeCaret(this);" onkeyup="storeCaret(this);" style="width: 98%;">{MESSAGE}</textarea>
heavenshock1\′s Photo
26 Jul 10, 6:52PM
Hello paklenizmaj, Are you saying that you changing the code above fixes my problem? I tried and did not do anything different for me. Thanks for checking this, If I find a fix I will let you know.

boB.
paklenizmaj\′s Photo
28 Jul 10, 6:33AM
Works perfectly for me, the first two steps as I did above written humongous, and I'm looking for the third step of code that must be changed. This is a tutorial for subsilver2, so you have to change in subsiver2, the file "posting_body.html"
Vsevolod\′s Photo
1 Feb 11, 4:08AM
Hello! I have a question about usage Codecogs Equation Editor. So, we made the Embedded integration of the Equation editor into our phpBB based forum. We plan to routinely use the service, but the generation of the Equations will not exceed 3000 equations per day. And absolutely all content of our website is provided for free to any user. But according for aragraph 3-4 of usage policy CodeCogs Equation Editor (http://www.codecogs.com/latex/usage.php), for such use of the Equation Editor we require a licence. Is my understanding true? should we make only the Popup integration for free usage CodeCogs Equation Editor?

Best regards, Vsevolod.

PS: Please, Sorry for my possible bad English... :)
CodeCogs\′s Photo
1 Feb 11, 1:08PM
Hi.

Thanks for asking. If you're using the code above, then you're using a javascript driven version of our Editor. In otherwords you don't have a copy of our editor on your servers, just the above code that loads our editor from CodeCogs on demand. As such you don't need a licence just so long as you stay under 3000 per day. (Please also cache equations if you know how).

However. If you copy the code behind the entire editor directory from CodeCogs; then you do need a licence.

Sounds like your ok. Hope this help.
Vsevolod\′s Photo
1 Feb 11, 2:12PM
Good evening! Thanks for the answer:) we are using the code from http://www.codecogs.com/latex/embedded.php. So, If I understood you correctly - we don't need the license, because it is a javascript driven version of the Editor and we dont copy the code behind the entire editor directory from CodeCogs.

Please tell me or give me a link: how can I cash equations? Thank you for the help!:)

PS: I hope my English is correct...:)
CodeCogs\′s Photo
1 Feb 11, 2:51PM
Yes, this is right regarding the equation.

In terms of the caching, there is nothing specific for phpBB, so you'll have to write something yourself; but this forum post should help you start: http://www.codecogs.com/pages/forums/pagegen.php?id=1764
USFmaster\′s Photo
3 Feb 11, 11:17PM
I implemented it according to instructions. And latex is working fine with tex tags. But in my editor, i cant find an equation editor button and nothing pops out Only bbcode tag button appeared.
CodeCogs\′s Photo
4 Feb 11, 8:55AM
Hi. We need to refresh the installation instructions and move them out of the Forum into a dedicated page for phpBB. I'm affraid we don't use this on a daily basis so its very likely the original installation is no longer correct.

You should compare an contrast with this page http://www.codecogs.com/latex/install.php
Nathan\′s Photo
24 Jun 11, 3:25PM
<img style="vertical-align: middle" src="http://latex.codecogs.com/png.latex?{TEXT}"/>

It should be noted that this opens up a phpBB forum to XSS attacks, which is very bad.
CodeCogs\′s Photo
24 Jun 11, 3:54PM
This is a fairly common technique with Bulletin Board, so i'm a little surprised they don't either strip HTML tags or run php's addslashes to prevent XSS.

Does anyone with more familiarity with BB able to offer any feedback?
Nathan\′s Photo
24 Jun 11, 6:02PM
Here's a thread I started on the phpBB website:

http://www.phpbb.com/community/viewtopic.php?f=46&t=2129340#p13002825

Apparently there's no easy way to do it, which is unfortunate because it worked perfectly.
Marko\′s Photo
25 Oct 11, 9:47PM
Hi, can someone please help me. I've lost Equation Editor button when I installed Advanced BBCode Box 3 (aka ABBC3) on my phpBB3 forum (untill then everything worked great) and I still got tex button left. How can I return that button and keep ABBC3??

Please help

Thanks!

P.s. sorry for bad english
joao_pimentel\′s Photo
17 Jan 12, 3:46PM
Hi there. I've successfully installed the equations editor popup window on my php math forum. But how do I remove the donate button, the tweets info, and leave only the formulas? How much do I need to pay? Thanks a lot and congratulations for your great work!!!
el_ts\′s Photo
18 Sep 13, 9:05AM
Hello!

I currently have the following forum www.estatistics.eu/forum. My LaTex bbcode worked perfectly until i changed from Http to HTTPs ... why? can you help me?
joao_pimentel\′s Photo
19 Dec 13, 7:30AM
Good day. Did you do anything on this equation editor recently? In my phpbb math forum, the equation editor doesn't work for some days. I thought it was temporarily, but it seems it isn't.

Can you kindly help?

Thanks in advance
samuel.leanza\′s Photo
8 Aug 14, 9:37AM
Hi humongous, I've followed all two steps for the installation of equation editor in my prosilver template but it doesn't appear any equation editor button.

It just appear the bbcode tex.

http://webtutoring.altervista.org/posting.php?mode=post&f=2&sid=50457ba534f3a09954793b2b5efba4d8

Would you explain me why?
samuel.leanza\′s Photo
8 Aug 14, 9:49AM
Hi humongous, I've followed all two steps for the installation of equation editor in my prosilver template but it doesn't appear any equation editor button.

It just appear the bbcode tex.

http://webtutoring.altervista.org/posting.php?mode=post&f=2&sid=50457ba534f3a09954793b2b5efba4d8

Would you explain me why?
Currently you need to be logged in to leave a message.