Skip to:
Content
Pages
Categories
Search
Top
Bottom

Post code between backticks

  • Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    The use of backticks for displaying code in forums has now been activated on buddypress.org. Check it out!

    `function tell_the_truth() {
    global $current_user;
    get_currentuserinfo();
    if ( $current_user->user_login == ‘boonebgorges’ )
    echo ‘Boone, you are the bomb dot com.’
    }
    add_action( ‘wp_head’, ‘tell_the_truth’ );
    `

Viewing 13 replies - 1 through 13 (of 13 total)
  • Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    Syntax highlighting?

    Also, it’d be helpful if the patch for checking for closed tags were implemented on here: http://trac.buddypress.org/ticket/2359

    Avatar of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    `function really () {
    echo “so it would seem”;
    }`

    Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    Yup, tag closing should be next :)

    Avatar of rich! @ etiviti
    rich! @ etiviti
    Participant

    @nuprn1

    schweet!

    Avatar of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    something doesn’t seem right – everything is now in italics!

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Very cool. I guess we can’t be ticked anymore.

    `function i_am_ticked() {
    global $bp, $whose_ticked;

    if( $whose_ticked == ‘you’ && $bp->backticks != false ) {
    echo “We’re sorry, you can no longer be ticked”;
    } else {
    echo “Yep! You’re ticked!”;
    }
    }`

    This is an important improvement. Thanks, Ninjas!

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    The backticks are back; all hail the Boone, prince amongst men

    Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    @djpaul – Decided to go with the straightforward backtick before worrying about syntax highlighting, as the most popular option (Syntax Highlighter) (a) requires you to specify the language in order for highlighting to work correctly, which is a bit onerous for first time users, and (b) requires an extra click to get the popup with copyable, plaintext code, which again might be confusing for some. Maybe it makes sense to enable Syntax Highlighter as an undocumented feature, with backticks in place as a fallback? Thoughts?

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    ‘?php backtick_is_back(); ?’

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    For mercime:

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    Thank you @hnla, I shall add that in BP Codex :-)

    Avatar of paulhastings0
    paulhastings0
    Participant

    @paulhastings0

    :woot:

    Avatar of Zen Gonzaga
    Zen Gonzaga
    Member

    @zen-gonzaga

    i typed ‘backticks’ but its not working. how am i gonna use this?

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

You must be logged in to reply to this topic.