MyBB Community Forums

Full Version: Fixed: Cannot Insert uploaded img to post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I use the add attachment function to upload an image (gif), and it shows an "Insert into post" button (along with unapprove and Remove buttons),
but the button does not working anymore (it used to work fine in 1.4)

Any idea how to trouble shooting this issue?

Thanks a lot
It works fine for me... [attachment=27205]

Could you post your Board URL and a test account?
(2012-09-04, 04:48 PM)Paul H. Wrote: [ -> ]It works fine for me...

Could you post your Board URL and a test account?
Thanks a lot Paul. Here is the access for testers:

login: tester/tester (for the forum "Test Area" http://math.elinkage.net/forumdisplay.php?fid=14)
It is probably due to that you aren't using the default MyBB text editor. I'm not an expert with JavaScript though; I'll see if anyone else has any input on how to fix it...?
The forum was upgraded from 1.4, the editor was set this way since 1.4, and (insert attached img to post)worked then.

I'd like to keep the default javascript editor and add the 'LaTeX (math)' editor to it. But they just hard to work together...

Using conditional to switch between two editors might be a solution but I don't know how either.

I found the template to fix. Yes the issue is just related to custom editor. Also, the template did altered since 1.4

Here it is:
Default Templates / Post Templates / post_attachments_attachment_postinsert

Hopefully my js editor code and this template are the only places that need some fixes...

The problem seems fixed by editing the template above

From
<input type="button" class="button" name="insert" value="{$lang->insert_attachment_post}" onclick="clickableEditor.insertAttachment({$attachment['aid']});" />

To
<input type="button" class="button" name="insert" value="{$lang->insert_attachment_post}" onclick="insert1Txt('[attachment='+{$attachment['aid']}+']');" />

My js editor code can be obtained by looking at the page source....