Plugin Directory

Changeset 693513


Ignore:
Timestamp:
04/08/2013 07:56:38 AM (13 years ago)
Author:
antonchanning
Message:

Removed support for video and audio bbcodes as these are now supported only via the 'Video Audio BBCode' plugin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bbpress-bbcode/trunk/class_bbpress2-bbcode.php

    r692893 r693513  
    6262        add_shortcode( 'spoiler' , array(&$this, 'shortcode_spoiler') );
    6363        add_shortcode( 'SPOILER' , array(&$this, 'shortcode_spoiler') );
    64         add_shortcode( 'freesound' , array(&$this, 'shortcode_freesound') );
    65         add_shortcode( 'FREESOUND' , array(&$this, 'shortcode_freesound') );
    6664        add_shortcode( 'user' , array(&$this, 'shortcode_user') );
    6765        add_shortcode( 'USER' , array(&$this, 'shortcode_user') );
     
    7472            $this->use_whitelist = false;
    7573            // Whitelist not installed.  So enable all shortcodes.
    76             // This is risky.  Admin page will recommend the admin installs the whitelist.add_filter('bp_get_activity_content_body','scripturize');
    77 
    78             add_filter( 'get_comment_text', 'do_shortcode' ); //Warning, doing it this way adds ALL shortcodes to forum topics
    79             add_filter( 'bbp_get_reply_content', 'do_shortcode' ); //Warning, doing it this way adds ALL shortcodes to forum replies
    80             add_filter( 'bp_get_activity_content_body', 'do_shortcode', 1 ); //Warning, doing it this way adds ALL shortcodes to activity stream
    81             add_filter( 'bp_get_the_topic_post_content', 'do_shortcode' ); //Warning, doing it this way adds ALL shortcodes to group forum posts
    82             add_filter( 'bp_get_the_thread_message_content', 'do_shortcode' ); //Warning, doing it this way yadda yadda
    83         }
    84     }
    85 
    86     function init_videotags() {
    87         // This initialisation is called later in order to override Viper's video tag handling.
    88         if(class_exists('VipersVideoQuicktags')) {
    89             // Remove Viper's handling of video tag, we'll enhance it.
    90             remove_shortcode( 'video' );
    91             remove_shortcode( 'VIDEO' );
    92         } else {
    93             // Viper's Video Quicktags not installed, so handle these ourselves
    94             add_shortcode( 'youtube' , array(&$this, 'shortcode_youtube') );       
    95             add_shortcode( 'YOUTUBE' , array(&$this, 'shortcode_youtube') );
    96             add_shortcode( 'googlevideo' , array(&$this, 'shortcode_gvideo') );
    97             add_shortcode( 'GOOGLEVIDEO' , array(&$this, 'shortcode_gvideo') );
    98             add_shortcode( 'gvideo' , array(&$this, 'shortcode_gvideo') );
    99             add_shortcode( 'GVIDEO' , array(&$this, 'shortcode_gvideo') );
    100         }
    101         add_shortcode( 'video' , array(&$this, 'shortcode_video') );
    102         add_shortcode( 'VIDEO' , array(&$this, 'shortcode_video') );
     74            // This is risky.  Do you want to ALL your users to be
     75            // able to post login forms where ever they like?  [bbp-login]
     76            // Admin page will recommend the admin installs the whitelist.
     77
     78            //Warning, doing it this way adds ALL shortcodes to forum topics
     79            add_filter( 'get_comment_text', 'do_shortcode' ); 
     80
     81            //Warning, doing it this way adds ALL shortcodes to forum replies
     82            add_filter( 'bbp_get_reply_content', 'do_shortcode' );
     83
     84            //Warning, doing it this way adds ALL shortcodes to activity stream
     85            add_filter( 'bp_get_activity_content_body', 'do_shortcode', 1 );
     86
     87            //Warning, doing it this way adds ALL shortcodes to group forum posts
     88            add_filter( 'bp_get_the_topic_post_content', 'do_shortcode' );
     89 
     90            //Warning, doing it this way add ALL shortcodes to private messages
     91            add_filter( 'bp_get_the_thread_message_content', 'do_shortcode' );
     92        }
    10393    }
    10494
     
    316306    }   
    317307
    318     // video shortcode - by Anton Channing
    319     function shortcode_video( $atts = array(), $content = NULL ) {
    320         global $VipersVideoQuicktags;
    321         if("" === $content) return __('No video');
    322 
    323         if(class_exists('VipersVideoQuicktags')) {
    324             // Viper's Video Quicktags installed, let it handle video.
    325             // If content is a url, work out which shortcode to emulate
    326             if(false !== strpos($content,'youtube.com')) return $VipersVideoQuicktags->shortcode_youtube($atts, $content);
    327             if(false !== strpos($content,'video.google')) return $VipersVideoQuicktags->shortcode_googlevideo($atts, $content);
    328             if(false !== strpos($content,'dailymotion.com')) return $VipersVideoQuicktags->shortcode_dailymotion($atts, $content);
    329             if(false !== strpos($content,'vimeo.com')) return $VipersVideoQuicktags->shortcode_vimeo($atts, $content);
    330             if(false !== strpos($content,'veoh.com')) return $VipersVideoQuicktags->shortcode_veoh($atts, $content);
    331             if(false !== strpos($content,'metacafe.com')) return $VipersVideoQuicktags->shortcode_metacafe($atts, $content);
    332             if(false !== strpos($content,'flickr.com')) return $VipersVideoQuicktags->shortcode_flickrvideo($atts, $content);
    333             if(false !== strpos($content,'ifilm.com')) return $VipersVideoQuicktags->shortcode_ifilm($atts, $content);
    334             if(false !== strpos($content,'spike.com')) return $VipersVideoQuicktags->shortcode_ifilm($atts, $content);
    335             if(false !== strpos($content,'myspace.com')) return $VipersVideoQuicktags->shortcode_myspace($atts, $content);
    336             if(false !== strpos($content,'myspacetv.com')) return $VipersVideoQuicktags->shortcode_myspace($atts, $content);
    337             //Otherwise we have no choice but to assume its a plain old video file and support
    338             //it in the way Viper originally did.
    339             return $VipersVideoQuicktags->shortcode_videofile($atts, $content);
    340         } else {
    341             // Viper's Video Quicktags not installed, so handle these ourselves best we can
    342             if(false !== strpos($content,'youtube.com')) {
    343                 $url_bits = parse_url($content);
    344                 $qs_bits = explode('&',$url_bits['query']);
    345 
    346                 $qs=array();
    347                 foreach($qs_bits as $qs_bit) {
    348                     $qs_part = explode('=',$qs_bit);
    349                     $qs[$qs_part[0]] = $qs_part[1];
    350                 }
    351                 return $this->shortcode_youtube($atts, $qs['v']);
    352             }
    353             if(false !== strpos($content,'video.google')) {
    354                 $url_bits = parse_url($content);
    355                 $qs_bits = explode('&',$url_bits['query']);
    356 
    357                 $qs=array();
    358                 foreach($qs_bits as $qs_bit) {
    359                     $qs_part = explode('=',$qs_bit);
    360                     $qs[$qs_part[0]] = $qs_part[1];
    361                 }
    362                 return $this->shortcode_gvideo($atts, $qs['docId']);
    363             }
    364             if("" === $content) return __('Unsupported video type');
    365         }
    366 
    367     }   
    368 
    369        
    370308    // bOingball - Spoiler - modded by Anton Channing
    371309    function shortcode_spoiler( $atts = array(), $content = NULL ) {
Note: See TracChangeset for help on using the changeset viewer.