rtMedia for WordPress, BuddyPress and bbPress - Version 2.13.2

Version Description

  • Adds parameter to include/exclude media title in shortcode
  • Resolved admin menu warnings for members
Download this release

Release Info

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

Code changes from version 2.13.1 to 2.13.2

app/assets/js/main.js CHANGED
@@ -304,7 +304,8 @@ jQuery(document).ready(function(){
304
  action: 'bp_media_load_more_sc',
305
  page: parseInt($this.attr('data-page'))+1,
306
  media:$this.attr('data-media'),
307
- count:$this.attr('data-count')
 
308
  };
309
  jQuery.get(bp_media_vars.ajaxurl, data, function(response) {
310
  if(response.length==0) {
304
  action: 'bp_media_load_more_sc',
305
  page: parseInt($this.attr('data-page'))+1,
306
  media:$this.attr('data-media'),
307
+ count:$this.attr('data-count'),
308
+ title:$this.attr('data-title')
309
  };
310
  jQuery.get(bp_media_vars.ajaxurl, data, function(response) {
311
  if(response.length==0) {
app/main/includes/BPMediaActions.php CHANGED
@@ -690,6 +690,7 @@ class BPMediaActions {
690
  $page = isset($_GET['page']) ? $_GET['page'] : die();
691
  $type = isset($_GET['media']) ? $_GET['media'] : 'all';
692
  $count = isset($_GET['count']) ? $_GET['count'] : 1;
 
693
 
694
  $value = 0;
695
  if (is_user_logged_in()) {
@@ -710,6 +711,13 @@ class BPMediaActions {
710
  'meta_query' => $privacy_query,
711
  'posts_per_page' => $count
712
  );
 
 
 
 
 
 
 
713
  if ($type != 'all')
714
  $args['post_mime_type'] = $type;
715
  $bp_media_widget_query = new WP_Query($args);
@@ -718,7 +726,7 @@ class BPMediaActions {
718
  $bp_media_widget_query->the_post();
719
  try {
720
  $entry = new BPMediaHostWordpress(get_the_ID());
721
- echo $entry->get_media_gallery_content();
722
  } catch (Exception $e) {
723
  echo '<li>';
724
  echo $e->getMessage();
@@ -1127,6 +1135,7 @@ class BPMediaActions {
1127
  global $bp_media;
1128
  extract(shortcode_atts(array(
1129
  'type' => 'all',
 
1130
  'count' => $bp_media->options['default_count'] ? $bp_media->options['default_count'] : 10,
1131
  'loadmore' => true
1132
  ), $atts));
@@ -1155,8 +1164,13 @@ class BPMediaActions {
1155
  $paged = get_query_var('paged') ? get_query_var('paged') : 1;
1156
  $args['paged'] = $paged;
1157
  }
1158
-
1159
-
 
 
 
 
 
1160
  $type = str_replace(array('music', 'photos'), array('audio', 'image'), $type);
1161
 
1162
  if ($type != 'all')
@@ -1170,7 +1184,7 @@ class BPMediaActions {
1170
  $query->the_post();
1171
  try {
1172
  $entry = new BPMediaHostWordpress(get_the_ID());
1173
- $markup .= $entry->get_media_gallery_content(false, false);
1174
  } catch (Exception $e) {
1175
  $markup .= '<li>';
1176
  $markup .= $e->getMessage();
@@ -1183,7 +1197,7 @@ class BPMediaActions {
1183
  $markup .= '</div>';
1184
  $loadmore = strtolower($loadmore);
1185
  if ($loadmore != 'false' && $loadmore != '0' && $loadmore != 'no' && $count != -1) {
1186
- $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>';
1187
  }
1188
  } else {
1189
  $markup .= __('No media found', 'buddypress-media');
690
  $page = isset($_GET['page']) ? $_GET['page'] : die();
691
  $type = isset($_GET['media']) ? $_GET['media'] : 'all';
692
  $count = isset($_GET['count']) ? $_GET['count'] : 1;
693
+ $title = isset($_GET['title']) ? $_GET['title'] : 1;
694
 
695
  $value = 0;
696
  if (is_user_logged_in()) {
711
  'meta_query' => $privacy_query,
712
  'posts_per_page' => $count
713
  );
714
+
715
+ $title = strtolower($title);
716
+ if ($title != 'false' && $title != '0' && $title != 'no')
717
+ $title = true;
718
+ else
719
+ $title = false;
720
+
721
  if ($type != 'all')
722
  $args['post_mime_type'] = $type;
723
  $bp_media_widget_query = new WP_Query($args);
726
  $bp_media_widget_query->the_post();
727
  try {
728
  $entry = new BPMediaHostWordpress(get_the_ID());
729
+ echo $entry->get_media_gallery_content(false,true,$title);
730
  } catch (Exception $e) {
731
  echo '<li>';
732
  echo $e->getMessage();
1135
  global $bp_media;
1136
  extract(shortcode_atts(array(
1137
  'type' => 'all',
1138
+ 'title' => true,
1139
  'count' => $bp_media->options['default_count'] ? $bp_media->options['default_count'] : 10,
1140
  'loadmore' => true
1141
  ), $atts));
1164
  $paged = get_query_var('paged') ? get_query_var('paged') : 1;
1165
  $args['paged'] = $paged;
1166
  }
1167
+
1168
+ $title = strtolower($title);
1169
+ if ($title != 'false' && $title != '0' && $title != 'no')
1170
+ $title = true;
1171
+ else
1172
+ $title = false;
1173
+
1174
  $type = str_replace(array('music', 'photos'), array('audio', 'image'), $type);
1175
 
1176
  if ($type != 'all')
1184
  $query->the_post();
1185
  try {
1186
  $entry = new BPMediaHostWordpress(get_the_ID());
1187
+ $markup .= $entry->get_media_gallery_content(false, false, $title);
1188
  } catch (Exception $e) {
1189
  $markup .= '<li>';
1190
  $markup .= $e->getMessage();
1197
  $markup .= '</div>';
1198
  $loadmore = strtolower($loadmore);
1199
  if ($loadmore != 'false' && $loadmore != '0' && $loadmore != 'no' && $count != -1) {
1200
+ $markup .= '<div class="bp-media-actions"><button data-title="' .($title?'true':'false') . '" data-media="' . $type . '" data-count="' . $count . '" data-page="' . $paged . '" class="button" id="bp-media-show-more-sc">Show More</button></div>';
1201
  }
1202
  } else {
1203
  $markup .= __('No media found', 'buddypress-media');
app/main/includes/BPMediaHostWordpress.php CHANGED
@@ -471,7 +471,7 @@ class BPMediaHostWordpress {
471
  * @global type $bp_media
472
  * @return boolean
473
  */
474
- function get_media_gallery_content($move = false, $echo = true) {
475
  $attachment = $this->id;
476
  $markup = '';
477
  switch ($this->type) {
@@ -488,12 +488,14 @@ class BPMediaHostWordpress {
488
  $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
489
  $markup .= '<img src="' . apply_filters("bp_media_video_thumb", $thumb_url, $attachment, $this->type) . '" />';
490
  $markup .= '</a>';
491
- $markup .= '<h3 title="' . $this->name . '">';
492
- if ($move) {
493
- $markup .= '<input type="checkbox" name="move" value="' . $this->id . '" />';
 
 
 
 
494
  }
495
- $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">' . $this->name . '</a>';
496
- $markup .= '</h3>';
497
  $markup .= '</li>';
498
  break;
499
  case 'audio' :
@@ -510,12 +512,14 @@ class BPMediaHostWordpress {
510
  $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
511
  $markup .= '<img src="' . $thumb_url . '" />';
512
  $markup .= '</a>';
513
- $markup .= '<h3 title="' . $this->name . '">';
514
- if ($move) {
515
- $markup .= '<input type="checkbox" name="move" value="' . $this->id . '" />';
 
 
 
 
516
  }
517
- $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">' . $this->name . '</a>';
518
- $markup .= '</h3>';
519
  $markup .= '<div class="bp-media-ajax-preloader"></div>';
520
  $markup .= '</li>';
521
  break;
@@ -529,12 +533,14 @@ class BPMediaHostWordpress {
529
  $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
530
  $markup .= '<img src="' . $medium_path . '" />';
531
  $markup .= '</a>';
532
- $markup .= '<h3 title="' . $this->name . '">';
533
- if ($move) {
534
- $markup .= '<input type="checkbox" name="move" value="' . $this->id . '" />';
 
 
 
 
535
  }
536
- $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">' . $this->name . '</a>';
537
- $markup .= '</h3>';
538
  $markup .= '<div class="bp-media-ajax-preloader"></div>';
539
  $markup .= '</li>';
540
  break;
@@ -567,7 +573,7 @@ class BPMediaHostWordpress {
567
  function show_comment_form() {
568
  global $bp_media;
569
  $activity_id = get_post_meta($this->id, 'bp_media_child_activity', true);
570
- if (!$activity_id || !function_exists('bp_has_activities'))
571
  return false;
572
  if (bp_has_activities(array(
573
  'display_comments' => 'stream',
@@ -972,25 +978,25 @@ class BPMediaHostWordpress {
972
  case 'video' :
973
  $this->url = trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . $this->id);
974
  $this->edit_url = trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_VIDEOS_EDIT_SLUG . '/' . $this->id);
975
- $this->delete_url = wp_nonce_url(trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id),'bp-media-delete-'.$this->id);
976
  $this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail', true);
977
  break;
978
  case 'audio' :
979
  $this->url = trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . $this->id);
980
  $this->edit_url = trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_AUDIO_EDIT_SLUG . '/' . $this->id);
981
- $this->delete_url = wp_nonce_url(trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id),'bp-media-delete-'.$this->id);
982
  $this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail', true);
983
  break;
984
  case 'image' :
985
  $this->url = trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . $this->id);
986
  $this->edit_url = trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_IMAGES_EDIT_SLUG . '/' . $this->id);
987
- $this->delete_url = wp_nonce_url(trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id),'bp-media-delete-'.$this->id);
988
  $this->thumbnail_id = $this->id;
989
  break;
990
  case 'album' :
991
  $this->url = trailingslashit($pre_url . BP_MEDIA_ALBUMS_SLUG . '/' . $this->id);
992
  $this->edit_url = trailingslashit($pre_url . BP_MEDIA_ALBUMS_SLUG . '/' . BP_MEDIA_ALBUMS_EDIT_SLUG . '/' . $this->id);
993
- $this->delete_url = wp_nonce_url(trailingslashit($pre_url . BP_MEDIA_ALBUMS_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id),'bp-media-delete-'.$this->id);
994
  // $this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail', true);
995
  break;
996
  default :
471
  * @global type $bp_media
472
  * @return boolean
473
  */
474
+ function get_media_gallery_content($move = false, $echo = true, $title = true) {
475
  $attachment = $this->id;
476
  $markup = '';
477
  switch ($this->type) {
488
  $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
489
  $markup .= '<img src="' . apply_filters("bp_media_video_thumb", $thumb_url, $attachment, $this->type) . '" />';
490
  $markup .= '</a>';
491
+ if ($title) {
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
  }
 
 
499
  $markup .= '</li>';
500
  break;
501
  case 'audio' :
512
  $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
513
  $markup .= '<img src="' . $thumb_url . '" />';
514
  $markup .= '</a>';
515
+ if ($title) {
516
+ $markup .= '<h3 title="' . $this->name . '">';
517
+ if ($move) {
518
+ $markup .= '<input type="checkbox" name="move" value="' . $this->id . '" />';
519
+ }
520
+ $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">' . $this->name . '</a>';
521
+ $markup .= '</h3>';
522
  }
 
 
523
  $markup .= '<div class="bp-media-ajax-preloader"></div>';
524
  $markup .= '</li>';
525
  break;
533
  $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">';
534
  $markup .= '<img src="' . $medium_path . '" />';
535
  $markup .= '</a>';
536
+ if ($title) {
537
+ $markup .= '<h3 title="' . $this->name . '">';
538
+ if ($move) {
539
+ $markup .= '<input type="checkbox" name="move" value="' . $this->id . '" />';
540
+ }
541
+ $markup .= '<a href="' . $this->url . '" title="' . $this->description . '">' . $this->name . '</a>';
542
+ $markup .= '</h3>';
543
  }
 
 
544
  $markup .= '<div class="bp-media-ajax-preloader"></div>';
545
  $markup .= '</li>';
546
  break;
573
  function show_comment_form() {
574
  global $bp_media;
575
  $activity_id = get_post_meta($this->id, 'bp_media_child_activity', true);
576
+ if (!$activity_id || !function_exists('bp_has_activities'))
577
  return false;
578
  if (bp_has_activities(array(
579
  'display_comments' => 'stream',
978
  case 'video' :
979
  $this->url = trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . $this->id);
980
  $this->edit_url = trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_VIDEOS_EDIT_SLUG . '/' . $this->id);
981
+ $this->delete_url = wp_nonce_url(trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id), 'bp-media-delete-' . $this->id);
982
  $this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail', true);
983
  break;
984
  case 'audio' :
985
  $this->url = trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . $this->id);
986
  $this->edit_url = trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_AUDIO_EDIT_SLUG . '/' . $this->id);
987
+ $this->delete_url = wp_nonce_url(trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id), 'bp-media-delete-' . $this->id);
988
  $this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail', true);
989
  break;
990
  case 'image' :
991
  $this->url = trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . $this->id);
992
  $this->edit_url = trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_IMAGES_EDIT_SLUG . '/' . $this->id);
993
+ $this->delete_url = wp_nonce_url(trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id), 'bp-media-delete-' . $this->id);
994
  $this->thumbnail_id = $this->id;
995
  break;
996
  case 'album' :
997
  $this->url = trailingslashit($pre_url . BP_MEDIA_ALBUMS_SLUG . '/' . $this->id);
998
  $this->edit_url = trailingslashit($pre_url . BP_MEDIA_ALBUMS_SLUG . '/' . BP_MEDIA_ALBUMS_EDIT_SLUG . '/' . $this->id);
999
+ $this->delete_url = wp_nonce_url(trailingslashit($pre_url . BP_MEDIA_ALBUMS_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id), 'bp-media-delete-' . $this->id);
1000
  // $this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail', true);
1001
  break;
1002
  default :
app/services/BPMediaEncoding.php CHANGED
@@ -79,9 +79,11 @@ class BPMediaEncoding {
79
  public function menu() {
80
  add_submenu_page('bp-media-settings', __('BuddyPress Media Audio/Video Encoding Service', 'buddypress-media'), __('Audio/Video Encoding', 'buddypress-media'), 'manage_options', 'bp-media-encoding', array($this, 'encoding_page'));
81
  global $submenu;
82
- $menu = $submenu['bp-media-settings'];
83
- $encoding_menu = array_pop($menu);
84
- $submenu['bp-media-settings'] = array_merge(array_slice($menu, 0, 1), array($encoding_menu), array_slice($menu, 1));
 
 
85
  }
86
 
87
  /**
79
  public function menu() {
80
  add_submenu_page('bp-media-settings', __('BuddyPress Media Audio/Video Encoding Service', 'buddypress-media'), __('Audio/Video Encoding', 'buddypress-media'), 'manage_options', 'bp-media-encoding', array($this, 'encoding_page'));
81
  global $submenu;
82
+ if ( isset($submenu['bp-media-settings']) ) {
83
+ $menu = $submenu['bp-media-settings'];
84
+ $encoding_menu = array_pop($menu);
85
+ $submenu['bp-media-settings'] = array_merge(array_slice($menu, 0, 1), array($encoding_menu), array_slice($menu, 1));
86
+ }
87
  }
88
 
89
  /**
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.13.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
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.13.2
7
  Author: rtCamp
8
  Text Domain: buddypress-media
9
  Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
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.13.1
10
 
11
  Adds Photos, Music, Videos & Albums to BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
12
 
@@ -120,6 +120,10 @@ Please visit [BuddyPress Media's Features page](http://rtcamp.com/buddypress-med
120
 
121
  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.
122
 
 
 
 
 
123
  = 2.13.1 =
124
  * Fixes bug in navigation
125
  * Fixes bug in admin menu
@@ -405,5 +409,5 @@ Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-medi
405
  * HTML5 Video Tag Support (with fallback)
406
 
407
  == Upgrade Notice ==
408
- = 2.13.1 =
409
- Bug fixes for audio/video encoding service and others
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.13.2
10
 
11
  Adds Photos, Music, Videos & Albums to BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
12
 
120
 
121
  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.
122
 
123
+ = 2.13.2 =
124
+ * Adds parameter to include/exclude media title in shortcode
125
+ * Resolved admin menu warnings for members
126
+
127
  = 2.13.1 =
128
  * Fixes bug in navigation
129
  * Fixes bug in admin menu
409
  * HTML5 Video Tag Support (with fallback)
410
 
411
  == Upgrade Notice ==
412
+ = 2.13.2 =
413
+ Bug fixes and shortcode enhancements