Version Description
- Fixed rewrite rule issue
- Fixed comment issue on media
- Fixed hide activity on private group
- Fixed file format and mime type issue
- Fixed image size issue
Download this release
Release Info
Developer | faishal |
Plugin | ![]() |
Version | 3.0.7 |
Comparing to | |
See all releases |
Code changes from version 3.0.6 to 3.0.7
- app/main/RTMedia.php +5 -9
- app/main/controllers/media/RTMediaMedia.php +6 -1
- app/main/controllers/template/RTMediaTemplate.php +5 -4
- app/main/controllers/upload/processors/RTMediaUploadFile.php +5 -2
- app/main/interactions/RTMediaInteraction.php +7 -7
- app/services/RTMediaEncoding.php +1 -1
- index.php +1 -1
- readme.txt +10 -3
app/main/RTMedia.php
CHANGED
@@ -87,11 +87,6 @@ class RTMedia {
|
|
87 |
* @global int $bp_media_counter Media counter
|
88 |
*/
|
89 |
public function __construct() {
|
90 |
-
|
91 |
-
// Rewrite API flush before activating and after deactivating the plugin
|
92 |
-
register_activation_hook( __FILE__, array( $this, 'flush_rewrite' ) );
|
93 |
-
register_deactivation_hook( __FILE__, array( $this, 'flush_rewrite' ) );
|
94 |
-
|
95 |
$this->default_thumbnail = apply_filters( 'rtmedia_default_thumbnail', RTMEDIA_URL . 'assets/thumb_default.png' );
|
96 |
|
97 |
// check for global album --- after wordpress is fully loaded
|
@@ -143,6 +138,11 @@ class RTMedia {
|
|
143 |
return $image_sizes;
|
144 |
}
|
145 |
public function add_image_sizes() {
|
|
|
|
|
|
|
|
|
|
|
146 |
add_action('wp_footer', array(&$this,'custome_style_for_activity_image_size'));
|
147 |
}
|
148 |
function custome_style_for_activity_image_size() {?>
|
@@ -610,10 +610,6 @@ class RTMedia {
|
|
610 |
load_plugin_textdomain( 'rtmedia', false, basename( RTMEDIA_PATH ) . '/languages/' );
|
611 |
}
|
612 |
|
613 |
-
function flush_rewrite() {
|
614 |
-
error_log( 'flush' );
|
615 |
-
flush_rewrite_rules();
|
616 |
-
}
|
617 |
|
618 |
function check_global_album() {
|
619 |
$album = new RTMediaAlbum();
|
87 |
* @global int $bp_media_counter Media counter
|
88 |
*/
|
89 |
public function __construct() {
|
|
|
|
|
|
|
|
|
|
|
90 |
$this->default_thumbnail = apply_filters( 'rtmedia_default_thumbnail', RTMEDIA_URL . 'assets/thumb_default.png' );
|
91 |
|
92 |
// check for global album --- after wordpress is fully loaded
|
138 |
return $image_sizes;
|
139 |
}
|
140 |
public function add_image_sizes() {
|
141 |
+
$bp_media_sizes = $this->image_sizes();
|
142 |
+
add_image_size("rt_media_thumbnail", $bp_media_sizes['thumbnail']["width"],$bp_media_sizes['thumbnail']["height"],$bp_media_sizes['thumbnail']["crop"]);
|
143 |
+
add_image_size("rt_media_activity_image", $bp_media_sizes['activity']["width"],$bp_media_sizes['activity']["height"],$bp_media_sizes['activity']["crop"]);
|
144 |
+
add_image_size("rt_media_single_image", $bp_media_sizes['single']["width"],$bp_media_sizes['single']["height"],$bp_media_sizes['single']["crop"]);
|
145 |
+
add_image_size("rt_media_featured_image", $bp_media_sizes['featured']["width"],$bp_media_sizes['featured']["height"],$bp_media_sizes['featured']["crop"]);
|
146 |
add_action('wp_footer', array(&$this,'custome_style_for_activity_image_size'));
|
147 |
}
|
148 |
function custome_style_for_activity_image_size() {?>
|
610 |
load_plugin_textdomain( 'rtmedia', false, basename( RTMEDIA_PATH ) . '/languages/' );
|
611 |
}
|
612 |
|
|
|
|
|
|
|
|
|
613 |
|
614 |
function check_global_album() {
|
615 |
$album = new RTMediaAlbum();
|
app/main/controllers/media/RTMediaMedia.php
CHANGED
@@ -462,7 +462,7 @@ class RTMediaMedia {
|
|
462 |
'%s added a %s', '%s added %d %s.', $count, 'rtmedia'
|
463 |
), $username, $media->media_type, $media_str
|
464 |
);
|
465 |
-
|
466 |
$activity_args = array(
|
467 |
'action' => $action,
|
468 |
'content' => $activity_content,
|
@@ -470,6 +470,11 @@ class RTMediaMedia {
|
|
470 |
'primary_link' => '',
|
471 |
'item_id' => $id
|
472 |
);
|
|
|
|
|
|
|
|
|
|
|
473 |
if ($media->context == 'group' || 'profile') {
|
474 |
$activity_args['component'] = $media->context;
|
475 |
}
|
462 |
'%s added a %s', '%s added %d %s.', $count, 'rtmedia'
|
463 |
), $username, $media->media_type, $media_str
|
464 |
);
|
465 |
+
|
466 |
$activity_args = array(
|
467 |
'action' => $action,
|
468 |
'content' => $activity_content,
|
470 |
'primary_link' => '',
|
471 |
'item_id' => $id
|
472 |
);
|
473 |
+
|
474 |
+
if($media->context == "group" && function_exists("bp_get_group_status") && bp_get_group_status(groups_get_group(array("group_id"=> $media->context_id)))!= "public"){
|
475 |
+
$activity_args["hide_sitewide"] = true;
|
476 |
+
}
|
477 |
+
|
478 |
if ($media->context == 'group' || 'profile') {
|
479 |
$activity_args['component'] = $media->context;
|
480 |
}
|
app/main/controllers/template/RTMediaTemplate.php
CHANGED
@@ -350,13 +350,14 @@ class RTMediaTemplate {
|
|
350 |
}
|
351 |
$comment = new RTMediaComment();
|
352 |
$attr = $_POST;
|
353 |
-
if (!isset($attr['comment_post_ID']))
|
354 |
-
$attr['comment_post_ID'] = $rtmedia_query->action_query->id;
|
355 |
-
$id = $comment->add($attr);
|
356 |
-
|
357 |
$mediaModel = new RTMediaModel();
|
358 |
$result = $mediaModel->get(array('id' => $rtmedia_query->action_query->id));
|
359 |
|
|
|
|
|
|
|
|
|
|
|
360 |
if ($result[0]->activity_id != NULL) {
|
361 |
global $rtmedia_buddypress_activity;
|
362 |
remove_action("bp_activity_comment_posted", array($rtmedia_buddypress_activity, "comment_sync"), 10, 2);
|
350 |
}
|
351 |
$comment = new RTMediaComment();
|
352 |
$attr = $_POST;
|
|
|
|
|
|
|
|
|
353 |
$mediaModel = new RTMediaModel();
|
354 |
$result = $mediaModel->get(array('id' => $rtmedia_query->action_query->id));
|
355 |
|
356 |
+
if (!isset($attr['comment_post_ID']))
|
357 |
+
$attr['comment_post_ID'] = $result[0]->media_id;
|
358 |
+
$id = $comment->add($attr);
|
359 |
+
|
360 |
+
|
361 |
if ($result[0]->activity_id != NULL) {
|
362 |
global $rtmedia_buddypress_activity;
|
363 |
remove_action("bp_activity_comment_posted", array($rtmedia_buddypress_activity, "comment_sync"), 10, 2);
|
app/main/controllers/upload/processors/RTMediaUploadFile.php
CHANGED
@@ -148,10 +148,13 @@ class RTMediaUploadFile {
|
|
148 |
$allowed_types[] = $extn;
|
149 |
}
|
150 |
}
|
|
|
151 |
$allowed_types = apply_filters('rtmedia_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => implode(",", $allowed_types))));
|
152 |
$allowed_types = explode(",", $allowed_types[0]["extensions"]);
|
153 |
-
if
|
154 |
-
|
|
|
|
|
155 |
}
|
156 |
// $is_valid = $this->id3_validate_type($file);
|
157 |
} catch (RTMediaUploadException $e) {
|
148 |
$allowed_types[] = $extn;
|
149 |
}
|
150 |
}
|
151 |
+
$file_data = wp_check_filetype($file['name']);
|
152 |
$allowed_types = apply_filters('rtmedia_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => implode(",", $allowed_types))));
|
153 |
$allowed_types = explode(",", $allowed_types[0]["extensions"]);
|
154 |
+
if (in_array(strtolower($file_data["ext"]), $allowed_types) == false) {
|
155 |
+
if (!preg_match('/' . implode('|', $allowed_types) . '/i', $file['type'], $result) || !isset($result[0])) {
|
156 |
+
throw new RTMediaUploadException(UPLOAD_ERR_EXTENSION);
|
157 |
+
}
|
158 |
}
|
159 |
// $is_valid = $this->id3_validate_type($file);
|
160 |
} catch (RTMediaUploadException $e) {
|
app/main/interactions/RTMediaInteraction.php
CHANGED
@@ -53,15 +53,15 @@ class RTMediaInteraction {
|
|
53 |
|
54 |
}
|
55 |
|
56 |
-
function rewrite_rules() {
|
57 |
-
add_rewrite_rule
|
58 |
-
add_rewrite_rule
|
59 |
-
add_rewrite_rule
|
60 |
-
add_rewrite_rule
|
61 |
-
add_rewrite_rule
|
62 |
}
|
63 |
|
64 |
-
function rewrite_tags(){
|
65 |
add_rewrite_tag('%media_id%','([0-9]*)');
|
66 |
add_rewrite_tag('%action%','([^/]*)');
|
67 |
add_rewrite_tag('%nonce_type%','([^/]*)');
|
53 |
|
54 |
}
|
55 |
|
56 |
+
static function rewrite_rules() {
|
57 |
+
add_rewrite_rule('^/media/([0-9]*)/([^/]*)/?','index.php?media_id=$matches[1]&action=$matches[2]','bottom');
|
58 |
+
add_rewrite_rule('^/media/([0-9]*)/pg/([0-9]*)/?','index.php?media_id=$matches[1]&pg=$matches[2]','bottom');
|
59 |
+
add_rewrite_rule('^/media/nonce/([^/]*)/?','index.php?nonce_type=$matches[1]','bottom');
|
60 |
+
add_rewrite_rule('^/media/([A-Za-z]*)/pg/([0-9]*)/?','index.php?media_type=$matches[1]&pg=$matches[2]','bottom');
|
61 |
+
add_rewrite_rule('^/media/pg/([0-9]*)/?','index.php?pg=$matches[1]','bottom');
|
62 |
}
|
63 |
|
64 |
+
static function rewrite_tags(){
|
65 |
add_rewrite_tag('%media_id%','([0-9]*)');
|
66 |
add_rewrite_tag('%action%','([^/]*)');
|
67 |
add_rewrite_tag('%nonce_type%','([^/]*)');
|
app/services/RTMediaEncoding.php
CHANGED
@@ -166,7 +166,7 @@ class RTMediaEncoding {
|
|
166 |
|
167 |
public function allowed_types($types) {
|
168 |
if (isset($types[0]) && isset($types[0]['extensions'])) {
|
169 |
-
$types[0]['extensions'] .= ',mov,m4v,m2v,avi,mpg,flv,wmv,mkv,webm,ogv,mxf,asf,vob,mts,qt,mpeg'; //Allow all types of file to be uploded
|
170 |
$types[0]['extensions'] .= ',wma,ogg,wav,m4a'; //Allow all types of file to be uploded
|
171 |
}
|
172 |
return $types;
|
166 |
|
167 |
public function allowed_types($types) {
|
168 |
if (isset($types[0]) && isset($types[0]['extensions'])) {
|
169 |
+
$types[0]['extensions'] .= ',mov,m4v,m2v,avi,mpg,flv,wmv,mkv,webm,ogv,mxf,asf,vob,mts,qt,mpeg,x-msvideo'; //Allow all types of file to be uploded
|
170 |
$types[0]['extensions'] .= ',wma,ogg,wav,m4a'; //Allow all types of file to be uploded
|
171 |
}
|
172 |
return $types;
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
|
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: 3.0.
|
7 |
Author: rtCamp
|
8 |
Text Domain: rtmedia
|
9 |
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
|
3 |
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
|
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: 3.0.7
|
7 |
Author: rtCamp
|
8 |
Text Domain: rtmedia
|
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
|
8 |
Tested up to: WordPress 3.5.2 + BuddyPress 1.7
|
9 |
-
Stable tag: 3.0.
|
10 |
|
11 |
rtMedia adds albums, audio/video encoding, privacy/sharing, front-end uploads & more. All this works nicely on mobile/tablets devices.
|
12 |
|
@@ -160,6 +160,13 @@ Please visit [rtMedia's Features page](http://rtcamp.com/buddypress-media/?utm_s
|
|
160 |
|
161 |
Please visit [rtMedia's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
= 3.0.6 =
|
164 |
* Fixed image size issue
|
165 |
* Fixed group create album permission and add setting for group admin
|
@@ -502,8 +509,8 @@ Please visit [rtMedia's Roadmap page](http://rtcamp.com/buddypress-media/roadmap
|
|
502 |
|
503 |
== Upgrade Notice ==
|
504 |
|
505 |
-
= 3.0.
|
506 |
-
Fixed
|
507 |
|
508 |
== Sponsors ==
|
509 |
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
Requires at least: WordPress 3.5
|
8 |
Tested up to: WordPress 3.5.2 + BuddyPress 1.7
|
9 |
+
Stable tag: 3.0.7
|
10 |
|
11 |
rtMedia adds albums, audio/video encoding, privacy/sharing, front-end uploads & more. All this works nicely on mobile/tablets devices.
|
12 |
|
160 |
|
161 |
Please visit [rtMedia's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
|
162 |
|
163 |
+
= 3.0.7 =
|
164 |
+
* Fixed rewrite rule issue
|
165 |
+
* Fixed comment issue on media
|
166 |
+
* Fixed hide activity on private group
|
167 |
+
* Fixed file format and mime type issue
|
168 |
+
* Fixed image size issue
|
169 |
+
|
170 |
= 3.0.6 =
|
171 |
* Fixed image size issue
|
172 |
* Fixed group create album permission and add setting for group admin
|
509 |
|
510 |
== Upgrade Notice ==
|
511 |
|
512 |
+
= 3.0.7 =
|
513 |
+
Fixed rewrite rule,media comment, activity on private group and image size issue
|
514 |
|
515 |
== Sponsors ==
|
516 |
|