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 »

Help Integrate into phpBB

humongous\′s Photo
4 Nov 09, 7:10PM
(12 replies)
Help Integrate into phpBB
Hi everybody... First of all thank you for this wonderful application.

I'm currently using the html output format. It works wonderfully, but it lacks the equation editor which I think would be more useful especially for latex noobs like me.

Is there a detailed guideline on how to integrate the popup into phpBB?

Just like what you have here when i click the button.

Thanks
humongous\′s Photo
4 Nov 09, 8:24PM
I just managed to add the "equation editor" button next to my bbcode buttons. The popup loads, so i'm quite happy with that.

But the problem still, i can't it to copy-paste the generated codes into my message.

Any ideas?
CodeCogs\′s Photo
5 Nov 09, 10:59PM
Hi,

To get the code copies to your message, the editor needs to know the ID of the textarea. I'll have to setup phpBB and test our what is required to enable this. Which version of phpBB are you using. Also can you post what-ever steps you've taken so far to install this.

On your other question, I'm afraid their are not editor specific instructions. We've been meaning to go through all the major editors and systems and write instructions for each. If nobody else does, then I'll try to get around to it shortly. Naturally any help you can lend us would be appreciated.

Will
humongous\′s Photo
6 Nov 09, 1:29AM
Hi Will, I managed to successfully integrate your neat program into my phpBB 3.0.5 forum.

It's fairly simple, but I'm a noob so..

Here's what I did.

Go to styles, current template, edit:

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

Add Before
<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>
Then 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
<a href="javascript:OpenLatexEditor('whatever-id-name-you-want','phpBB','')"><input type="button" class="btnbbcode" name="Equation Editor" value="Equation Editor" /></a>

Then in posting_body.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>
Add Before name="message"
id="whatever-id-name-you-gave-previously"

What left is to customise the BBCode.

What I did:

In Posting > BBCodes > Add new BBCodes

For BBCode usage
[tex]{TEXT}[/tex]
The HTML Replacement
<img style="vertical-align: middle" src="http://latex.codecogs.com/png.latex?\fg_FFFFFF {TEXT}"/>
(My forum use dark bg so that color settings is optional)

Done!
Anatolii\′s Photo
8 Nov 09, 9:17AM
Hi humongous, Works fine! But how did you add EquationEditor button on your Message Body Panel which opens Editor itself and then generates codes into the message?
humongous\′s Photo
8 Nov 09, 2:34PM
What do you mean by "Message body panel"?

The workaround above should give you a button next to your BBCode. When you clicked on it, the equation editor will popup, and when you click "copy to documents" the codes will be copied to your message.

I have to remind though, that the button settings might be a bit different for different theme.

The most important part is to add the id.
Anatolii\′s Photo
8 Nov 09, 3:52PM
OK, Here is the problem. In prosilver theme there is no text like this in the posting_body.html file:

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

Instead of it I have:

<!-- IF S_PRIVMSGS -->
	<!-- INCLUDE posting_pm_layout.html -->
<!-- ELSE -->
	<!-- INCLUDE posting_layout.html -->
<!-- ENDIF -->

And, of course, in posting_pm_layout.html and posting_layout.html there is no such text too.

So doing all you wrote with subsilver2 theme I have an exellent result. But what can I do with prosilver?

P.S. another problem is that TWO EquationEditor windows opens. (On your forum http://tinyurl.com/ylq4pqd there are also two popup windows when you click on Equation Editor button).
humongous\′s Photo
8 Nov 09, 8:40PM
Yeap, you were right. That line can't be found on prosilver. I had a look into the files, and I think it's using 'div' to define textarea. But it has an id, 'posting box'. So you might want to try exchange the id to 'posting box' first and see what will happen. Other than that, I really have no idea. Maybe you can try the official forum, phpBB.com - ask them where the textarea for prosilver is.

Regarding double post, I don't have that problem on my chrome and FF. Sad thing is popup won't appear at all on IE8. I've tried on several other computers too. One thing you can do is check on here http://www.codecogs.com/components/equationeditor/equation_install.php#Quick See if you have the same double popups when you click the links in the example.

Cheers

CodeCogs\′s Photo
8 Nov 09, 10:10PM
Thanks for the great work. We'll sort out the IE8 bug. If you guys can figure out the forum :)

Do you think there is any benefit to us positing some sample code here?
humongous\′s Photo
9 Nov 09, 6:31AM
My bad. It's not a bug afterall, just poor coding on my part. Or probably because IE sucks anyway ;)

I replaced this
<a href="javascript:OpenLatexEditor('whatever-id-name-you-want','phpBB','')"><input type="button" class="btnbbcode"
name="Equation Editor" value="Equation Editor" /></a>

with this
<input type="button" class="btnbbcode" onclick="javascript:OpenLatexEditor('kambing','phpBB','')" value="Equation Editor"/>

And now it all works fine in IE.

That sample code would be useful. But I think it'll be very laborious for you to provide workaround for every major editors. Maybe you can focus on popular choices like joomla, vbulletin, wordpress etc.

Cheers
CodeCogs\′s Photo
9 Nov 09, 7:17AM
I had wondered what the IE8 problem was, have been testing IE8 all morning and everything seems correct.

I agree regarding integration. However, there only seem to be a few major wysiwyg editors, incluuding FCK, Tiny, etc. So if we start with these, and since they're using in joomla, wordpress etc, we sort of solve two problems.

As you've probably noticed we've got reasonably integration with FCKEditor. Next in that family is CKEditor, then we move toward TinyMCE and CuteEditor.
Anatolii\′s Photo
9 Nov 09, 11:50AM
humongous, then what about id you gave at this step:
<a href="javascript:OpenLatexEditor('whatever-id-name-you-want','phpBB','')"><input type="button" class="btnbbcode"
name="Equation Editor" value="Equation Editor" /></a>
with your substitution it doesn't matter at all? Still I have a situation: Editor window popups, but when you click on "copy to document" nothing happens... :( (I mean window doesn't close and there are no formula codes in the message).
humongous\′s Photo
9 Nov 09, 2:07PM
This part here
onclick="javascript:OpenLatexEditor('kambing','phpBB','')"

If you noticed, I changed it to "kambing".

I tested phpmathpub plugin for my wordpress page, and it seems to be a popular choice. But it's not full latex, and they don't have integrated editor which is a big plus for codecogs.
Currently you need to be logged in to leave a message.