rtMedia for WordPress, BuddyPress and bbPress - Version 2.10.1

Version Description

  • Fixes bug in shortcode
Download this release

Release Info

Developer JoshuaAbenazer
Plugin Icon 128x128 rtMedia for WordPress, BuddyPress and bbPress
Version 2.10.1
Comparing to
See all releases

Code changes from version 2.10 to 2.10.1

app/main/includes/BPMediaActions.php CHANGED
@@ -1128,10 +1128,8 @@ class BPMediaActions {
1128
  )
1129
  );
1130
 
1131
- $paged = get_query_var('paged') ? get_query_var('paged') : 1;
1132
 
1133
  $args = array(
1134
- 'paged' => $paged,
1135
  'post_type' => 'attachment',
1136
  'post_type' => 'attachment',
1137
  'post_status' => 'any',
@@ -1139,38 +1137,45 @@ class BPMediaActions {
1139
  'posts_per_page' => $count
1140
  );
1141
 
1142
- $type = str_replace(array('music', 'photos'),array('audio','image'),$type);
 
 
 
1143
 
 
 
 
1144
  if ($type != 'all')
1145
  $args['post_mime_type'] = $type;
1146
  $query = new WP_Query($args);
 
1147
  if ($query->have_posts()) {
1148
- ?>
1149
- <div id="item-body" class="bp-media-sc-list">
1150
- <ul class="bp-media-gallery item-list"><?php
1151
  while ($query->have_posts()) {
1152
  $query->the_post();
1153
  try {
1154
  $entry = new BPMediaHostWordpress(get_the_ID());
1155
- echo $entry->get_media_gallery_content();
1156
  } catch (Exception $e) {
1157
- echo '<li>';
1158
- echo $e->getMessage();
1159
- echo '<h3>' . __('Private', 'buddypress-media') . '</h3>';
1160
- echo '</li>';
1161
  }
1162
  }
1163
- ?>
1164
- </ul>
1165
- </div><?php
1166
  $loadmore = strtolower($loadmore);
1167
- if ( $loadmore != 'false' && $loadmore != '0' && $loadmore != 'no' ) { ?>
1168
- <div class="bp-media-actions"><button data-media="<?php echo $type; ?>" data-count="<?php echo $count; ?>" data-page="<?php echo $count; ?>" class="button" id="bp-media-show-more-sc">Show More</button></div><?php
1169
  }
1170
  } else {
1171
- _e('No media found', 'buddypress-media');
1172
  }
1173
  wp_reset_query();
 
1174
  }
1175
 
1176
  }
1128
  )
1129
  );
1130
 
 
1131
 
1132
  $args = array(
 
1133
  'post_type' => 'attachment',
1134
  'post_type' => 'attachment',
1135
  'post_status' => 'any',
1137
  'posts_per_page' => $count
1138
  );
1139
 
1140
+ if ($count != -1) {
1141
+ $paged = get_query_var('paged') ? get_query_var('paged') : 1;
1142
+ $args['paged'] = $paged;
1143
+ }
1144
 
1145
+
1146
+ $type = str_replace(array('music', 'photos'), array('audio', 'image'), $type);
1147
+
1148
  if ($type != 'all')
1149
  $args['post_mime_type'] = $type;
1150
  $query = new WP_Query($args);
1151
+ $markup = '';
1152
  if ($query->have_posts()) {
1153
+ $markup .= '<div id="item-body" class="bp-media-sc-list">';
1154
+ $markup .= '<ul class="bp-media-gallery item-list">';
 
1155
  while ($query->have_posts()) {
1156
  $query->the_post();
1157
  try {
1158
  $entry = new BPMediaHostWordpress(get_the_ID());
1159
+ $markup .= $entry->get_media_gallery_content(false, false);
1160
  } catch (Exception $e) {
1161
+ $markup .= '<li>';
1162
+ $markup .= $e->getMessage();
1163
+ $markup .= '<h3>' . __('Private', 'buddypress-media') . '</h3>';
1164
+ $markup .= '</li>';
1165
  }
1166
  }
1167
+
1168
+ $markup .= '</ul>';
1169
+ $markup .= '</div>';
1170
  $loadmore = strtolower($loadmore);
1171
+ if ($loadmore != 'false' && $loadmore != '0' && $loadmore != 'no' && $count != -1) {
1172
+ $markup .= '<div class="bp-media-actions"><button data-media="' . $type . '" data-count="' . $count . '" data-page="' . $paged . '" class="button" id="bp-media-show-more-sc">Show More</button></div>';
1173
  }
1174
  } else {
1175
+ $markup .= __('No media found', 'buddypress-media');
1176
  }
1177
  wp_reset_query();
1178
+ return $markup;
1179
  }
1180
 
1181
  }
app/main/includes/BPMediaHostWordpress.php CHANGED
@@ -261,7 +261,7 @@ class BPMediaHostWordpress {
261
  if (in_array($this->type, array('image', 'video', 'audio'))) {
262
  if ($this->thumbnail_id) {
263
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
264
- $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail'])?'bp_media_thumbnail':'thumbnail';
265
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
266
  $thumb_url = $medium_array[0];
267
  } else {
@@ -295,13 +295,13 @@ class BPMediaHostWordpress {
295
  case 'video' :
296
  if ($this->thumbnail_id) {
297
  $image_array = image_downsize($this->thumbnail_id, 'bp_media_activity_image');
298
- $activity_content.=apply_filters('bp_media_single_activity_filter', '<video poster="' . $image_array[0] . '" src="' . wp_get_attachment_url($attachment_id) . '" width="'.$default_size['video']['medium']['width'].'" height="'.$default_size['video']['medium']['height'].'" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span>', $this, true);
299
  } else {
300
- $activity_content.=apply_filters('bp_media_single_activity_filter', '<video src="' . wp_get_attachment_url($attachment_id) . '" width="'.$default_size['video']['medium']['width'].'" height="'.$default_size['video']['medium']['height'].'" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span>', $this, true);
301
  }
302
  break;
303
  case 'audio' :
304
- $activity_content.=apply_filters('bp_media_single_activity_filter', '<audio src="' . wp_get_attachment_url($attachment_id) . '" width="'.$default_size['audio']['medium']['width'].'" type="audio/mp3" id="bp_media_audio_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none" ></audio></span>', $this, true);
305
  break;
306
  case 'image' :
307
  $image_array = image_downsize($attachment_id, 'bp_media_activity_image');
@@ -472,82 +472,80 @@ class BPMediaHostWordpress {
472
  * @global type $bp_media
473
  * @return boolean
474
  */
475
- function get_media_gallery_content($move=false) {
476
  $attachment = $this->id;
 
477
  switch ($this->type) {
478
  case 'video' :
479
  if ($this->thumbnail_id) {
480
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
481
- $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail'])?'bp_media_thumbnail':'thumbnail';
482
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
483
  $thumb_url = $medium_array[0];
484
  } else {
485
  $thumb_url = BP_MEDIA_URL . 'app/assets/img/video_thumb.png';
486
  }
487
- ?>
488
- <li id="bp-media-item-<?php echo $this->id ?>">
489
- <a href="<?php echo $this->url ?>" title="<?php _e($this->description, 'buddypress-media'); ?>">
490
- <img src="<?php echo apply_filters('bp_media_video_thumb', $thumb_url, $attachment, $this->type); ?>" />
491
- </a>
492
- <h3 title="<?php echo $this->name; ?>"><?php
493
- if ( $move ) {
494
- echo '<input type="checkbox" name="move" value="'.$this->id.'" />';
495
- }
496
- ?>
497
- <a href="<?php echo $this->url ?>" title="<?php _e($this->description, 'buddypress-media'); ?>"><?php echo $this->name; ?></a>
498
- </h3>
499
- </li>
500
- <?php
501
  break;
502
  case 'audio' :
503
  if ($this->thumbnail_id) {
504
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
505
- $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail'])?'bp_media_thumbnail':'thumbnail';
506
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
507
  $thumb_url = $medium_array[0];
508
  } else {
509
  $thumb_url = BP_MEDIA_URL . 'app/assets/img/audio_thumb.png';
510
  }
511
- ?>
512
- <li id="bp-media-item-<?php echo $this->id; ?>">
513
- <a href="<?php echo $this->url ?>" title="<?php _e($this->description, 'buddypress-media'); ?>">
514
- <img src="<?php echo $thumb_url ?>" />
515
- </a>
516
- <h3 title="<?php echo $this->name; ?>"><?php
517
- if ( $move ) {
518
- echo '<input type="checkbox" name="move" value="'.$this->id.'" />';
519
- }
520
- ?>
521
- <a href="<?php echo $this->url ?>" title="<?php _e($this->description, 'buddypress-media'); ?>"><?php echo $this->name ?></a>
522
- </h3>
523
- <div class="bp-media-ajax-preloader"></div>
524
- </li>
525
- <?php
526
  break;
527
  case 'image' :
528
  $metadata = wp_get_attachment_metadata($attachment);
529
- $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail'])?'bp_media_thumbnail':'thumbnail';
530
  $medium_array = image_downsize($attachment, $wpattachsize);
531
  $medium_path = $medium_array[0];
532
- ?>
533
- <li id="bp-media-item-<?php echo $this->id ?>">
534
- <a href="<?php echo $this->url ?>" title="<?php echo $this->description ?>">
535
- <img src="<?php echo $medium_path ?>" />
536
- </a>
537
- <h3 title="<?php echo $this->name ?>"><?php
538
- if ( $move ) {
539
- echo '<input type="checkbox" name="move" value="'.$this->id.'" />';
540
- }
541
- ?>
542
- <a href="<?php echo $this->url ?>" title="<?php _e($this->description, 'buddypress-media'); ?>"><?php echo $this->name ?></a>
543
- </h3>
544
- <div class="bp-media-ajax-preloader"></div>
545
- </li>
546
- <?php
547
  break;
548
  default :
549
- return false;
550
  }
 
 
 
 
551
  }
552
 
553
  function show_comment_form_wordpress() {
@@ -780,7 +778,7 @@ class BPMediaHostWordpress {
780
  case 'video' :
781
  if ($this->thumbnail_id) {
782
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
783
- $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail'])?'bp_media_thumbnail':'thumbnail';
784
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
785
  $thumb_url = $medium_array[0];
786
  } else {
@@ -790,7 +788,7 @@ class BPMediaHostWordpress {
790
  case 'audio' :
791
  if ($this->thumbnail_id) {
792
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
793
- $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail'])?'bp_media_thumbnail':'thumbnail';
794
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
795
  $thumb_url = $medium_array[0];
796
  } else {
@@ -799,7 +797,7 @@ class BPMediaHostWordpress {
799
  break;
800
  case 'image' :
801
  $metadata = wp_get_attachment_metadata($attachment);
802
- $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail'])?'bp_media_thumbnail':'thumbnail';
803
  $medium_array = image_downsize($attachment, $wpattachsize);
804
  $thumb_url = $medium_array[0];
805
  break;
@@ -1020,7 +1018,7 @@ class BPMediaHostWordpress {
1020
  $create_new_album_flag = false;
1021
  if ($album_id != 0) {
1022
  $album = get_post($album_id);
1023
- if ( $author_id && $album->post_author != $author_id && $group == 0) {
1024
  $create_new_album_flag = true;
1025
  } else {
1026
  $post_id = $album->ID;
261
  if (in_array($this->type, array('image', 'video', 'audio'))) {
262
  if ($this->thumbnail_id) {
263
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
264
+ $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail']) ? 'bp_media_thumbnail' : 'thumbnail';
265
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
266
  $thumb_url = $medium_array[0];
267
  } else {
295
  case 'video' :
296
  if ($this->thumbnail_id) {
297
  $image_array = image_downsize($this->thumbnail_id, 'bp_media_activity_image');
298
+ $activity_content.=apply_filters('bp_media_single_activity_filter', '<video poster="' . $image_array[0] . '" src="' . wp_get_attachment_url($attachment_id) . '" width="' . $default_size['video']['medium']['width'] . '" height="' . $default_size['video']['medium']['height'] . '" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span>', $this, true);
299
  } else {
300
+ $activity_content.=apply_filters('bp_media_single_activity_filter', '<video src="' . wp_get_attachment_url($attachment_id) . '" width="' . $default_size['video']['medium']['width'] . '" height="' . $default_size['video']['medium']['height'] . '" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span>', $this, true);
301
  }
302
  break;
303
  case 'audio' :
304
+ $activity_content.=apply_filters('bp_media_single_activity_filter', '<audio src="' . wp_get_attachment_url($attachment_id) . '" width="' . $default_size['audio']['medium']['width'] . '" type="audio/mp3" id="bp_media_audio_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none" ></audio></span>', $this, true);
305
  break;
306
  case 'image' :
307
  $image_array = image_downsize($attachment_id, 'bp_media_activity_image');
472
  * @global type $bp_media
473
  * @return boolean
474
  */
475
+ function get_media_gallery_content($move = false, $echo = true) {
476
  $attachment = $this->id;
477
+ $markup = '';
478
  switch ($this->type) {
479
  case 'video' :
480
  if ($this->thumbnail_id) {
481
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
482
+ $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail']) ? 'bp_media_thumbnail' : 'thumbnail';
483
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
484
  $thumb_url = $medium_array[0];
485
  } else {
486
  $thumb_url = BP_MEDIA_URL . 'app/assets/img/video_thumb.png';
487
  }
488
+ $markup .= '<li id="bp-media-item-' . $this->id . '">';
489
+ $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
490
+ $markup .= '<img src="' . apply_filters("bp_media_video_thumb", $thumb_url, $attachment, $this->type) . '" />';
491
+ $markup .= '</a>';
492
+ $markup .= '<h3 title="' . $this->name . '">';
493
+ if ($move) {
494
+ $markup .= '<input type="checkbox" name="move" value="' . $this->id . '" />';
495
+ }
496
+ $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">' . $this->name . '</a>';
497
+ $markup .= '</h3>';
498
+ $markup .= '</li>';
 
 
 
499
  break;
500
  case 'audio' :
501
  if ($this->thumbnail_id) {
502
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
503
+ $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail']) ? 'bp_media_thumbnail' : 'thumbnail';
504
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
505
  $thumb_url = $medium_array[0];
506
  } else {
507
  $thumb_url = BP_MEDIA_URL . 'app/assets/img/audio_thumb.png';
508
  }
509
+
510
+ $markup .= '<li id="bp-media-item-' . $this->id . '">';
511
+ $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
512
+ $markup .= '<img src="' . $thumb_url . '" />';
513
+ $markup .= '</a>';
514
+ $markup .= '<h3 title="' . $this->name . '">';
515
+ if ($move) {
516
+ $markup .= '<input type="checkbox" name="move" value="' . $this->id . '" />';
517
+ }
518
+ $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">' . $this->name . '</a>';
519
+ $markup .= '</h3>';
520
+ $markup .= '<div class="bp-media-ajax-preloader"></div>';
521
+ $markup .= '</li>';
 
 
522
  break;
523
  case 'image' :
524
  $metadata = wp_get_attachment_metadata($attachment);
525
+ $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail']) ? 'bp_media_thumbnail' : 'thumbnail';
526
  $medium_array = image_downsize($attachment, $wpattachsize);
527
  $medium_path = $medium_array[0];
528
+
529
+ $markup .= '<li id="bp-media-item-' . $this->id . '">';
530
+ $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
531
+ $markup .= '<img src="' . $medium_path . '" />';
532
+ $markup .= '</a>';
533
+ $markup .= '<h3 title="' . $this->name . '">';
534
+ if ($move) {
535
+ $markup .= '<input type="checkbox" name="move" value="' . $this->id . '" />';
536
+ }
537
+ $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">' . $this->name . '</a>';
538
+ $markup .= '</h3>';
539
+ $markup .= '<div class="bp-media-ajax-preloader"></div>';
540
+ $markup .= '</li>';
 
 
541
  break;
542
  default :
543
+ $markup .= false;
544
  }
545
+ if ($echo)
546
+ echo $markup;
547
+ else
548
+ return $markup;
549
  }
550
 
551
  function show_comment_form_wordpress() {
778
  case 'video' :
779
  if ($this->thumbnail_id) {
780
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
781
+ $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail']) ? 'bp_media_thumbnail' : 'thumbnail';
782
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
783
  $thumb_url = $medium_array[0];
784
  } else {
788
  case 'audio' :
789
  if ($this->thumbnail_id) {
790
  $metadata = wp_get_attachment_metadata($this->thumbnail_id);
791
+ $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail']) ? 'bp_media_thumbnail' : 'thumbnail';
792
  $medium_array = image_downsize($this->thumbnail_id, $wpattachsize);
793
  $thumb_url = $medium_array[0];
794
  } else {
797
  break;
798
  case 'image' :
799
  $metadata = wp_get_attachment_metadata($attachment);
800
+ $wpattachsize = isset($metadata['sizes']['bp_media_thumbnail']) ? 'bp_media_thumbnail' : 'thumbnail';
801
  $medium_array = image_downsize($attachment, $wpattachsize);
802
  $thumb_url = $medium_array[0];
803
  break;
1018
  $create_new_album_flag = false;
1019
  if ($album_id != 0) {
1020
  $album = get_post($album_id);
1021
+ if ($author_id && $album->post_author != $author_id && $group == 0) {
1022
  $create_new_album_flag = true;
1023
  } else {
1024
  $post_id = $album->ID;
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: BuddyPress Media
4
  Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
5
  Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
6
- Version: 2.10
7
  Author: rtCamp
8
  Text Domain: buddypress-media
9
  Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
3
  Plugin Name: BuddyPress Media
4
  Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
5
  Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
6
+ Version: 2.10.1
7
  Author: rtCamp
8
  Text Domain: buddypress-media
9
  Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
languages/buddypress-media-ja_JA.mo ADDED
Binary file
readme.txt CHANGED
@@ -6,7 +6,7 @@ License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: WordPress 3.5 + BuddyPress 1.6
8
  Tested up to: WordPress 3.5 + BuddyPress 1.7
9
- Stable tag: 2.10
10
 
11
  Adds Photos, Music, Videos & Albums to BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
12
 
@@ -125,6 +125,9 @@ Please visit [BuddyPress Media's Features page](http://rtcamp.com/buddypress-med
125
 
126
  Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit BuddyPress Media's Features page") to get some details about future releases.
127
 
 
 
 
128
  = 2.10 =
129
  * Adds album management options (Merge/Move/Delete)
130
  * Adds shortcode to display media [bpmedia]
@@ -374,5 +377,5 @@ Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-medi
374
  * HTML5 Video Tag Support (with fallback)
375
 
376
  == Upgrade Notice ==
377
- = 2.10 =
378
  Adds album management options (Merge/Move/Delete), shortcode to display media
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: WordPress 3.5 + BuddyPress 1.6
8
  Tested up to: WordPress 3.5 + BuddyPress 1.7
9
+ Stable tag: 2.10.1
10
 
11
  Adds Photos, Music, Videos & Albums to BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
12
 
125
 
126
  Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit BuddyPress Media's Features page") to get some details about future releases.
127
 
128
+ = 2.10.1 =
129
+ * Fixes bug in shortcode
130
+
131
  = 2.10 =
132
  * Adds album management options (Merge/Move/Delete)
133
  * Adds shortcode to display media [bpmedia]
377
  * HTML5 Video Tag Support (with fallback)
378
 
379
  == Upgrade Notice ==
380
+ = 2.10.1 =
381
  Adds album management options (Merge/Move/Delete), shortcode to display media