WordPress.org

Support

Support » Plugins and Hacks » WP-United : phpBB WordPress Integration » WP-United breaking forum BBCode and smilies

WP-United breaking forum BBCode and smilies

Viewing 7 replies - 1 through 7 (of 7 total)
  • After a day of struggle, I’ve found the problem.

    In the MOD installation there’s an error. You ask to replace a line in editor.js:

    document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');

    With:

    document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px; background-color: #' + color + ;">');

    You forgot to add an apostrophe (‘) in front of the semicolon (;) at the end of the line before closing the round brackets.

    I’m sad to see such an unprofessional syntax error 🙁

    Sh*t happens though, correct it and get back on the horse, plugin does a pretty brave thing so it makes sense that there are errors here and there.

    What is the exact code that is needed and what is the phsyical location of the file? I’m having this problem too and all forum traffic has stopped. Nobody can post.

    I too am disappointed. Please test things before telling such a large audience to upload a change. There are critical mistakes seen in almost every release.

    Oh, many many thanks. I had the same problem and this post gave me the solution.
    I hope WP-United team test this kind of bugs in further version, because is a really great and useful MOD.

    Same issue here. Any update on which editor.js file to make the correction in? There are more than one in similar phbb. Thanks.

    it is the editor.js file associated to your theme.

    /forum/styles/prosilver/template/editor.js

    This solved part of the problem for me. However I wanted to use an advanced editor like TinyMCE so it is easier for my users to edit their posts.
    With Tiny editor turned off
    http://i747.photobucket.com/albums/xx117/derrick_young1/tiny-off_zpsa1ba8c19.jpg

    With tiny editor turned on
    http://i747.photobucket.com/albums/xx117/derrick_young1/tiny-on_zpsa7438c46.jpg

    What I am after and I get if I turn wp-united theme integration off

    Having the same issue.. can’t insert images or add bbcode.

    Is this the correct line of code that need to be added?? I added it as shown and it still didn’t work..

    document.write(‘<td bgcolor=”#’ + color + ‘” style=”width: ‘ + width + ‘px; height: ‘ + height + ‘px; background-color: #’ + color + ;”>’);

    Okay I had the same error and this is how I fixed it.

    1) Open the editor.js file found in the \styles\prosilver\template folder

    2) Goto line 390
    This is what you should see:

    document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px; background-color: #' + color + ;">');

    3) Change the code to this:

    document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px; background-color: #' + color + ';">');

    The old code was missing a ‘ to open the last part of the table tag.

    4) Save this file and upload it back in to the \styles\prosilver\template folder

    Hope this helps,

    ————
    HOW IT WORKS:

    For those interested in learning more let me break it down so you can understand what is going on.

    If you break the code down into the open and close markers you can see really quick how the code is put together. We start with a document.write( command and then open a ‘ to start the code to create part of the table. we close the ‘ and add in the color tag which will be added by the script. So on and so forth this goes through the code, table code is in the ‘ ‘ marks and the script code is between the + + marks telling the browsers to add them all together.

    The problem in this code happens in the last section because the code hasn’t been opened with the proper ‘ (see bold section). It has the + color + but it is missing the ‘ to open the last bit of code to finish rendering the table properly.

    BAD CODE
    document.write(
    ‘<td bgcolor=”#’
    + color +
    ‘” style=”width: ‘
    + width +
    ‘px; height: ‘
    + height +
    ‘px; background-color: #’
    + color +
    ;”>’ <— Here is the problem
    );

    In the code below you can see what the correct code should look like when you break it apart the same way:

    GOOD CODE
    document.write(
    ‘<td bgcolor=”#’
    + color +
    ‘” style=”width: ‘
    + width +
    ‘px; height: ‘
    + height +
    ‘px; background-color: #’
    + color +
    ‘;”>’ <— Here is the solution
    );

    Technically the code is a simple table column format that can be simplified to looks like this: (The “X” represent the code that will be added by the script running on the board.)

    document.write(

    <td bgcolor=”#XXXXXX” style=”width: XXXpx; height: XXXpx; background-color: #XXX;”>

    ‘);

    The Bold sections below show you the parts of the code that will be generated by the script.

    document.write(‘<td bgcolor=”#’ + color + ‘” style=”width: ‘ + width + ‘px; height: ‘ + height + ‘px; background-color: #’ + color + ‘;”>’);

    I hope this helps fix the problems for some of you and helps explains how and why this works for you budding coders out there.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WP-United breaking forum BBCode and smilies’ is closed to new replies.
Skip to toolbar