Activity Stream
48,167 MEMBERS
6841 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member

    Default Wordpress BBcode Help

    Guys there is a wordpress plugin for BBcode. It can be found here:

    http://wordpress.org/extend/plugins/bbcode/

    Code: 
    class BBCode { 
     
        // Plugin initialization 
        function BBCode() { 
            // This version only supports WP 2.5+ (learn to upgrade please!) 
            if ( !function_exists('add_shortcode') ) return; 
     
            // Register the shortcodes 
            add_shortcode( 'b' , array(&$this, 'shortcode_bold') ); 
            add_shortcode( 'i' , array(&$this, 'shortcode_italics') ); 
            add_shortcode( 'u' , array(&$this, 'shortcode_underline') ); 
            add_shortcode( 'url' , array(&$this, 'shortcode_url') ); 
            add_shortcode( 'img' , array(&$this, 'shortcode_image') ); 
            add_shortcode( 'quote' , array(&$this, 'shortcode_quote') ); 
        } 
     
     
        // No-name attribute fixing 
        function attributefix( $atts = array() ) { 
            if ( empty($atts[0]) ) return $atts; 
     
            if ( 0 !== preg_match( '#=("|\')(.*?)("|\')#', $atts[0], $match ) ) 
                $atts[0] = $match[2]; 
     
            return $atts; 
        } 
     
     
        // Bold shortcode 
        function shortcode_bold( $atts = array(), $content = NULL ) { 
            if ( NULL === $content ) return ''; 
     
            return '<strong>' . do_shortcode( $content ) . '</strong>'; 
        } 
     
     
        // Italics shortcode 
        function shortcode_italics( $atts = array(), $content = NULL ) { 
            if ( NULL === $content ) return ''; 
     
            return '<em>' . do_shortcode( $content ) . '</em>'; 
        } 
     
     
        // Italics shortcode 
        function shortcode_underline( $atts = array(), $content = NULL ) { 
            if ( NULL === $content ) return ''; 
     
            return '<span style="text-decoration:underline">' . do_shortcode( $content ) . '</span>'; 
        } 
     
     
        // Italics shortcode 
        function shortcode_url( $atts = array(), $content = NULL ) { 
            $atts = $this->attributefix( $atts ); 
     
             // Google 
            if ( isset($atts[0]) ) { 
                $url = $atts[0]; 
                $text = $content; 
            } 
             // http://www.google.com/ 
            else { 
                $url = $text = $content; 
            } 
     
            if ( empty($url) ) return ''; 
            if ( empty($text) ) $text = $url; 
     
            return '<a href="' . $url . '">' . do_shortcode( $text ) . '</a>'; 
        } 
     
     
        // Italics shortcode 
        function shortcode_image( $atts = array(), $content = NULL ) { 
            if ( NULL === $content ) return ''; 
     
            return '<img src="' . $content . '" alt="" />'; 
        } 
     
     
        // Italics shortcode 
        function shortcode_quote( $atts = array(), $content = NULL ) { 
            if ( NULL === $content ) return ''; 
     
            return '<blockquote>' . do_shortcode( $content ) . '</blockquote>'; 
        } 
    } 
     
    // Start this plugin once all other plugins are fully loaded 
    add_action( 'plugins_loaded', create_function( '', 'global $BBCode; $BBCode = new BBCode();' ) );
    However, it doesn't convert [code] to <code>. Does anyone have a script for this or know what needs to be done?
    kiddo Reviewed by kiddo on . Wordpress BBcode Help Guys there is a wordpress plugin for BBcode. It can be found here: http://wordpress.org/extend/plugins/bbcode/ class BBCode { // Plugin initialization function BBCode() { // This version only supports WP 2.5+ (learn to upgrade please!) if ( !function_exists('add_shortcode') ) return; Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Never mind. I sat and coded it on my own.

  4.     
    #3
    Member
    Website's:
    scrls.co.uk
    Why use this why not just edit the codex ?
    But yeah if you got it then gratz

  5.     
    #4
    Member
    Well its damn easy.

    Just replace [code] with <blockquote> using STR REPLACE function in PHP. Its easy. No need for plugin shit.

  6.     
    #5
    Member
    Website's:
    host4offshore.com
    your plugin is backdated
    Requires WordPress Version: 2.5 or higher

    Last Updated: 2008-6-24

    i will say you use
    gorzek's BBCode Filter
    or
    WP BBCodes to HTML Parser
    after install this you can use bbcode into your post
    || Host4Offshore :: Reliable, Quality, Fast Offshore Hosting Solution (USA/Netherlands/Sweden/Russia/Romania)
    || Shared , Reseller Hosting Sales Thread
    || Rapidleech Hosting Sales Thread
    || Current Promotion

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. need help with Wordpress BBcode
    By divineee in forum Webmaster Discussion
    Replies: 1
    Last Post: 1st Sep 2012, 01:16 AM
  2. wordpress bbcode help
    By indianmoviefans.info in forum Webmaster Discussion
    Replies: 7
    Last Post: 23rd Nov 2011, 07:12 PM
  3. BBCode in Wordpress - W/O a plugin
    By Apathetic in forum Wordpress
    Replies: 11
    Last Post: 7th Oct 2011, 11:18 AM
  4. Wordpress BBCode Help
    By Gempis in forum Technical Help Desk Support
    Replies: 5
    Last Post: 13th Jul 2011, 05:09 PM
  5. Need wordpress BBcode plugin
    By only1_PO in forum Wordpress
    Replies: 1
    Last Post: 21st Aug 2009, 08:54 AM

Tags for this Thread

BE SOCIAL