Changeset 1147

Show
Ignore:
Timestamp:
06/23/08 08:51:35 (2 months ago)
Author:
naden
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bbvideo/trunk/admin.php

    r953 r1147  
    11<?php 
    22/* 
    3 BBVideo Plugin v0.22 admin template 
     3BBVideo Plugin v0.23 admin template 
    44http://www.naden.de/blog/bbvideo-bbpress-video-plugin 
    55*/ 
     
    99  $this->SaveOptions( 
    1010    array( 
    11       'embed' => intval( $_POST[ 'embed' ] ) 
     11      'embed' => intval( $_POST[ 'embed' ] ), 
     12      'download' => intval( $_POST[ 'download' ] ) 
    1213    ) 
    1314  ); 
     
    2223<p> 
    2324<h4>Embed:</h4> 
    24 <label for"embed">Zeige Embed Optionen unter den Videos. / Show embed field below the videos.</label> 
     25<label for="embed">Zeige Embed Optionen unter den Videos. / Show embed field below the videos.</label> 
    2526<p> 
    2627<input type="radio" name="embed" value="1" <?php print( $this->options[ 'embed' ] == 1 ? ' checked="checked"' : '' ); ?>/> Ja 
    2728<input type="radio" name="embed" value="0" <?php print( $this->options[ 'embed' ] == 0 ? ' checked="checked"' : '' ); ?>/> Nein 
     29</p> 
     30</p> 
     31<p> 
     32<h4>Download:</h4> 
     33<label for="download">Zeige Download-Link unter den Videos. / Show download link field below the videos.</label> 
     34<p> 
     35<input type="radio" name="download" value="1" <?php print( $this->options[ 'download' ] == 1 ? ' checked="checked"' : '' ); ?>/> Ja 
     36<input type="radio" name="download" value="0" <?php print( $this->options[ 'download' ] == 0 ? ' checked="checked"' : '' ); ?>/> Nein 
    2837</p> 
    2938</p> 
  • bbvideo/trunk/bbvideo.php

    r953 r1147  
    66Author: Naden Badalgogtapeh 
    77Author URI: http://www.naden.de/blog 
    8 Version: 0.22 
     8Version: 0.23 
    99*/ 
    1010 
     
    4444  function BBPressPluginBBVideo() 
    4545  { 
    46     $this->version = '0.22'; 
     46    $this->version = '0.23'; 
    4747     
    4848    $this->wp_filter_id = 'bbvideo'; 
    4949 
    50         $this->index = 0; 
     50          $this->index = 0; 
    5151 
    5252    $this->options = bb_get_option( 'bbvideo_options' ); 
     
    5555    { 
    5656      $this->SaveOptions( array( 'embed' => 1 ), false ); 
     57    } 
     58 
     59    if( !array_key_exists( 'download', $this->options ) ) 
     60    { 
     61      $this->options[ 'download' ] = 1; 
     62 
     63      $this->SaveOptions( $this->options, false ); 
    5764    } 
    5865     
     
    180187           
    181188          $url = sprintf( '<a href="http://www.naden.de/blog/bbvideo-bbpress-video-plugin" style="color:#aaa;text-decoration:underline;">%s</a>', $this->GetTitle( get_topic_title() ) ); 
     189           
     190          if( $this->options[ 'download' ] == 1 ) 
     191          { 
     192            $download = sprintf( '<a style="color: #000;" href="http://www.degrab.de/?url=%s" target="_blank">Video Download</a>', urlencode( $link ) ); 
     193          }             
    182194 
    183195          if( $this->options[ 'embed' ] == 1 ) 
    184196          { 
     197 
    185198            $post_title = str_replace( "'", '', get_topic_title() ); 
    186199            $post_link  = get_topic_link(); 
    187              
     200 
     201            if( isset( $download ) ) 
     202            { 
     203              $download = ' | ' . $download; 
     204            }             
     205 
    188206            $code = <<<DATA 
    189207            <!-- bbVideo Plugin v{$this->version} - http://www.naden.de/blog/bbvideo-bbpress-video-plugin --> 
    190208            <div style="width:{$provider[ 'width' ]}px;">{$code}<div> 
    191209            <table width="100%" cellpadding="0" cellspacing="0" border="0"> 
    192             <tr><td><a href="" id="bbvideo{$this->index}" onclick="javascript:return(bbvideo_embed(this));" style="color: #000;">[+] Embed the video</a></td><td align="right" style="color:#aaa;font-size:80%;">Get the {$url}</td></tr></table> 
     210            <tr><td><a href="" id="bbvideo{$this->index}" onclick="javascript:return(bbvideo_embed(this));" style="color: #000;">[+] Embed the video</a>{$download}</td><td align="right" style="color:#aaa;font-size:80%;">Get the {$url}</td></tr></table> 
    193211   
    194212            <div id="bbvideo{$this->index}embed" style="display:none;"> 
     
    204222          } 
    205223          else 
    206           {           
    207             $code = "<div style=\"width:{$provider[ 'width' ]}px;\">{$code}<div align=\"right\" style=\"color:#aaa;font-size:80%;\">Get the {$url}</div></div>"; 
     224          { 
     225            if( isset( $download ) ) 
     226            { 
     227              $download = '<td>' . $download . '</td>'; 
     228            } 
     229 
     230            $code = <<<DATA 
     231            <div style="width:{$provider[ 'width' ]}px;">{$code} 
     232            <table width="100%" cellpadding="0" cellspacing="0" border="0"> 
     233            <tr>{$download}<td align="right" style="color:#aaa;font-size:80%;">Get the {$url}</td></tr> 
     234            </table> 
     235            </div> 
     236DATA; 
    208237          }  
    209238 
  • bbvideo/trunk/provider.inc.php

    r934 r1147  
    11<?php 
    22/* 
    3 BBVideo Plugin v0.1 definition file 
     3BBVideo Plugin v0.23 definition file 
    44http://www.naden.de/blog/bbvideo-bbpress-video-plugin 
    55*/ 
     
    2020+ clipfish 
    2121+ gametrailers 
     22+ vimeo 
    2223*/ 
    2324 
     
    2627                'width' => '425', 
    2728                'height' => '350', 
    28 #               'pattern' => 'youtube\.(.*)/v(=|\/)([a-zA-Z0-9_-]*)', 
    2929                'pattern' => 'youtube\.(.*)/watch\?v=([a-zA-Z0-9_-]*)', 
    3030                'index' => 2, 
    31 #    'code' => "<object width='[WIDTH]' height='[HEIGHT]'><param name='movie' value='http://www.youtube.com/v/[ID]&rel=1'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/[ID]&rel=1' type='application/x-shockwave-flash' wmode='transparent' width='[WIDTH]' height='[HEIGHT]'></embed></object>", 
    3231                'code' => '<object width="[WIDTH]" height="[HEIGHT]"><param name="movie" value="http://www.youtube.com/v/[ID]&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/[ID]&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="[WIDTH]" height="[HEIGHT]"></embed></object>', 
    3332                'page_url' => 'http://www.youtube.com' 
     
    10099                'width' => '425', 
    101100                'height' => '350', 
    102 #    'pattern' => 'video\.google\.(.*)/([url|videoplay].?)\?docid=([a-zA-Z0-9_-]*)', 
    103101    'pattern' => 'video\.google\.(.*)/(videoplay)?(url)?\?docid=([a-zA-Z0-9_-]*)', 
    104102                'index' => 1, 
     
    129127                'code' => '<embed src="http://www.clipfish.de/videoplayer.swf?as=0&videoid=[ID]&r=1" quality="high" bgcolor="#cacaca" width="[WIDTH]" height="[HEIGHT]" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>', 
    130128                'page_url' => 'http://www.clipfish.de' 
     129        ), 
     130        'vimeo' => array( 
     131                'width' => '425', 
     132                'height' => '350', 
     133                'pattern' => 'vimeo\.com/([0-9]*)', 
     134                'index' => 1, 
     135                'code' => '<object width="[WIDTH]" height="[HEIGHT]"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=[ID]&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=[ID]&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="[WIDTH]" height="[HEIGHT]"></embed></object>', 
     136                'page_url' => 'http://www.vimeo.com' 
    131137        ) 
    132138); 
  • bbvideo/trunk/readme.txt

    r935 r1147  
    11=== bbVideo === 
    2 Tags: video, embed, embedding, embedded, multimedia, film, media, videos, youtube, flashvideo, flashvideos 
     2Tags: video, embed, embedding, embedded, multimedia, film, media, videos, youtube, flashvideo, flashvideos, vimeo, myvideo, clipfish, video download 
    33Contributors: Naden Badalgogtapeh 
    44Requires at least: 0.8.3 
     
    1010== Description == 
    1111 
    12 This plugin converts all links to knowen videos portals to the matching embedded players and supports the reader with easy sharing options
     12This plugin converts all links to knowen videos portals to the matching embedded players and supports the reader with easy sharing options and video downloading capabilities
    1313 
    1414== Installation == 
     
    2222But! You can add the following snippet to 'topic.php' just below '<?php post_form(); ?>' to have a list of video providers displayed the poster can use. 
    2323 
    24 <?php 
     24<code> 
    2525global $BBPressPluginBBVideo; 
    2626if( isset( $BBPressPluginBBVideo ) && !is_null( $BBPressPluginBBVideo ) ) 
     
    2929        $BBPressPluginBBVideo->DisplayProvider(); 
    3030} 
    31 ?
     31</code
    3232 
    3333== Frequently Asked Questions ==