Version Description
- Removed download button enable/disable settings
- Bug fixed for translation
- added support for Playlists and its required filters
Download this release
Release Info
Developer | faishal |
Plugin | rtMedia for WordPress, BuddyPress and bbPress |
Version | 3.1.6 |
Comparing to | |
See all releases |
Code changes from version 3.1.5 to 3.1.6
- app/admin/RTMediaAdmin.php +3 -3
- app/admin/RTMediaFormHandler.php +1 -10
- app/main/RTMedia.php +6 -4
- app/main/controllers/media/RTMediaMeta.php +2 -1
- app/main/controllers/template/RTMediaNav.php +3 -1
- app/main/controllers/template/RTMediaTemplate.php +7 -7
- app/main/controllers/template/rt-template-functions.php +5 -4
- app/main/routers/query/RTMediaQuery.php +16 -2
- index.php +1 -1
- readme.txt +8 -3
app/admin/RTMediaAdmin.php
CHANGED
@@ -80,8 +80,8 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
|
|
80 |
function rtmedia_advertisement(){ ?>
|
81 |
<div class='rtmedia-admin-ad'>
|
82 |
<a href='http://rtcamp.com/store/rtmedia-pro/' target='_blank' title='rtMedia Pro'>
|
83 |
-
<img src='http://rtcamp.com/wp-content/uploads/2013/09/rtMedia-pro-ad-300x300px-2-RS.png' alt='rtMedia Pro is released' />
|
84 |
-
|
85 |
</div>
|
86 |
<?php }
|
87 |
// Create the function to output the contents of our Dashboard Widget
|
@@ -104,7 +104,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
|
|
104 |
?>
|
105 |
<tr>
|
106 |
<td class = "b"> <?php echo $media->count; ?> </td>
|
107 |
-
<td class = "t"><?php
|
108 |
</tr>
|
109 |
<?php
|
110 |
}
|
80 |
function rtmedia_advertisement(){ ?>
|
81 |
<div class='rtmedia-admin-ad'>
|
82 |
<a href='http://rtcamp.com/store/rtmedia-pro/' target='_blank' title='rtMedia Pro'>
|
83 |
+
<img src='http://rtcamp.com/wp-content/uploads/2013/09/rtMedia-pro-ad-300x300px-2-RS.png' alt='rtMedia Pro is released' />
|
84 |
+
</a>
|
85 |
</div>
|
86 |
<?php }
|
87 |
// Create the function to output the contents of our Dashboard Widget
|
104 |
?>
|
105 |
<tr>
|
106 |
<td class = "b"> <?php echo $media->count; ?> </td>
|
107 |
+
<td class = "t"><?php echo constant(strtoupper('RTMEDIA_'.$media->media_type.'_PLURAL_LABEL') ); ?></td>
|
108 |
</tr>
|
109 |
<?php
|
110 |
}
|
app/admin/RTMediaFormHandler.php
CHANGED
@@ -190,15 +190,6 @@ class RTMediaFormHandler {
|
|
190 |
'desc' => __('Enable Comments in rtMedia','rtmedia')
|
191 |
)
|
192 |
),
|
193 |
-
'general_downloadButton' => array(
|
194 |
-
'title' => __('Download Button','rtmedia'),
|
195 |
-
'callback' => array('RTMediaFormHandler', 'checkbox'),
|
196 |
-
'args' => array(
|
197 |
-
'key' => 'general_downloadButton',
|
198 |
-
'value' => $options['general_downloadButton'],
|
199 |
-
'desc' => __('Display download button under media','rtmedia')
|
200 |
-
)
|
201 |
-
),
|
202 |
'general_enableLightbox' => array(
|
203 |
'title' => __('Lightbox','rtmedia'),
|
204 |
'callback' => array('RTMediaFormHandler', 'checkbox'),
|
@@ -580,4 +571,4 @@ class RTMediaFormHandler {
|
|
580 |
echo '</div>';
|
581 |
}
|
582 |
}
|
583 |
-
}
|
190 |
'desc' => __('Enable Comments in rtMedia','rtmedia')
|
191 |
)
|
192 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
'general_enableLightbox' => array(
|
194 |
'title' => __('Lightbox','rtmedia'),
|
195 |
'callback' => array('RTMediaFormHandler', 'checkbox'),
|
571 |
echo '</div>';
|
572 |
}
|
573 |
}
|
574 |
+
}
|
app/main/RTMedia.php
CHANGED
@@ -211,7 +211,7 @@ class RTMedia
|
|
211 |
|
212 |
// sanitize all the types
|
213 |
$allowed_types = $this->sanitize_allowed_types($allowed_types);
|
214 |
-
|
215 |
// set the allowed types property
|
216 |
$this->allowed_types = $allowed_types;
|
217 |
}
|
@@ -232,8 +232,9 @@ class RTMedia
|
|
232 |
|
233 |
if (!isset($type['name']) || // check if a name is set
|
234 |
empty($type['name']) ||
|
235 |
-
|
236 |
-
|
|
|
237 |
unset($allowed_types[$key]); // if not unset this type
|
238 |
continue;
|
239 |
}
|
@@ -600,7 +601,8 @@ class RTMedia
|
|
600 |
}
|
601 |
}
|
602 |
}
|
603 |
-
|
|
|
604 |
|
605 |
global $rtmedia_buddypress_activity;
|
606 |
$rtmedia_buddypress_activity = new RTMediaBuddyPressActivity();
|
211 |
|
212 |
// sanitize all the types
|
213 |
$allowed_types = $this->sanitize_allowed_types($allowed_types);
|
214 |
+
|
215 |
// set the allowed types property
|
216 |
$this->allowed_types = $allowed_types;
|
217 |
}
|
232 |
|
233 |
if (!isset($type['name']) || // check if a name is set
|
234 |
empty($type['name']) ||
|
235 |
+
//commented this section for playlist // !isset($type['extn']) || // check if file extensions are set
|
236 |
+
//commented this section for playlist // empty($type['extn']) ||
|
237 |
+
strstr($type['name'], " ") || strstr($type['name'], "_")) {
|
238 |
unset($allowed_types[$key]); // if not unset this type
|
239 |
continue;
|
240 |
}
|
601 |
}
|
602 |
}
|
603 |
}
|
604 |
+
|
605 |
+
$this->set_allowed_types(); // Define allowed types
|
606 |
|
607 |
global $rtmedia_buddypress_activity;
|
608 |
$rtmedia_buddypress_activity = new RTMediaBuddyPressActivity();
|
app/main/controllers/media/RTMediaMeta.php
CHANGED
@@ -45,7 +45,7 @@ class RTMediaMeta {
|
|
45 |
}
|
46 |
|
47 |
function add_meta($id=false,$key=false,$value=false,$duplicate=false){
|
48 |
-
$this->update_meta($id
|
49 |
}
|
50 |
|
51 |
function update_meta($id=false,$key=false,$value=false,$duplicate=false){
|
@@ -65,6 +65,7 @@ class RTMediaMeta {
|
|
65 |
$media_meta = $this->model->insert(array('media_id'=>$id,'meta_key'=>$key, 'meta_value'=>$value));
|
66 |
}
|
67 |
}
|
|
|
68 |
}
|
69 |
|
70 |
function delete_meta($id=false,$key=false){
|
45 |
}
|
46 |
|
47 |
function add_meta($id=false,$key=false,$value=false,$duplicate=false){
|
48 |
+
return $this->update_meta($id,$key,$value,$duplicate);
|
49 |
}
|
50 |
|
51 |
function update_meta($id=false,$key=false,$value=false,$duplicate=false){
|
65 |
$media_meta = $this->model->insert(array('media_id'=>$id,'meta_key'=>$key, 'meta_value'=>$value));
|
66 |
}
|
67 |
}
|
68 |
+
return $media_meta;
|
69 |
}
|
70 |
|
71 |
function delete_meta($id=false,$key=false){
|
app/main/controllers/template/RTMediaNav.php
CHANGED
@@ -146,7 +146,7 @@ class RTMediaNav {
|
|
146 |
$counts[ 'total' ][ "album" ] = $counts[ 'total' ][ "album" ] + $other_count;
|
147 |
echo apply_filters ( 'rtmedia_sub_nav_albums', '<li id="rtmedia-nav-item-albums-li" ' . $albums . '><a id="rtmedia-nav-item-albums" href="' . trailingslashit ( $link ) . RTMEDIA_MEDIA_SLUG . '/album/">' . __ ( "Albums", "rtmedia" ) . '<span>' . ((isset ( $counts[ 'total' ][ "album" ] )) ? $counts[ 'total' ][ "album" ] : 0 ) . '</span>' . '</a></li>' );
|
148 |
}
|
149 |
-
|
150 |
foreach ( $rtmedia->allowed_types as $type ) {
|
151 |
//print_r($type);
|
152 |
if ( ! $rtmedia->options[ 'allowedTypes_' . $type[ 'name' ] . '_enabled' ] )
|
@@ -193,6 +193,8 @@ class RTMediaNav {
|
|
193 |
. $type[ 'plural_label' ] . '<span>' . ((isset ( $counts[ 'total' ][ $type[ 'name' ] ] )) ? $counts[ 'total' ][ $type[ 'name' ] ] : 0) . '</span>' . '</a></li>', $type[ 'name' ]
|
194 |
);
|
195 |
}
|
|
|
|
|
196 |
}
|
197 |
|
198 |
function refresh_counts ( $user_id, $where ) {
|
146 |
$counts[ 'total' ][ "album" ] = $counts[ 'total' ][ "album" ] + $other_count;
|
147 |
echo apply_filters ( 'rtmedia_sub_nav_albums', '<li id="rtmedia-nav-item-albums-li" ' . $albums . '><a id="rtmedia-nav-item-albums" href="' . trailingslashit ( $link ) . RTMEDIA_MEDIA_SLUG . '/album/">' . __ ( "Albums", "rtmedia" ) . '<span>' . ((isset ( $counts[ 'total' ][ "album" ] )) ? $counts[ 'total' ][ "album" ] : 0 ) . '</span>' . '</a></li>' );
|
148 |
}
|
149 |
+
|
150 |
foreach ( $rtmedia->allowed_types as $type ) {
|
151 |
//print_r($type);
|
152 |
if ( ! $rtmedia->options[ 'allowedTypes_' . $type[ 'name' ] . '_enabled' ] )
|
193 |
. $type[ 'plural_label' ] . '<span>' . ((isset ( $counts[ 'total' ][ $type[ 'name' ] ] )) ? $counts[ 'total' ][ $type[ 'name' ] ] : 0) . '</span>' . '</a></li>', $type[ 'name' ]
|
194 |
);
|
195 |
}
|
196 |
+
|
197 |
+
do_action("add_extra_sub_nav");
|
198 |
}
|
199 |
|
200 |
function refresh_counts ( $user_id, $where ) {
|
app/main/controllers/template/RTMediaTemplate.php
CHANGED
@@ -493,10 +493,12 @@ class RTMediaTemplate {
|
|
493 |
return;
|
494 |
}
|
495 |
}
|
496 |
-
|
497 |
-
|
|
|
|
|
498 |
$template_name = $template . '.php';
|
499 |
-
|
500 |
if ( $context === false ) {
|
501 |
$context = 'media/';
|
502 |
}
|
@@ -504,12 +506,9 @@ class RTMediaTemplate {
|
|
504 |
$context .='/';
|
505 |
}
|
506 |
|
507 |
-
|
508 |
$path = 'rtmedia/' . $context;
|
509 |
$ogpath = 'templates/' . $context;
|
510 |
|
511 |
-
|
512 |
-
|
513 |
if ( file_exists ( trailingslashit ( STYLESHEETPATH ) . $path . $template_name ) ) {
|
514 |
if ( $url ) {
|
515 |
$located = trailingslashit ( get_stylesheet_directory_uri () ) . $path . $template_name;
|
@@ -529,7 +528,8 @@ class RTMediaTemplate {
|
|
529 |
$located = trailingslashit ( RTMEDIA_PATH ) . $ogpath . $template_name;
|
530 |
}
|
531 |
}
|
532 |
-
|
|
|
533 |
return $located;
|
534 |
}
|
535 |
|
493 |
return;
|
494 |
}
|
495 |
}
|
496 |
+
|
497 |
+
$context = apply_filters( 'rtmedia_context_filter' , $context ); // filter added for rtmedia_pro playist
|
498 |
+
$template = apply_filters( 'rtmedia_template_filter', $template ); // filter added for rtmedia_pro playist
|
499 |
+
|
500 |
$template_name = $template . '.php';
|
501 |
+
|
502 |
if ( $context === false ) {
|
503 |
$context = 'media/';
|
504 |
}
|
506 |
$context .='/';
|
507 |
}
|
508 |
|
|
|
509 |
$path = 'rtmedia/' . $context;
|
510 |
$ogpath = 'templates/' . $context;
|
511 |
|
|
|
|
|
512 |
if ( file_exists ( trailingslashit ( STYLESHEETPATH ) . $path . $template_name ) ) {
|
513 |
if ( $url ) {
|
514 |
$located = trailingslashit ( get_stylesheet_directory_uri () ) . $path . $template_name;
|
528 |
$located = trailingslashit ( RTMEDIA_PATH ) . $ogpath . $template_name;
|
529 |
}
|
530 |
}
|
531 |
+
|
532 |
+
$located = apply_filters('rtmedia_located_template', $located );
|
533 |
return $located;
|
534 |
}
|
535 |
|
app/main/controllers/template/rt-template-functions.php
CHANGED
@@ -521,7 +521,7 @@ function rtmedia_pagination_prev_link () {
|
|
521 |
$link .= RTMEDIA_MEDIA_SLUG . '/';
|
522 |
|
523 |
if ( isset ( $rtmedia_query->action_query->media_type ) ) {
|
524 |
-
if ( in_array ( $rtmedia_query->action_query->media_type, array( "photo", "music", "video", "album" ) ) )
|
525 |
$link .= $rtmedia_query->action_query->media_type . '/';
|
526 |
}
|
527 |
return $link . $page_url;
|
@@ -554,7 +554,7 @@ function rtmedia_pagination_next_link () {
|
|
554 |
$link .= $rtmedia_query->media_query[ "album_id" ] . "/";
|
555 |
}
|
556 |
if ( isset ( $rtmedia_query->action_query->media_type ) ) {
|
557 |
-
if ( in_array ( $rtmedia_query->action_query->media_type, array( "photo", "music", "video", "album" ) ) )
|
558 |
$link .= $rtmedia_query->action_query->media_type . '/';
|
559 |
}
|
560 |
return $link . $page_url;
|
@@ -1209,7 +1209,8 @@ function get_rtmedia_allowed_upload_type () {
|
|
1209 |
$allow_type_str = "";
|
1210 |
$sep = "";
|
1211 |
foreach ( $rtmedia->allowed_types as $type ) {
|
1212 |
-
|
|
|
1213 |
foreach ( $type[ "extn" ] as $extn ) {
|
1214 |
$allow_type_str .= $sep . $extn;
|
1215 |
$sep = ",";
|
@@ -1222,4 +1223,4 @@ function get_rtmedia_allowed_upload_type () {
|
|
1222 |
|
1223 |
function is_rt_admin(){
|
1224 |
return current_user_can("list_users");
|
1225 |
-
}
|
521 |
$link .= RTMEDIA_MEDIA_SLUG . '/';
|
522 |
|
523 |
if ( isset ( $rtmedia_query->action_query->media_type ) ) {
|
524 |
+
if ( in_array ( $rtmedia_query->action_query->media_type, array( "photo", "music", "video", "album", "playlist" ) ) )
|
525 |
$link .= $rtmedia_query->action_query->media_type . '/';
|
526 |
}
|
527 |
return $link . $page_url;
|
554 |
$link .= $rtmedia_query->media_query[ "album_id" ] . "/";
|
555 |
}
|
556 |
if ( isset ( $rtmedia_query->action_query->media_type ) ) {
|
557 |
+
if ( in_array ( $rtmedia_query->action_query->media_type, array( "photo", "music", "video", "album", "playlist" ) ) )
|
558 |
$link .= $rtmedia_query->action_query->media_type . '/';
|
559 |
}
|
560 |
return $link . $page_url;
|
1209 |
$allow_type_str = "";
|
1210 |
$sep = "";
|
1211 |
foreach ( $rtmedia->allowed_types as $type ) {
|
1212 |
+
|
1213 |
+
if (function_exists("is_rtmedia_upload_" . $type[ "name" ] . "_enabled") && call_user_func ( "is_rtmedia_upload_" . $type[ "name" ] . "_enabled" ) ) {
|
1214 |
foreach ( $type[ "extn" ] as $extn ) {
|
1215 |
$allow_type_str .= $sep . $extn;
|
1216 |
$sep = ",";
|
1223 |
|
1224 |
function is_rt_admin(){
|
1225 |
return current_user_can("list_users");
|
1226 |
+
}
|
app/main/routers/query/RTMediaQuery.php
CHANGED
@@ -156,6 +156,20 @@ class RTMediaQuery {
|
|
156 |
}
|
157 |
return false;
|
158 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
/**
|
161 |
* json request
|
@@ -552,7 +566,7 @@ class RTMediaQuery {
|
|
552 |
foreach ( $rtmedia->allowed_types as $value ) {
|
553 |
$allowed_media_types[ ] = $value[ 'name' ];
|
554 |
}
|
555 |
-
|
556 |
if ( ! isset ( $this->media_query[ 'media_type' ] ) ) {
|
557 |
if ( isset ( $this->action_query->media_type ) &&
|
558 |
(
|
@@ -560,7 +574,7 @@ class RTMediaQuery {
|
|
560 |
$this->action_query->media_type == 'album'
|
561 |
)
|
562 |
) {
|
563 |
-
|
564 |
} else {
|
565 |
$this->media_query[ 'media_type' ] = array( 'compare' => 'NOT IN', 'value' => array( 'album' ) );
|
566 |
}
|
156 |
}
|
157 |
return false;
|
158 |
}
|
159 |
+
|
160 |
+
function is_playlist_gallery () {
|
161 |
+
if ( isset ( $this->action_query->media_type ) && $this->action_query->media_type == 'playlist' ) {
|
162 |
+
return true;
|
163 |
+
}
|
164 |
+
return false;
|
165 |
+
}
|
166 |
+
|
167 |
+
function is_playlist () {
|
168 |
+
if ( isset ( $this->query[ 'media_type' ] ) && $this->query[ 'media_type' ] == 'playlist' ) {
|
169 |
+
return true;
|
170 |
+
}
|
171 |
+
return false;
|
172 |
+
}
|
173 |
|
174 |
/**
|
175 |
* json request
|
566 |
foreach ( $rtmedia->allowed_types as $value ) {
|
567 |
$allowed_media_types[ ] = $value[ 'name' ];
|
568 |
}
|
569 |
+
|
570 |
if ( ! isset ( $this->media_query[ 'media_type' ] ) ) {
|
571 |
if ( isset ( $this->action_query->media_type ) &&
|
572 |
(
|
574 |
$this->action_query->media_type == 'album'
|
575 |
)
|
576 |
) {
|
577 |
+
$this->media_query[ 'media_type' ] = $this->action_query->media_type;
|
578 |
} else {
|
579 |
$this->media_query[ 'media_type' ] = array( 'compare' => 'NOT IN', 'value' => array( 'album' ) );
|
580 |
}
|
index.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
|
5 |
Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
|
6 |
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!
|
7 |
-
Version: 3.1.
|
8 |
Author: rtCamp
|
9 |
Text Domain: rtmedia
|
10 |
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
|
4 |
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
|
5 |
Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
|
6 |
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!
|
7 |
+
Version: 3.1.6
|
8 |
Author: rtCamp
|
9 |
Text Domain: rtmedia
|
10 |
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.6
|
8 |
Tested up to: WordPress 3.6.1 + BuddyPress 1.8.1
|
9 |
-
Stable tag: 3.1.
|
10 |
|
11 |
Add albums, photo, audio/video encoding, privacy, sharing, front-end uploads & more. All this works mobile/tablets devices.
|
12 |
|
@@ -119,6 +119,11 @@ Please visit [rtMedia's Features page](http://rtcamp.com/rtmedia/?utm_source=rea
|
|
119 |
|
120 |
Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
|
121 |
|
|
|
|
|
|
|
|
|
|
|
122 |
= 3.1.5 =
|
123 |
* Ignore privacy if admin user.
|
124 |
* Other minor issues.
|
@@ -547,8 +552,8 @@ Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_sou
|
|
547 |
|
548 |
== Upgrade Notice ==
|
549 |
|
550 |
-
= 3.1.
|
551 |
-
Requires BuddyPress 1.7 or higher, if using BuddyPress.
|
552 |
|
553 |
== Sponsors ==
|
554 |
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
Requires at least: WordPress 3.6
|
8 |
Tested up to: WordPress 3.6.1 + BuddyPress 1.8.1
|
9 |
+
Stable tag: 3.1.6
|
10 |
|
11 |
Add albums, photo, audio/video encoding, privacy, sharing, front-end uploads & more. All this works mobile/tablets devices.
|
12 |
|
119 |
|
120 |
Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
|
121 |
|
122 |
+
= 3.1.6 =
|
123 |
+
* Removed download button enable/disable settings
|
124 |
+
* Bug fixed for translation
|
125 |
+
* added support for Playlists and its required filters
|
126 |
+
|
127 |
= 3.1.5 =
|
128 |
* Ignore privacy if admin user.
|
129 |
* Other minor issues.
|
552 |
|
553 |
== Upgrade Notice ==
|
554 |
|
555 |
+
= 3.1.6 =
|
556 |
+
Requires BuddyPress 1.7 or higher, if using BuddyPress. Fix for translation, other bug fixes
|
557 |
|
558 |
== Sponsors ==
|
559 |
|