Skip to:

Quick Hack: Enable SyntaxHighlighter Evolved on Group Forums

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

  • LPH2005



    Something isn’t quite right on my attempt:

    Installed the plugin
    Added the add_filter to line 113

    Attempted to insert php code

    A single line number shows … but no code.

    I also see that it looks like you have something else installed in your forums. What did you do to get the editors showing?

    As always, thank you.

    Changed theme to default to see if something else is interfering … still no code.

    Any thoughts or suggestions?

    I have markitup running in the textarea

    Make sure you have (due to this:

    A few things changed since my first post above, I don’t know if this will work but here is what I have in syntaxhighlighter code (v2.3.8)

    add_filter( ‘bp_get_the_topic_post_content’, array(&$this, ‘parse_shortcodes’), 7 );
    add_filter( ‘group_forum_post_text_before_save’, array(&$this, ‘encode_shortcode_contents_slashed’), 1 );
    add_filter( ‘group_forum_topic_text_before_save’, array(&$this, ‘encode_shortcode_contents_slashed’), 1 );

    add_filter( ‘bp_get_the_topic_text’, array(&$this, ‘decode_shortcode_contents’), 1 );
    add_filter( ‘bp_get_the_topic_post_edit_text’, array(&$this, ‘decode_shortcode_contents’), 1 );

    I have all the the_content, comment and widget hooks filtered out. (since i only care about syntax within the forums)

    Which reminds me – I want to enable this on activity stream content as well. :P



    Thank you.

    I checked the trac and the fix by jjj is present. However, I wasn’t clear if your workaround was present – and I couldn’t figure out how you added your workaround … which file, etc.

    I’ll try adding more filters now.

    PS. I got the markitup! to work – except the one for adding php code doesn’t show … lol … :p

    i modified the syntaxhighlighter.php plugin file (just easy for my case)



    Adding the new filters worked!!!!

    AWESOME. Thank you!

    Now it’s starting to look like it should .. wish this was added to this site because you can’t just copy/paste your add filters but had to change the ‘ …

    sweet! i also dropped viper a note in that wp support thread over to here.

    yo @johnjamesjacoby – add it to the site too :P



    Agreed – @johnjamesjacoby – I just did this to a second site and took less than 3 minutes to get it working.

    1. Install plugin (
    2. Insert add_filter statements around line 112 of the syntaxhighlighter.php file in the plugin directory




    Thank you @nuprn1 – “bookmarking” it now :-)



    @nuprn1, i’m using your filters above but noticed when mixing php & css in the same forum post, the css code messed up.
    add_filter( ‘bp_get_the_topic_post_content’, array(&$this, ‘parse_shortcodes’), 7 );
    add_filter( ‘bp_get_the_topic_post_content’, array(&$this, ‘parse_shortcodes_comment’), 7 );
    fixed the issue.

    Other than that, did you ever figure how to get it working on the activity stream?



    @nuprn1, the filters listed, does not seem to work on custom theme…. or at-least from what I am using. I added the filters you listed in your second post to line 113, no success. I need this to work here, because I have a group on my site that is meant for a pastebin, and the code tags make it a absolute mess, pigpen!!!

    P.S…. a little help on the MarkItUp would be awesome too!


    It’ very easy to get the code highlighted via this plugin. But I have another problem: Backslashes are stripped out! Even a double backslash is stripped from forum view. In edit view it is still there…
    any idea?

    I’ll test here:
    1 backslash:
    2 backslahes: \
    3 backslashes: \

    Ok, same problem here…



    Probably not the exact answer, but this could help you (it’s in french but php is in english)

    Personnaly i use this and it’s working:

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Quick Hack: Enable SyntaxHighlighter Evolved on Group Forums’ is closed to new replies.
Skip to toolbar