Skip to:
Content
Pages
Categories
Search
Top
Bottom

TinyMCE and Allow Images installed, but images doesn't work!

  • I installed both TinyMCE 3.2.7 and the Allow Images plugin on a bbPress 1.0.1, but images and emoticoms (which are images as well) don’t work.

    I don’t know what problem it might be. Any hint or help?

    (I did fix the annoyance with the <p> tag that TinyMCE has, now I need images to work.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • Isn’t there anybody that was able to make images work with TinyMCE intagrated in bbPress? I can’t believe that such a basic funtion like images in posts is so coplicated with bbPress. I know it’s LIGHTWEIGHT, but basic feaures like that should not be considered luxuriuos options that are so hard to get and to make work.

    Can anybody tell if at least IS possible to have images to work with TinyMCE in bbPress?


    julienbechade
    Member

    @julienbechade

    You can use the HTML Purifier plugin and allow any other tag also:

    http://urbangiraffe.com/plugins/html-purified/ (Download the bbPress one)

    It should do the trick, I’m using it & it works like a charm…!

    Should the HTML purifier be used alongside the tinyMCE plugin? How can you set up the advanced mode?

    I thought it should be a parameter of the tinyMCE.init funtion..

    Have you guys found a solution?

    I really hope I find a way of making linking images from an external source that didn’t involve having to inserting the code by hand..

    Thanks in advanced for any help or advice!

    @apam

    What I did to make images work with Allow Images plugin is to go in the plugin’s php file and comment out this chunk of code (at the bottom of the file):

    remove_filter( ‘pre_post’, ‘encode_bad’ );

    add_filter( ‘pre_post’, ‘allow_images_encode_bad’, 9 );

    add_filter( ‘pre_post’, ‘allow_images’, 52 );

    Like this:

    // remove_filter( ‘pre_post’, ‘encode_bad’ );

    // add_filter( ‘pre_post’, ‘allow_images_encode_bad’, 9 );

    // add_filter( ‘pre_post’, ‘allow_images’, 52 );

    That worked for me. Hope it does work for you as well.

    Bonus tip: with TinyMCE installed, if you try to “Edit” a post, you get <p>tags all over the text. To fix that go to this file:

    bb-includes/functions.bb-formatting.php

    Find this chunk of code:

    function bb_code_trick_reverse( $text ) {

    $text = preg_replace_callback(“!(

    |)(.*?)(
    |)!s”, ‘bb_decodeit’, $text);
    $text = str_replace(array(‘<p>’, ‘’), ‘’, $text);
    $text = str_replace(‘</p>’, “n”, $text);
    $text = str_replace(‘<coded_br />’, ‘’, $text);
    $text = str_replace(‘<coded_p>’, ‘<p>’, $text);
    $text = str_replace(‘</coded_p>’, ‘</p>’, $text);
    return $text;
    }

    And comment out this two lines:

    // $text = str_replace(array(‘<p>’, ‘
    ’), ‘’, $text);

    // $text = str_replace(‘</p>’, “n”, $text);

    You may now have a proper Editor.

    bb-gian:

    Thankyou VERY much for your help and the clarity with which you explained yourself.

    I kinda had managed to make images work with tinyMCE alone (tinyMCE3.7.2, bb-press1.01) and have only used your tip on the ‘functions.bb-formatting.php’ that I’m not too sure is working.

    When I insert images and then render the page there is a ‘ “image26.jpg” />’ after the image itself, looking at the source code I see a linebreak (br) inside the value of the ‘alt’ attribute that breaks the code.

    Same thing happens on links: a linebreak ‘br’ at the beginning of the ‘href’ value.

    Anyone having/had the same problem?

    Ok the problem seems to be the HTML purifier plugin that inserts those linebreaks which is a pity for it does a good job of cleaning up the code.

    I have disabled it for now unitll I’ll find a solution, if anyoe can shed some light it would be great!

    I’m still having trouble…tinymce seems to break up my template, doesn’t show pics in the post content untill I save and preview the post (not all images though…) and tag management keeps giving me errors. Everything seems to go away when I disable the plugin.

    I must say it’s getting quite difficult to get this forum to work as I’d like…must say if I can’t find a solution I might go back to my old smf forum…but I’d love to keep to bbpress.

    I can’t find help on other tinymce forums either…

    :( :( :(

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.