Version Description
- Update Russian and Polish translations
- Bug fixes
Download this release
Release Info
Developer | faishal |
Plugin | ![]() |
Version | 3.6.11 |
Comparing to | |
See all releases |
Code changes from version 3.6.10 to 3.6.11
- app/importers/RTMediaMediaSizeImporter.php +62 -36
- app/main/controllers/template/RTMediaNav.php +1 -1
- app/main/controllers/template/RTMediaTemplate.php +654 -615
- app/main/controllers/template/rt-template-functions.php +2 -2
- index.php +1 -1
- languages/rtmedia-pl_PL.mo +0 -0
- languages/rtmedia-ru_RU.mo +0 -0
- languages/rtmedia.mo +0 -0
- languages/rtmedia.po +1304 -1285
- readme.txt +7 -3
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.
|
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
|
80 |
-
|
81 |
-
echo '<span class="pending">' . rtmedia_migrate_formatseconds( $total - $done ) .
|
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
|
90 |
-
var
|
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(
|
131 |
-
|
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
|
157 |
-
jQuery( 'span.pending' ).html( "
|
158 |
-
|
|
|
|
|
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 |
-
|
219 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
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 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
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-
|
6 |
-
"PO-Revision-Date: 2014-03-
|
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.
|
16 |
"X-Poedit-SearchPath-0: .\n"
|
17 |
|
18 |
-
#: app/
|
19 |
-
msgid "
|
20 |
msgstr ""
|
21 |
|
22 |
-
#: app/
|
23 |
-
msgid "
|
24 |
msgstr ""
|
25 |
|
26 |
-
#: app/
|
27 |
-
msgid "
|
28 |
msgstr ""
|
29 |
|
30 |
-
#: app/
|
31 |
-
msgid "
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: app/
|
35 |
-
msgid
|
|
|
|
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: app/
|
39 |
-
msgid
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: app/
|
43 |
-
msgid
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: app/
|
47 |
-
msgid
|
48 |
msgstr ""
|
49 |
|
50 |
-
#: app/
|
51 |
-
msgid
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: app/
|
55 |
-
msgid "
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: app/
|
59 |
-
msgid "
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: app/
|
63 |
-
|
64 |
-
#: app/main/controllers/media/RTMediaAlbum.php:54
|
65 |
-
msgid "Album"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: app/
|
69 |
-
#: app/main/controllers/
|
70 |
-
|
71 |
-
#: app/main/controllers/media/RTMediaAlbum.php:65
|
72 |
-
msgid "Albums"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: app/
|
76 |
-
|
77 |
-
#: app/main/controllers/template/rt-template-functions.php:1741
|
78 |
-
msgid "Upload"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: app/
|
82 |
-
msgid "
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: app/
|
86 |
-
msgid "
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: app/
|
90 |
-
msgid
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: app/
|
94 |
-
msgid "
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: app/
|
98 |
-
|
|
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: app/
|
102 |
-
|
|
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: app/
|
106 |
-
|
|
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: app/
|
110 |
-
|
|
|
|
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: app/
|
114 |
-
|
|
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: app/
|
118 |
-
|
|
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: app/
|
122 |
-
msgid "
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: app/
|
126 |
-
msgid "
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: app/
|
130 |
-
msgid "
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: app/
|
134 |
-
msgid
|
|
|
|
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: app/
|
138 |
-
msgid "
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: app/
|
142 |
-
msgid
|
|
|
|
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: app/
|
146 |
-
msgid "
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: app/
|
150 |
-
msgid "
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: app/
|
154 |
-
msgid "
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: app/
|
158 |
-
msgid "
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: app/
|
162 |
-
msgid "
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: app/
|
166 |
-
msgid "
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: app/
|
170 |
-
msgid "
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: app/
|
174 |
-
msgid "
|
175 |
msgstr ""
|
176 |
|
177 |
-
#: app/
|
178 |
-
msgid "
|
179 |
msgstr ""
|
180 |
|
181 |
-
#: app/
|
182 |
-
|
183 |
-
|
184 |
-
|
|
|
|
|
185 |
msgstr ""
|
186 |
|
187 |
-
#: app/
|
188 |
-
|
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/
|
195 |
-
msgid "
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: app/
|
199 |
-
msgid "
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: app/
|
203 |
-
msgid "
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: app/
|
207 |
-
msgid "
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: app/
|
211 |
-
msgid "
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: app/
|
215 |
-
msgid "
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: app/
|
219 |
-
msgid "
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: app/
|
223 |
-
|
224 |
-
msgid "Deprecated %s. Please use %s."
|
225 |
msgstr ""
|
226 |
|
227 |
-
#: app/
|
228 |
-
msgid "
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: app/
|
232 |
-
|
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/
|
239 |
-
|
|
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: app/
|
243 |
-
msgid "
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: app/
|
247 |
-
msgid "
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: app/
|
251 |
-
msgid "
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: app/
|
255 |
-
|
|
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: app/
|
259 |
-
|
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/
|
297 |
-
|
298 |
-
msgid "Comment"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: app/
|
302 |
-
|
303 |
-
msgid "Delete Media"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: app/
|
307 |
-
|
308 |
-
#: app/main/controllers/shortcodes/RTMediaUploadShortcode.php:103
|
309 |
-
msgid "You are not allowed to upload/attach media."
|
310 |
msgstr ""
|
311 |
|
312 |
-
#: app/
|
313 |
-
msgid "
|
314 |
msgstr ""
|
315 |
|
316 |
-
#: app/
|
317 |
-
|
318 |
-
msgid "Group Albums"
|
319 |
msgstr ""
|
320 |
|
321 |
-
#: app/
|
322 |
-
|
323 |
-
msgid "Create New Album"
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: app/
|
327 |
-
msgid "
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: app/
|
331 |
-
msgid "
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: app/
|
335 |
-
|
336 |
-
msgid "Create Album"
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: app/
|
340 |
-
|
341 |
-
#: app/main/controllers/template/rt-template-functions.php:1484
|
342 |
-
msgid "Merge Album"
|
343 |
msgstr ""
|
344 |
|
345 |
-
#: app/
|
346 |
-
msgid "
|
347 |
msgstr ""
|
348 |
|
349 |
-
#: app/
|
350 |
-
|
351 |
-
msgid "Edit Album"
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: app/
|
355 |
-
|
|
|
|
|
|
|
|
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: app/
|
359 |
-
|
|
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: app/
|
363 |
-
#: app/
|
364 |
-
msgid "
|
365 |
msgstr ""
|
366 |
|
367 |
-
#: app/
|
368 |
-
|
|
|
|
|
|
|
|
|
369 |
msgstr ""
|
370 |
|
371 |
-
#: app/
|
372 |
-
|
373 |
-
msgid
|
|
|
|
|
|
|
374 |
msgstr ""
|
375 |
|
376 |
-
#: app/
|
377 |
-
msgid "
|
378 |
msgstr ""
|
379 |
|
380 |
-
#: app/
|
381 |
-
msgid "
|
382 |
msgstr ""
|
383 |
|
384 |
-
#: app/
|
385 |
-
msgid "
|
386 |
msgstr ""
|
387 |
|
388 |
-
#: app/
|
389 |
msgid ""
|
390 |
-
"
|
391 |
-
"
|
392 |
-
msgstr ""
|
393 |
-
|
394 |
-
#: app/main/controllers/template/rt-template-functions.php:1817
|
395 |
-
msgid "WordPress Comment Attachment"
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: app/
|
399 |
-
|
|
|
|
|
400 |
msgstr ""
|
401 |
|
402 |
-
#: app/
|
403 |
-
|
|
|
404 |
msgstr ""
|
405 |
|
406 |
-
#: app/
|
407 |
-
msgid "
|
408 |
msgstr ""
|
409 |
|
410 |
-
#: app/
|
411 |
-
msgid "
|
412 |
msgstr ""
|
413 |
|
414 |
-
#: app/
|
415 |
msgid ""
|
416 |
-
"
|
417 |
-
"
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: app/
|
421 |
-
msgid "
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: app/
|
425 |
-
msgid
|
426 |
-
"Integrating CubePoints/myCRED with rtMedia, you can reward users with "
|
427 |
-
"virtual points on rtMedia activities."
|
428 |
msgstr ""
|
429 |
|
430 |
-
#: app/
|
431 |
-
msgid "
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: app/
|
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/
|
441 |
-
msgid "
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: app/
|
445 |
msgid ""
|
446 |
-
"
|
447 |
-
"
|
|
|
448 |
msgstr ""
|
449 |
|
450 |
-
#: app/
|
451 |
-
msgid "
|
452 |
msgstr ""
|
453 |
|
454 |
-
#: app/
|
455 |
msgid ""
|
456 |
-
"
|
457 |
-
"
|
458 |
msgstr ""
|
459 |
|
460 |
-
#: app/
|
461 |
-
msgid "
|
462 |
msgstr ""
|
463 |
|
464 |
-
#: app/
|
465 |
-
msgid
|
466 |
-
"Users can download photos, videos and music. Admin has option to allow "
|
467 |
-
"download the media."
|
468 |
msgstr ""
|
469 |
|
470 |
-
#: app/
|
471 |
-
msgid "
|
472 |
msgstr ""
|
473 |
|
474 |
-
#: app/
|
475 |
msgid ""
|
476 |
-
"
|
477 |
-
"
|
478 |
-
msgstr ""
|
479 |
-
|
480 |
-
#: app/main/controllers/template/rt-template-functions.php:1880
|
481 |
-
msgid "Post-editor button"
|
482 |
msgstr ""
|
483 |
|
484 |
-
#: app/
|
485 |
msgid ""
|
486 |
-
"
|
487 |
-
"
|
488 |
msgstr ""
|
489 |
|
490 |
-
#: app/
|
491 |
-
msgid "
|
492 |
msgstr ""
|
493 |
|
494 |
-
#: app/
|
495 |
msgid ""
|
496 |
-
"
|
497 |
-
|
498 |
-
msgstr ""
|
499 |
-
|
500 |
-
#: app/main/controllers/template/rt-template-functions.php:1894
|
501 |
-
msgid "Global Albums"
|
502 |
msgstr ""
|
503 |
|
504 |
-
#: app/
|
505 |
msgid ""
|
506 |
-
"
|
507 |
-
"
|
508 |
msgstr ""
|
509 |
|
510 |
-
#: app/
|
511 |
-
msgid "
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: app/
|
515 |
-
msgid
|
516 |
-
"Without leaving your WordPress dashboard, you can contact us for help using "
|
517 |
-
"a support form."
|
518 |
msgstr ""
|
519 |
|
520 |
-
#: app/
|
521 |
-
msgid "
|
522 |
msgstr ""
|
523 |
|
524 |
-
#: app/
|
525 |
-
msgid
|
526 |
-
"Developers get full control over rtMedia-PRO's source. They'll get access to "
|
527 |
msgstr ""
|
528 |
|
529 |
-
#: app/
|
530 |
-
msgid "
|
531 |
msgstr ""
|
532 |
|
533 |
-
#: app/
|
534 |
-
msgid "
|
535 |
msgstr ""
|
536 |
|
537 |
-
#: app/
|
538 |
-
msgid "
|
539 |
msgstr ""
|
540 |
|
541 |
-
#: app/
|
542 |
-
msgid "
|
543 |
msgstr ""
|
544 |
|
545 |
-
#: app/
|
546 |
-
msgid "
|
547 |
msgstr ""
|
548 |
|
549 |
-
#: app/
|
550 |
-
msgid "
|
551 |
msgstr ""
|
552 |
|
553 |
-
#: app/
|
554 |
-
msgid "
|
555 |
msgstr ""
|
556 |
|
557 |
-
#: app/
|
558 |
-
msgid "
|
559 |
msgstr ""
|
560 |
|
561 |
-
#: app/
|
562 |
-
msgid
|
|
|
|
|
563 |
msgstr ""
|
564 |
|
565 |
-
#: app/
|
566 |
-
msgid
|
|
|
|
|
567 |
msgstr ""
|
568 |
|
569 |
-
#: app/
|
570 |
-
msgid "
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: app/
|
574 |
-
msgid
|
|
|
|
|
575 |
msgstr ""
|
576 |
|
577 |
-
#: app/
|
578 |
-
msgid "
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: app/
|
582 |
-
msgid "
|
583 |
msgstr ""
|
584 |
|
585 |
-
#: app/
|
586 |
-
|
587 |
-
msgid "%s ago "
|
588 |
msgstr ""
|
589 |
|
590 |
-
#: app/
|
591 |
-
msgid "
|
592 |
msgstr ""
|
593 |
|
594 |
-
#: app/
|
595 |
-
msgid "
|
596 |
msgstr ""
|
597 |
|
598 |
-
#: app/
|
599 |
-
msgid "
|
600 |
msgstr ""
|
601 |
|
602 |
-
#: app/
|
603 |
-
msgid "
|
604 |
msgstr ""
|
605 |
|
606 |
-
#: app/
|
607 |
-
msgid
|
|
|
608 |
msgstr ""
|
609 |
|
610 |
-
#: app/
|
611 |
-
msgid "
|
612 |
msgstr ""
|
613 |
|
614 |
-
#: app/
|
615 |
-
msgid "
|
616 |
msgstr ""
|
617 |
|
618 |
-
#: app/
|
619 |
-
msgid "
|
620 |
msgstr ""
|
621 |
|
622 |
-
#: app/
|
623 |
-
msgid "
|
624 |
msgstr ""
|
625 |
|
626 |
-
#: app/
|
627 |
-
msgid "
|
628 |
msgstr ""
|
629 |
|
630 |
-
#: app/
|
631 |
-
msgid "
|
632 |
msgstr ""
|
633 |
|
634 |
-
#: app/
|
635 |
-
msgid "
|
636 |
msgstr ""
|
637 |
|
638 |
-
#: app/
|
639 |
-
msgid "
|
640 |
msgstr ""
|
641 |
|
642 |
-
#: app/
|
643 |
msgid ""
|
644 |
-
"
|
|
|
|
|
645 |
msgstr ""
|
646 |
|
647 |
-
#: app/
|
648 |
-
|
649 |
-
msgid "Username: %s"
|
650 |
msgstr ""
|
651 |
|
652 |
-
#: app/
|
653 |
msgid ""
|
654 |
-
"
|
655 |
-
|
656 |
msgstr ""
|
657 |
|
658 |
-
#: app/
|
659 |
#, php-format
|
660 |
-
msgid
|
661 |
-
|
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/
|
688 |
-
msgid "
|
689 |
msgstr ""
|
690 |
|
691 |
-
#: app/
|
692 |
-
msgid "
|
693 |
msgstr ""
|
694 |
|
695 |
-
#: app/
|
696 |
-
msgid "
|
697 |
msgstr ""
|
698 |
|
699 |
-
#: app/
|
700 |
-
msgid
|
|
|
|
|
701 |
msgstr ""
|
702 |
|
703 |
-
#: app/
|
704 |
-
|
|
|
705 |
msgstr ""
|
706 |
|
707 |
-
#: app/
|
708 |
-
|
|
|
|
|
709 |
msgstr ""
|
710 |
|
711 |
-
#: app/
|
712 |
-
msgid "
|
713 |
msgstr ""
|
714 |
-
|
715 |
-
#: app/
|
716 |
-
msgid
|
|
|
|
|
717 |
msgstr ""
|
718 |
|
719 |
-
#: app/
|
720 |
-
msgid "
|
721 |
msgstr ""
|
722 |
|
723 |
-
#: app/
|
724 |
-
msgid "
|
725 |
msgstr ""
|
726 |
|
727 |
-
#: app/
|
728 |
-
msgid "
|
729 |
msgstr ""
|
730 |
|
731 |
-
#: app/
|
732 |
-
msgid "
|
733 |
msgstr ""
|
734 |
|
735 |
-
#: app/
|
736 |
-
msgid
|
|
|
737 |
msgstr ""
|
738 |
|
739 |
-
#: app/
|
740 |
-
msgid "
|
741 |
msgstr ""
|
742 |
|
743 |
-
#: app/
|
744 |
-
msgid "
|
745 |
msgstr ""
|
746 |
|
747 |
-
#: app/
|
748 |
-
msgid "
|
749 |
msgstr ""
|
750 |
|
751 |
-
#: app/
|
752 |
-
msgid "
|
753 |
msgstr ""
|
754 |
|
755 |
-
#: app/
|
756 |
-
msgid "
|
757 |
msgstr ""
|
758 |
|
759 |
-
#: app/
|
760 |
-
|
761 |
-
msgid "no file"
|
762 |
msgstr ""
|
763 |
|
764 |
-
#: app/
|
765 |
-
|
766 |
-
msgid "upload failed, check size and file type"
|
767 |
msgstr ""
|
768 |
|
769 |
-
#: app/
|
770 |
-
msgid "
|
771 |
msgstr ""
|
772 |
|
773 |
-
#: app/
|
774 |
-
msgid "
|
775 |
msgstr ""
|
776 |
|
777 |
-
#: app/
|
778 |
-
msgid "
|
779 |
msgstr ""
|
780 |
|
781 |
-
#: app/
|
782 |
-
msgid "
|
783 |
msgstr ""
|
784 |
|
785 |
-
#: app/
|
786 |
-
msgid "
|
787 |
msgstr ""
|
788 |
|
789 |
-
#: app/
|
790 |
-
|
|
|
|
|
|
|
791 |
msgstr ""
|
792 |
|
793 |
-
#: app/
|
794 |
-
msgid "
|
795 |
msgstr ""
|
796 |
|
797 |
-
#: app/
|
798 |
-
msgid "
|
799 |
msgstr ""
|
800 |
|
801 |
-
#: app/
|
802 |
-
msgid "
|
803 |
msgstr ""
|
804 |
|
805 |
-
#: app/
|
806 |
-
|
807 |
-
msgid "Album "
|
808 |
msgstr ""
|
809 |
|
810 |
-
#: app/
|
811 |
-
|
812 |
-
msgid "File Upload"
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: app/
|
816 |
-
msgid
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: app/
|
820 |
-
msgid "
|
821 |
msgstr ""
|
822 |
|
823 |
-
#: app/
|
824 |
-
msgid "
|
825 |
msgstr ""
|
826 |
|
827 |
-
#: app/
|
828 |
-
|
|
|
|
|
|
|
829 |
msgstr ""
|
830 |
|
831 |
-
#: app/
|
832 |
-
msgid "
|
833 |
msgstr ""
|
834 |
|
835 |
-
#: app/
|
836 |
-
msgid "
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: app/
|
840 |
-
msgid
|
|
|
|
|
|
|
|
|
|
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: app/
|
844 |
-
|
845 |
-
|
|
|
|
|
846 |
msgstr ""
|
847 |
|
848 |
-
#: app/
|
849 |
-
|
|
|
850 |
msgstr ""
|
851 |
|
852 |
-
#: app/
|
853 |
-
|
|
|
854 |
msgstr ""
|
855 |
|
856 |
-
#: app/
|
857 |
-
#: app/
|
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/
|
864 |
-
msgid "
|
865 |
msgstr ""
|
866 |
|
867 |
-
#: app/
|
868 |
-
msgid "
|
869 |
msgstr ""
|
870 |
|
871 |
-
#: app/
|
872 |
-
|
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/
|
879 |
-
msgid "
|
880 |
msgstr ""
|
881 |
|
882 |
-
#: app/
|
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/
|
889 |
-
|