rtMedia for WordPress, BuddyPress and bbPress - Version 3.6.11

Version Description

  • Update Russian and Polish translations
  • Bug fixes
Download this release

Release Info

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

Code changes from version 3.6.10 to 3.6.11

app/importers/RTMediaMediaSizeImporter.php CHANGED
@@ -18,6 +18,7 @@ class RTMediaMediaSizeImporter {
18
add_action( 'wp_ajax_rtmedia_media_size_import', array( $this, "rtmedia_media_size_import" ) );
19
add_action( 'admin_init', array( $this, 'add_admin_notice' ) );
20
add_action( 'admin_menu', array( $this, 'menu' ), 10 );
21
}
22
23
function menu() {
@@ -30,12 +31,25 @@ class RTMediaMediaSizeImporter {
30
return $admin_pages;
31
}
32
33
function add_admin_notice() {
34
$pending = $this->get_pending_count();
35
if ( $pending < 0 ){
36
$pending = 0;
37
}
38
rtmedia_update_site_option( "rtmedia_media_size_import_pending_count", $pending );
39
if ( $pending > 0 ){
40
if ( ! ( isset ( $_REQUEST[ "page" ] ) && $_REQUEST[ "page" ] == "rtmedia-migration-media-size-import" ) ){
41
$site_option = get_site_option( "rtmedia_media_size_import_notice" );
@@ -49,8 +63,8 @@ class RTMediaMediaSizeImporter {
49
50
function add_rtmedia_media_size_import_notice() {
51
if ( current_user_can( 'manage_options' ) ){
52
- $this->create_notice( "<p><strong>rtMedia</strong>: <a href='" . admin_url( "admin.php?page=rtmedia-migration-media-size-import&force=true" ) . "'>Click Here</a> to import media sizes. <a href='#' onclick='rtmedia_hide_media_size_import_notice()' style='float:right'>" . __( "Hide" ) . "</a> </p>" );
53
- ?>
54
<script type="text/javascript">
55
function rtmedia_hide_media_size_import_notice() {
56
var data = {action: 'rtmedia_hide_media_size_import_notice'};
@@ -76,18 +90,18 @@ class RTMediaMediaSizeImporter {
76
$done = $total - $pending;
77
?>
78
<div class="wrap">
79
- <h2>rtMedia Media Size Import</h2>
80
- <?php
81
- echo '<span class="pending">' . rtmedia_migrate_formatseconds( $total - $done ) . '</span><br />';
82
echo '<span class="finished">' . $done . '</span>/<span class="total">' . $total . '</span>';
83
echo '<img src="images/loading.gif" alt="syncing" id="rtMediaSyncing" style="display:none" />';
84
85
$temp = $prog->progress( $done, $total );
86
$prog->progress_ui( $temp, true );
87
- ?>
88
<script type="text/javascript">
89
- var false_count = 0;
90
- var curr_done = 0;
91
jQuery( document ).ready( function ( e ) {
92
jQuery( "#toplevel_page_rtmedia-settings" ).addClass( "wp-has-current-submenu" )
93
jQuery( "#toplevel_page_rtmedia-settings" ).removeClass( "wp-not-current-submenu" )
@@ -97,17 +111,19 @@ class RTMediaMediaSizeImporter {
97
if ( db_total < 1 )
98
jQuery( "#submit" ).attr( 'disabled', "disabled" );
99
} )
100
- function db_start_migration( db_done, db_total ) {
101
102
if ( db_done < db_total ) {
103
jQuery( "#rtMediaSyncing" ).show();
104
jQuery.ajax( {
105
url: rtmedia_admin_ajax,
106
type: 'post',
107
- data: {
108
- "action": "rtmedia_media_size_import",
109
- "done": db_done
110
- },
111
success: function ( sdata ) {
112
113
try {
@@ -127,17 +143,10 @@ class RTMediaMediaSizeImporter {
127
jQuery( 'span.finished' ).html( done );
128
jQuery( 'span.total' ).html( total );
129
jQuery( 'span.pending' ).html( data.pending );
130
- if( curr_done == done ) {
131
- false_count++;
132
- } else {
133
- false_count = 0;
134
- }
135
- curr_done = done;
136
- if( false_count > 5 ) {
137
- rtm_show_file_error( done, total );
138
- } else {
139
- db_start_migration( done, total );
140
}
141
} else {
142
alert( "Migration completed." );
143
jQuery( "#rtMediaSyncing" ).hide();
@@ -150,18 +159,23 @@ class RTMediaMediaSizeImporter {
150
} );
151
} else {
152
alert( "Migration completed." );
153
jQuery( "#rtMediaSyncing" ).hide();
154
}
155
}
156
- function rtm_show_file_error( done, total ) {
157
- jQuery( 'span.pending' ).html( "File size of " + ( total - done ) + " file(s) are not imported. Don't worry, you can end importing media size now :)" );
158
- jQuery( "#rtMediaSyncing" ).hide();
159
}
160
var db_done = <?php echo $done; ?>;
161
var db_total = <?php echo $total; ?>;
162
jQuery( document ).on( 'click', '#submit', function ( e ) {
163
e.preventDefault();
164
- db_start_migration( db_done, db_total );
165
jQuery( this ).attr( 'disabled', 'disabled' );
166
} );
167
</script>
@@ -173,10 +187,13 @@ class RTMediaMediaSizeImporter {
173
<?php
174
}
175
176
- function get_pending_count() {
177
global $wpdb;
178
$rtmedia_model = new RTMediaModel();
179
$query_pending = "SELECT COUNT(*) as pending from {$rtmedia_model->table_name} where file_size IS NULL AND media_type in ('photo','video','document','music','other')";
180
$pending_count = $wpdb->get_results( $query_pending );
181
if ( $pending_count && sizeof( $pending_count ) > 0 ){
182
return $pending_count[ 0 ]->pending;
@@ -201,32 +218,41 @@ class RTMediaMediaSizeImporter {
201
global $wpdb;
202
$rtmedia_model = new RTMediaModel();
203
$get_media_sql = "SELECT * from {$rtmedia_model->table_name} where file_size is NULL and media_type in ('photo','video','document','music','other') order by id limit " . $limit;
204
if ( $lastid ){
205
$get_media_sql = "SELECT * from {$rtmedia_model->table_name} where id > '" . $lastid . "' AND file_size is NULL and media_type in ('photo','video','document','music','other') order by id limit " . $limit;
206
}
207
$result = $wpdb->get_results( $get_media_sql );
208
if ( $result && sizeof( $result ) > 0 ){
209
- $this->migrate_single_media( $result[ 0 ] );
210
}
211
- $this->return_migration();
212
}
213
214
function migrate_single_media( $result ) {
215
global $wpdb;
216
$rtmedia_model = new RTMediaModel();
217
$attached_file = get_attached_file( $result->media_id );
218
- if ( ! file_exists( $attached_file ) ){
219
- $this->rtmedia_media_size_import( $result->id );
220
}
221
- $file_size = filesize( $attached_file );
222
$post = get_post( $result->media_id );
223
$post_date = $post->post_date;
224
$rtmedia_model->update( array( 'upload_date' => $post_date, 'file_size' => $file_size ), array( 'id' => $result->id ) );
225
}
226
227
- function return_migration() {
228
$total = $this->get_total_count();
229
- $pending = $this->get_pending_count();
230
$done = $total - $pending;
231
if ( $pending < 0 ){
232
$pending = 0;
@@ -237,7 +263,7 @@ class RTMediaMediaSizeImporter {
237
}
238
rtmedia_update_site_option( 'rtmedia_media_size_import_pending_count', $pending );
239
$pending_time = rtmedia_migrate_formatseconds( $pending ). " (estimated)";
240
- echo json_encode( array( "status" => true, "done" => $done, "total" => $total, "pending" => $pending_time ) );
241
die();
242
}
243
}
18
add_action( 'wp_ajax_rtmedia_media_size_import', array( $this, "rtmedia_media_size_import" ) );
19
add_action( 'admin_init', array( $this, 'add_admin_notice' ) );
20
add_action( 'admin_menu', array( $this, 'menu' ), 10 );
21
+ add_action( 'wp_ajax_rtmedia_hide_media_size_import_notice', array( $this, "rtmedia_hide_media_size_import_notice" ) );
22
}
23
24
function menu() {
31
return $admin_pages;
32
}
33
34
+ function rtmedia_hide_media_size_import_notice() {
35
+ if( rtmedia_update_site_option( "rtmedia_hide_media_size_import_notice", true ) ) {
36
+ echo '1';
37
+ } else {
38
+ echo '0';
39
+ }
40
+ wp_die();
41
+ }
42
+
43
function add_admin_notice() {
44
$pending = $this->get_pending_count();
45
if ( $pending < 0 ){
46
$pending = 0;
47
}
48
rtmedia_update_site_option( "rtmedia_media_size_import_pending_count", $pending );
49
+ $hide_admin_option = rtmedia_get_site_option( 'rtmedia_hide_media_size_import_notice' );
50
+ if( $hide_admin_option ) {
51
+ return;
52
+ }
53
if ( $pending > 0 ){
54
if ( ! ( isset ( $_REQUEST[ "page" ] ) && $_REQUEST[ "page" ] == "rtmedia-migration-media-size-import" ) ){
55
$site_option = get_site_option( "rtmedia_media_size_import_notice" );
63
64
function add_rtmedia_media_size_import_notice() {
65
if ( current_user_can( 'manage_options' ) ){
66
+ $this->create_notice( "<p><strong>rtMedia</strong>: Database table structure for rtMedia has been updated. Please <a href='" . admin_url( "admin.php?page=rtmedia-migration-media-size-import&force=true" ) . "'>Click Here</a> to import media sizes. <a href='#' onclick='rtmedia_hide_media_size_import_notice()' style='float:right'>" . __( "Hide" ) . "</a> </p>" );
67
+ ?>
68
<script type="text/javascript">
69
function rtmedia_hide_media_size_import_notice() {
70
var data = {action: 'rtmedia_hide_media_size_import_notice'};
90
$done = $total - $pending;
91
?>
92
<div class="wrap">
93
+ <h2>rtMedia: Import Media Size</h2>
94
+ <?php
95
+ echo '<span class="pending">' . rtmedia_migrate_formatseconds( $total - $done ) . ' (estimated)</span><br />';
96
echo '<span class="finished">' . $done . '</span>/<span class="total">' . $total . '</span>';
97
echo '<img src="images/loading.gif" alt="syncing" id="rtMediaSyncing" style="display:none" />';
98
99
$temp = $prog->progress( $done, $total );
100
$prog->progress_ui( $temp, true );
101
+ ?>
102
<script type="text/javascript">
103
+ var fail_id = new Array();
104
+ var ajax_data;
105
jQuery( document ).ready( function ( e ) {
106
jQuery( "#toplevel_page_rtmedia-settings" ).addClass( "wp-has-current-submenu" )
107
jQuery( "#toplevel_page_rtmedia-settings" ).removeClass( "wp-not-current-submenu" )
111
if ( db_total < 1 )
112
jQuery( "#submit" ).attr( 'disabled', "disabled" );
113
} )
114
+ function db_start_migration( db_done, db_total, last_id ) {
115
116
if ( db_done < db_total ) {
117
jQuery( "#rtMediaSyncing" ).show();
118
+ ajax_data = {
119
+ "action": "rtmedia_media_size_import",
120
+ "done": db_done,
121
+ "last_id" : last_id
122
+ }
123
jQuery.ajax( {
124
url: rtmedia_admin_ajax,
125
type: 'post',
126
+ data: ajax_data,
127
success: function ( sdata ) {
128
129
try {
143
jQuery( 'span.finished' ).html( done );
144
jQuery( 'span.total' ).html( total );
145
jQuery( 'span.pending' ).html( data.pending );
146
+ if( data.imported === false ) {
147
+ fail_id.push(data.media_id);
148
}
149
+ db_start_migration( done, total, parseInt( data.media_id ) );
150
} else {
151
alert( "Migration completed." );
152
jQuery( "#rtMediaSyncing" ).hide();
159
} );
160
} else {
161
alert( "Migration completed." );
162
+ if( fail_id.length > 0 ) {
163
+ rtm_show_file_error();
164
+ }
165
jQuery( "#rtMediaSyncing" ).hide();
166
}
167
}
168
+ function rtm_show_file_error() {
169
+ jQuery( 'span.pending' ).html( "Media with ID: " + fail_id.join() + " can not be imported. Please check your server error log for more details. Don't worry, you can end importing media size now :)" );
170
+ // var data = {action: 'rtmedia_hide_media_size_import_notice'};
171
+ // jQuery.post( ajaxurl, data, function ( response ) { } );
172
+ // jQuery( "#rtMediaSyncing" ).hide();
173
}
174
var db_done = <?php echo $done; ?>;
175
var db_total = <?php echo $total; ?>;
176
jQuery( document ).on( 'click', '#submit', function ( e ) {
177
e.preventDefault();
178
+ db_start_migration( db_done, db_total, 0 );
179
jQuery( this ).attr( 'disabled', 'disabled' );
180
} );
181
</script>
187
<?php
188
}
189
190
+ function get_pending_count( $media_id = false ) {
191
global $wpdb;
192
$rtmedia_model = new RTMediaModel();
193
$query_pending = "SELECT COUNT(*) as pending from {$rtmedia_model->table_name} where file_size IS NULL AND media_type in ('photo','video','document','music','other')";
194
+ if( $media_id ) {
195
+ $query_pending = "SELECT COUNT(*) as pending from {$rtmedia_model->table_name} where file_size IS NULL AND media_type in ('photo','video','document','music','other') AND id > '" . $media_id . "'";
196
+ }
197
$pending_count = $wpdb->get_results( $query_pending );
198
if ( $pending_count && sizeof( $pending_count ) > 0 ){
199
return $pending_count[ 0 ]->pending;
218
global $wpdb;
219
$rtmedia_model = new RTMediaModel();
220
$get_media_sql = "SELECT * from {$rtmedia_model->table_name} where file_size is NULL and media_type in ('photo','video','document','music','other') order by id limit " . $limit;
221
+ if( isset( $_REQUEST['last_id'] ) ) {
222
+ $lastid = $_REQUEST['last_id'];
223
+ }
224
if ( $lastid ){
225
$get_media_sql = "SELECT * from {$rtmedia_model->table_name} where id > '" . $lastid . "' AND file_size is NULL and media_type in ('photo','video','document','music','other') order by id limit " . $limit;
226
}
227
$result = $wpdb->get_results( $get_media_sql );
228
if ( $result && sizeof( $result ) > 0 ){
229
+ $migrate = $this->migrate_single_media( $result[ 0 ] );
230
}
231
+ $this->return_migration( $result[ 0 ], $migrate );
232
}
233
234
function migrate_single_media( $result ) {
235
global $wpdb;
236
$rtmedia_model = new RTMediaModel();
237
$attached_file = get_attached_file( $result->media_id );
238
+ $return = true;
239
+ if ( file_exists( $attached_file ) ){
240
+ $file_size = filesize( $attached_file );
241
+ } else {
242
+ $file_size = '0';
243
+ error_log( 'rtMedia size importer: file not exist. Media ID: '.$result->id.', File: '.$attached_file );
244
+ $return = false;
245
+ return false;
246
}
247
$post = get_post( $result->media_id );
248
$post_date = $post->post_date;
249
$rtmedia_model->update( array( 'upload_date' => $post_date, 'file_size' => $file_size ), array( 'id' => $result->id ) );
250
+ return $return;
251
}
252
253
+ function return_migration( $media, $migrate = true ) {
254
$total = $this->get_total_count();
255
+ $pending = $this->get_pending_count( $media->id );
256
$done = $total - $pending;
257
if ( $pending < 0 ){
258
$pending = 0;
263
}
264
rtmedia_update_site_option( 'rtmedia_media_size_import_pending_count', $pending );
265
$pending_time = rtmedia_migrate_formatseconds( $pending ). " (estimated)";
266
+ echo json_encode( array( "status" => true, "done" => $done, "total" => $total, "pending" => $pending_time, "media_id" => $media->id, "imported" => $migrate ) );
267
die();
268
}
269
}
app/main/controllers/template/RTMediaNav.php CHANGED
@@ -37,7 +37,7 @@ class RTMediaNav {
37
if ( $rtmedia->options[ "buddypress_enableOnProfile" ] != 0 ) {
38
bp_core_new_nav_item ( array(
39
'name' => RTMEDIA_MEDIA_LABEL . '<span>' . $profile_counts[ 'total' ][ 'all' ] . '</span>',
40
- 'slug' => RTMEDIA_MEDIA_SLUG,
41
'screen_function' => array( $this, 'media_screen' ),
42
'default_subnav_slug' => 'all',
43
'position' => $tab_position
37
if ( $rtmedia->options[ "buddypress_enableOnProfile" ] != 0 ) {
38
bp_core_new_nav_item ( array(
39
'name' => RTMEDIA_MEDIA_LABEL . '<span>' . $profile_counts[ 'total' ][ 'all' ] . '</span>',
40
+ 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG ),
41
'screen_function' => array( $this, 'media_screen' ),
42
'default_subnav_slug' => 'all',
43
'position' => $tab_position
app/main/controllers/template/RTMediaTemplate.php CHANGED
@@ -10,622 +10,661 @@
10
*/
11
class RTMediaTemplate {
12
13
- public $media_args;
14
-
15
- function __construct () {
16
- global $rtmedia_query;
17
- if ( $rtmedia_query ) {
18
- add_action ( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
19
- add_action ( 'wp_enqueue_scripts', array( $this, 'enqueue_image_editor_scripts' ) );
20
- }
21
- }
22
-
23
- /**
24
- * Enqueues required scripts on the page
25
- */
26
- function enqueue_scripts () {
27
- wp_enqueue_script ( 'rtmedia-backbone' );
28
- $is_album = is_rtmedia_album () ? true : false;
29
- $is_edit_allowed = is_rtmedia_edit_allowed () ? true : false;
30
- wp_localize_script ( 'rtmedia-backbone', 'is_album', array( $is_album ) );
31
- wp_localize_script ( 'rtmedia-backbone', 'is_edit_allowed', array( $is_edit_allowed ) );
32
- }
33
-
34
- function enqueue_image_editor_scripts () {
35
- $suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
36
- wp_enqueue_script ( 'wp-ajax-response' );
37
- wp_enqueue_script ( 'rtmedia-image-edit', admin_url ( "js/image-edit$suffix.js" ), array( 'jquery', 'json2', 'imgareaselect' ), false, 1 );
38
- wp_enqueue_style ( 'rtmedia-image-edit', RTMEDIA_URL . 'app/assets/css/image-edit.css' );
39
- wp_enqueue_style ( 'rtmedia-image-area-select', includes_url ( '/js/imgareaselect/imgareaselect.css' ) );
40
- }
41
-
42
- /**
43
- * redirects to the template according to the page request
44
- * Pass on the shortcode attributes to the template so that the shortcode can berendered accordingly.
45
- *
46
- * Also handles the json request coming from the AJAX calls for the media
47
- *
48
- * @global type $rtmedia_query
49
- * @global type $rtmedia_interaction
50
- * @param type $template
51
- * @param type $shortcode_attr
52
- * @return type
53
- */
54
- function set_template ( $template = false, $shortcode_attr = false ) {
55
-
56
- global $rtmedia_query, $rtmedia_interaction, $rtmedia_media;
57
-
58
- do_action ( 'rtmedia_pre_template' );
59
-
60
- //print_r($rtmedia_query);
61
-
62
- if ( isset ( $rtmedia_query->action_query->action ) ) {
63
- //echo $rtmedia_query->action_query->action;
64
- do_action ( 'rtmedia_pre_action_' . $rtmedia_query->action_query->action );
65
- } else {
66
- do_action ( 'rtmedia_pre_action_default' );
67
- }
68
-
69
- $this->check_return_json ();
70
-
71
- $this->check_return_upload ();
72
-
73
- if ( $rtmedia_interaction && isset( $rtmedia_interaction->context ) && in_array ( $rtmedia_interaction->context->type, array( "profile", "group" ) ) ) {
74
-
75
-
76
- $this->check_return_edit ();
77
-
78
- $this->check_return_delete ();
79
-
80
- $this->check_return_merge ();
81
-
82
- $this->check_return_comments ();
83
-
84
- $this->check_delete_comments ();
85
- if( isset($rtmedia_query->is_gallery_shortcode) && $rtmedia_query->is_gallery_shortcode == true && isset( $shortcode_attr[ 'name' ] ) && $shortcode_attr[ 'name' ] == 'gallery' ) {
86
- echo "<div class='rtmedia_gallery_wrapper'>";
87
- $this->add_hidden_fields_in_gallery ();
88
- $gallery_template = apply_filters("rtmedia-before-template",$template,$shortcode_attr);
89
- include $this->locate_template ( $gallery_template );
90
- echo "</div>";
91
- } else {
92
- return $this->get_default_template ();
93
- }
94
- } else if ( ! $shortcode_attr ) {
95
- return $this->get_default_template ();
96
- } else if ( $shortcode_attr[ 'name' ] == 'gallery' ) {
97
- $valid = $this->sanitize_gallery_attributes ( $shortcode_attr[ 'attr' ] );
98
- if ( $valid ) {
99
- if ( is_array ( $shortcode_attr[ 'attr' ] ) ) {
100
- $this->update_global_query ( $shortcode_attr[ 'attr' ] );
101
- }
102
- global $rtaccount;
103
- if ( ! isset ( $rtaccount ) ) {
104
- $rtaccount = 0;
105
- }
106
- //add_action("rtmedia_before_media_gallery",array(&$this,"")) ;
107
- if( isset( $shortcode_attr[ 'attr' ] ) && isset( $shortcode_attr[ 'attr' ]['uploader'] ) && $shortcode_attr[ 'attr' ]['uploader'] == "before" ) {
108
- echo RTMediaUploadShortcode::pre_render($shortcode_attr[ 'attr' ]);
109
- }
110
- echo "<div class='rtmedia_gallery_wrapper'>";
111
- $this->add_hidden_fields_in_gallery ();
112
- $gallery_template = apply_filters("rtmedia-before-template",$template,$shortcode_attr);
113
- include $this->locate_template ( $gallery_template );
114
- echo "</div>";
115
- if( isset( $shortcode_attr[ 'attr' ] ) && isset( $shortcode_attr[ 'attr' ]['uploader'] ) && ( $shortcode_attr[ 'attr' ]['uploader'] == "after" || $shortcode_attr[ 'attr' ]['uploader'] == "true" ) ) {
116
- echo RTMediaUploadShortcode::pre_render($shortcode_attr[ 'attr' ]);
117
- }
118
- } else {
119
- echo __ ( 'Invalid attribute passed for rtmedia_gallery shortcode.', 'rtmedia' );
120
- return false;
121
- }
122
- }
123
- }
124
-
125
- function add_hidden_fields_in_gallery () {
126
- global $rtmedia_query;
127
- $return_str = "<input name='rtmedia_shortcode' value='true' type='hidden' />";
128
- if ( $rtmedia_query->original_query && is_array ( $rtmedia_query->original_query ) ) {
129
- foreach ( $rtmedia_query->original_query as $key => $val ) {
130
- $return_str.= '<input name="' . $key . '" value="' . $val . '" type="hidden" />';
131
- }
132
- }
133
- echo $return_str;
134
- }
135
-
136
- function check_return_json () {
137
- global $rtmedia_query;
138
- if ( $rtmedia_query->format == 'json' ) {
139
- $this->json_output ();
140
- } else {
141
- return;
142
- }
143
- }
144
-
145
- function check_return_upload () {
146
- global $rtmedia_query;
147
- if ( $rtmedia_query->action_query->action != 'upload' )
148
- return;
149
- $upload = new RTMediaUploadEndpoint();
150
- $upload->template_redirect ();
151
- }
152
-
153
- function json_output () {
154
- global $rtmedia_query;
155
- $media_array = array( );
156
- if ( $rtmedia_query->media ) {
157
- foreach ( $rtmedia_query->media as $key => $media ) {
158
- $media_array[ $key ] = $media;
159
- $media_array[ $key ]->guid = rtmedia_image('rt_media_thumbnail', $media->id ,false);
160
- $media_array[ $key ]->rt_permalink = get_rtmedia_permalink ( $media->id );
161
- }
162
- }
163
- $return_array[ 'data' ] = $media_array;
164
- $return_array[ 'prev' ] = rtmedia_page () - 1;
165
- $return_array[ 'next' ] = (rtmedia_offset () + rtmedia_per_page_media () < rtmedia_count ()) ? (rtmedia_page () + 1) : -1;
166
- echo json_encode ( $return_array );
167
- die;
168
- }
169
-
170
- function check_return_edit () {
171
- global $rtmedia_query;
172
- if ( $rtmedia_query->action_query->action == 'edit' && count ( $_POST ) )
173
- $this->save_edit ();
174
- return $this->get_default_template ();
175
- }
176
-
177
- function save_edit () {
178
- if ( is_rtmedia_single () ) {
179
- $this->save_single_edit ();
180
- } elseif ( is_rtmedia_album () ) {
181
- $this->save_album_edit ();
182
- }
183
- }
184
-
185
- function save_single_edit () {
186
- global $rtmedia_query;
187
- $nonce = $_POST[ 'rtmedia_media_nonce' ];
188
- if ( wp_verify_nonce ( $nonce, 'rtmedia_' . $rtmedia_query->action_query->id ) ) {
189
- do_action ( 'rtmedia_before_update_media', $rtmedia_query->action_query->id );
190
- $data_array = array( 'media_title', 'description', 'privacy' );
191
- //for medias except album and playlist, if album_is is found, then update album_id for the media also
192
- if( isset( $_POST['album_id'] ) && $_POST['album_id'] != ''){
193
- $data_array[] = 'album_id';
194
- }
195
- $data = rtmedia_sanitize_object ( $_POST, $data_array );
196
- $media = new RTMediaMedia();
197
- $image_path = get_attached_file( $rtmedia_query->media[ 0 ]->media_id );
198
- if( $image_path && $rtmedia_query->media[ 0 ]->media_type == "photo" ) {
199
- $image_meta_data = wp_generate_attachment_metadata( $rtmedia_query->media[ 0 ]->media_id, $image_path );
200
- wp_update_attachment_metadata( $rtmedia_query->media[ 0 ]->media_id, $image_meta_data );
201
- }
202
- $state = $media->update ( $rtmedia_query->action_query->id, $data, $rtmedia_query->media[ 0 ]->media_id );
203
- $rtmedia_query->query ( false );
204
- global $rtmedia_points_media_id;
205
- $rtmedia_points_media_id = $rtmedia_query->action_query->id;
206
- do_action ( 'rtmedia_after_edit_media', $rtmedia_query->action_query->id, $state );
207
-
208
- //refresh
209
- $rtMediaNav = new RTMediaNav();
210
- if ( $rtmedia_query->media[ 0 ]->context == "group" ) {
211
- $rtMediaNav->refresh_counts ( $rtmedia_query->media[ 0 ]->context_id, array( "context" => $rtmedia_query->media[ 0 ]->context, 'context_id' => $rtmedia_query->media[ 0 ]->context_id ) );
212
- } else {
213
- $rtMediaNav->refresh_counts ( $rtmedia_query->media[ 0 ]->media_author, array( "context" => "profile", 'media_author' => $rtmedia_query->media[ 0 ]->media_author ) );
214
- }
215
- $state = apply_filters('rtmedia_single_edit_state',$state);
216
- if ( $state !== false ) {
217
- add_action ( "rtmedia_before_template_load", array( &$this, "media_update_success_messege" ) );
218
- } else {
219
- add_action ( "rtmedia_before_template_load", array( &$this, "media_update_success_error" ) );
220
- }
221
- } else {
222
- _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
223
- }
224
- }
225
-
226
- function media_update_success_messege () {
227
- $message = apply_filters ( "rtmedia_update_media_message", __( 'Media updated Sucessfully', 'rtmedia' ), false );
228
- $html = "<div class='rtmedia-success media-edit-messge'>" . __ ( $message, "rtmedia" ) . "</div>";
229
- echo apply_filters ( "rtmedia_update_media_message_html", $html, $message, false );
230
- }
231
-
232
- function media_update_success_error () {
233
- $message = apply_filters ( "rtmedia_update_media_message", __( 'Error in updating Media', 'rtmedia' ), true );
234
- $html = "<div class='rtmedia-error media-edit-messge'>" . __ ( $message, "rtmedia" ) . "</div>";
235
- echo apply_filters ( "rtmedia_update_media_message_html", $html, $message, true );
236
- }
237
-
238
- function save_album_edit () {
239
- global $rtmedia_query;
240
- $nonce = $_REQUEST[ 'rtmedia_media_nonce' ];
241
- if ( wp_verify_nonce ( $nonce, 'rtmedia_' . $rtmedia_query->media_query[ 'album_id' ] ) ) {
242
- $media = new RTMediaMedia();
243
- $model = new RTMediaModel();
244
- if ( isset ( $_POST[ 'submit' ] ) ) {
245
- $data = $_POST;
246
- unset ( $data[ 'rtmedia_media_nonce' ] );
247
- unset ( $data[ '_wp_http_referer' ] );
248
- unset ( $data[ 'submit' ] );
249
- $album = $model->get_media ( array( 'id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
250
- $state = $media->update ( $album[ 0 ]->id, $data, $album[ 0 ]->media_id );
251
- global $rtmedia_points_media_id;
252
- $rtmedia_points_media_id = $album[ 0 ]->id;
253
- do_action ( 'rtmedia_after_update_album', $album[ 0 ]->id, $state );
254
- } elseif ( isset ( $_POST[ 'move-selected' ] ) ) {
255
- // print_r($_POST);die;
256
- $album_move = $_POST[ 'album' ];
257
- $selected_ids = NULL;
258
-
259
- if ( isset ( $_POST[ 'selected' ] ) ) {
260
- $selected_ids = $_POST[ 'selected' ];
261
- unset ( $_POST[ 'selected' ] );
262
- }
263
- if ( ! empty ( $selected_ids ) && is_array ( $selected_ids ) ) {
264
- $album_move_details = $model->get_media ( array( 'id' => $album_move ), false, false );
265
- foreach ( $selected_ids as $media_id ) {
266
- $media_details = $model->get_media ( array( 'id' => $media_id ), false, false );
267
- $post_array[ 'ID' ] = $media_details[ 0 ]->media_id;
268
- $post_array[ 'post_parent' ] = $album_move_details[ 0 ]->media_id;
269
- wp_update_post ( $post_array );
270
- $media->update ( $media_details[ 0 ]->id, array( 'album_id' => $album_move_details[ 0 ]->id ), $media_details[ 0 ]->media_id );
271
- }
272
- }
273
- }
274
- //refresh
275
- $rtMediaNav = new RTMediaNav();
276
- if ( $rtmedia_query->media[ 0 ]->context == "group" ) {
277
- $rtMediaNav->refresh_counts ( $rtmedia_query->media[ 0 ]->context_id, array( "context" => $rtmedia_query->media[ 0 ]->context, 'context_id' => $rtmedia_query->media[ 0 ]->context_id ) );
278
- } else {
279
- $rtMediaNav->refresh_counts ( $rtmedia_query->media[ 0 ]->media_author, array( "context" => "profile", 'media_author' => $rtmedia_query->media[ 0 ]->media_author ) );
280
- }
281
- wp_safe_redirect ( get_rtmedia_permalink ( $rtmedia_query->media_query[ 'album_id' ] ) . 'edit/' );
282
- die();
283
- } else {
284
- _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
285
- }
286
- }
287
-
288
- function check_return_delete () {
289
-
290
- global $rtmedia_query;
291
- if ( $rtmedia_query->action_query->action != 'delete' )
292
- return;
293
- if ( ! count ( $_POST ) )
294
- return;
295
-
296
- if ( isset ( $rtmedia_query->action_query->default ) && $rtmedia_query->action_query->default == 'delete' ) {
297
- $this->bulk_delete ();
298
- } else {
299
- if ( is_rtmedia_single () ) {
300
- $this->single_delete ();
301
- } elseif ( is_rtmedia_album () ) {
302
-
303
- $this->album_delete ();
304
- }
305
- }
306
- }
307
-
308
- function bulk_delete () {
309
- $nonce = $_POST[ 'rtmedia_bulk_delete_nonce' ];
310
-
311
- $media = new RTMediaMedia();
312
- if ( wp_verify_nonce ( $nonce, 'rtmedia_bulk_delete_nonce' ) && isset ( $_POST[ 'selected' ] ) ) {
313
- $ids = $_POST[ 'selected' ];
314
- foreach ( $ids as $id ) {
315
- $media->delete ( $id );
316
- }
317
- }
318
- wp_safe_redirect ( $_POST[ '_wp_http_referer' ] );
319
- die();
320
- }
321
-
322
- function single_delete () {
323
- global $rtmedia_query;
324
- $nonce = $_REQUEST[ 'rtmedia_media_nonce' ];
325
- if ( wp_verify_nonce ( $nonce, 'rtmedia_' . $rtmedia_query->media[ 0 ]->id ) ) {
326
-
327
- // do_action('rtmedia_before_delete_media',$rtmedia_query->media[ 0 ]->id);
328
-
329
- $id = $_POST;
330
- unset ( $id[ 'rtmedia_media_nonce' ] );
331
- unset ( $id[ '_wp_http_referer' ] );
332
- $media = new RTMediaMedia();
333
- $media->delete ( $rtmedia_query->media[ 0 ]->id );
334
-
335
- $post = get_post ( $rtmedia_query->media[ 0 ] );
336
-
337
- $parent_link = '';
338
- if ( function_exists ( 'bp_core_get_user_domain' ) ) {
339
- $parent_link = bp_core_get_user_domain ( $post->media_author );
340
- } else {
341
- $parent_link = get_author_posts_url ( $post->media_author );
342
- }
343
- $redirect_url = $_SERVER[ "HTTP_REFERER" ];
344
-
345
-
346
- if ( strpos ( $_SERVER[ "HTTP_REFERER" ], "/" . $rtmedia_query->media[ 0 ]->id ) > 0 ) {
347
- if ( isset ( $rtmedia_query->media[ 0 ]->album_id ) && intval ( $rtmedia_query->media[ 0 ]->album_id ) > 0 ) {
348
- $redirect_url = trailingslashit ( $parent_link ) . "media/" . $rtmedia_query->media[ 0 ]->album_id;
349
- } else {
350
- $redirect_url = trailingslashit ( $parent_link ) . "media/";
351
- }
352
- }
353
- $redirect_url = apply_filters( 'rtmedia_before_delete_media_redirect', $redirect_url );
354
- wp_safe_redirect ( $redirect_url );
355
- die();
356
- } else {
357
- _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
358
- }
359
- }
360
-
361
- function album_delete () {
362
- global $rtmedia_query;
363
- $nonce = $_REQUEST[ 'rtmedia_delete_album_nonce' ];
364
- if ( wp_verify_nonce ( $nonce, 'rtmedia_delete_album_' . $rtmedia_query->media_query[ 'album_id' ] ) ) {
365
- $media = new RTMediaMedia();
366
- $model = new RTMediaModel();
367
- $album_contents = $model->get ( array( 'album_id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
368
- foreach ( $album_contents as $album_media ) {
369
- $media->delete ( $album_media->id );
370
- }
371
- $media->delete ( $rtmedia_query->media_query[ 'album_id' ] );
372
- }
373
- if(isset($rtmedia_query->media_query['context']) && $rtmedia_query->media_query['context'] == "group") {
374
- global $bp;
375
- $group_link = bp_get_group_permalink($bp->groups->current_group);
376
- wp_safe_redirect ( trailingslashit( $group_link ) . RTMEDIA_MEDIA_SLUG . '/album/' );
377
- } else {
378
- wp_safe_redirect ( trailingslashit( get_rtmedia_user_link ( get_current_user_id () ) ) . RTMEDIA_MEDIA_SLUG . '/album/' );
379
}
380
- exit;
381
- }
382
-
383
- function check_return_merge () {
384
- global $rtmedia_query;
385
- if ( $rtmedia_query->action_query->action != 'merge' )
386
- return;
387
- $nonce = $_REQUEST[ 'rtmedia_merge_album_nonce' ];
388
- if ( wp_verify_nonce ( $nonce, 'rtmedia_merge_album_' . $rtmedia_query->media_query[ 'album_id' ] ) ) {
389
- $media = new RTMediaMedia();
390
- $model = new RTMediaModel();
391
- $album_contents = $model->get ( array( 'album_id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
392
- // print_r($album_contents); die;
393
- $album_move_details = $model->get_media ( array( 'id' => $_POST[ 'album' ] ), false, false );
394
- foreach ( $album_contents as $album_media ) {
395
-
396
- $post_array[ 'ID' ] = $album_media->media_id;
397
- $post_array[ 'post_parent' ] = $album_move_details[ 0 ]->media_id;
398
- wp_update_post ( $post_array );
399
- $media->update ( $album_media->id, array( 'album_id' => $album_move_details[ 0 ]->id ), $album_media->media_id );
400
- }
401
- $media->delete ( $rtmedia_query->media_query[ 'album_id' ] );
402
- }
403
- if(isset($rtmedia_query->media_query['context']) && $rtmedia_query->media_query['context'] == "group") {
404
- global $bp;
405
- $group_link = bp_get_group_permalink($bp->groups->current_group);
406
- wp_safe_redirect ( trailingslashit( $group_link ) . RTMEDIA_MEDIA_SLUG . '/album/' );
407
- } else {
408
- wp_safe_redirect ( trailingslashit( get_rtmedia_user_link ( get_current_user_id () ) ) . RTMEDIA_MEDIA_SLUG . '/album/' );
409
}
410
- exit;
411
- }
412
-
413
- function check_return_comments () {
414
- global $rtmedia_query;
415
-
416
- if ( $rtmedia_query->action_query->action != 'comment' )
417
- return;
418
- if ( isset ( $rtmedia_query->action_query->id ) && count ( $_POST ) ) {
419
- /**
420
- * /media/comments [POST]
421
- * Post a comment to the album by post id
422
- */
423
- $nonce = $_REQUEST[ 'rtmedia_comment_nonce' ];
424
- if ( wp_verify_nonce ( $nonce, 'rtmedia_comment_nonce' ) ) {
425
- if ( empty ( $_POST[ 'comment_content' ] ) ) {
426
- return false;
427
- }
428
- $comment = new RTMediaComment();
429
- $attr = $_POST;
430
- $mediaModel = new RTMediaModel();
431
- $result = $mediaModel->get ( array( 'id' => $rtmedia_query->action_query->id ) );
432
-
433
- if ( ! isset ( $attr[ 'comment_post_ID' ] ) )
434
- $attr[ 'comment_post_ID' ] = $result[ 0 ]->media_id;
435
- $id = $comment->add ( $attr );
436
-
437
-
438
- if ( $result[ 0 ]->activity_id != NULL ) {
439
- global $rtmedia_buddypress_activity;
440
- remove_action ( "bp_activity_comment_posted", array( $rtmedia_buddypress_activity, "comment_sync" ), 10, 2 );
441
- if ( function_exists ( 'bp_activity_new_comment' ) ) {
442
- $comment_activity_id = bp_activity_new_comment ( array( 'content' => $_POST[ 'comment_content' ], 'activity_id' => $result[ 0 ]->activity_id ) );
443
- }
444
- }
445
- if(!empty($comment_activity_id)){
446
- update_comment_meta($id, 'activity_id', $comment_activity_id);
447
- }
448
- if ( isset ( $_POST[ "rtajax" ] ) ) {
449
- global $wpdb;
450
- $comments = $wpdb->get_row ( $wpdb->prepare ( "SELECT * FROM $wpdb->comments WHERE comment_ID = %d", $id ), ARRAY_A );
451
- echo rmedia_single_comment ( $comments );
452
- exit;
453
- }
454
- } else {
455
- _e ( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
456
- }
457
- }
458
- }
459
- function check_delete_comments () {
460
- global $rtmedia_query;
461
-
462
- if ( $rtmedia_query->action_query->action != 'delete-comment' )
463
- return;
464
-
465
- if ( count ( $_POST ) ) {
466
- /**
467
- * /media/id/delete-comment [POST]
468
- * Delete Comment by Comment ID
469
- */
470
-
471
- if ( empty ( $_POST[ 'comment_id' ] ) ) {
472
- return false;
473
- }
474
- $comment = new RTMediaComment();
475
- $id = $_POST['comment_id'];
476
- $activity_id = get_comment_meta($id, 'activity_id',true);
477
-
478
- if(!empty($activity_id)){
479
- if(function_exists('bp_activity_delete_comment')){ //if buddypress is active
480
- $activity_deleted = bp_activity_delete_comment ($activity_id, $id);
481
- $delete = bp_activity_delete( array( 'id' => $activity_id, 'type' => 'activity_comment' ) );
482
- }
483
- }
484
- $comment_deleted = $comment->remove ( $id );
485
-
486
-
487
- echo $comment_deleted;
488
- exit;
489
- }
490
- }
491
-
492
- /**
493
- * Helper method to fetch allowed media types from each section
494
- *
495
- * @param type $allowed_type
496
- * @return type
497
- */
498
- function get_allowed_type_name ( $allowed_type ) {
499
- return $allowed_type[ 'name' ];
500
- }
501
-
502
- /**
503
- * Validates all the attributes for gallery shortcode
504
- *
505
- * @global type $rtmedia
506
- * @param string $attr
507
- * @return type
508
- */
509
- function sanitize_gallery_attributes ( &$attr ) {
510
- global $rtmedia;
511
-
512
- $flag = true;
513
-
514
- if ( isset ( $attr[ 'media_type' ] ) ) {
515
- $allowed_type_names = array_map ( array( $this, 'get_allowed_type_name' ), $rtmedia->allowed_types );
516
-
517
- if ( strtolower ( $attr[ 'media_type' ] ) == 'all' ) {
518
- $flag = $flag && true;
519
- unset ( $attr[ 'media_type' ] );
520
- } else if(strtolower ( $attr[ 'media_type' ] ) == 'album' ){
521
- $flag = $flag && true;
522
- }
523
- else
524
- $flag = $flag && in_array ( $attr[ 'media_type' ], $allowed_type_names );
525
- }
526
-
527
- if ( isset ( $attr[ 'order_by' ] ) ) {
528
-
529
- $allowed_columns = array( 'date', 'views', 'downloads', 'ratings', 'likes', 'dislikes' );
530
- $allowed_columns = apply_filters ( 'filter_allowed_sorting_columns', $allowed_columns );
531
-
532
- $flag = $flag && in_array ( $attr[ 'order_by' ], $allowed_columns );
533
-
534
- if ( strtolower ( $attr[ 'order_by' ] ) == 'date' )
535
- $attr[ 'order_by' ] = 'media_id';
536
- }
537
-
538
- if ( isset ( $attr[ 'order' ] ) ) {
539
- $flag = $flag && strtolower ( $attr[ 'order' ] ) == 'asc' || strtolower ( $attr[ 'order' ] ) == 'desc';
540
- }
541
-
542
- return $flag;
543
- }
544
-
545
- function update_global_query ( $attr ) {
546
- global $rtmedia_query;
547
- $rtmedia_query->query ( $attr );
548
- }
549
-
550
- /**
551
- * filter to change the template path independent of the plugin
552
- *
553
- * @return type
554
- */
555
- function get_default_template () {
556
-
557
- return apply_filters ( 'rtmedia_media_template_include', self::locate_template ( 'main', '' ) );
558
- }
559
-
560
- /**
561
- * Template Locator
562
- *
563
- * @param type $template
564
- * @return string
565
- */
566
- static function locate_template ( $template = false, $context = false, $url = false ) {
567
- $located = '';
568
- if ( ! $template ) {
569
- global $rtmedia_query;
570
-
571
- if ( is_rtmedia_album_gallery () ) {
572
- $template = 'album-gallery';
573
- } elseif ( is_rtmedia_album () || is_rtmedia_gallery () ) {
574
- $template = 'media-gallery';
575
- if (
576
- is_rtmedia_album () &&
577
- isset ( $rtmedia_query->media_query ) &&
578
- $rtmedia_query->action_query->action == 'edit'
579
- ) {
580
- if ( rtmedia_is_album_editable() || is_rt_admin() ) {
581
- $template = 'album-single-edit';
582
- }
583
- }
584
- } else if ( is_rtmedia_single () ) {
585
- $template = 'media-single';
586
- if ( $rtmedia_query->action_query->action == 'edit' )
587
- $template = 'media-single-edit';
588
- }else {
589
- return;
590
- }
591
- $template = apply_filters('rtmedia_template_filter',$template);
592
- }
593
-
594
- $context = apply_filters( 'rtmedia_context_filter' , $context );
595
-
596
- $template_name = $template . '.php';
597
-
598
- if ( $context === false ) {
599
- $context = 'media/';
600
- }
601
- if ( ! $context === '' ) {
602
- $context .='/';
603
- }
604
-
605
- $path = 'rtmedia/' . $context;
606
- $ogpath = 'templates/' . $context;
607
-
608
- if ( file_exists ( trailingslashit ( STYLESHEETPATH ) . $path . $template_name ) ) {
609
- if ( $url ) {
610
- $located = trailingslashit ( get_stylesheet_directory_uri () ) . $path . $template_name;
611
- } else {
612
- $located = trailingslashit ( STYLESHEETPATH ) . $path . $template_name;
613
- }
614
- } else if ( file_exists ( trailingslashit ( TEMPLATEPATH ) . $path . $template_name ) ) {
615
- if ( $url ) {
616
- $located = trailingslashit ( get_template_directory_uri () ) . $path . $template_name;
617
- } else {
618
- $located = trailingslashit ( TEMPLATEPATH ) . $path . $template_name;
619
- }
620
- } else {
621
- if ( $url ) {
622
- $located = trailingslashit ( RTMEDIA_URL ) . $ogpath . $template_name;
623
- } else {
624
- $located = trailingslashit ( RTMEDIA_PATH ) . $ogpath . $template_name;
625
- }
626
- $located = apply_filters('rtmedia_located_template', $located , $url, $ogpath, $template_name );// filter for rtmedia pro
627
- }
628
- return $located;
629
- }
630
631
}
10
*/
11
class RTMediaTemplate {
12
13
+ public $media_args;
14
+
15
+ function __construct() {
16
+ global $rtmedia_query;
17
+ if ( $rtmedia_query ){
18
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
19
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_image_editor_scripts' ) );
20
+ }
21
+ }
22
+
23
+ /**
24
+ * Enqueues required scripts on the page
25
+ */
26
+ function enqueue_scripts() {
27
+ wp_enqueue_script( 'rtmedia-backbone' );
28
+ $is_album = is_rtmedia_album() ? true : false;
29
+ $is_edit_allowed = is_rtmedia_edit_allowed() ? true : false;
30
+ wp_localize_script( 'rtmedia-backbone', 'is_album', array( $is_album ) );
31
+ wp_localize_script( 'rtmedia-backbone', 'is_edit_allowed', array( $is_edit_allowed ) );
32
+ }
33
+
34
+ function enqueue_image_editor_scripts() {
35
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
36
+ wp_enqueue_script( 'wp-ajax-response' );
37
+ wp_enqueue_script( 'rtmedia-image-edit', admin_url( "js/image-edit$suffix.js" ), array( 'jquery', 'json2', 'imgareaselect' ), false, 1 );
38
+ wp_enqueue_style( 'rtmedia-image-edit', RTMEDIA_URL . 'app/assets/css/image-edit.css' );
39
+ wp_enqueue_style( 'rtmedia-image-area-select', includes_url( '/js/imgareaselect/imgareaselect.css' ) );
40
+ }
41
+
42
+ /**
43
+ * redirects to the template according to the page request
44
+ * Pass on the shortcode attributes to the template so that the shortcode can berendered accordingly.
45
+ *
46
+ * Also handles the json request coming from the AJAX calls for the media
47
+ *
48
+ * @global type $rtmedia_query
49
+ * @global type $rtmedia_interaction
50
+ *
51
+ * @param type $template
52
+ * @param type $shortcode_attr
53
+ *
54
+ * @return type
55
+ */
56
+ function set_template( $template = false, $shortcode_attr = false ) {
57
+
58
+ global $rtmedia_query, $rtmedia_interaction, $rtmedia_media;
59
+
60
+ do_action( 'rtmedia_pre_template' );
61
+
62
+ //print_r($rtmedia_query);
63
+
64
+ if ( isset ( $rtmedia_query->action_query->action ) ){
65
+ //echo $rtmedia_query->action_query->action;
66
+ do_action( 'rtmedia_pre_action_' . $rtmedia_query->action_query->action );
67
+ } else {
68
+ do_action( 'rtmedia_pre_action_default' );
69
+ }
70
+
71
+ $this->check_return_json();
72
+
73
+ $this->check_return_upload();
74
+
75
+ if ( $rtmedia_interaction && isset( $rtmedia_interaction->context ) && in_array( $rtmedia_interaction->context->type, array( "profile", "group" ) ) ){
76
+
77
+
78
+ $this->check_return_edit();
79
+
80
+ $this->check_return_delete();
81
+
82
+ $this->check_return_merge();
83
+
84
+ $this->check_return_comments();
85
+
86
+ $this->check_delete_comments();
87
+ if ( isset( $rtmedia_query->is_gallery_shortcode ) && $rtmedia_query->is_gallery_shortcode == true && isset( $shortcode_attr[ 'name' ] ) && $shortcode_attr[ 'name' ] == 'gallery' ){
88
+
89
+ $valid = $this->sanitize_gallery_attributes( $shortcode_attr[ 'attr' ] );
90
+
91
+ if ( $valid ) {
92
+ if ( is_array( $shortcode_attr[ 'attr' ] ) ) {
93
+ $this->update_global_query( $shortcode_attr[ 'attr' ] );
94
+ }
95
+ echo "<div class='rtmedia_gallery_wrapper'>";
96
+ $this->add_hidden_fields_in_gallery();
97
+ $gallery_template = apply_filters( "rtmedia-before-template", $template, $shortcode_attr );
98
+ include $this->locate_template( $gallery_template );
99
+ echo "</div>";
100
+ } else {
101
+ echo __( 'Invalid attribute passed for rtmedia_gallery shortcode.', 'rtmedia' );
102
+
103
+ return false;
104
+ }
105
+ } else {
106
+ return $this->get_default_template();
107
+ }
108
+ } else {
109
+ if ( ! $shortcode_attr ){
110
+ return $this->get_default_template();
111
+ } else {
112
+ if ( $shortcode_attr[ 'name' ] == 'gallery' ){
113
+ $valid = $this->sanitize_gallery_attributes( $shortcode_attr[ 'attr' ] );
114
+ if ( $valid ){
115
+ if ( is_array( $shortcode_attr[ 'attr' ] ) ){
116
+ $this->update_global_query( $shortcode_attr[ 'attr' ] );
117
+ }
118
+ global $rtaccount;
119
+ if ( ! isset ( $rtaccount ) ){
120
+ $rtaccount = 0;
121
+ }
122
+ //add_action("rtmedia_before_media_gallery",array(&$this,"")) ;
123
+ if ( isset( $shortcode_attr[ 'attr' ] ) && isset( $shortcode_attr[ 'attr' ][ 'uploader' ] ) && $shortcode_attr[ 'attr' ][ 'uploader' ] == "before" ){
124
+ echo RTMediaUploadShortcode::pre_render( $shortcode_attr[ 'attr' ] );
125
+ }
126
+ echo "<div class='rtmedia_gallery_wrapper'>";
127
+ $this->add_hidden_fields_in_gallery();
128
+ $gallery_template = apply_filters( "rtmedia-before-template", $template, $shortcode_attr );
129
+ include $this->locate_template( $gallery_template );
130
+ echo "</div>";
131
+ if ( isset( $shortcode_attr[ 'attr' ] ) && isset( $shortcode_attr[ 'attr' ][ 'uploader' ] ) && ( $shortcode_attr[ 'attr' ][ 'uploader' ] == "after" || $shortcode_attr[ 'attr' ][ 'uploader' ] == "true" ) ){
132
+ echo RTMediaUploadShortcode::pre_render( $shortcode_attr[ 'attr' ] );
133
+ }
134
+ } else {
135
+ echo __( 'Invalid attribute passed for rtmedia_gallery shortcode.', 'rtmedia' );
136
+
137
+ return false;
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+ function add_hidden_fields_in_gallery() {
145
+ global $rtmedia_query;
146
+ $return_str = "<input name='rtmedia_shortcode' value='true' type='hidden' />";
147
+ if ( $rtmedia_query->original_query && is_array( $rtmedia_query->original_query ) ){
148
+ foreach ( $rtmedia_query->original_query as $key => $val ) {
149
+ $return_str .= '<input name="' . $key . '" value="' . $val . '" type="hidden" />';
150
+ }
151
+ }
152
+ echo $return_str;
153
+ }
154
+
155
+ function check_return_json() {
156
+ global $rtmedia_query;
157
+ if ( $rtmedia_query->format == 'json' ){
158
+ $this->json_output();
159
+ } else {
160
+ return;
161
+ }
162
+ }
163
+
164
+ function check_return_upload() {
165
+ global $rtmedia_query;
166
+ if ( $rtmedia_query->action_query->action != 'upload' ){
167
+ return;
168
+ }
169
+ $upload = new RTMediaUploadEndpoint();
170
+ $upload->template_redirect();
171
+ }
172
+
173
+ function json_output() {
174
+ global $rtmedia_query;
175
+ $media_array = array();
176
+ if ( $rtmedia_query->media ){
177
+ foreach ( $rtmedia_query->media as $key => $media ) {
178
+ $media_array[ $key ] = $media;
179
+ $media_array[ $key ]->guid = rtmedia_image( 'rt_media_thumbnail', $media->id, false );
180
+ $media_array[ $key ]->rt_permalink = get_rtmedia_permalink( $media->id );
181
+ }
182
+ }
183
+ $return_array[ 'data' ] = $media_array;
184
+ $return_array[ 'prev' ] = rtmedia_page() - 1;
185
+ $return_array[ 'next' ] = ( rtmedia_offset() + rtmedia_per_page_media() < rtmedia_count() ) ? ( rtmedia_page() + 1 ) : - 1;
186
+ echo json_encode( $return_array );
187
+ die;
188
+ }
189
+
190
+ function check_return_edit() {
191
+ global $rtmedia_query;
192
+ if ( $rtmedia_query->action_query->action == 'edit' && count( $_POST ) ){
193
+ $this->save_edit();
194
+ }
195
+
196
+ return $this->get_default_template();
197
+ }
198
+
199
+ function save_edit() {
200
+ if ( is_rtmedia_single() ){
201
+ $this->save_single_edit();
202
+ } elseif ( is_rtmedia_album() ) {
203
+ $this->save_album_edit();
204
+ }
205
+ }
206
+
207
+ function save_single_edit() {
208
+ global $rtmedia_query;
209
+ $nonce = $_POST[ 'rtmedia_media_nonce' ];
210
+ if ( wp_verify_nonce( $nonce, 'rtmedia_' . $rtmedia_query->action_query->id ) ){
211
+ do_action( 'rtmedia_before_update_media', $rtmedia_query->action_query->id );
212
+ $data_array = array( 'media_title', 'description', 'privacy' );
213
+ //for medias except album and playlist, if album_is is found, then update album_id for the media also
214
+ if ( isset( $_POST[ 'album_id' ] ) && $_POST[ 'album_id' ] != '' ){
215
+ $data_array[ ] = 'album_id';
216
+ }
217
+ $data = rtmedia_sanitize_object( $_POST, $data_array );
218
+ $media = new RTMediaMedia();
219
+ $image_path = get_attached_file( $rtmedia_query->media[ 0 ]->media_id );
220
+ if ( $image_path && $rtmedia_query->media[ 0 ]->media_type == "photo" ){
221
+ $image_meta_data = wp_generate_attachment_metadata( $rtmedia_query->media[ 0 ]->media_id, $image_path );
222
+ wp_update_attachment_metadata( $rtmedia_query->media[ 0 ]->media_id, $image_meta_data );
223
+ }
224
+ $state = $media->update( $rtmedia_query->action_query->id, $data, $rtmedia_query->media[ 0 ]->media_id );
225
+ $rtmedia_query->query( false );
226
+ global $rtmedia_points_media_id;
227
+ $rtmedia_points_media_id = $rtmedia_query->action_query->id;
228
+ do_action( 'rtmedia_after_edit_media', $rtmedia_query->action_query->id, $state );
229
+
230
+ //refresh
231
+ $rtMediaNav = new RTMediaNav();
232
+ if ( $rtmedia_query->media[ 0 ]->context == "group" ){
233
+ $rtMediaNav->refresh_counts( $rtmedia_query->media[ 0 ]->context_id, array( "context" => $rtmedia_query->media[ 0 ]->context, 'context_id' => $rtmedia_query->media[ 0 ]->context_id ) );
234
+ } else {
235
+ $rtMediaNav->refresh_counts( $rtmedia_query->media[ 0 ]->media_author, array( "context" => "profile", 'media_author' => $rtmedia_query->media[ 0 ]->media_author ) );
236
+ }
237
+ $state = apply_filters( 'rtmedia_single_edit_state', $state );
238
+ if ( $state !== false ){
239
+ add_action( "rtmedia_before_template_load", array( &$this, "media_update_success_messege" ) );
240
+ } else {
241
+ add_action( "rtmedia_before_template_load", array( &$this, "media_update_success_error" ) );
242
+ }
243
+ } else {
244
+ _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
245
+ }
246
+ }
247
+
248
+ function media_update_success_messege() {
249
+ $message = apply_filters( "rtmedia_update_media_message", __( 'Media updated Sucessfully', 'rtmedia' ), false );
250
+ $html = "<div class='rtmedia-success media-edit-messge'>" . __( $message, "rtmedia" ) . "</div>";
251
+ echo apply_filters( "rtmedia_update_media_message_html", $html, $message, false );
252
+ }
253
+
254
+ function media_update_success_error() {
255
+ $message = apply_filters( "rtmedia_update_media_message", __( 'Error in updating Media', 'rtmedia' ), true );
256
+ $html = "<div class='rtmedia-error media-edit-messge'>" . __( $message, "rtmedia" ) . "</div>";
257
+ echo apply_filters( "rtmedia_update_media_message_html", $html, $message, true );
258
+ }
259
+
260
+ function save_album_edit() {
261
+ global $rtmedia_query;
262
+ $nonce = $_REQUEST[ 'rtmedia_media_nonce' ];
263
+ if ( wp_verify_nonce( $nonce, 'rtmedia_' . $rtmedia_query->media_query[ 'album_id' ] ) ){
264
+ $media = new RTMediaMedia();
265
+ $model = new RTMediaModel();
266
+ if ( isset ( $_POST[ 'submit' ] ) ){
267
+ $data = $_POST;
268
+ unset ( $data[ 'rtmedia_media_nonce' ] );
269
+ unset ( $data[ '_wp_http_referer' ] );
270
+ unset ( $data[ 'submit' ] );
271
+ $album = $model->get_media( array( 'id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
272
+ $state = $media->update( $album[ 0 ]->id, $data, $album[ 0 ]->media_id );
273
+ global $rtmedia_points_media_id;
274
+ $rtmedia_points_media_id = $album[ 0 ]->id;
275
+ do_action( 'rtmedia_after_update_album', $album[ 0 ]->id, $state );
276
+ } elseif ( isset ( $_POST[ 'move-selected' ] ) ) {
277
+ // print_r($_POST);die;
278
+ $album_move = $_POST[ 'album' ];
279
+ $selected_ids = null;
280
+
281
+ if ( isset ( $_POST[ 'selected' ] ) ){
282
+ $selected_ids = $_POST[ 'selected' ];
283
+ unset ( $_POST[ 'selected' ] );
284
+ }
285
+ if ( ! empty ( $selected_ids ) && is_array( $selected_ids ) ){
286
+ $album_move_details = $model->get_media( array( 'id' => $album_move ), false, false );
287
+ foreach ( $selected_ids as $media_id ) {
288
+ $media_details = $model->get_media( array( 'id' => $media_id ), false, false );
289
+ $post_array[ 'ID' ] = $media_details[ 0 ]->media_id;
290
+ $post_array[ 'post_parent' ] = $album_move_details[ 0 ]->media_id;
291
+ wp_update_post( $post_array );
292
+ $media->update( $media_details[ 0 ]->id, array( 'album_id' => $album_move_details[ 0 ]->id ), $media_details[ 0 ]->media_id );
293
+ }
294
+ }
295
+ }
296
+ //refresh
297
+ $rtMediaNav = new RTMediaNav();
298
+ if ( $rtmedia_query->media[ 0 ]->context == "group" ){
299
+ $rtMediaNav->refresh_counts( $rtmedia_query->media[ 0 ]->context_id, array( "context" => $rtmedia_query->media[ 0 ]->context, 'context_id' => $rtmedia_query->media[ 0 ]->context_id ) );
300
+ } else {
301
+ $rtMediaNav->refresh_counts( $rtmedia_query->media[ 0 ]->media_author, array( "context" => "profile", 'media_author' => $rtmedia_query->media[ 0 ]->media_author ) );
302
+ }
303
+ wp_safe_redirect( get_rtmedia_permalink( $rtmedia_query->media_query[ 'album_id' ] ) . 'edit/' );
304
+ die();
305
+ } else {
306
+ _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
307
+ }
308
+ }
309
+
310
+ function check_return_delete() {
311
+
312
+ global $rtmedia_query;
313
+ if ( $rtmedia_query->action_query->action != 'delete' ){
314
+ return;
315
+ }
316
+ if ( ! count( $_POST ) ){
317
+ return;
318
+ }
319
+
320
+ if ( isset ( $rtmedia_query->action_query->default ) && $rtmedia_query->action_query->default == 'delete' ){
321
+ $this->bulk_delete();
322
+ } else {
323
+ if ( is_rtmedia_single() ){
324
+ $this->single_delete();
325
+ } elseif ( is_rtmedia_album() ) {
326
+
327
+ $this->album_delete();
328
+ }
329
+ }
330
+ }
331
+
332
+ function bulk_delete() {
333
+ $nonce = $_POST[ 'rtmedia_bulk_delete_nonce' ];
334
+
335
+ $media = new RTMediaMedia();
336
+ if ( wp_verify_nonce( $nonce, 'rtmedia_bulk_delete_nonce' ) && isset ( $_POST[ 'selected' ] ) ){
337
+ $ids = $_POST[ 'selected' ];
338
+ foreach ( $ids as $id ) {
339
+ $media->delete( $id );
340
+ }
341
+ }
342
+ wp_safe_redirect( $_POST[ '_wp_http_referer' ] );
343
+ die();
344
}
345
+
346
+ function single_delete() {
347
+ global $rtmedia_query;
348
+ $nonce = $_REQUEST[ 'rtmedia_media_nonce' ];
349
+ if ( wp_verify_nonce( $nonce, 'rtmedia_' . $rtmedia_query->media[ 0 ]->id ) ){
350
+
351
+ // do_action('rtmedia_before_delete_media',$rtmedia_query->media[ 0 ]->id);
352
+
353
+ $id = $_POST;
354
+ unset ( $id[ 'rtmedia_media_nonce' ] );
355
+ unset ( $id[ '_wp_http_referer' ] );
356
+ $media = new RTMediaMedia();
357
+ $media->delete( $rtmedia_query->media[ 0 ]->id );
358
+
359
+ $post = get_post( $rtmedia_query->media[ 0 ] );
360
+
361
+ $parent_link = '';
362
+ if ( function_exists( 'bp_core_get_user_domain' ) ){
363
+ $parent_link = bp_core_get_user_domain( $post->media_author );
364
+ } else {
365
+ $parent_link = get_author_posts_url( $post->media_author );
366
+ }
367
+ $redirect_url = $_SERVER[ "HTTP_REFERER" ];
368
+
369
+
370
+ if ( strpos( $_SERVER[ "HTTP_REFERER" ], "/" . $rtmedia_query->media[ 0 ]->id ) > 0 ){
371
+ if ( isset ( $rtmedia_query->media[ 0 ]->album_id ) && intval( $rtmedia_query->media[ 0 ]->album_id ) > 0 ){
372
+ $redirect_url = trailingslashit( $parent_link ) . "media/" . $rtmedia_query->media[ 0 ]->album_id;
373
+ } else {
374
+ $redirect_url = trailingslashit( $parent_link ) . "media/";
375
+ }
376
+ }
377
+ $redirect_url = apply_filters( 'rtmedia_before_delete_media_redirect', $redirect_url );
378
+ wp_safe_redirect( $redirect_url );
379
+ die();
380
+ } else {
381
+ _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
382
+ }
383
+ }
384
+
385
+ function album_delete() {
386
+ global $rtmedia_query;
387
+ $nonce = $_REQUEST[ 'rtmedia_delete_album_nonce' ];
388
+ if ( wp_verify_nonce( $nonce, 'rtmedia_delete_album_' . $rtmedia_query->media_query[ 'album_id' ] ) ){
389
+ $media = new RTMediaMedia();
390
+ $model = new RTMediaModel();
391
+ $album_contents = $model->get( array( 'album_id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
392
+ foreach ( $album_contents as $album_media ) {
393
+ $media->delete( $album_media->id );
394
+ }
395
+ $media->delete( $rtmedia_query->media_query[ 'album_id' ] );
396
+ }
397
+ if ( isset( $rtmedia_query->media_query[ 'context' ] ) && $rtmedia_query->media_query[ 'context' ] == "group" ){
398
+ global $bp;
399
+ $group_link = bp_get_group_permalink( $bp->groups->current_group );
400
+ wp_safe_redirect( trailingslashit( $group_link ) . RTMEDIA_MEDIA_SLUG . '/album/' );
401
+ } else {
402
+ wp_safe_redirect( trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . RTMEDIA_MEDIA_SLUG . '/album/' );
403
+ }
404
+ exit;
405
+ }
406
+
407
+ function check_return_merge() {
408
+ global $rtmedia_query;
409
+ if ( $rtmedia_query->action_query->action != 'merge' ){
410
+ return;
411
+ }
412
+ $nonce = $_REQUEST[ 'rtmedia_merge_album_nonce' ];
413
+ if ( wp_verify_nonce( $nonce, 'rtmedia_merge_album_' . $rtmedia_query->media_query[ 'album_id' ] ) ){
414
+ $media = new RTMediaMedia();
415
+ $model = new RTMediaModel();
416
+ $album_contents = $model->get( array( 'album_id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
417
+ // print_r($album_contents); die;
418
+ $album_move_details = $model->get_media( array( 'id' => $_POST[ 'album' ] ), false, false );
419
+ foreach ( $album_contents as $album_media ) {
420
+
421
+ $post_array[ 'ID' ] = $album_media->media_id;
422
+ $post_array[ 'post_parent' ] = $album_move_details[ 0 ]->media_id;
423
+ wp_update_post( $post_array );
424
+ $media->update( $album_media->id, array( 'album_id' => $album_move_details[ 0 ]->id ), $album_media->media_id );
425
+ }
426
+ $media->delete( $rtmedia_query->media_query[ 'album_id' ] );
427
+ }
428
+ if ( isset( $rtmedia_query->media_query[ 'context' ] ) && $rtmedia_query->media_query[ 'context' ] == "group" ){
429
+ global $bp;
430
+ $group_link = bp_get_group_permalink( $bp->groups->current_group );
431
+ wp_safe_redirect( trailingslashit( $group_link ) . RTMEDIA_MEDIA_SLUG . '/album/' );
432
+ } else {
433
+ wp_safe_redirect( trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . RTMEDIA_MEDIA_SLUG . '/album/' );
434
+ }
435
+ exit;
436
+ }
437
+
438
+ function check_return_comments() {
439
+ global $rtmedia_query;
440
+
441
+ if ( $rtmedia_query->action_query->action != 'comment' ){
442
+ return;
443
+ }
444
+ if ( isset ( $rtmedia_query->action_query->id ) && count( $_POST ) ){
445
+ /**
446
+ * /media/comments [POST]
447
+ * Post a comment to the album by post id
448
+ */
449
+ $nonce = $_REQUEST[ 'rtmedia_comment_nonce' ];
450
+ if ( wp_verify_nonce( $nonce, 'rtmedia_comment_nonce' ) ){
451
+ if ( empty ( $_POST[ 'comment_content' ] ) ){
452
+ return false;
453
+ }
454
+ $comment = new RTMediaComment();
455
+ $attr = $_POST;
456
+ $mediaModel = new RTMediaModel();
457
+ $result = $mediaModel->get( array( 'id' => $rtmedia_query->action_query->id ) );
458
+
459
+ if ( ! isset ( $attr[ 'comment_post_ID' ] ) ){
460
+ $attr[ 'comment_post_ID' ] = $result[ 0 ]->media_id;
461
+ }
462
+ $id = $comment->add( $attr );
463
+
464
+
465
+ if ( $result[ 0 ]->activity_id != null ){
466
+ global $rtmedia_buddypress_activity;
467
+ remove_action( "bp_activity_comment_posted", array( $rtmedia_buddypress_activity, "comment_sync" ), 10, 2 );
468
+ if ( function_exists( 'bp_activity_new_comment' ) ){
469
+ $comment_activity_id = bp_activity_new_comment( array( 'content' => $_POST[ 'comment_content' ], 'activity_id' => $result[ 0 ]->activity_id ) );
470
+ }
471
+ }
472
+ if ( ! empty( $comment_activity_id ) ){
473
+ update_comment_meta( $id, 'activity_id', $comment_activity_id );
474
+ }
475
+ if ( isset ( $_POST[ "rtajax" ] ) ){
476
+ global $wpdb;
477
+ $comments = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_ID = %d", $id ), ARRAY_A );
478
+ echo rmedia_single_comment( $comments );
479
+ exit;
480
+ }
481
+ } else {
482
+ _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
483
+ }
484
+ }
485
+ }
486
+
487
+ function check_delete_comments() {
488
+ global $rtmedia_query;
489
+
490
+ if ( $rtmedia_query->action_query->action != 'delete-comment' ){
491
+ return;
492
+ }
493
+
494
+ if ( count( $_POST ) ){
495
+ /**
496
+ * /media/id/delete-comment [POST]
497
+ * Delete Comment by Comment ID
498
+ */
499
+
500
+ if ( empty ( $_POST[ 'comment_id' ] ) ){
501
+ return false;
502
+ }
503
+ $comment = new RTMediaComment();
504
+ $id = $_POST[ 'comment_id' ];
505
+ $activity_id = get_comment_meta( $id, 'activity_id', true );
506
+
507
+ if ( ! empty( $activity_id ) ){
508
+ if ( function_exists( 'bp_activity_delete_comment' ) ){ //if buddypress is active
509
+ $activity_deleted = bp_activity_delete_comment( $activity_id, $id );
510
+ $delete = bp_activity_delete( array( 'id' => $activity_id, 'type' => 'activity_comment' ) );
511
+ }
512
+ }
513
+ $comment_deleted = $comment->remove( $id );
514
+
515
+
516
+ echo $comment_deleted;
517
+ exit;
518
+ }
519
+ }
520
+
521
+ /**
522
+ * Helper method to fetch allowed media types from each section
523
+ *
524
+ * @param type $allowed_type
525
+ *
526
+ * @return type
527
+ */
528
+ function get_allowed_type_name( $allowed_type ) {
529
+ return $allowed_type[ 'name' ];
530
+ }
531
+
532
+ /**
533
+ * Validates all the attributes for gallery shortcode
534
+ *
535
+ * @global type $rtmedia
536
+ *
537
+ * @param string $attr
538
+ *
539
+ * @return type
540
+ */
541
+ function sanitize_gallery_attributes( &$attr ) {
542
+ global $rtmedia;
543
+
544
+ $flag = true;
545
+
546
+ if ( isset ( $attr[ 'media_type' ] ) ){
547
+ $allowed_type_names = array_map( array( $this, 'get_allowed_type_name' ), $rtmedia->allowed_types );
548
+
549
+ if ( strtolower( $attr[ 'media_type' ] ) == 'all' ){
550
+ $flag = $flag && true;
551
+ unset ( $attr[ 'media_type' ] );
552
+ } else {
553
+ if ( strtolower( $attr[ 'media_type' ] ) == 'album' ){
554
+ $flag = $flag && true;
555
+ } else {
556
+ $flag = $flag && in_array( $attr[ 'media_type' ], $allowed_type_names );
557
+ }
558
+ }
559
+ }
560
+
561
+ if ( isset ( $attr[ 'order_by' ] ) ){
562
+
563
+ $allowed_columns = array( 'date', 'views', 'downloads', 'ratings', 'likes', 'dislikes' );
564
+ $allowed_columns = apply_filters( 'filter_allowed_sorting_columns', $allowed_columns );
565
+
566
+ $flag = $flag && in_array( $attr[ 'order_by' ], $allowed_columns );
567
+
568
+ if ( strtolower( $attr[ 'order_by' ] ) == 'date' ){
569
+ $attr[ 'order_by' ] = 'media_id';
570
+ }
571
+ }
572
+
573
+ if ( isset ( $attr[ 'order' ] ) ){
574
+ $flag = $flag && strtolower( $attr[ 'order' ] ) == 'asc' || strtolower( $attr[ 'order' ] ) == 'desc';
575
+ }
576
+
577
+ return $flag;
578
+ }
579
+
580
+ function update_global_query( $attr ) {
581
+ global $rtmedia_query;
582
+ $rtmedia_query->query( $attr );
583
+ }
584
+
585
+ /**
586
+ * filter to change the template path independent of the plugin
587
+ *
588
+ * @return type
589
+ */
590
+ function get_default_template() {
591
+
592
+ return apply_filters( 'rtmedia_media_template_include', self::locate_template( 'main', '' ) );
593
+ }
594
+
595
+ /**
596
+ * Template Locator
597
+ *
598
+ * @param type $template
599
+ *
600
+ * @return string
601
+ */
602
+ static function locate_template( $template = false, $context = false, $url = false ) {
603
+ $located = '';
604
+ if ( ! $template ){
605
+ global $rtmedia_query;
606
+
607
+ if ( is_rtmedia_album_gallery() ){
608
+ $template = 'album-gallery';
609
+ } elseif ( is_rtmedia_album() || is_rtmedia_gallery() ) {
610
+ $template = 'media-gallery';
611
+ if ( is_rtmedia_album() && isset ( $rtmedia_query->media_query ) && $rtmedia_query->action_query->action == 'edit'
612
+ ){
613
+ if ( rtmedia_is_album_editable() || is_rt_admin() ){
614
+ $template = 'album-single-edit';
615
+ }
616
+ }
617
+ } else {
618
+ if ( is_rtmedia_single() ){
619
+ $template = 'media-single';
620
+ if ( $rtmedia_query->action_query->action == 'edit' ){
621
+ $template = 'media-single-edit';
622
+ }
623
+ } else {
624
+ return;
625
+ }
626
+ }
627
+ $template = apply_filters( 'rtmedia_template_filter', $template );
628
+ }
629
+
630
+ $context = apply_filters( 'rtmedia_context_filter', $context );
631
+
632
+ $template_name = $template . '.php';
633
+
634
+ if ( $context === false ){
635
+ $context = 'media/';
636
+ }
637
+ if ( ! $context === '' ){
638
+ $context .= '/';
639
+ }
640
+
641
+ $path = 'rtmedia/' . $context;
642
+ $ogpath = 'templates/' . $context;
643
+
644
+ if ( file_exists( trailingslashit( STYLESHEETPATH ) . $path . $template_name ) ){
645
+ if ( $url ){
646
+ $located = trailingslashit( get_stylesheet_directory_uri() ) . $path . $template_name;
647
+ } else {
648
+ $located = trailingslashit( STYLESHEETPATH ) . $path . $template_name;
649
+ }
650
+ } else {
651
+ if ( file_exists( trailingslashit( TEMPLATEPATH ) . $path . $template_name ) ){
652
+ if ( $url ){
653
+ $located = trailingslashit( get_template_directory_uri() ) . $path . $template_name;
654
+ } else {
655
+ $located = trailingslashit( TEMPLATEPATH ) . $path . $template_name;
656
+ }
657
+ } else {
658
+ if ( $url ){
659
+ $located = trailingslashit( RTMEDIA_URL ) . $ogpath . $template_name;
660
+ } else {
661
+ $located = trailingslashit( RTMEDIA_PATH ) . $ogpath . $template_name;
662
+ }
663
+ $located = apply_filters( 'rtmedia_located_template', $located, $url, $ogpath, $template_name ); // filter for rtmedia pro
664
+ }
665
+ }
666
+
667
+ return $located;
668
}
669
670
}
app/main/controllers/template/rt-template-functions.php CHANGED
@@ -1377,7 +1377,7 @@ function rtmedia_create_album ( $options) {
1377
if ( $display === true ) {
1378
1379
add_action('rtmedia_before_media_gallery','rtmedia_create_album_modal');
1380
- $options[] = "<a href='#rtmedia-create-album-modal' class='rtmedia-reveal-modal rtmedia-modal-link' title='". __( 'Create New Album', 'rtmedia' ) ."'><i class='rtmicon-plus-circle'></i>" . __('Add Album') . "</a>";
1381
return $options;
1382
1383
}
@@ -1725,7 +1725,7 @@ function show_rtmedia_like_counts(){
1725
$count = get_rtmedia_like();
1726
if( !(isset($options['general_enableLikes']) && $options['general_enableLikes'] == 0)){
1727
?>
1728
- <div class='rtmedia-like-info<?php if($count == 0) echo " hide";?>'><i class="rtmicon-thumbs-up"></i> <span class="rtmedia-like-counter-wrap"><span class="rtmedia-like-counter"><?php echo $count; ?></span> <?php _e('people like this');?></span></div>
1729
<?php }
1730
1731
}
1377
if ( $display === true ) {
1378
1379
add_action('rtmedia_before_media_gallery','rtmedia_create_album_modal');
1380
+ $options[] = "<a href='#rtmedia-create-album-modal' class='rtmedia-reveal-modal rtmedia-modal-link' title='". __( 'Create New Album', 'rtmedia' ) ."'><i class='rtmicon-plus-circle'></i>" . __('Add Album', 'rtmedia') . "</a>";
1381
return $options;
1382
1383
}
1725
$count = get_rtmedia_like();
1726
if( !(isset($options['general_enableLikes']) && $options['general_enableLikes'] == 0)){
1727
?>
1728
+ <div class='rtmedia-like-info<?php if($count == 0) echo " hide";?>'><i class="rtmicon-thumbs-up"></i> <span class="rtmedia-like-counter-wrap"><span class="rtmedia-like-counter"><?php echo $count; ?></span> <?php _e('people like this', 'rtmedia');?></span></div>
1729
<?php }
1730
1731
}
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.6.10
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.6.11
8
Author: rtCamp
9
Text Domain: rtmedia
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
languages/rtmedia-pl_PL.mo CHANGED
Binary file
languages/rtmedia-ru_RU.mo CHANGED
Binary file
languages/rtmedia.mo CHANGED
Binary file
languages/rtmedia.po CHANGED
@@ -2,1074 +2,1032 @@ msgid ""
2
msgstr ""
3
"Project-Id-Version: BuddyPress Media\n"
4
"Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-03-26 19:54+0530\n"
6
- "PO-Revision-Date: 2014-03-26 19:54+0530\n"
7
"Last-Translator: faishal <faishal.saiyed@rtcamp.com>\n"
8
"Language-Team: rtCamp <info@rtcamp.com>\n"
9
"Language: en_IN\n"
10
"MIME-Version: 1.0\n"
11
"Content-Type: text/plain; charset=UTF-8\n"
12
"Content-Transfer-Encoding: 8bit\n"
13
- "X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;__\n"
14
"X-Poedit-Basepath: ../.\n"
15
- "X-Generator: Poedit 1.5.4\n"
16
"X-Poedit-SearchPath-0: .\n"
17
18
- #: app/main/RTMedia.php:254
19
- msgid "Photo"
20
msgstr ""
21
22
- #: app/main/RTMedia.php:255
23
- msgid "Photos"
24
msgstr ""
25
26
- #: app/main/RTMedia.php:263
27
- msgid "Video"
28
msgstr ""
29
30
- #: app/main/RTMedia.php:264
31
- msgid "Videos"
32
msgstr ""
33
34
- #: app/main/RTMedia.php:272 app/main/RTMedia.php:273
35
- msgid "Music"
36
msgstr ""
37
38
- #: app/main/RTMedia.php:360
39
- msgid "<strong>Private</strong> - Visible only to the user"
40
msgstr ""
41
42
- #: app/main/RTMedia.php:361
43
- msgid "<strong>Friends</strong> - Visible to user's friends"
44
msgstr ""
45
46
- #: app/main/RTMedia.php:362
47
- msgid "<strong>Logged in Users</strong> - Visible to registered users"
48
msgstr ""
49
50
- #: app/main/RTMedia.php:363
51
- msgid "<strong>Public</strong> - Visible to the world"
52
msgstr ""
53
54
- #: app/main/RTMedia.php:514 app/importers/BPMediaAlbumimporter.php:91
55
- msgid "Media"
56
msgstr ""
57
58
- #: app/main/RTMedia.php:520 app/main/controllers/template/RTMediaNav.php:146
59
- msgid "All"
60
msgstr ""
61
62
- #: app/main/RTMedia.php:529
63
- #: app/main/controllers/template/rt-template-functions.php:1057
64
- #: app/main/controllers/media/RTMediaAlbum.php:54
65
- msgid "Album"
66
msgstr ""
67
68
- #: app/main/RTMedia.php:532 app/main/controllers/template/RTMediaNav.php:95
69
- #: app/main/controllers/template/RTMediaNav.php:167
70
- #: app/main/controllers/media/RTMediaAlbum.php:53
71
- #: app/main/controllers/media/RTMediaAlbum.php:65
72
- msgid "Albums"
73
msgstr ""
74
75
- #: app/main/RTMedia.php:540
76
- #: app/main/controllers/template/rt-template-functions.php:1738
77
- #: app/main/controllers/template/rt-template-functions.php:1741
78
- msgid "Upload"
79
msgstr ""
80
81
- #: app/main/RTMedia.php:544
82
- msgid "Wall Post"
83
msgstr ""
84
85
- #: app/main/RTMedia.php:735
86
- msgid "Wall Posts"
87
msgstr ""
88
89
- #: app/main/RTMedia.php:775
90
- msgid ": Can't Create Database table. Please check create table permission."
91
msgstr ""
92
93
- #: app/main/RTMedia.php:809
94
- msgid "Loading media"
95
msgstr ""
96
97
- #: app/main/RTMedia.php:810
98
- msgid "Please enter some content to post."
99
msgstr ""
100
101
- #: app/main/RTMedia.php:811
102
- msgid "Empty Comment is not allowed."
103
msgstr ""
104
105
- #: app/main/RTMedia.php:812
106
- msgid "Are you sure you want to delete this media?"
107
msgstr ""
108
109
- #: app/main/RTMedia.php:813
110
- msgid "Are you sure you want to delete this comment?"
111
msgstr ""
112
113
- #: app/main/RTMedia.php:814
114
- msgid "Are you sure you want to delete this Album?"
115
msgstr ""
116
117
- #: app/main/RTMedia.php:815
118
- msgid "Drop files here"
119
msgstr ""
120
121
- #: app/main/RTMedia.php:816
122
- msgid "album created successfully."
123
msgstr ""
124
125
- #: app/main/RTMedia.php:817
126
- msgid "Something went wrong. Please try again."
127
msgstr ""
128
129
- #: app/main/RTMedia.php:818
130
- msgid "Enter an album name."
131
msgstr ""
132
133
- #: app/main/RTMedia.php:819
134
- msgid "Max file Size Limit : "
135
msgstr ""
136
137
- #: app/main/RTMedia.php:820
138
- msgid "Allowed File Formats"
139
msgstr ""
140
141
- #: app/main/RTMedia.php:821 templates/media/album-single-edit.php:58
142
- msgid "Select All Visible"
143
msgstr ""
144
145
- #: app/main/RTMedia.php:822
146
- msgid "Unselect All Visible"
147
msgstr ""
148
149
- #: app/main/RTMedia.php:823
150
- msgid "Please select some media."
151
msgstr ""
152
153
- #: app/main/RTMedia.php:824
154
- msgid "Are you sure you want to delete the selected medias?"
155
msgstr ""
156
157
- #: app/main/RTMedia.php:825
158
- msgid "Are you sure you want to move the selected medias?"
159
msgstr ""
160
161
- #: app/main/RTMedia.php:826
162
- msgid "Waiting"
163
msgstr ""
164
165
- #: app/main/RTMedia.php:827
166
- msgid "Uploaded"
167
msgstr ""
168
169
- #: app/main/RTMedia.php:828
170
- msgid "Uploading"
171
msgstr ""
172
173
- #: app/main/RTMedia.php:829
174
- msgid "Failed"
175
msgstr ""
176
177
- #: app/main/RTMedia.php:830
178
- msgid "Close"
179
msgstr ""
180
181
- #: app/main/RTMedia.php:831
182
- #: app/main/controllers/template/rt-template-functions.php:591
183
- #: app/main/controllers/template/rt-template-functions.php:612
184
- msgid "Edit"
185
msgstr ""
186
187
- #: app/main/RTMedia.php:832
188
- #: app/main/controllers/template/rt-template-functions.php:1136
189
- #: app/main/controllers/template/rt-template-functions.php:1143
190
- #: templates/media/album-single-edit.php:60
191
- msgid "Delete"
192
msgstr ""
193
194
- #: app/main/RTMedia.php:833 templates/media/media-single-edit.php:13
195
- msgid "Edit Media"
196
msgstr ""
197
198
- #: app/main/RTMedia.php:834
199
- msgid "Remove from queue"
200
msgstr ""
201
202
- #: app/main/RTMedia.php:835
203
- msgid "Add more files"
204
msgstr ""
205
206
- #: app/main/RTMedia.php:836
207
- msgid "File not supported"
208
msgstr ""
209
210
- #: app/main/RTMedia.php:837
211
- msgid "more"
212
msgstr ""
213
214
- #: app/main/RTMedia.php:838
215
- msgid "less"
216
msgstr ""
217
218
- #: app/main/RTMedia.php:839
219
- msgid "This media is uploaded. Are you sure you want to delete this media?"
220
msgstr ""
221
222
- #: app/main/deprecated/RTMediaDeprecated.php:27
223
- #, php-format
224
- msgid "Deprecated %s. Please use %s."
225
msgstr ""
226
227
- #: app/main/controllers/template/RTMediaTemplate.php:119
228
- msgid "Invalid attribute passed for rtmedia_gallery shortcode."
229
msgstr ""
230
231
- #: app/main/controllers/template/RTMediaTemplate.php:222
232
- #: app/main/controllers/template/RTMediaTemplate.php:284
233
- #: app/main/controllers/template/RTMediaTemplate.php:357
234
- #: app/main/controllers/template/RTMediaTemplate.php:455
235
- msgid "Ooops !!! Invalid access. No nonce was found !!"
236
msgstr ""
237
238
- #: app/main/controllers/template/RTMediaTemplate.php:227
239
- msgid "Media updated Sucessfully"
240
msgstr ""
241
242
- #: app/main/controllers/template/RTMediaTemplate.php:233
243
- msgid "Error in updating Media"
244
msgstr ""
245
246
- #: app/main/controllers/template/rt-template-functions.php:56
247
- msgid "All Photos"
248
msgstr ""
249
250
- #: app/main/controllers/template/rt-template-functions.php:57
251
- msgid "All Videos"
252
msgstr ""
253
254
- #: app/main/controllers/template/rt-template-functions.php:58
255
- msgid "All Music"
256
msgstr ""
257
258
- #: app/main/controllers/template/rt-template-functions.php:60
259
- #: app/main/controllers/template/rt-template-functions.php:62
260
- msgid "All "
261
- msgstr ""
262
-
263
- #: app/main/controllers/template/rt-template-functions.php:567
264
- #: app/main/controllers/template/rt-template-functions.php:1325
265
- msgid "Options"
266
- msgstr ""
267
-
268
- #: app/main/controllers/template/rt-template-functions.php:657
269
- msgid "There are no comments on this media yet."
270
- msgstr ""
271
-
272
- #: app/main/controllers/template/rt-template-functions.php:689
273
- msgid "Delete Comment"
274
- msgstr ""
275
-
276
- #: app/main/controllers/template/rt-template-functions.php:891
277
- msgid "Video Thumbnail"
278
- msgstr ""
279
-
280
- #: app/main/controllers/template/rt-template-functions.php:934
281
- msgid "Video Thumbnail:"
282
- msgstr ""
283
-
284
- #: app/main/controllers/template/rt-template-functions.php:1011
285
- msgid "Image"
286
- msgstr ""
287
-
288
- #: app/main/controllers/template/rt-template-functions.php:1026
289
- msgid "Modify Image"
290
- msgstr ""
291
-
292
- #: app/main/controllers/template/rt-template-functions.php:1098
293
- msgid "Type Comment..."
294
msgstr ""
295
296
- #: app/main/controllers/template/rt-template-functions.php:1101
297
- #: templates/media/media-single.php:71 templates/media/media-single.php:110
298
- msgid "Comment"
299
msgstr ""
300
301
- #: app/main/controllers/template/rt-template-functions.php:1136
302
- #: app/main/controllers/template/rt-template-functions.php:1143
303
- msgid "Delete Media"
304
msgstr ""
305
306
- #: app/main/controllers/template/rt-template-functions.php:1168
307
- #: app/main/controllers/activity/RTMediaBuddyPressActivity.php:180
308
- #: app/main/controllers/shortcodes/RTMediaUploadShortcode.php:103
309
- msgid "You are not allowed to upload/attach media."
310
msgstr ""
311
312
- #: app/main/controllers/template/rt-template-functions.php:1269
313
- msgid "Profile Albums"
314
msgstr ""
315
316
- #: app/main/controllers/template/rt-template-functions.php:1271
317
- #: app/main/controllers/template/rt-template-functions.php:1307
318
- msgid "Group Albums"
319
msgstr ""
320
321
- #: app/main/controllers/template/rt-template-functions.php:1380
322
- #: app/main/controllers/template/rt-template-functions.php:1393
323
- msgid "Create New Album"
324
msgstr ""
325
326
- #: app/main/controllers/template/rt-template-functions.php:1380
327
- msgid "Add Album"
328
msgstr ""
329
330
- #: app/main/controllers/template/rt-template-functions.php:1395
331
- msgid "Album Title : "
332
msgstr ""
333
334
- #: app/main/controllers/template/rt-template-functions.php:1399
335
- #: app/main/controllers/media/RTMediaAlbum.php:56
336
- msgid "Create Album"
337
msgstr ""
338
339
- #: app/main/controllers/template/rt-template-functions.php:1428
340
- #: app/main/controllers/template/rt-template-functions.php:1433
341
- #: app/main/controllers/template/rt-template-functions.php:1484
342
- msgid "Merge Album"
343
msgstr ""
344
345
- #: app/main/controllers/template/rt-template-functions.php:1430
346
- msgid "Select Album to merge with : "
347
msgstr ""
348
349
- #: app/main/controllers/template/rt-template-functions.php:1473
350
- #: app/main/controllers/media/RTMediaAlbum.php:57
351
- msgid "Edit Album"
352
msgstr ""
353
354
- #: app/main/controllers/template/rt-template-functions.php:1476
355
- msgid "Delete Album"
356
msgstr ""
357
358
- #: app/main/controllers/template/rt-template-functions.php:1509
359
- msgid "Merge"
360
msgstr ""
361
362
- #: app/main/controllers/template/rt-template-functions.php:1558
363
- #: app/main/controllers/upload/RTMediaUploadView.php:65
364
- msgid "Privacy : "
365
msgstr ""
366
367
- #: app/main/controllers/template/rt-template-functions.php:1728
368
- msgid "people like this"
369
msgstr ""
370
371
- #: app/main/controllers/template/rt-template-functions.php:1738
372
- #: app/main/controllers/template/rt-template-functions.php:1741
373
- msgid "Upload Media"
374
msgstr ""
375
376
- #: app/main/controllers/template/rt-template-functions.php:1784
377
- msgid "Go PRO!"
378
msgstr ""
379
380
- #: app/main/controllers/template/rt-template-functions.php:1805
381
- msgid "Reasons to buy rtMedia-PRO"
382
msgstr ""
383
384
- #: app/main/controllers/template/rt-template-functions.php:1810
385
- msgid "RSS Feed/Podcasting Support"
386
msgstr ""
387
388
- #: app/main/controllers/template/rt-template-functions.php:1811
389
msgid ""
390
- "You can consume rtMedia uploads from iTunes as well as any feed-reader/"
391
- "podcasting software."
392
- msgstr ""
393
-
394
- #: app/main/controllers/template/rt-template-functions.php:1817
395
- msgid "WordPress Comment Attachment"
396
msgstr ""
397
398
- #: app/main/controllers/template/rt-template-functions.php:1818
399
- msgid "You can attach files to WordPress comments."
400
msgstr ""
401
402
- #: app/main/controllers/template/rt-template-functions.php:1824
403
- msgid "bbPress Attachment"
404
msgstr ""
405
406
- #: app/main/controllers/template/rt-template-functions.php:1825
407
- msgid "You can attach files to bbPress topic and reply."
408
msgstr ""
409
410
- #: app/main/controllers/template/rt-template-functions.php:1831
411
- msgid "Document Support"
412
msgstr ""
413
414
- #: app/main/controllers/template/rt-template-functions.php:1832
415
msgid ""
416
- "You can add, view and download documents like txt, doc, pdf, also add and "
417
- "upload other file types like zip, tar and tar.gz etc."
418
msgstr ""
419
420
- #: app/main/controllers/template/rt-template-functions.php:1838
421
- msgid "CubePoints & MyCRED Integration"
422
msgstr ""
423
424
- #: app/main/controllers/template/rt-template-functions.php:1839
425
- msgid ""
426
- "Integrating CubePoints/myCRED with rtMedia, you can reward users with "
427
- "virtual points on rtMedia activities."
428
msgstr ""
429
430
- #: app/main/controllers/template/rt-template-functions.php:1845
431
- msgid "Album Privacy"
432
msgstr ""
433
434
- #: app/main/controllers/template/rt-template-functions.php:1846
435
- msgid ""
436
- "This will allow you to set album privacy while creating albums or change "
437
- "album privacy with editing albums too."
438
msgstr ""
439
440
- #: app/main/controllers/template/rt-template-functions.php:1852
441
- msgid "Audio Playlist"
442
msgstr ""
443
444
- #: app/main/controllers/template/rt-template-functions.php:1853
445
msgid ""
446
- "With this feature you can create your audio playlists and listen to your "
447
- "favorite music at will."
448
msgstr ""
449
450
- #: app/main/controllers/template/rt-template-functions.php:1859
451
- msgid "Report Button & Moderation Tools"
452
msgstr ""
453
454
- #: app/main/controllers/template/rt-template-functions.php:1860
455
msgid ""
456
- "Users can report media if they find it offensive. Set number of reports to "
457
- "automatically take down media."
458
msgstr ""
459
460
- #: app/main/controllers/template/rt-template-functions.php:1866
461
- msgid "Download Button For Media"
462
msgstr ""
463
464
- #: app/main/controllers/template/rt-template-functions.php:1867
465
- msgid ""
466
- "Users can download photos, videos and music. Admin has option to allow "
467
- "download the media."
468
msgstr ""
469
470
- #: app/main/controllers/template/rt-template-functions.php:1873
471
- msgid "Sidebar widgets"
472
msgstr ""
473
474
- #: app/main/controllers/template/rt-template-functions.php:1874
475
msgid ""
476
- "These will let you display a gallery or an uploader in a sidebar. Several of "
477
- "them can be used in a single sidebar."
478
- msgstr ""
479
-
480
- #: app/main/controllers/template/rt-template-functions.php:1880
481
- msgid "Post-editor button"
482
msgstr ""
483
484
- #: app/main/controllers/template/rt-template-functions.php:1881
485
msgid ""
486
- "With this button, a UI appears to quickly generate shortcodes for special "
487
- "pages like \"Editorial Picks\"."
488
msgstr ""
489
490
- #: app/main/controllers/template/rt-template-functions.php:1887
491
- msgid "Star-Rating option"
492
msgstr ""
493
494
- #: app/main/controllers/template/rt-template-functions.php:1888
495
msgid ""
496
- "Users can give up to five stars to rate media. This data can be used for "
497
- "\"Most Rated Media\" in sidebars."
498
- msgstr ""
499
-
500
- #: app/main/controllers/template/rt-template-functions.php:1894
501
- msgid "Global Albums"
502
msgstr ""
503
504
- #: app/main/controllers/template/rt-template-functions.php:1895
505
msgid ""
506
- "Multiple global albums can be created beforehand. One of these can be chosen "
507
- "as the default album."
508
msgstr ""
509
510
- #: app/main/controllers/template/rt-template-functions.php:1901
511
- msgid "Premium one-to-one support"
512
msgstr ""
513
514
- #: app/main/controllers/template/rt-template-functions.php:1902
515
- msgid ""
516
- "Without leaving your WordPress dashboard, you can contact us for help using "
517
- "a support form."
518
msgstr ""
519
520
- #: app/main/controllers/template/rt-template-functions.php:1908
521
- msgid "Premium & Open-Source"
522
msgstr ""
523
524
- #: app/main/controllers/template/rt-template-functions.php:1909
525
- msgid ""
526
- "Developers get full control over rtMedia-PRO's source. They'll get access to "
527
msgstr ""
528
529
- #: app/main/controllers/template/rt-template-functions.php:1915
530
- msgid "Upgrade to rtMedia PRO Now "
531
msgstr ""
532
533
- #: app/main/controllers/template/rt-template-functions.php:1926
534
- msgid "You can consider rtMedia Team for following :"
535
msgstr ""
536
537
- #: app/main/controllers/template/rt-template-functions.php:1928
538
- msgid "rtMedia Customization ( in Upgrade Safe manner )"
539
msgstr ""
540
541
- #: app/main/controllers/template/rt-template-functions.php:1929
542
- msgid "Wordpress/BuddyPress Theme Design and Development"
543
msgstr ""
544
545
- #: app/main/controllers/template/rt-template-functions.php:1930
546
- msgid "Wordpress/BuddyPress Plugin Development"
547
msgstr ""
548
549
- #: app/main/controllers/template/rt-template-functions.php:1934
550
- msgid "Contact Us"
551
msgstr ""
552
553
- #: app/main/controllers/template/rt-template-functions.php:1952
554
- msgid "Empowering your community with "
555
msgstr ""
556
557
- #: app/main/controllers/template/rt-template-functions.php:1953
558
- msgid "The only complete media solution for WordPress, BuddyPress and bbPress"
559
msgstr ""
560
561
- #: app/main/controllers/template/rt-template-functions.php:1967
562
- msgid "Close (Esc)"
563
msgstr ""
564
565
- #: app/main/controllers/template/rt-template-functions.php:1982
566
- msgid "Public"
567
msgstr ""
568
569
- #: app/main/controllers/template/rt-template-functions.php:1986
570
- msgid "All members"
571
msgstr ""
572
573
- #: app/main/controllers/template/rt-template-functions.php:1990
574
- msgid "Your friends"
575
msgstr ""
576
577
- #: app/main/controllers/template/rt-template-functions.php:1994
578
- msgid "Only you"
579
msgstr ""
580
581
- #: app/main/controllers/template/rt-template-functions.php:1998
582
- msgid "Blocked Temperorily"
583
msgstr ""
584
585
- #: app/main/controllers/template/rt-template-functions.php:2032
586
- #, php-format
587
- msgid "%s ago "
588
msgstr ""
589
590
- #: app/main/controllers/api/RTMediaJsonApi.php:166
591
- msgid "username/password empty"
592
msgstr ""
593
594
- #: app/main/controllers/api/RTMediaJsonApi.php:169
595
- msgid "incorrect username"
596
msgstr ""
597
598
- #: app/main/controllers/api/RTMediaJsonApi.php:172
599
- msgid "incorrect password"
600
msgstr ""
601
602
- #: app/main/controllers/api/RTMediaJsonApi.php:175
603
- msgid "login success"
604
msgstr ""
605
606
- #: app/main/controllers/api/RTMediaJsonApi.php:221
607
- msgid "fields empty"
608
msgstr ""
609
610
- #: app/main/controllers/api/RTMediaJsonApi.php:224
611
- msgid "invalid email"
612
msgstr ""
613
614
- #: app/main/controllers/api/RTMediaJsonApi.php:227
615
- msgid "password do not match"
616
msgstr ""
617
618
- #: app/main/controllers/api/RTMediaJsonApi.php:230
619
- msgid "username already registered"
620
msgstr ""
621
622
- #: app/main/controllers/api/RTMediaJsonApi.php:233
623
- msgid "email already exists"
624
msgstr ""
625
626
- #: app/main/controllers/api/RTMediaJsonApi.php:236
627
- msgid "new user created"
628
msgstr ""
629
630
- #: app/main/controllers/api/RTMediaJsonApi.php:297
631
- msgid "email empty"
632
msgstr ""
633
634
- #: app/main/controllers/api/RTMediaJsonApi.php:300
635
- msgid "username/email not registered"
636
msgstr ""
637
638
- #: app/main/controllers/api/RTMediaJsonApi.php:303
639
- msgid "reset link sent"
640
msgstr ""
641
642
- #: app/main/controllers/api/RTMediaJsonApi.php:335
643
msgid ""
644
- "Someone has asked to reset the password for the following site and username."
645
msgstr ""
646
647
- #: app/main/controllers/api/RTMediaJsonApi.php:337
648
- #, php-format
649
- msgid "Username: %s"
650
msgstr ""
651
652
- #: app/main/controllers/api/RTMediaJsonApi.php:338
653
msgid ""
654
- "To reset your password visit the following address, otherwise just ignore "
655
- "this email and nothing will happen."
656
msgstr ""
657
658
- #: app/main/controllers/api/RTMediaJsonApi.php:341
659
#, php-format
660
- msgid "[%s] Password Reset"
661
- msgstr ""
662
-
663
- #: app/main/controllers/api/RTMediaJsonApi.php:356
664
- msgid "bp activities"
665
- msgstr ""
666
-
667
- #: app/main/controllers/api/RTMediaJsonApi.php:359
668
- msgid "user activities"
669
- msgstr ""
670
-
671
- #: app/main/controllers/api/RTMediaJsonApi.php:389
672
- msgid "comment content missing"
673
- msgstr ""
674
-
675
- #: app/main/controllers/api/RTMediaJsonApi.php:392
676
- msgid "comment posted"
677
- msgstr ""
678
-
679
- #: app/main/controllers/api/RTMediaJsonApi.php:439
680
- msgid "unliked media"
681
- msgstr ""
682
-
683
- #: app/main/controllers/api/RTMediaJsonApi.php:442
684
- msgid "liked media"
685
msgstr ""
686
687
- #: app/main/controllers/api/RTMediaJsonApi.php:526
688
- msgid "no comments"
689
msgstr ""
690
691
- #: app/main/controllers/api/RTMediaJsonApi.php:529
692
- msgid "media comments"
693
msgstr ""
694
695
- #: app/main/controllers/api/RTMediaJsonApi.php:532
696
- msgid "my comments"
697
msgstr ""
698
699
- #: app/main/controllers/api/RTMediaJsonApi.php:582
700
- msgid "no likes"
701
msgstr ""
702
703
- #: app/main/controllers/api/RTMediaJsonApi.php:585
704
- msgid "media likes"
705
msgstr ""
706
707
- #: app/main/controllers/api/RTMediaJsonApi.php:627
708
- msgid "invalid comment/media id"
709
msgstr ""
710
711
- #: app/main/controllers/api/RTMediaJsonApi.php:630
712
- msgid "no comment id"
713
msgstr ""
714
-
715
- #: app/main/controllers/api/RTMediaJsonApi.php:633
716
- msgid "comment deleted"
717
msgstr ""
718
719
- #: app/main/controllers/api/RTMediaJsonApi.php:676
720
- msgid "no profile found"
721
msgstr ""
722
723
- #: app/main/controllers/api/RTMediaJsonApi.php:679
724
- msgid "profile fields"
725
msgstr ""
726
727
- #: app/main/controllers/api/RTMediaJsonApi.php:773
728
- msgid "follow user id missing"
729
msgstr ""
730
731
- #: app/main/controllers/api/RTMediaJsonApi.php:776
732
- msgid "started following"
733
msgstr ""
734
735
- #: app/main/controllers/api/RTMediaJsonApi.php:779
736
- msgid "already following"
737
msgstr ""
738
739
- #: app/main/controllers/api/RTMediaJsonApi.php:811
740
- msgid "unfollow id missing"
741
msgstr ""
742
743
- #: app/main/controllers/api/RTMediaJsonApi.php:814
744
- msgid "stopped following"
745
msgstr ""
746
747
- #: app/main/controllers/api/RTMediaJsonApi.php:817
748
- msgid "not following"
749
msgstr ""
750
751
- #: app/main/controllers/api/RTMediaJsonApi.php:849
752
- msgid "name/location empty"
753
msgstr ""
754
755
- #: app/main/controllers/api/RTMediaJsonApi.php:852
756
- msgid "profile updated"
757
msgstr ""
758
759
- #: app/main/controllers/api/RTMediaJsonApi.php:878
760
- #: app/main/controllers/api/RTMediaJsonApi.php:905
761
- msgid "no file"
762
msgstr ""
763
764
- #: app/main/controllers/api/RTMediaJsonApi.php:881
765
- #: app/main/controllers/api/RTMediaJsonApi.php:917
766
- msgid "upload failed, check size and file type"
767
msgstr ""
768
769
- #: app/main/controllers/api/RTMediaJsonApi.php:884
770
- msgid "avatar updated"
771
msgstr ""
772
773
- #: app/main/controllers/api/RTMediaJsonApi.php:908
774
- msgid "invalid file string"
775
msgstr ""
776
777
- #: app/main/controllers/api/RTMediaJsonApi.php:911
778
- msgid "image type missing"
779
msgstr ""
780
781
- #: app/main/controllers/api/RTMediaJsonApi.php:914
782
- msgid "no title"
783
msgstr ""
784
785
- #: app/main/controllers/api/RTMediaJsonApi.php:920
786
- msgid "media updated"
787
msgstr ""
788
789
- #: app/main/controllers/api/RTMediaJsonApi.php:1042
790
- msgid "media list"
791
msgstr ""
792
793
- #: app/main/controllers/api/RTMediaJsonApi.php:1045
794
- msgid "no media found for requested media type"
795
msgstr ""
796
797
- #: app/main/controllers/api/RTMediaJsonApi.php:1048
798
- msgid "media_type not allowed"
799
msgstr ""
800
801
- #: app/main/controllers/api/RTMediaJsonApi.php:1133
802
- msgid "single media"
803
msgstr ""
804
805
- #: app/main/controllers/upload/RTMediaUploadView.php:50
806
- #: app/main/controllers/upload/RTMediaUploadView.php:53
807
- msgid "Album "
808
msgstr ""
809
810
- #: app/main/controllers/upload/RTMediaUploadView.php:71
811
- #: app/main/controllers/upload/RTMediaUploadView.php:86
812
- msgid "File Upload"
813
msgstr ""
814
815
- #: app/main/controllers/upload/RTMediaUploadView.php:76
816
- msgid "Select your files"
817
msgstr ""
818
819
- #: app/main/controllers/upload/RTMediaUploadView.php:77
820
- msgid "or"
821
msgstr ""
822
823
- #: app/main/controllers/upload/RTMediaUploadView.php:77
824
- msgid "Drop your files here"
825
msgstr ""
826
827
- #: app/main/controllers/upload/RTMediaUploadView.php:79
828
- msgid "Start upload"
829
msgstr ""
830
831
- #: app/main/controllers/upload/RTMediaUploadView.php:86
832
- msgid "Attach Files"
833
msgstr ""
834
835
- #: app/main/controllers/upload/RTMediaUploadView.php:86
836
- msgid "Upload will start only after you enter content and click Post Update."
837
msgstr ""
838
839
- #: app/main/controllers/upload/RTMediaUploadView.php:89
840
- msgid "Insert from URL"
841
msgstr ""
842
843
- #: app/main/controllers/upload/RTMediaUploadEndpoint.php:97
844
- #, php-format
845
- msgid "%s added %d %s"
846
msgstr ""
847
848
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:54
849
- msgid "Error Uploading File"
850
msgstr ""
851
852
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:201
853
- msgid "MP4 file you have uploaded is corrupt."
854
msgstr ""
855
856
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:208
857
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:213
858
- msgid ""
859
- "The MP4 file you have uploaded is using an unsupported video codec. "
860
- "Supported video codec is H.264."
861
msgstr ""
862
863
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:218
864
- msgid "The MP4 file you have uploaded is not a video file."
865
msgstr ""
866
867
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:230
868
- msgid "MP3 file you have uploaded is currupt."
869
msgstr ""
870
871
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:237
872
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:242
873
- msgid ""
874
- "The MP3 file you have uploaded is using an unsupported audio format. "
875
- "Supported audio format is MP3."
876
msgstr ""
877
878
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:247
879
- msgid "The MP3 file you have uploaded is not an audio file."
880
msgstr ""
881
882
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:255
883
- msgid ""
884
- "Media File you have tried to upload is not supported. Supported media files "
885
- "are .jpg, .png, .gif, .mp3, .mov and .mp4."
886
msgstr ""
887
888
- #: app/main/controllers/group/RTMediaGroupExtension.php:30
889
-