rtMedia for WordPress, BuddyPress and bbPress - Version 3.6

Version Description

  • rtMedia JSON API added
  • Updated russian translations
  • Bug fixes
Download this release

Release Info

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

Code changes from version 3.5.2.1 to 3.6

app/assets/js/rtMedia.backbone.js CHANGED
@@ -795,6 +795,7 @@ jQuery(document).ready(function($) {
795
  $('#rtMedia-update-queue-list').html('');
796
  //$("#div-attache-rtmedia").hide();
797
  apply_rtMagnificPopup(jQuery('.rtmedia-list-media, .rtmedia-activity-container ul.rtmedia-list, #bp-media-list,.widget-item-listing,.bp-media-sc-list, li.media.album_updated ul,ul.bp-media-list-media, li.activity-item div.activity-content div.activity-inner div.bp_media_content'));
 
798
  }
799
  $("#whats-new-post-in").removeAttr('disabled');
800
  $("#rtmedia-add-media-button-post-update").removeAttr('disabled');
795
  $('#rtMedia-update-queue-list').html('');
796
  //$("#div-attache-rtmedia").hide();
797
  apply_rtMagnificPopup(jQuery('.rtmedia-list-media, .rtmedia-activity-container ul.rtmedia-list, #bp-media-list,.widget-item-listing,.bp-media-sc-list, li.media.album_updated ul,ul.bp-media-list-media, li.activity-item div.activity-content div.activity-inner div.bp_media_content'));
798
+ rtMediaHook.call('rtmedia_js_after_activity_added', []);
799
  }
800
  $("#whats-new-post-in").removeAttr('disabled');
801
  $("#rtmedia-add-media-button-post-update").removeAttr('disabled');
app/helper/RTMediaModel.php CHANGED
@@ -77,7 +77,9 @@ class RTMediaModel extends RTDBModel {
77
 
78
  $tmpVal = isset ( $colvalue[ 'value' ] ) ? $colvalue[ 'value' ] : $colvalue;
79
  $col_val_comapare = ( is_array( $tmpVal ) ) ? '(\'' . implode ( "','", $tmpVal ) . '\')' : '(\''.$tmpVal.'\')';
80
-
 
 
81
  $where .= " AND {$this->table_name}.{$colname} {$compare} {$col_val_comapare}";
82
  }
83
  else
@@ -116,7 +118,6 @@ class RTMediaModel extends RTDBModel {
116
 
117
  $sql .= $limit;
118
  }
119
-
120
  if( ! $count_flag )
121
  return $wpdb->get_results ( $sql );
122
  else
77
 
78
  $tmpVal = isset ( $colvalue[ 'value' ] ) ? $colvalue[ 'value' ] : $colvalue;
79
  $col_val_comapare = ( is_array( $tmpVal ) ) ? '(\'' . implode ( "','", $tmpVal ) . '\')' : '(\''.$tmpVal.'\')';
80
+ if($compare == 'IS NOT'){
81
+ $col_val_comapare = !empty($colvalue[ 'value' ]) ? $colvalue[ 'value' ] : $col_val_comapare;
82
+ }
83
  $where .= " AND {$this->table_name}.{$colname} {$compare} {$col_val_comapare}";
84
  }
85
  else
118
 
119
  $sql .= $limit;
120
  }
 
121
  if( ! $count_flag )
122
  return $wpdb->get_results ( $sql );
123
  else
app/main/RTMedia.php CHANGED
@@ -356,7 +356,7 @@ class RTMedia
356
  'levels' => array(
357
  60 => __('<strong>Private</strong> - Visible only to the user', 'rtmedia'),
358
  40 => __('<strong>Friends</strong> - Visible to user\'s friends', 'rtmedia'),
359
- 20 => __('<strong>Users</strong> - Visible to registered users', 'rtmedia'),
360
  0 => __('<strong>Public</strong> - Visible to the world', 'rtmedia')
361
  )
362
  );
@@ -685,6 +685,9 @@ class RTMedia
685
 
686
  global $rtmedia_ajax;
687
  $rtmedia_ajax = new RTMediaAJAX();
 
 
 
688
 
689
  do_action('bp_media_init'); // legacy For plugin using this actions
690
  do_action('rtmedia_init');
356
  'levels' => array(
357
  60 => __('<strong>Private</strong> - Visible only to the user', 'rtmedia'),
358
  40 => __('<strong>Friends</strong> - Visible to user\'s friends', 'rtmedia'),
359
+ 20 => __('<strong>Logged in Users</strong> - Visible to registered users', 'rtmedia'),
360
  0 => __('<strong>Public</strong> - Visible to the world', 'rtmedia')
361
  )
362
  );
685
 
686
  global $rtmedia_ajax;
687
  $rtmedia_ajax = new RTMediaAJAX();
688
+ //API Classes
689
+ global $rtmediajsonapi;
690
+ $rtmediajsonapi = new RTMediaJsonApi();
691
 
692
  do_action('bp_media_init'); // legacy For plugin using this actions
693
  do_action('rtmedia_init');
app/main/controllers/activity/RTMediaActivity.php CHANGED
@@ -56,35 +56,39 @@ class RTMediaActivity {
56
  if( intval( $limitActivityFeed ) > 0 )
57
  $media_details = array_slice( $media_details, 0, $limitActivityFeed, true);
58
  $rtmedia_activity_ul_class = apply_filters("rtmedia_activity_ul_class","large-block-grid-3");
59
- $html .= '<ul class="rtmedia-list '.$rtmedia_activity_ul_class.'">';
 
60
  foreach ( $media_details as $media ) {
61
- $html .= '<li class="rtmedia-list-item media-type-' . $media->media_type . '">';
62
  if ( $media->media_type == 'photo' )
63
- $html .= '<a href ="' . get_rtmedia_permalink ( $media->id ) . '">';
64
- $html .= '<div class="rtmedia-item-thumbnail">';
65
 
66
- $html .= $this->media ( $media );
67
 
68
- $html .= '</div>';
69
 
70
- $html .= '<div class="rtmedia-item-title">';
71
- $html .= '<h4 title="' . $media->media_title . '">';
72
  if ( $media->media_type != 'photo' )
73
- $html .= '<a href="' . get_rtmedia_permalink ( $media->id ) . '">';
74
 
75
- $html .= $media->media_title;
76
  if ( $media->media_type != 'photo' )
77
- $html .= '</a>';
78
- $html .= '</h4>';
79
- $html .= '</div>';
80
  if ( $media->media_type == 'photo' )
81
- $html .= '</a>';
82
 
83
- $html .= '<div class="rtmedia-item-actions">';
84
- $html .= $this->actions ();
85
- $html .= '</div>';
86
- $html .= '</li>';
 
87
  }
 
 
88
  $html .= '</ul>';
89
  $html .= '</div>';
90
  return $html;
56
  if( intval( $limitActivityFeed ) > 0 )
57
  $media_details = array_slice( $media_details, 0, $limitActivityFeed, true);
58
  $rtmedia_activity_ul_class = apply_filters("rtmedia_activity_ul_class","large-block-grid-3");
59
+ $li_content = "";
60
+ $count = 0;
61
  foreach ( $media_details as $media ) {
62
+ $li_content .= '<li class="rtmedia-list-item media-type-' . $media->media_type . '">';
63
  if ( $media->media_type == 'photo' )
64
+ $li_content .= '<a href ="' . get_rtmedia_permalink ( $media->id ) . '">';
65
+ $li_content .= '<div class="rtmedia-item-thumbnail">';
66
 
67
+ $li_content .= $this->media ( $media );
68
 
69
+ $li_content .= '</div>';
70
 
71
+ $li_content .= '<div class="rtmedia-item-title">';
72
+ $li_content .= '<h4 title="' . $media->media_title . '">';
73
  if ( $media->media_type != 'photo' )
74
+ $li_content .= '<a href="' . get_rtmedia_permalink ( $media->id ) . '">';
75
 
76
+ $li_content .= $media->media_title;
77
  if ( $media->media_type != 'photo' )
78
+ $li_content .= '</a>';
79
+ $li_content .= '</h4>';
80
+ $li_content .= '</div>';
81
  if ( $media->media_type == 'photo' )
82
+ $li_content .= '</a>';
83
 
84
+ $li_content .= '<div class="rtmedia-item-actions">';
85
+ $li_content .= $this->actions ();
86
+ $li_content .= '</div>';
87
+ $li_content .= '</li>';
88
+ $count++;
89
  }
90
+ $html .= '<ul class="rtmedia-list '.$rtmedia_activity_ul_class.' rtmedia-activity-media-length-'.$count.'">';
91
+ $html .= $li_content;
92
  $html .= '</ul>';
93
  $html .= '</div>';
94
  return $html;
app/main/controllers/api/RTMediaApiLogin.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @author Umesh Kumar<umeshsingla05@gmail.com>
5
+ */
6
+ if(!class_exists('RTDBModel')){
7
+ return;
8
+ }
9
+ class RTMediaApiLogin extends RTDBModel {
10
+
11
+ function __construct () {
12
+ parent::__construct ( 'rtm_api' );
13
+ }
14
+ }
app/main/controllers/api/RTMediaJsonApi.php ADDED
@@ -0,0 +1,1167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File Description
4
+ * @author Umesh Kumar <umeshsingla05@gmail.com>
5
+ */
6
+ class RTMediaJsonApi{
7
+
8
+ var $ec_method_missing = 600001,
9
+ $msg_method_missing = 'no method specified',
10
+ $ec_token_missing = 600002,
11
+ $msg_token_missing = 'token empty',
12
+ $ec_token_invalid = 600003,
13
+ $msg_token_invalid = 'token invalid',
14
+ $ec_server_error = 600004,
15
+ $msg_server_error = 'server error',
16
+ $ec_media_activity_id_missing = 600005,
17
+ $msg_media_activity_id_missing = 'media/activity id missing',
18
+ $ec_invalid_media_id = 600006,
19
+ $msg_invalid_media_id = 'invalid media id',
20
+ $ec_invalid_request_type = 600007,
21
+ $msg_invalid_request_type = 'invalid request type',
22
+ $rtmediajsonapifunction,
23
+ $user_id = '';
24
+
25
+ function __construct(){
26
+ if (!class_exists('RTMediaApiLogin') || !class_exists('RTMediaJsonApiFunctions')) {
27
+ return;
28
+ }
29
+
30
+ add_action('wp_ajax_nopriv_rtmedia_api', array($this, 'rtmedia_api_process_request') );
31
+ add_action('wp_ajax_rtmedia_api', array($this, 'rtmedia_api_process_request') );
32
+ }
33
+
34
+ function rtmedia_api_process_request(){
35
+ if ( empty ( $_POST['method'] ) ){
36
+ echo $this->rtmedia_api_response_object( 'FALSE', $this->$ec_method_missing, $this->msg_method_missing );
37
+ }
38
+ if (!class_exists('BuddyPress')) {
39
+ echo $this->rtmedia_api_response_object( 'FALSE', '600008', 'buddypress not active' );
40
+ die;
41
+ }
42
+ $this->rtmediajsonapifunction = new RTMediaJsonApiFunctions();
43
+
44
+ if(!empty($_POST['token'])){
45
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
46
+ $this->user_id = $this->rtmediajsonapifunction->rtmedia_api_get_user_id_from_token($_POST['token']);
47
+ //add filter
48
+ add_filter('rtmedia_current_user', array($this->rtmediajsonapifunction, 'rtmedia_api_set_user_id'));
49
+ }
50
+ //Process Request
51
+ $method = $_POST['method'];
52
+
53
+ switch ( $method ){
54
+
55
+ case 'wp_login':
56
+ $this->rtmedia_api_process_wp_login_request();
57
+ break;
58
+ case 'wp_logout':
59
+ $this->rtmedia_api_process_wp_logout_request();
60
+ break;
61
+ case 'wp_register':
62
+ $this->rtmedia_api_process_wp_register_request();
63
+ break;
64
+ case 'wp_forgot_password':
65
+ $this->rtmedia_api_process_wp_forgot_password_request();
66
+ break;
67
+ case 'bp_get_profile':
68
+ $this->rtmedia_api_process_bp_get_profile_request();
69
+ break;
70
+ case 'bp_get_activities':
71
+ $this->rtmedia_api_process_bp_get_activities_request();
72
+ break;
73
+ case 'add_rtmedia_comment':
74
+ $this->rtmedia_api_process_add_rtmedia_comment_request();
75
+ break;
76
+ case 'like_media':
77
+ $this->rtmedia_api_process_like_media_request();
78
+ break;
79
+ case 'get_rtmedia_comments':
80
+ $this->rtmedia_api_process_get_rtmedia_comments_request();
81
+ break;
82
+ case 'get_likes_rtmedia':
83
+ $this->rtmedia_api_process_get_likes_rtmedia_request();
84
+ break;
85
+ case 'remove_comment':
86
+ $this->rtmedia_api_process_remove_comment_request();
87
+ break;
88
+ case 'update_profile':
89
+ $this->rtmedia_api_process_update_profile_request();
90
+ break;
91
+ case 'rtmedia_upload_media':
92
+ $this->rtmedia_api_process_rtmedia_upload_media_request();
93
+ break;
94
+ case 'rtmedia_gallery':
95
+ $this->rtmedia_api_process_rtmedia_gallery_request();
96
+ break;
97
+ case 'rtmedia_get_media_details':
98
+ $this->rtmedia_api_process_rtmedia_get_media_details_request();
99
+ break;
100
+ default:
101
+ echo $this->rtmedia_api_response_object( 'FALSE', $this->ec_invalid_request_type, $this->msg_invalid_request_type );
102
+ exit;
103
+ }
104
+
105
+ die(1);
106
+ }
107
+ /**
108
+ * Returns a json object
109
+ * @param type $status
110
+ * @param type $status_code
111
+ * @param type $message
112
+ * @param type $data
113
+ * @return boolean
114
+ */
115
+ function rtmedia_api_response_object( $status, $status_code, $message, $data = false ){
116
+ if ( $status === '' || empty( $status_code ) || empty( $message ) ) {
117
+ return false;
118
+ exit;
119
+ }
120
+
121
+ ob_end_clean();
122
+ global $wpdb;
123
+ $rtmapilogin = new RTMediaApiLogin();
124
+ $login_details = array( 'last_access' => $wpdb->get_var("SELECT current_timestamp();") );
125
+ if( !empty( $_POST['token'] ) ){
126
+ $where = array('user_id' => $this->user_id, 'token' => $_POST['token'] );
127
+ }
128
+ if( !empty( $where ) ){
129
+ $rtmapilogin->update( $login_details, $where);
130
+ }
131
+ $response_object = array();
132
+ $response_object['status'] = $status;
133
+ $response_object['status_code'] = $status_code;
134
+ $response_object['message'] = $message;
135
+ $response_object['data'] = $data;
136
+
137
+ $response_object = json_encode( $response_object );
138
+ return $response_object;
139
+ }
140
+ /**
141
+ * Takes username and password, if succesful returns a access token
142
+ */
143
+ function rtmedia_api_process_wp_login_request(){
144
+ //Login Errors and Messages
145
+ $ec_user_pass_missing = 200001;
146
+ $msg_user_pass_missing = __('username/password empty', 'rtmedia' );
147
+
148
+ $ec_incorrect_username = 200002;
149
+ $msg_incorrect_username = __('incorrect username', 'rtmedia' );
150
+
151
+ $ec_incorrect_pass = 200003;
152
+ $msg_incorrect_pass = __('incorrect password', 'rtmedia' );
153
+
154
+ $ec_login_success = 200004;
155
+ $msg_login_success = __('login success', 'rtmedia' );
156
+
157
+ if ( empty( $_POST['username'] ) || empty( $_POST['password'] ) ){
158
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_user_pass_missing, $msg_user_pass_missing );
159
+ exit;
160
+ } else{
161
+ $user_login = wp_authenticate( trim( $_POST['username'] ), trim( $_POST['password'] ) );
162
+ if (is_wp_error( $user_login ) ){
163
+
164
+ $incorrect_password = !empty( $user_login->errors['incorrect_password'] ) ? TRUE : FALSE;
165
+ $incorrect_username = !empty( $user_login->errors['invalid_username'] ) ? TRUE : FALSE;
166
+ if ( $incorrect_password ){
167
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_incorrect_pass, $msg_incorrect_pass );
168
+ exit;
169
+ }elseif ( $incorrect_username ) {
170
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_incorrect_username, $msg_incorrect_username );
171
+ exit;
172
+ }
173
+
174
+ }else{
175
+ $access_token = $this->rtmediajsonapifunction->rtmedia_api_get_user_token( $user_login->ID, $user_login->data->user_login );
176
+ $data = array(
177
+ 'access_token' => $access_token,
178
+ );
179
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_login_success, $msg_login_success, $data );
180
+
181
+ $rtmapilogin = new RTMediaApiLogin();
182
+
183
+ //update all tokens for user to exired on each login
184
+ $rtmapilogin->update( array('status' => 'FALSE' ), array('user_id' => $user_login->ID ) );
185
+ $login_details = array( 'user_id' => $user_login->ID,
186
+ 'ip' => $_SERVER['REMOTE_ADDR'],
187
+ 'token' => $access_token,
188
+ 'token_time' => date("Y-m-d H:i:s")
189
+ );
190
+ $rtmapilogin->insert( $login_details );
191
+ }
192
+ }
193
+ }
194
+ /**
195
+ * register a user through api request
196
+ * requires signup_* => display_name, username, password, confirm password, location,
197
+ */
198
+ function rtmedia_api_process_wp_register_request(){
199
+ //Registration errors and messages
200
+ $ec_register_fields_missing = 300001;
201
+ $msg_register_fields_missing = __('fields empty', 'rtmedia' );
202
+
203
+ $ec_invalid_email = 300002;
204
+ $msg_invalid_email = __('invalid email', 'rtmedia' );
205
+
206
+ $ec_pass_do_not_match = 300003;
207
+ $msg_pass_do_not_match = __('password do not match', 'rtmedia' );
208
+
209
+ $ec_username_exists = 300004;
210
+ $msg_username_exists = __('username already registered', 'rtmedia' );
211
+
212
+ $ec_email_exists = 300005;
213
+ $msg_email_existsh = __('email already exists', 'rtmedia' );
214
+
215
+ $ec_user_insert_success = 300007;
216
+ $msg_user_insert_success = __('new user created', 'rtmedia' );
217
+
218
+ $registration_fields = array('username', 'email', 'password', 'password_confirm');
219
+ //fields empty field_1, field_4
220
+ if ( empty( $_POST['field_1'] ) ) {
221
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_register_fields_missing, $msg_register_fields_missing );
222
+ exit;
223
+ }
224
+ foreach ( $registration_fields as $field_name ){
225
+ if ( empty( $_POST['signup_'.$field_name] ) ) {
226
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_register_fields_missing, $msg_register_fields_missing );
227
+ exit;
228
+ }
229
+ }
230
+ //incorrect email
231
+ if ( !is_email( $_POST['signup_email'] ) ){
232
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_invalid_email, $msg_invalid_email );
233
+ exit;
234
+ }
235
+ //Passwords do not match
236
+ elseif ( $_POST['signup_password'] !== $_POST['signup_password_confirm'] ){
237
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_pass_do_not_match, $msg_pass_do_not_match );
238
+ exit;
239
+ }
240
+ //Username already registered
241
+ elseif ( username_exists( $_POST['signup_username'] ) ){
242
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_username_exists, $msg_username_exists );
243
+ exit;
244
+ }
245
+ //email already registered
246
+ elseif (email_exists( $_POST['signup_email'] ) ){
247
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_email_exists, $msg_email_existsh );
248
+ exit;
249
+ }else{
250
+ $userdata = array(
251
+ 'user_login' => $_POST['signup_username'],
252
+ 'user_pass' => $_POST['signup_password'],
253
+ 'display_name' => $_POST['field_1']
254
+ );
255
+
256
+ $user_id = wp_insert_user( $userdata );
257
+ if ( !is_wp_error( $user_id )){
258
+ echo xprofile_get_field_id_from_name('field_1');
259
+ xprofile_set_field_data( 1, $user_id, $_POST['field_1'] );
260
+ update_user_meta( $user_id, 'register_source', 'site_api' );
261
+ echo $this->rtmedia_api_response_object('TRUE', $ec_user_insert_success, $msg_user_insert_success );
262
+ exit;
263
+ }else{
264
+ echo $this->rtmedia_api_response_object( 'FALSE', $this->ec_server_error, $this->msg_server_error );
265
+ exit;
266
+ }
267
+ }
268
+ }
269
+ /**
270
+ * Sends a reset link to user email
271
+ * @global type $wpdb
272
+ */
273
+ function rtmedia_api_process_wp_forgot_password_request(){
274
+ global $wpdb;
275
+ //Registration errors and messages
276
+ $ec_email_missing = 500001;
277
+ $msg_email_missing = __('email empty', 'rtmedia' );
278
+
279
+ $ec_username_email_not_registered = 500002;
280
+ $msg_username_email_not_registered = __('username/email not registered', 'rtmedia' );
281
+
282
+ $ec_email_sent = 500003;
283
+ $msg_email_sent = __('reset link sent', 'rtmedia' );
284
+
285
+ if ( empty( $_POST['user_login'] ) ) { echo $this->rtmedia_api_response_object('FALSE', $ec_email_missing, $msg_email_missing ); exit; }
286
+
287
+ if ( username_exists( $_POST['user_login'] ) ){
288
+ $user_exists = true;
289
+ $user = get_user_by('login', $_POST['user_login'] );
290
+ }
291
+ // Then, by e-mail address
292
+ elseif( email_exists( $_POST['user_login'] ) ){
293
+ $user_exists = true;
294
+ $user = get_user_by('email', $_POST['user_login'] );
295
+ }else{
296
+ echo $this->rtmedia_api_response_object('FALSE', $ec_username_email_not_registered, $msg_username_email_not_registered );
297
+ exit;
298
+ }
299
+ $user_login = $user->data->user_login;
300
+ $user_email = $user->data->user_email;
301
+
302
+ // Generate something random for a key...
303
+ $key = wp_generate_password(20, false);
304
+ do_action('retrieve_password_key', $user_login, $key);
305
+ // Now insert the new md5 key into the db
306
+ // Now insert the key, hashed, into the DB.
307
+ if ( empty( $wp_hasher ) ) {
308
+ require_once ABSPATH . 'wp-includes/class-phpass.php';
309
+ $wp_hasher = new PasswordHash( 8, true );
310
+ }
311
+ $hashed = $wp_hasher->HashPassword( $key );
312
+ $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user_login ) );
313
+
314
+ //create email message
315
+ $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
316
+ $message .= get_option('siteurl') . "\r\n\r\n";
317
+ $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
318
+ $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
319
+ $message .='<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";
320
+ //send email meassage
321
+ if (FALSE == wp_mail($user_email, sprintf(__('[%s] Password Reset'), get_option('blogname')), $message))
322
+ echo $this->rtmedia_api_response_object ('FALSE', $this->ec_server_error, $this->msg_server_error);
323
+ else{
324
+ echo $this->rtmedia_api_response_object ('TRUE', $ec_email_sent, $msg_email_sent);
325
+ }
326
+ exit;
327
+ }
328
+ /**
329
+ * Sends a reset link to user email
330
+ * @global type $wpdb
331
+ */
332
+ function rtmedia_api_process_bp_get_activities_request(){
333
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
334
+ //Feed Errors
335
+ $ec_latest_feed = 700001;
336
+ $msg_latest_feed = __('bp activities', 'rtmedia' );
337
+
338
+ $ec_my_looks = 700002;
339
+ $msg_my_looks = __('user activities', 'rtmedia' );
340
+
341
+ //Fetch user id from token
342
+ $activity_user_id = '';
343
+ extract($_REQUEST);
344
+ $per_page = !empty($_REQUEST['per_page']) ? $_REQUEST['per_page'] : 10;
345
+ $activity_feed = $this->rtmediajsonapifunction->rtmedia_api_get_feed($activity_user_id, '', $per_page);
346
+ if( empty($activity_feed) ){
347
+ $activity_feed = 'no updates';
348
+ }
349
+ if ( !empty( $activity_user_id ) ){
350
+ echo $this->rtmedia_api_response_object('TRUE', $ec_my_looks, $msg_my_looks, $activity_feed );
351
+ }else{
352
+ echo $this->rtmedia_api_response_object('TRUE', $ec_latest_feed, $msg_latest_feed, $activity_feed );
353
+ }
354
+ exit;
355
+ }
356
+ /**
357
+ * Post comment on activity_id or media_id
358
+ * @global type $this->msg_server_error
359
+ * @global int $this->ec_server_error
360
+ * @global int $this->ec_invalid_media_id
361
+ * @global type $this->msg_invalid_media_id
362
+ */
363
+ function rtmedia_api_process_add_rtmedia_comment_request(){
364
+
365
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
366
+ $this->rtmediajsonapifunction->rtmedia_api_media_activity_id_missing();
367
+ //Post comment errors
368
+ $ec_comment_content_missing = 800001;
369
+ $msg_comment_content_missing = __('comment content missing', 'rtmedia' );
370
+
371
+ $ec_comment_posted = 800002;
372
+ $msg_comment_posted = __('comment posted', 'rtmedia' );
373
+
374
+ //Fetch user id from token
375
+ $user_data = get_userdata( $this->user_id );
376
+ if ( empty( $_POST['content'] ) ) {
377
+ echo $this->rtmedia_api_response_object('FALSE', $ec_comment_content_missing, $msg_comment_content_missing );
378
+ exit;
379
+ }
380
+ extract($_POST);
381
+
382
+ if ( empty( $activity_id ) && !empty( $media_id ) ){
383
+ $activity_id = $this->rtmediajsonapifunction->rtmedia_api_activityid_from_mediaid( $media_id );
384
+ }
385
+ if(empty($activity_id)){
386
+ echo $this->rtmedia_api_response_object('FALSE', $this->ec_invalid_media_id, $this->msg_invalid_media_id );
387
+ exit;
388
+ }
389
+ $args = array(
390
+ 'content' => $content,
391
+ 'activity_id' => $activity_id,
392
+ 'user_id' => $this->user_id,
393
+ 'parent_id' => false
394
+ );
395
+ if ( function_exists ( 'bp_activity_new_comment' ) ) {
396
+ $comment_id = bp_activity_new_comment ( $args );
397
+ }
398
+ if ( $comment_id ) {
399
+ echo $this->rtmedia_api_response_object('TRUE', $ec_comment_posted, $msg_comment_posted );
400
+ exit;
401
+ }else{
402
+ echo $this->rtmedia_api_response_object('FALSE', $this->msg_server_error, $this->ec_server_error );
403
+ exit;
404
+ }
405
+ }
406
+ /**
407
+ * Like/Unlike by media_id or activity_id
408
+ * @global int $this->ec_server_error
409
+ * @global type $this->msg_server_error
410
+ * @global int $this->ec_invalid_media_id
411
+ * @global type $this->msg_invalid_media_id
412
+ */
413
+ function rtmedia_api_process_like_media_request(){
414
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
415
+ $this->rtmediajsonapifunction->rtmedia_api_media_activity_id_missing();
416
+
417
+ //Like errors
418
+ $ec_already_liked = 900001;
419
+ $msg_already_liked = __('unliked media', 'rtmedia' );
420
+
421
+ $ec_liked_media = 900002;
422
+ $msg_liked_media = __('liked media', 'rtmedia' );
423
+
424
+ extract($_POST);
425
+
426
+ if(class_exists('RTMediaInteractionModel') ):
427
+ $rtmediainteraction = new RTMediaInteractionModel();
428
+
429
+ if(class_exists('RTMediaLike') )
430
+ $rtmedialike = new RTMediaLike();
431
+
432
+ $action = 'like';
433
+ // Like or Unlike
434
+ if( !rtmedia_media_id( $media_id) ){
435
+ echo $this->rtmedia_api_response_object( 'FALSE', $this->ec_invalid_media_id, $this->msg_invalid_media_id );
436
+ exit;
437
+ }
438
+
439
+ $like_count_old = get_rtmedia_like( rtmedia_media_id( $media_id) );
440
+ $check_action = $rtmediainteraction->check( $this->user_id, $media_id, $action);
441
+ if($check_action) {
442
+ $results = $rtmediainteraction->get_row( $this->user_id, $media_id, $action);
443
+ $row = $results[0];
444
+ $curr_value = $row->value;
445
+ if($curr_value == "1") {
446
+ $value = "0";
447
+ $increase =false;
448
+ } else {
449
+ $value = "1";
450
+ $increase = true;
451
+ }
452
+ $update_data = array('value' => $value);
453
+ $where_columns = array(
454
+ 'user_id' => $this->user_id,
455
+ 'media_id' => $media_id,
456
+ 'action' => $action,
457
+ );
458
+ $update = $rtmediainteraction->update($update_data, $where_columns);
459
+ } else {
460
+ $value = "1";
461
+ $columns = array(
462
+ 'user_id' => $this->user_id,
463
+ 'media_id' => $media_id,
464
+ 'action' => $action,
465
+ 'value' => $value
466
+ );
467
+ $insert_id = $rtmediainteraction->insert($columns);
468
+ $increase = true;
469
+ }
470
+ if ( $increase ){
471
+ $like_count_old++;
472
+ }elseif(!$increase){
473
+ $like_count_old--;
474
+ }
475
+ if($like_count_old < 0 ){
476
+ $like_count_old = 0;
477
+ }
478
+ $data = array('like_count' => $like_count_old );
479
+ if ( !empty( $insert_id ) ){
480
+ $rtmedialike->model->update( array( 'likes' => $like_count_old ), array( 'id' => $media_id ) );
481
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_liked_media, $msg_liked_media, $data );
482
+ exit;
483
+ }elseif ( !empty( $update ) ){
484
+ $rtmedialike->model->update( array( 'likes' => $like_count_old ), array( 'id' => $media_id ) );
485
+ if ( $value == 1 ){
486
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_liked_media, $msg_liked_media, $data );
487
+ exit;
488
+ }elseif( $value == 0 ){
489
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_already_liked, $msg_already_liked, $data );
490
+ exit;
491
+ }
492
+ }else{
493
+ echo $this->rtmedia_api_response_object( 'FALSE', $this->ec_server_error, $this->msg_server_error );
494
+ exit;
495
+ }
496
+ endif;
497
+ }
498
+ /**
499
+ * Fetch Comments by media id
500
+ * @global type $wpdb
501
+ */
502
+ function rtmedia_api_process_get_rtmedia_comments_request(){
503
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
504
+ //Errors Fetching comment
505
+ $ec_no_comments = 800003;
506
+ $msg_no_comments = __('no comments', 'rtmedia' );
507
+
508
+ $ec_media_comments = 800004;
509
+ $msg_media_comments = __('media comments', 'rtmedia' );
510
+
511
+ $ec_my_comments = 800005;
512
+ $msg_my_comments = __('my comments', 'rtmedia' );
513
+
514
+ extract($_REQUEST);
515
+ global $wpdb;
516
+ if ( empty( $media_id ) ){
517
+
518
+ $user_data = $this->rtmediajsonapifunction->rtmedia_api_user_data_from_id($this->user_id);
519
+ $comments = $wpdb->get_results ( "SELECT * FROM $wpdb->comments WHERE user_id = '" . $this->user_id . "'", ARRAY_A );
520
+ $my_comments = array();
521
+ if ( !empty( $comments ) ){
522
+ foreach ( $comments as $comment ){
523
+ $my_comments['comments'][] = array(
524
+ 'comment_ID' => $comment['comment_ID'],
525
+ 'comment_content' => $comment['comment_content'],
526
+ 'media_id' => $comment['comment_post_ID']
527
+ );
528
+ }
529
+ $my_comments['user'] = array(
530
+ 'user_id' => $this->user_id,
531
+ 'name' => $user_data['name'],
532
+ 'avatar' => $user_data['avatar']
533
+ );
534
+
535
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_media_comments, $msg_media_comments, $my_comments );
536
+ exit;
537
+ }
538
+ }else{
539
+ $media_comments = $this->rtmediajsonapifunction->rtmedia_api_get_media_comments($media_id);
540
+ if( $media_comments ){
541
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_media_comments, $msg_media_comments, $media_comments );
542
+ exit;
543
+ }else{
544
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_no_comments, $msg_no_comments );
545
+ exit;
546
+ }
547
+ }
548
+ //If no comments
549
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_no_comments, $msg_no_comments );
550
+ exit;
551
+ }
552
+ /**
553
+ * Fetch Likes by media id
554
+ * @global type $wpdb
555
+ */
556
+ function rtmedia_api_process_get_likes_rtmedia_request(){
557
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
558
+ $this->rtmediajsonapifunction->rtmedia_api_media_activity_id_missing();
559
+ global $wpdb;
560
+ //Errors Fetching Likes
561
+ $ec_no_likes = 900003;
562
+ $msg_no_likes = __('no likes', 'rtmedia' );
563
+
564
+ $ec_media_likes = 900004;
565
+ $msg_media_likes = __('media likes', 'rtmedia' );
566
+ $media_like_users = array();
567
+ $media_likes = array();
568
+ $media_likes['user'] = array();
569
+ extract($_POST);
570
+ $media_like_users = $this->rtmediajsonapifunction->rtmedia_api_media_liked_by_user($media_id);
571
+ if ( !empty( $media_like_users ) ){
572
+ foreach ( $media_like_users as $like_details){
573
+ if ( !array_key_exists( $like_details->user_id, $media_likes['user'] ) ){
574
+
575
+ $user_data = $this->rtmediajsonapifunction->rtmedia_api_user_data_from_id( $like_details->user_id );
576
+ $mysql_time = $wpdb->get_var('select CURRENT_TIMESTAMP()');
577
+ $like_time = human_time_diff( strtotime($like_details->action_date), strtotime( $mysql_time ) );
578
+ $media_likes['likes'][] = array(
579
+ 'activity_time' => $like_time,
580
+ 'user_id' => $like_details->user_id
581
+ );
582
+ $media_likes['user'][$like_details->user_id] = array(
583
+ 'name' => $user_data['name'],
584
+ 'avatar' => $user_data['avatar']
585
+ );
586
+ }
587
+ }
588
+ }
589
+ if( !empty ( $media_likes ) ){
590
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_media_likes, $msg_media_likes, $media_likes );
591
+ exit;
592
+ }else{
593
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_no_likes, $msg_no_likes );
594
+ exit;
595
+ }
596
+ }
597
+ /**
598
+ * Delete comment by activity id or media id
599
+ */
600
+ function rtmedia_api_process_remove_comment_request(){
601
+ global $wpdb;
602
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
603
+ $this->rtmediajsonapifunction->rtmedia_api_media_activity_id_missing();
604
+ //Errors Deleting comment
605
+
606
+ $ec_comment_not_found = 800007;
607
+ $msg_comment_not_found = __('invalid comment/media id', 'rtmedia' );
608
+
609
+ $ec_no_comment_id = 800008;
610
+ $msg_no_comment_id = __('no comment id', 'rtmedia' );
611
+
612
+ $ec_comment_deleted = 800009;
613
+ $msg_comment_deleted = __('comment deleted', 'rtmedia' );
614
+ extract($_POST);
615
+
616
+ if ( empty( $comment_id ) ){
617
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_no_comment_id, $msg_no_comment_id );
618
+ exit;
619
+ }
620
+ $id = rtmedia_media_id($media_id);
621
+
622
+ $sql = "SELECT * FROM {$wpdb->comments} WHERE comment_ID = " . $comment_id . " AND comment_post_ID = " . $id. " AND user_id = " . $this->user_id;
623
+
624
+ $comments = $wpdb->get_results ( $sql, ARRAY_A );
625
+ //Delete Comment
626
+ if ( !empty( $comments ) ) {
627
+ $comment = new RTMediaComment();
628
+
629
+ $activity_id = get_comment_meta($comment_id, 'activity_id',true);
630
+
631
+ if(!empty($activity_id)){
632
+ $activity_deleted = bp_activity_delete_comment ($activity_id, $comment_id);
633
+
634
+ $delete = bp_activity_delete( array( 'id' => $activity_id, 'type' => 'activity_comment' ) );
635
+
636
+ }
637
+ $comment_deleted = $comment->rtmedia_comment_model->delete($comment_id);;
638
+
639
+ if ( $comment_deleted ){
640
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_comment_deleted, $msg_comment_deleted );
641
+ exit;
642
+ }else{
643
+ echo $this->rtmedia_api_response_object( 'FALSE', $this->ec_server_error, $this->msg_server_error );
644
+ exit;
645
+ }
646
+
647
+ }else{
648
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_comment_not_found, $msg_comment_not_found );
649
+ exit;
650
+ }
651
+ }
652
+ function rtmedia_api_process_bp_get_profile_request(){
653
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
654
+ //Errors
655
+ $ec_no_fields = 400001;
656
+ $msg_no_fields = __('no profile found', 'rtmedia' );
657
+
658
+ $ec_profile_fields = 400002;
659
+ $msg_profile_fields = __('profile fields', 'rtmedia' );
660
+
661
+ $profile_fields = array();
662
+ $user_id = $loggedin_user_id = '';
663
+ extract($_REQUEST);
664
+ if(empty($user_id)){
665
+ $user_id = $this->user_id;
666
+ }else{
667
+ $loggedin_user_id = $this->user_id;
668
+ }
669
+ $user = get_userdata($user_id);
670
+ if(empty($user)){
671
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_no_fields, $msg_no_fields);
672
+ exit;
673
+ }
674
+ $user_data = $this->rtmediajsonapifunction->rtmedia_api_user_data_from_id($user_id, 250, 250, 'full' );
675
+ $profile_fields['id'] = $user_id;
676
+ $profile_fields['avatar']['src'] = $user_data['avatar'];
677
+ $profile_fields['avatar']['width'] = 250;
678
+ $profile_fields['avatar']['height'] = 250;
679
+
680
+ if ( bp_has_profile(array('user_id' => $user_id) ) ) :
681
+ while ( bp_profile_groups() ) : bp_the_profile_group();
682
+
683
+ if ( bp_profile_group_has_fields() ) :
684
+
685
+ while ( bp_profile_fields() ) : bp_the_profile_field();
686
+
687
+ if ( bp_field_has_data() ) :
688
+
689
+ $profile_fields['fields'][bp_get_the_profile_field_name()] = array(
690
+ 'value' => strip_tags( bp_get_the_profile_field_value() ),
691
+ 'privacy' => bp_get_the_profile_field_visibility_level()
692
+ );
693
+ endif;
694
+
695
+ endwhile;
696
+ endif;
697
+ endwhile;
698
+ else:
699
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_no_fields, $msg_no_fields);
700
+ exit;
701
+ endif;
702
+ //If followers plugin exists
703
+ if( function_exists('rtmedia_api_followers') ){
704
+ $followers = rtmedia_api_followers($user_id);
705
+ $following = rtmedia_api_following($user_id);
706
+
707
+ foreach ( $followers as $follower ){
708
+ $follower_data = $this->rtmediajsonapifunction->rtmedia_api_user_data_from_id( $follower, 66, 66 );
709
+ $profile_fields['follower'][] = array(
710
+ 'id' => $follower,
711
+ 'name' => $follower_data['name'],
712
+ 'avatar' => $follower_data['avatar'],
713
+ );
714
+ }
715
+
716
+ foreach ( $following as $follow ){
717
+ $follow_data = $this->rtmediajsonapifunction->rtmedia_api_user_data_from_id( $follow, 66, 66 );
718
+ $profile_fields['following'][] = array(
719
+ 'id' => $follow,
720
+ 'name' => $follow_data['name'],
721
+ 'avatar' => $follow_data['avatar'],
722
+ );
723
+ }
724
+ }
725
+ if(!empty($_REQUEST['user_id']) && $loggedin_user_id != $user_id ){
726
+ $args = array(
727
+ 'leader_id' => $user_id,
728
+ 'follower_id' => $loggedin_user_id
729
+ );
730
+ if(function_exists('bp_follow_is_following')){
731
+ $profile_fields['loggedin_user']['following'] = 'FALSE';
732
+ if (bp_follow_is_following( $args )){
733
+ $profile_fields['loggedin_user']['following'] = 'TRUE';
734
+ }
735
+
736
+ $args = array(
737
+ 'leader_id' => $loggedin_user_id,
738
+ 'follower_id' => $user_id
739
+ );
740
+ $profile_fields['loggedin_user']['followed'] = 'FALSE';
741
+ if (bp_follow_is_following( $args )){
742
+ $profile_fields['loggedin_user']['followed'] = 'TRUE';
743
+ }
744
+ }
745
+ }
746
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_profile_fields, $msg_profile_fields, $profile_fields);
747
+ exit;
748
+ }
749
+
750
+ function rtmedia_api_process_follow_request(){
751
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
752
+ $ec_empty_follow_id = 400003;
753
+ $msg_empty_follow_id = __('follow user id missing', 'rtmedia' );
754
+
755
+ $ec_started_following = 400004;
756
+ $msg_started_following = __('started following', 'rtmedia' );
757
+
758
+ $ec_already_following = 400005;
759
+ $msg_already_following = __('already following', 'rtmedia' );
760
+
761
+ extract($_POST);
762
+
763
+ if ( empty( $follow_id ) ){
764
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_empty_follow_id, $msg_empty_follow_id );
765
+ exit;
766
+ }
767
+ $args = array(
768
+ 'leader_id' => $follow_id,
769
+ 'follower_id' => $this->user_id
770
+ );
771
+ $already_following = bp_follow_is_following($args);
772
+ if( !$already_following ){
773
+ $follow_user = bp_follow_start_following($args);
774
+ if ( $follow_user ){
775
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_started_following, $msg_started_following );
776
+ exit;
777
+ }
778
+ else{
779
+ echo $this->rtmedia_api_response_object( 'TRUE', $this->ec_server_error, $this->msg_server_error );
780
+ exit;
781
+ }
782
+ }else{
783
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_already_following, $msg_already_following );
784
+ exit;
785
+ }
786
+ }
787
+ function rtmedia_api_process_unfollow_request(){
788
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
789
+
790
+ $ec_empty_unfollow_id = 400006;
791
+ $msg_empty_unfollow_id = __('unfollow id missing', 'rtmedia' );
792
+
793
+ $ec_stopped_following = 400007;
794
+ $msg_stopped_following = __('stopped following', 'rtmedia' );
795
+
796
+ $ec_not_following = 400008;
797
+ $msg_not_following = __('not following', 'rtmedia' );
798
+
799
+ extract($_POST);
800
+
801
+ if ( empty( $unfollow_id ) ){
802
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_empty_unfollow_id, $msg_empty_unfollow_id );
803
+ exit;
804
+ }
805
+
806
+ $args = array(
807
+ 'leader_id' => $unfollow_id,
808
+ 'follower_id' => $this->user_id
809
+ );
810
+ $following = bp_follow_is_following($args);
811
+ if( $following ){
812
+ $unfollow_user = bp_follow_stop_following($args);
813
+ if ( $unfollow_user ){
814
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_stopped_following, $msg_stopped_following );
815
+ exit;
816
+ }
817
+ else{
818
+ echo $this->rtmedia_api_response_object( 'TRUE', $this->ec_server_error, $this->msg_server_error );
819
+ exit;
820
+ }
821
+ }else{
822
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_not_following, $msg_not_following );
823
+ exit;
824
+ }
825
+ }
826
+ function rtmedia_api_process_update_profile_request(){
827
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
828
+ $ec_empty_name_location = 120001;
829
+ $msg_empty_name_location = __('name/location empty', 'rtmedia' );
830
+
831
+ $ec_profile_updated = 120002;
832
+ $msg_profile_updated = __('profile updated', 'rtmedia' );
833
+ extract($_POST);
834
+
835
+ for ( $i=1; $i<=12; $i++ ){
836
+ $field_str = 'field_';
837
+ $field_str .= $i;
838
+ $field_str_privacy = $field_str.'_privacy';
839
+ !empty( $$field_str ) ? $$field_str : '';
840
+ !empty( $$field_str_privacy ) ? $$field_str_privacy : 'public';
841
+ if ( $i ==1 || $i == 4 ){
842
+ $field_str_privacy = 'public';
843
+ if ( empty( $field_str )){
844
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_empty_name_location, $msg_empty_name_location );
845
+ exit;
846
+ }
847
+ }
848
+ xprofile_set_field_data( $i, $this->user_id, $$field_str );
849
+ xprofile_set_field_visibility_level($i, $this->user_id, $$field_str_privacy);
850
+ }
851
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_profile_updated, $msg_profile_updated );
852
+ exit;
853
+ }
854
+ function rtmedia_api_process_update_avatar_request(){
855
+
856
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
857
+ $ec_no_file = 130001;
858
+ $msg_no_file = __('no file', 'rtmedia' );
859
+
860
+ $ec_invalid_image = 130002;
861
+ $msg_invalid_image = __('upload failed, check size and file type', 'rtmedia' );
862
+
863
+ $ec_avatar_updated = 130003;
864
+ $msg_avatar_updated = __('avatar updated', 'rtmedia' );
865
+ extract($_POST);
866
+ if( empty( $_FILES['file'] )){
867
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_no_file, $msg_no_file );
868
+ exit;
869
+ }
870
+ $uploaded = bp_core_avatar_handle_upload( $_FILES, 'xprofile_avatar_upload_dir' );
871
+ if ( !$uploaded ){
872
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_invalid_image, $msg_invalid_image );
873
+ exit;
874
+ }else{
875
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_avatar_updated, $msg_avatar_updated );
876
+ exit;
877
+ }
878
+ }
879
+
880
+ function rtmedia_api_process_rtmedia_upload_media_request(){
881
+
882
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
883
+ //Error Codes for new look
884
+ $ec_no_file = 140001;
885
+ $msg_no_file = __('no file', 'rtmedia' );
886
+
887
+ $ec_invalid_file_string = 140005;
888
+ $msg_invalid_file_string = __('invalid file string', 'rtmedia' );
889
+
890
+ $ec_image_type_missing = 140006;
891
+ $msg_image_type_missing = __('image type missing', 'rtmedia' );
892
+
893
+ $ec_no_file_title = 140002;
894
+ $msg_no_file_title = __('no title', 'rtmedia' );
895
+
896
+ $ec_invalid_image = 140003;
897
+ $msg_invalid_image = __('upload failed, check size and file type', 'rtmedia' );
898
+
899
+ $ec_look_updated = 140004;
900
+ $msg_look_updated = __('media updated', 'rtmedia' );
901
+
902
+ $description = '';
903
+ extract($_POST);
904
+ $updated = FALSE;
905
+ $uploaded_look = FALSE;
906
+ if( empty($_POST['rtmedia_file'] ) && empty($_FILES['rtmedia_file'] ) ){
907
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_no_file, $msg_no_file );
908
+ exit;
909
+ }
910
+ if( !empty($_POST['rtmedia_file'] ) ) {
911
+ if( empty($_POST['image_type'] ) ){
912
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_image_type_missing, $msg_image_type_missing );
913
+ exit;
914
+ }
915
+ if( empty($title ) ){
916
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_no_file_title, $msg_no_file_title );
917
+ exit;
918
+ }
919
+ }
920
+ if( !empty($_FILES['rtmedia_file']) ){
921
+ $_POST['rtmedia_upload_nonce'] = $_REQUEST['rtmedia_upload_nonce'] = wp_create_nonce ( 'rtmedia_upload_nonce' );
922
+ $_POST['rtmedia_simple_file_upload'] = $_REQUEST['rtmedia_simple_file_upload'] = 1;
923
+ $_POST['context'] = $_REQUEST['context'] = !empty($_REQUEST['context']) ? $_REQUEST['context'] : 'profile';
924
+ $_POST['context_id'] = $_REQUEST['context_id'] = !empty($_REQUEST['context_id']) ? $_REQUEST['context_id'] : $this->user_id;
925
+ $_POST['mode'] = $_REQUEST['mode'] = 'file_upload';
926
+ $_POST['media_author'] = $_REQUEST['media_author'] = $this->user_id;
927
+ $upload = new RTMediaUploadEndpoint();
928
+ $uploaded_look = $upload->template_redirect ();
929
+ }else{
930
+ //Process rtmedia_file
931
+ $img = $rtmedia_file;
932
+ $img = str_replace('data:image/png;base64,', '', $img);
933
+ // $img = str_replace(' ', '+', $img);
934
+ $rtmedia_file = base64_decode($img);
935
+ if( !$rtmedia_file ){
936
+ echo $this->rtmedia_api_response_object( 'FALSE', $ec_invalid_file_string, $msg_invalid_file_string );
937
+ exit;
938
+ }
939
+ define('UPLOAD_DIR_LOOK', sys_get_temp_dir().'/' );
940
+ $tmp_name = UPLOAD_DIR_LOOK . $title;
941
+ $file = $tmp_name . '.'.$image_type;
942
+ $success = file_put_contents($file, $rtmedia_file);
943
+ add_filter('upload_dir', 'api_new_look_upload_dir');
944
+ // echo $file;
945
+ $new_look = wp_upload_bits($title.'.'.$image_type, '', $rtmedia_file);
946
+ $new_look['type'] = 'image/'.$image_type;
947
+ remove_filter('upload_dir', 'api_new_look_upload_dir');
948
+ foreach ( $new_look as $key => $value ){
949
+ $new_look[0][$key] = $value;
950
+ unset($new_look[$key]);
951
+ }
952
+ //Jugaad
953
+ if(!empty($tags)){
954
+ $tags = explode(',', $tags);
955
+ }
956
+ $uploaded['rtmedia_upload_nonce'] = wp_create_nonce ( 'rtmedia_upload_nonce' );
957
+ $uploaded['rtmedia_simple_file_upload'] = 1;
958
+ $uploaded['context'] = 'profile';
959
+ $uploaded['context_id'] = $this->user_id;
960
+ $uploaded['mode'] = 'file_upload';
961
+ $uploaded['media_author'] = $this->user_id;
962
+ $uploaded['album_id'] = $this->user_id;
963
+ $uploaded['privacy'] = 0;
964
+ $uploaded['title'] = $title;
965
+ $uploaded['description'] = $description;
966
+ $uploaded['taxonomy'] = array();
967
+ $uploaded['custom_fields'] = array();
968
+ $rtmedia = new RTMediaMedia();
969
+ $rtupload = $rtmedia->add( $uploaded, $new_look );
970
+ $id = rtmedia_media_id($rtupload[0]);
971
+ wp_set_post_terms( $id , $_POST["tags"] , 'media-category',true);
972
+ $media = $rtmedia->model->get ( array( 'id' => $rtupload[ 0 ] ) );
973
+ $rtMediaNav = new RTMediaNav();
974
+ $perma_link = "";
975
+
976
+ if(isset($media) && sizeof($media) > 0) {
977
+ $perma_link = get_rtmedia_permalink($media[0]->id);
978
+ if($media[0]->media_type == "photo") {
979
+ $thumb_image = rtmedia_image("rt_media_thumbnail", $rtupload[ 0 ], false);
980
+ } elseif( $media[0]->media_type == "music" ) {
981
+ $thumb_image = $media[0]->cover_art;
982
+ } else {
983
+ $thumb_image = "";
984
+ }
985
+
986
+ if ( $media[ 0 ]->context == "group" ) {
987
+ $rtMediaNav->refresh_counts ( $media[ 0 ]->context_id, array( "context" => $media[ 0 ]->context, 'context_id' => $media[ 0 ]->context_id ) );
988
+ } else {
989
+ $rtMediaNav->refresh_counts ( $media[ 0 ]->media_author, array( "context" => "profile", 'media_author' => $media[ 0 ]->media_author ) );
990
+ }
991
+ $activity_id = $rtmedia->insert_activity ( $media[ 0 ]->media_id, $media[ 0 ] );
992
+ $rtmedia->model->update ( array( 'activity_id' => $activity_id ), array( 'id' => $rtupload[ 0 ] ) );
993
+ //
994
+ $same_medias = $rtmedia->model->get ( array( 'activity_id' => $activity_id ) );
995
+
996
+ $update_activity_media = Array( );
997
+ foreach ( $same_medias as $a_media ) {
998
+ $update_activity_media[ ] = $a_media->id;
999
+ }
1000
+ $privacy = 0;
1001
+ $objActivity = new RTMediaActivity ( $update_activity_media, $privacy, false );
1002
+
1003
+ global $wpdb, $bp;
1004
+ $updated = $wpdb->update ( $bp->activity->table_name, array( "type" => "rtmedia_update", "content" => $objActivity->create_activity_html () ), array( "id" => $activity_id ) );
1005
+ }
1006
+ }
1007
+
1008
+ if ( $updated || $uploaded_look) {
1009
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_look_updated, $msg_look_updated );
1010
+ exit;
1011
+ }else{
1012
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_invalid_image, $msg_invalid_image );
1013
+ exit;
1014
+ }
1015
+ }
1016
+ function rtmedia_api_process_rtmedia_gallery_request(){
1017
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
1018
+ //Errors
1019
+ $ec_media = 160002;
1020
+ $msg_media = __('media list', 'rtmedia' );
1021
+
1022
+ $ec_no_media = 160003;
1023
+ $msg_no_media = __('no media found for requested media type', 'rtmedia' );
1024
+
1025
+ $ec_invalid_media_type = 160004;
1026
+ $msg_invalid_media_type = __('media_type not allowed', 'rtmedia' );
1027
+
1028
+ global $rtmedia;
1029
+ $rtmediamodel = new RTMediaModel();
1030
+ //Media type to fetch
1031
+ $media_type = $allowed_types = array_keys($rtmedia->allowed_types);
1032
+ $media_type[] = 'album';
1033
+ $allowed_types[] = 'album';
1034
+ if( !empty($_REQUEST['media_type']) ) {
1035
+ if(!is_array( $_REQUEST['media_type'] ) ){
1036
+ $media_type = explode(',', $_REQUEST['media_type']);
1037
+ }else{
1038
+ $media_type = $_REQUEST['media_type'];
1039
+ }
1040
+ //Check array for currently allowed media types
1041
+ $media_type = array_intersect($media_type, $allowed_types);
1042
+ }
1043
+ //Args for fetching media
1044
+ $args = array(
1045
+ 'media_type' => $media_type,
1046
+ );
1047
+
1048
+ //global
1049
+ if(isset($_REQUEST['global'])){
1050
+ if( $_REQUEST['global'] == 'false' ){
1051
+ $args['context'] = array(
1052
+ 'compare' => 'IS NOT',
1053
+ 'value' => 'NULL'
1054
+ );
1055
+ }
1056
+ }
1057
+ //context
1058
+ if(isset($_REQUEST['context'])){
1059
+ $args['context'] = $_REQUEST['context'];
1060
+ }
1061
+ //context Id
1062
+ if(isset($_POST['context_id'])){
1063
+ $args['context_id'] = $_REQUEST['context_id'];
1064
+ }
1065
+ //Media Author
1066
+ $media_author = '';
1067
+ if(!is_super_admin()){
1068
+ $media_author = $this->user_id;
1069
+ $args['media_author'] = $media_author;
1070
+ }
1071
+ if( !empty($_REQUEST['media_author'])){
1072
+ if( is_super_admin( $this->user_id ) ){
1073
+ $media_author = (int)$_REQUEST['media_author'];
1074
+ $args['media_author'] = $media_author;
1075
+ }
1076
+ }
1077
+ $offset = !empty($_REQUEST['page']) ? (int)$_REQUEST['page'] : 0;
1078
+ $per_page = isset($_REQUEST['per_page']) ? (int)$_REQUEST['per_page'] : 10;
1079
+ $order_by = !empty($_REQUEST['order_by']) ? $_REQUEST['order_by'] : 'media_id desc';
1080
+
1081
+ $media_list = $rtmediamodel->get($args, $offset, $per_page, $order_by );
1082
+ $media_result = array();
1083
+ foreach($media_list as $media ){
1084
+ $data = array(
1085
+ 'id' => $media->id,
1086
+ 'media_title' => $media->media_title,
1087
+ 'album_id' => $media->album_id,
1088
+ 'media_type' => $media->media_type,
1089
+ 'media_author' => $media->media_author,
1090
+ 'url' => get_rtmedia_permalink($media->id),
1091
+ 'cover' => rtmedia_image('rt_media_thumbnail', $media->media_id, FALSE)
1092
+ );
1093
+ //for album list all medias
1094
+ if($media->media_type == 'album'){
1095
+ $data['media'] = $this->rtmediajsonapifunction->rtmedia_api_album_media($media->id);
1096
+ }
1097
+ $media_result[] = $data;
1098
+ }
1099
+ if(!empty($media_result)){
1100
+ echo $this->rtmedia_api_response_object("TRUE", $ec_media, $msg_media, $media_result);
1101
+ }else{
1102
+ echo $this->rtmedia_api_response_object("FALSE", $ec_no_media, $msg_no_media);
1103
+ }
1104
+ }
1105
+ function rtmedia_api_process_rtmedia_get_media_details_request(){
1106
+
1107
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
1108
+ $this->rtmediajsonapifunction->rtmedia_api_media_activity_id_missing();
1109
+ //Errors
1110
+ $ec_single_media = 150002;
1111
+ $msg_single_media = __('single media', 'rtmedia' );
1112
+
1113
+ extract($_REQUEST);
1114
+ $id = rtmedia_media_id( $media_id );
1115
+ if (empty( $id ) ){
1116
+ echo $this->rtmedia_api_response_object( 'TRUE', $this->ec_invalid_media_id, $this->msg_invalid_media_id );
1117
+ exit;
1118
+ }
1119
+ if(class_exists('RTMediaModel')){
1120
+ $rtmediamodel = new RTMediaModel();
1121
+ $args = array(
1122
+ 'media_id' => $id,
1123
+ 'id' => $media_id
1124
+ );
1125
+ $media = $rtmediamodel->get($args);
1126
+ }
1127
+ $activity_id = !empty( $media) ? $media[0]->activity_id : '';
1128
+ if( empty( $activity_id ) ){
1129
+ echo $this->rtmedia_api_response_object( 'FALSE', $this->ec_invalid_media_id, $this->msg_invalid_media_id );
1130
+ exit;
1131
+ }
1132
+ $media_single = $this->rtmediajsonapifunction->rtmedia_api_get_feed(FALSE, $activity_id );
1133
+
1134
+ if( $media_single ){
1135
+ echo $this->rtmedia_api_response_object( 'TRUE', $ec_single_media, $msg_single_media, $media_single );
1136
+ exit;
1137
+ }
1138
+ }
1139
+ function rtmedia_api_process_logout_request(){
1140
+ $this->rtmediajsonapifunction->rtmedia_api_verfiy_token();
1141
+ extract($_POST);
1142
+ //Errors
1143
+ $ec_logged_out = 200005;
1144
+ $msg_logged_out = "logged out";
1145
+ $rtmapilogin = new RTMediaApiLogin();
1146
+ $updated = $rtmapilogin->update( array('status' => 'FALSE' ), array('user_id' => $this->user_id ) );
1147
+ if( $updated ){
1148
+ echo $this->rtmedia_api_response_object( "TRUE", $ec_logged_out, $msg_logged_out);
1149
+ exit;
1150
+ }else{
1151
+ echo $this->rtmedia_api_response_object( 'FALSE', $this->ec_server_error, $this->msg_server_error );
1152
+ exit;
1153
+ }
1154
+
1155
+ }
1156
+ function api_new_look_upload_dir($args){
1157
+ if( !empty($args) || !is_array($args) || empty($_POST['token']) ){
1158
+ foreach( $args as $key => $arg ){
1159
+ $replacestring = 'uploads/rtMedia/users/'.$this->rtmediajsonapifunction->rtmedia_api_get_user_id_from_token($_POST['token']);
1160
+ $arg = str_replace('uploads', $replacestring, $arg);
1161
+ $args[$key] = $arg;
1162
+ }
1163
+ $args['error'] = FALSE;
1164
+ return $args;
1165
+ }
1166
+ }
1167
+ }
app/main/controllers/api/RTMediaJsonApiFunctions.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @author Umesh Kumar<umeshsingla05@gmail.com>
5
+ */
6
+ class RTMediaJsonApiFunctions{
7
+
8
+ public function __construct() {
9
+ }
10
+ /**
11
+ * Generates a user token for user login
12
+ * @param type $user_id
13
+ * @param type $user_login
14
+ * @return type
15
+ */
16
+
17
+ function rtmedia_api_get_user_token( $user_id, $user_login ){
18
+ if( empty( $user_id ) || empty( $user_login ) ) return false;
19
+ $string = '08~'.$user_id.'~'.$user_login.'~kumar';
20
+ return sha1($string. current_time('timestamp').rand(1,9));
21
+ }
22
+ //User data from user id
23
+
24
+ function rtmedia_api_user_data_from_id( $user_id, $width = 80, $height = 80, $type = 'thumb' ){
25
+ if ( empty($user_id) ) return false;
26
+ $user_data = array();
27
+ $user_data['id'] = $user_id;
28
+ $user_data['name'] = xprofile_get_field_data( 'Name', $user_id );
29
+
30
+ $avatar_args = array( 'item_id' => $user_id, 'width' =>$width, 'height' => $height, 'html' => false, 'alt' => '', 'type' => $type );
31
+ $user_data['avatar'] = bp_core_fetch_avatar( $avatar_args );
32
+ return $user_data;
33
+ }
34
+ //Media details from id
35
+ function rtmedia_api_media_data_from_object( $media ){
36
+ if ( empty($media) ) return false;
37
+ $media_data = array();
38
+ $media_data['id'] = $media["id"];
39
+ $media_data['src'] = rtmedia_image('rt_media_activity_image', $media["id"], false);
40
+ $media_data["title"] = $media["media_title"];
41
+ $media_data['comment_count'] = bp_activity_get_comment_count();
42
+ return $media_data;
43
+ }
44
+ //Validate token
45
+ function rtmedia_api_validate_token( $token ){
46
+ if ( empty($token ) ) return false;
47
+ if ( class_exists( "RTMediaApiLogin" )) {
48
+ $rtmediaapilogin = new RTMediaApiLogin();
49
+ $columns = array(
50
+ 'token' => $token
51
+ );
52
+ $token_data = $rtmediaapilogin->get($columns);
53
+ if ( empty( $token_data ) || $token_data[0]->status === 'FALSE' ) {
54
+ return FALSE;
55
+ }
56
+ return $token_data;
57
+ }else
58
+ return false;
59
+ }
60
+ //user id from token
61
+ function rtmedia_api_get_user_id_from_token( $token ){
62
+ if ( empty($token ) ) return false;
63
+ $token_data = $this->rtmedia_api_validate_token( $token );
64
+ return $token_data[0]->user_id;
65
+ }
66
+
67
+ // Token processing for all data fetch/post requests
68
+
69
+ function rtmedia_api_verfiy_token(){
70
+ $rtmjsonapi = new RTMediaJsonApi();
71
+ if ( empty($_POST['token'] ) ){
72
+ echo $rtmjsonapi->rtmedia_api_response_object('FALSE', $rtmjsonapi->ec_token_missing, $rtmjsonapi->msg_token_missing );
73
+ exit;
74
+ }
75
+ //Validate token
76
+
77
+ $token_valid = $this->rtmedia_api_validate_token( $_POST['token'] );
78
+
79
+ if ( !$token_valid ){
80
+ echo $rtmjsonapi->rtmedia_api_response_object('FALSE', $rtmjsonapi->ec_token_invalid, $rtmjsonapi->msg_token_invalid );
81
+ exit;
82
+ }
83
+ }
84
+ function rtmedia_api_media_activity_id_missing(){
85
+ $rtmjsonapi = new RTMediaJsonApi();
86
+ if ( empty( $_POST['activity_id'] ) && empty( $_POST['media_id'] ) ) {
87
+ echo $rtmjsonapi->rtmedia_api_response_object('FALSE', $rtmjsonapi->ec_media_activity_id_missing,$rtmjsonapi->msg_media_activity_id_missing );
88
+ exit;
89
+ }
90
+ }
91
+
92
+ function rtmedia_api_activityid_from_mediaid( $media_id ){
93
+ $rtmjsonapi = new RTMediaJsonApi();
94
+ if ( empty( $media_id )) return false;
95
+ $mediaModel = new RTMediaModel();
96
+ $result = $mediaModel->get ( array( 'id' => $media_id ) );
97
+
98
+ if ( empty( $result ) ){
99
+ echo $rtmjsonapi->rtmedia_api_response_object('FALSE', $rtmjsonapi->ec_invalid_media_id, $rtmjsonapi->msg_invalid_media_id );
100
+ exit;
101
+ }
102
+ return $result[ 0 ]->activity_id;
103
+ }
104
+
105
+ function rtmedia_api_followers( $user_id){
106
+ if(empty($user_id)) return false;
107
+ $followers = bp_follow_get_followers( array( 'user_id' => $user_id ) );
108
+ return $followers;
109
+ }
110
+ function rtmedia_api_following( $user_id){
111
+ if(empty($user_id)) return false;
112
+ $followers = bp_follow_get_following( array( 'user_id' => $user_id ) );
113
+ return $followers;
114
+ }
115
+ /**
116
+ * Accepts a rtmedia media object and returns a array of media details
117
+ */
118
+ function rtmedia_api_media_details( $media_list ){
119
+ global $rtmediajsonapi;
120
+ if(empty($media_list)) return false;
121
+ $result = array();
122
+ if(is_array($media_list)){
123
+ foreach($media_list as $media ){
124
+ //Media likes
125
+ $rtmediainteraction = new RTMediaInteractionModel();
126
+ $action = 'like';
127
+ $results = $rtmediainteraction->get_row( $rtmediajsonapi->user_id, $media['id'], $action);
128
+ $row = !empty($results )? $results[0] : '';
129
+ $current_user = ( !empty( $row ) && $row->value == 1 ) ? 'TRUE' : 'FALSE';
130
+
131
+
132
+ $result[] = array(
133
+ 'id' => $media['id'],
134
+ 'title' => $media['media_title'],
135
+ 'src' => rtmedia_image('rt_media_activity_image', $media["id"], false),
136
+ 'likes' => $media['likes'],
137
+ 'current_user' => $current_user,
138
+
139
+ );
140
+ }
141
+ }
142
+ return $result;
143
+ }
144
+ /**
145
+ * Fetches Activity for rtmedia updates, if user id for activity is provided fetches the user specific rtmedia updates
146
+ * @global type $activities_template
147
+ * @param type $activity_user_id
148
+ * @param type $activity_id
149
+ * @return array(), Activity data
150
+ */
151
+ function rtmedia_api_get_feed($activity_user_id = FALSE, $activity_id = FALSE, $per_page = 10 ){
152
+ global $activities_template, $rtmediajsonapi;
153
+ $activity_feed = array();
154
+ extract($_REQUEST);
155
+ $i = 0;
156
+ $args = array (
157
+ 'user_id' => $activity_user_id,
158
+ 'action'=>'', /* or rtmedia_update for fetching only rtmedia updates */
159
+ 'page' => !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1,
160
+ 'per_page' => $per_page,
161
+ 'in' => $activity_id
162
+ );
163
+ if ( bp_has_activities($args) ) :
164
+ $activity_feed['total_activity_count'] = $activities_template->total_activity_count;
165
+ $activity_feed['total'] = ceil( (int) $activities_template->total_activity_count / (int) $activities_template->pag_num );
166
+ $activity_feed['current'] = $activities_template->pag_page;
167
+ while ( bp_activities() ) : bp_the_activity();
168
+ //Activity basic details
169
+ $activity_feed[$i]['id'] = $activities_template->activity->id;
170
+ $activity_feed[$i]['activity_type'] = $activities_template->activity->type;
171
+ $activity_feed[$i]['activity_time'] = bp_get_activity_date_recorded();
172
+ $activity_feed[$i]['activity_time_human'] = strip_tags(bp_insert_activity_meta( '' ));
173
+ $activity_feed[$i]['activity_content'] = $activities_template->activity->content;
174
+
175
+ //activity User
176
+ if ( !$activity_user_id ) {
177
+ //Activity User data
178
+ $activity_feed[$i]['user'] = $this->rtmedia_api_user_data_from_id( bp_get_activity_user_id() );
179
+ }
180
+
181
+ //Media Details
182
+ if (class_exists("RTMediaModel")) {
183
+ $model = new RTMediaModel();
184
+ $media = $model->get_by_activity_id($activities_template->activity->id);
185
+
186
+ if (isset($media['result']) && count($media['result']) > 0){
187
+ //Create media array
188
+ $media = $this->rtmedia_api_media_details($media['result']);
189
+ }
190
+ else
191
+ $media = false;
192
+ }
193
+ if ( $activity_id ){;
194
+ //Activity Comment Count
195
+ $id = $media[0]['id'];
196
+ $activity_feed[$i]['comments'] = $this->rtmedia_api_get_media_comments($id) ;
197
+ }
198
+ //Activity Image
199
+ $activity_feed[$i]['media'] = $media;
200
+ $i++;
201
+ endwhile;
202
+ endif;
203
+ return $activity_feed;
204
+ }
205
+ function rtmedia_api_get_media_comments( $media_id ){
206
+ global $wpdb;
207
+ $rtmjsonapi =new RTMediaJsonApi();
208
+ $id = rtmedia_media_id($media_id);
209
+ if( empty( $id ) ){
210
+ echo $rtmjsonapi->rtmedia_api_response_object('FALSE', $rtmjsonapi->ec_invalid_media_id, $rtmjsonapi->msg_invalid_media_id );
211
+ exit;
212
+ }
213
+ $comments = $wpdb->get_results ( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = '" . $id . "'", ARRAY_A );
214
+
215
+ $media_comments = array();
216
+ if ( !empty( $comments ) ){
217
+ foreach ( $comments as $comment ){
218
+ $media_comments['comments'][] = array(
219
+ 'comment_ID' => $comment['comment_ID'],
220
+ 'comment_content' => $comment['comment_content'],
221
+ 'user_id' => $comment['user_id']
222
+ );
223
+ if ( !array_key_exists( $comment['user_id'], $media_comments['user'] ) ){
224
+
225
+ $user_data = $this->rtmedia_api_user_data_from_id( $comment['user_id'] );
226
+
227
+ $media_comments['user'][$comment['user_id']] = array(
228
+ 'name' => $user_data['name'],
229
+ 'avatar' => $user_data['avatar']
230
+ );
231
+ }
232
+ }
233
+ }
234
+ return $media_comments;
235
+ }
236
+ function rtmedia_api_media_liked_by_user( $media_id ){
237
+ $rtmediainteractionmodel = new RTMediaInteractionModel();
238
+ $media_like_cols = array(
239
+ 'media_id' => $media_id,
240
+ 'action' => 'like',
241
+ 'value' => 1
242
+ );
243
+ $likers = $rtmediainteractionmodel->get( $media_like_cols, FALSE, FALSE, 'action_date');
244
+ return $likers;
245
+ }
246
+ function rtmedia_api_album_media($album_id){
247
+ if(empty($album_id)) return false;
248
+ $rtmediamodel = new RTMediaModel();
249
+ $args = array(
250
+ 'album_id' => $album_id
251
+ );
252
+ $media_list = $rtmediamodel->get($args);
253
+ $media_data = array();
254
+ if(!empty($media_list) && is_array($media_list)){
255
+ foreach($media_list as $media ){
256
+ $media_data[] = array(
257
+ 'id' => $media->id,
258
+ 'media_title' => $media->media_title,
259
+ 'media_url' => get_rtmedia_permalink($media->media_id),
260
+ 'media_author' => $media->media_author,
261
+ 'cover' => rtmedia_image('rt_media_thumbnail', $media->media_id, FALSE)
262
+ );
263
+ }
264
+ }
265
+ return $media_data;
266
+ }
267
+ function rtmedia_api_set_user_id(){
268
+ global $rtmediajsonapi;
269
+ return $rtmediajsonapi->user_id;
270
+ }
271
+ }
app/main/controllers/media/RTMediaAlbum.php CHANGED
@@ -126,7 +126,7 @@ class RTMediaAlbum {
126
  */
127
  function get_current_author () {
128
 
129
- return get_current_user_id ();
130
  }
131
 
132
  /**
126
  */
127
  function get_current_author () {
128
 
129
+ return apply_filters('rtmedia_current_user', get_current_user_id());
130
  }
131
 
132
  /**
app/main/controllers/privacy/RTMediaPrivacy.php CHANGED
@@ -27,7 +27,7 @@ class RTMediaPrivacy {
27
  add_filter ( 'bp_activity_get_user_join_filter' , array ( $this , 'activity_privacy' ) , 10 , 6 ) ;
28
  }
29
  }
30
-
31
  function edit_media_privacy_ui($echo = true) {
32
  $privacy = "";
33
  $privacy = $this->select_privacy_ui ($echo = false);
@@ -246,7 +246,7 @@ class RTMediaPrivacy {
246
  global $rtmedia ;
247
  ?>
248
  <form method='post'>
249
- <div class="">
250
  <div class="section">
251
  <div class="columns large-2"><h2><?php _e( "Default Privacy" , "rtmedia" ) ; ?></h2></div>
252
  <div class="columns large-5">
27
  add_filter ( 'bp_activity_get_user_join_filter' , array ( $this , 'activity_privacy' ) , 10 , 6 ) ;
28
  }
29
  }
30
+
31
  function edit_media_privacy_ui($echo = true) {
32
  $privacy = "";
33
  $privacy = $this->select_privacy_ui ($echo = false);
246
  global $rtmedia ;
247
  ?>
248
  <form method='post'>
249
+ <div class="rtm_bp_default_privacy">
250
  <div class="section">
251
  <div class="columns large-2"><h2><?php _e( "Default Privacy" , "rtmedia" ) ; ?></h2></div>
252
  <div class="columns large-5">
app/main/controllers/template/RTMediaNav.php CHANGED
@@ -33,13 +33,14 @@ class RTMediaNav {
33
  if ( isset ( $bp->displayed_user ) && isset ( $bp->displayed_user->id ) ) {
34
  $profile_counts = $this->actual_counts ( $bp->displayed_user->id );
35
  }
36
-
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
  ) );
44
  }
45
  }
33
  if ( isset ( $bp->displayed_user ) && isset ( $bp->displayed_user->id ) ) {
34
  $profile_counts = $this->actual_counts ( $bp->displayed_user->id );
35
  }
36
+ $tab_position = apply_filters('rtmedia_media_tab_position',99);
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
44
  ) );
45
  }
46
  }
app/main/controllers/template/RTMediaUploadTemplate.php CHANGED
@@ -30,7 +30,7 @@ class RTMediaUploadTemplate {
30
  return;
31
  $params = array(
32
  'url' => 'upload',
33
- 'runtimes' => 'gears,html5,flash,silverlight,browserplus',
34
  'browse_button' => 'browse-button',
35
  'container' => 'bpm-file_upload-ui',
36
  'drop_element' => 'drag-drop-area',
30
  return;
31
  $params = array(
32
  'url' => 'upload',
33
+ 'runtimes' => 'gears,html5,flash,browserplus,html4',
34
  'browse_button' => 'browse-button',
35
  'container' => 'bpm-file_upload-ui',
36
  'drop_element' => 'drag-drop-area',
app/main/controllers/template/rt-template-functions.php CHANGED
@@ -375,7 +375,7 @@ function rtmedia_album_image ( $size = 'thumbnail', $id = false) {
375
  $id = $rtmedia_media->id;
376
  }
377
  global $rtmedia_query;
378
- if(isset($rtmedia_query->query['context_id'])){
379
  $media = $model->get_media ( array( 'album_id' => $id, 'media_type' => 'photo', 'media_author' => $rtmedia_query->query['context_id'] ), 0, 1 );
380
  } else {
381
  $media = $model->get_media ( array( 'album_id' => $id, 'media_type' => 'photo'), 0, 1 );
@@ -1364,7 +1364,7 @@ function rtmedia_create_album ( $options) {
1364
  if ( $display === true ) {
1365
 
1366
  add_action('rtmedia_before_media_gallery','rtmedia_create_album_modal');
1367
- $options[] = "<span><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></span>";
1368
  return $options;
1369
 
1370
  }
375
  $id = $rtmedia_media->id;
376
  }
377
  global $rtmedia_query;
378
+ if(isset($rtmedia_query->query['context_id']) && isset( $rtmedia_query->query['context'] ) && $rtmedia_query->query['context'] != "group" ){
379
  $media = $model->get_media ( array( 'album_id' => $id, 'media_type' => 'photo', 'media_author' => $rtmedia_query->query['context_id'] ), 0, 1 );
380
  } else {
381
  $media = $model->get_media ( array( 'album_id' => $id, 'media_type' => 'photo'), 0, 1 );
1364
  if ( $display === true ) {
1365
 
1366
  add_action('rtmedia_before_media_gallery','rtmedia_create_album_modal');
1367
+ $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>";
1368
  return $options;
1369
 
1370
  }
app/main/controllers/upload/RTMediaUploadView.php CHANGED
@@ -47,18 +47,18 @@ class RTMediaUploadView {
47
  } elseif ( is_rtmedia_album_enable () && $rtmedia_query && is_rtmedia_gallery () ) {
48
 
49
  if ( isset( $rtmedia_query->query[ 'context' ] ) && $rtmedia_query->query[ 'context' ] == 'profile' ) {
50
- $album = '<span><i class="rtmicon-picture-o"></i> <label>' . __('Album ','rtmedia') . ': </label><select name="album" class="rtmedia-user-album-list">' . rtmedia_user_album_list () . '</select></span>';
51
  }
52
  if (isset( $rtmedia_query->query[ 'context' ] ) && $rtmedia_query->query[ 'context' ] == 'group' ) {
53
- $album = '<span><i class="rtmicon-picture-o"></i> <label>' . __('Album ','rtmedia') . ': </label><select name="album" class="rtmedia-user-album-list">' . rtmedia_group_album_list () . '</select></span>';
54
  }
55
  }
56
  $up_privacy = $privacy = ""; //uploader privacy dropdown for uploader under rtMedia Media tab.
57
  if( is_rtmedia_privacy_enable () && ( ! isset( $rtmedia_query->is_upload_shortcode ) || $rtmedia_query->is_upload_shortcode === false) ) {
58
  if( isset( $rtmedia_query->query[ 'context' ] ) && $rtmedia_query->query[ 'context' ] == 'group'){
59
- // if the context is group, then set the media privacy to public
60
  $privacy = "<input type='hidden' name='privacy' value='0'/>";
61
- }else {
62
  $up_privacy = new RTMediaPrivacy();
63
  $up_privacy = $up_privacy->select_privacy_ui( false, 'rtSelectPrivacy') ;
64
  if($up_privacy){
@@ -69,10 +69,10 @@ class RTMediaUploadView {
69
  $tabs = array(
70
  'file_upload' => array(
71
  'default' => array( 'title' => __( 'File Upload', 'rtmedia' ),
72
- 'content' =>
73
  '<div id="rtmedia-upload-container" >'
74
  . '<div id="drag-drop-area" class="drag-drop row">'
75
- ."<div class='rtm-album-privacy'>" . $album . $privacy . "</div>"
76
  . '<div class="rtm-select-files"><input id="rtMedia-upload-button" value="' . __( "Select your files", "rtmedia" ) . '" type="button" class="rtmedia-upload-input rtmedia-file" />'
77
  . '<span class="rtm-seperator">' . __('or','rtmedia') .'</span><span class="drag-drop-info">' . __('Drop your files here', 'rtmedia') . '</span> <i class="rtm-file-size-limit rtmicon-info-circle"></i></div>'
78
  . '<input type="button" class="start-media-upload" value="' . __('Start upload', 'rtmedia') .'"/>'
47
  } elseif ( is_rtmedia_album_enable () && $rtmedia_query && is_rtmedia_gallery () ) {
48
 
49
  if ( isset( $rtmedia_query->query[ 'context' ] ) && $rtmedia_query->query[ 'context' ] == 'profile' ) {
50
+ $album = '<span> <label> <i class="rtmicon-picture-o"></i>' . __('Album ','rtmedia') . ': </label><select name="album" class="rtmedia-user-album-list">' . rtmedia_user_album_list () . '</select></span>';
51
  }
52
  if (isset( $rtmedia_query->query[ 'context' ] ) && $rtmedia_query->query[ 'context' ] == 'group' ) {
53
+ $album = '<span> <label> <i class="rtmicon-picture-o"></i>' . __('Album ','rtmedia') . ': </label><select name="album" class="rtmedia-user-album-list">' . rtmedia_group_album_list () . '</select></span>';
54
  }
55
  }
56
  $up_privacy = $privacy = ""; //uploader privacy dropdown for uploader under rtMedia Media tab.
57
  if( is_rtmedia_privacy_enable () && ( ! isset( $rtmedia_query->is_upload_shortcode ) || $rtmedia_query->is_upload_shortcode === false) ) {
58
  if( isset( $rtmedia_query->query[ 'context' ] ) && $rtmedia_query->query[ 'context' ] == 'group'){
59
+ // if the context is group, then set the media privacy to public
60
  $privacy = "<input type='hidden' name='privacy' value='0'/>";
61
+ }else {
62
  $up_privacy = new RTMediaPrivacy();
63
  $up_privacy = $up_privacy->select_privacy_ui( false, 'rtSelectPrivacy') ;
64
  if($up_privacy){
69
  $tabs = array(
70
  'file_upload' => array(
71
  'default' => array( 'title' => __( 'File Upload', 'rtmedia' ),
72
+ 'content' =>
73
  '<div id="rtmedia-upload-container" >'
74
  . '<div id="drag-drop-area" class="drag-drop row">'
75
+ ."<div class='rtm-album-privacy'>" . $album . $privacy . "</div>"
76
  . '<div class="rtm-select-files"><input id="rtMedia-upload-button" value="' . __( "Select your files", "rtmedia" ) . '" type="button" class="rtmedia-upload-input rtmedia-file" />'
77
  . '<span class="rtm-seperator">' . __('or','rtmedia') .'</span><span class="drag-drop-info">' . __('Drop your files here', 'rtmedia') . '</span> <i class="rtm-file-size-limit rtmicon-info-circle"></i></div>'
78
  . '<input type="button" class="start-media-upload" value="' . __('Start upload', 'rtmedia') .'"/>'
app/main/controllers/upload/processors/RTMediaUploadFile.php CHANGED
@@ -74,7 +74,7 @@ class RTMediaUploadFile {
74
  if ( isset ( $this->uploaded[ "context" ] ) && isset ( $this->uploaded[ "context_id" ] ) ) {
75
  if ( $this->uploaded[ "context" ] != 'group' ) {
76
  $rtmedia_upload_prefix = 'users/';
77
- $id = get_current_user_id ();
78
  } else {
79
  $rtmedia_upload_prefix = 'groups/';
80
  $id = $this->uploaded[ "context_id" ];
@@ -82,14 +82,13 @@ class RTMediaUploadFile {
82
  } else {
83
  if ( $rtmedia_interaction->context->type != 'group' ) {
84
  $rtmedia_upload_prefix = 'users/';
85
- $id = get_current_user_id ();
86
  } else {
87
  $rtmedia_upload_prefix = 'groups/';
88
  $id = $rtmedia_interaction->context->id;
89
  }
90
  }
91
 
92
-
93
  if( strpos ( $upload_dir[ 'path' ] , 'rtMedia/' . $rtmedia_upload_prefix ) === false ){
94
  $upload_dir[ 'path' ] = trailingslashit (
95
  str_replace ( $upload_dir[ 'subdir' ], '', $upload_dir[ 'path' ] ) )
@@ -99,9 +98,8 @@ class RTMediaUploadFile {
99
  str_replace ( $upload_dir[ 'subdir' ], '', $upload_dir[ 'url' ] ) )
100
  . 'rtMedia/' . $rtmedia_upload_prefix . $id
101
  . $upload_dir[ 'subdir' ];
102
- }
103
  $upload_dir = apply_filters("rtmedia_filter_upload_dir",$upload_dir);
104
-
105
  return $upload_dir;
106
  }
107
 
74
  if ( isset ( $this->uploaded[ "context" ] ) && isset ( $this->uploaded[ "context_id" ] ) ) {
75
  if ( $this->uploaded[ "context" ] != 'group' ) {
76
  $rtmedia_upload_prefix = 'users/';
77
+ $id = apply_filters('rtmedia_current_user', get_current_user_id());
78
  } else {
79
  $rtmedia_upload_prefix = 'groups/';
80
  $id = $this->uploaded[ "context_id" ];
82
  } else {
83
  if ( $rtmedia_interaction->context->type != 'group' ) {
84
  $rtmedia_upload_prefix = 'users/';
85
+ $id = apply_filters('rtmedia_current_user', get_current_user_id());
86
  } else {
87
  $rtmedia_upload_prefix = 'groups/';
88
  $id = $rtmedia_interaction->context->id;
89
  }
90
  }
91
 
 
92
  if( strpos ( $upload_dir[ 'path' ] , 'rtMedia/' . $rtmedia_upload_prefix ) === false ){
93
  $upload_dir[ 'path' ] = trailingslashit (
94
  str_replace ( $upload_dir[ 'subdir' ], '', $upload_dir[ 'path' ] ) )
98
  str_replace ( $upload_dir[ 'subdir' ], '', $upload_dir[ 'url' ] ) )
99
  . 'rtMedia/' . $rtmedia_upload_prefix . $id
100
  . $upload_dir[ 'subdir' ];
101
+ }
102
  $upload_dir = apply_filters("rtmedia_filter_upload_dir",$upload_dir);
 
103
  return $upload_dir;
104
  }
105
 
app/main/routers/RTMediaRouter.php CHANGED
@@ -71,7 +71,17 @@ class RTMediaRouter {
71
  */
72
  function is_template () {
73
  global $wp_query;
74
-
 
 
 
 
 
 
 
 
 
 
75
  $return = isset ( $wp_query->query_vars[ $this->slug ] );
76
  $return = apply_filters('rtmedia_return_is_template',$return,$this->slug);
77
  if ( $return ) {
71
  */
72
  function is_template () {
73
  global $wp_query;
74
+ global $rtmedia, $rtmedia_query;
75
+ if( isset( $rtmedia_query ) && isset( $rtmedia_query->query ) && isset($rtmedia_query->query['context']) ) {
76
+ if( ( ! isset( $rtmedia->options['buddypress_enableOnGroup'] ) ) || ( $rtmedia_query->query['context'] == "group" && isset( $rtmedia->options['buddypress_enableOnGroup'] ) && $rtmedia->options['buddypress_enableOnGroup'] == '0' ) ) {
77
+ $wp_query->is_404 = true;
78
+ return false;
79
+ }
80
+ if( ( ! isset( $rtmedia->options['buddypress_enableOnProfile'] ) ) || ( $rtmedia_query->query['context'] == "profile" && isset( $rtmedia->options['buddypress_enableOnProfile'] ) && $rtmedia->options['buddypress_enableOnProfile'] == '0' ) ) {
81
+ $wp_query->is_404 = true;
82
+ return false;
83
+ }
84
+ }
85
  $return = isset ( $wp_query->query_vars[ $this->slug ] );
86
  $return = apply_filters('rtmedia_return_is_template',$return,$this->slug);
87
  if ( $return ) {
app/main/routers/query/RTMediaQuery.php CHANGED
@@ -496,7 +496,7 @@ class RTMediaQuery {
496
 
497
  function get_user () {
498
  if ( is_user_logged_in () ) {
499
- $user = get_current_user_id ();
500
  } else {
501
  $user = 0;
502
  }
496
 
497
  function get_user () {
498
  if ( is_user_logged_in () ) {
499
+ $user = apply_filters('rtmedia_current_user', get_current_user_id());
500
  } else {
501
  $user = 0;
502
  }
app/schema/rtm_api.schema ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE %s (
2
+ id bigint(20) NOT NULL AUTO_INCREMENT ,
3
+ user_id bigint(20) NOT NULL DEFAULT 0,
4
+ ip varchar(255) NOT NULL DEFAULT 0,
5
+ token_time varchar(1000),
6
+ token varchar(1000),
7
+ status varchar(255),
8
+ last_access TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
9
+ PRIMARY KEY (id)
10
+ );
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.5.2.1
8
  Author: rtCamp
9
  Text Domain: rtmedia
10
  Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
@@ -55,7 +55,7 @@ if ( ! defined ( 'RTMEDIA_BASE_NAME' ) ) {
55
 
56
  if ( ! defined ( 'RTMEDIA_BOWER_COMPONENTS_URL' ) ) {
57
  /**
58
- * The url to the foundation resources
59
  *
60
  */
61
  define ( 'RTMEDIA_BOWER_COMPONENTS_URL', RTMEDIA_URL . 'app/assets/sass/bower_components/foundation/' );
@@ -102,6 +102,7 @@ function rtmedia_autoloader ( $class_name ) {
102
  'app/main/template/' . $class_name . '.php',
103
  'app/log/' . $class_name . '.php',
104
  'app/importers/' . $class_name . '.php',
 
105
  );
106
  foreach ( $rtlibpath as $path ) {
107
  $path = RTMEDIA_PATH . $path;
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
55
 
56
  if ( ! defined ( 'RTMEDIA_BOWER_COMPONENTS_URL' ) ) {
57
  /**
58
+ * The url to the foundation resources
59
  *
60
  */
61
  define ( 'RTMEDIA_BOWER_COMPONENTS_URL', RTMEDIA_URL . 'app/assets/sass/bower_components/foundation/' );
102
  'app/main/template/' . $class_name . '.php',
103
  'app/log/' . $class_name . '.php',
104
  'app/importers/' . $class_name . '.php',
105
+ 'app/main/controllers/api/' . $class_name . '.php',
106
  );
107
  foreach ( $rtlibpath as $path ) {
108
  $path = RTMEDIA_PATH . $path;
languages/rtmedia-da_DA.mo CHANGED
Binary file
languages/rtmedia-ru_RU.mo ADDED
Binary file
languages/rtmedia.mo CHANGED
Binary file
languages/rtmedia.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: BuddyPress Media\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-01-28 22:11+0530\n"
6
- "PO-Revision-Date: 2014-01-28 22:12+0530\n"
7
  "Last-Translator: faishal <faishal.saiyed@rtcamp.com>\n"
8
  "Language-Team: rtCamp <info@rtcamp.com>\n"
9
  "Language: en_IN\n"
@@ -90,34 +90,34 @@ msgstr ""
90
  msgid "Regenerate Thumbnail"
91
  msgstr ""
92
 
93
- #: app/admin/RTMediaAdmin.php:323 app/admin/RTMediaAdmin.php:804
94
- #: app/admin/RTMediaAdmin.php:805
95
  msgid "rtMedia"
96
  msgstr ""
97
 
98
  #: app/admin/RTMediaAdmin.php:329 app/admin/RTMediaAdmin.php:332
99
- #: app/admin/RTMediaAdmin.php:457 app/admin/RTMediaAdmin.php:826
100
  msgid "Settings"
101
  msgstr ""
102
 
103
  #: app/admin/RTMediaAdmin.php:339 app/admin/RTMediaAdmin.php:342
104
- #: app/admin/RTMediaAdmin.php:458 app/admin/RTMediaAdmin.php:831
105
  msgid "Addons"
106
  msgstr ""
107
 
108
  #: app/admin/RTMediaAdmin.php:349 app/admin/RTMediaAdmin.php:352
109
- #: app/admin/RTMediaAdmin.php:459 app/admin/RTMediaAdmin.php:846
110
  #: app/helper/RTMediaSettings.php:133
111
  msgid "Support"
112
  msgstr ""
113
 
114
  #: app/admin/RTMediaAdmin.php:359 app/admin/RTMediaAdmin.php:362
115
- #: app/admin/RTMediaAdmin.php:460 app/admin/RTMediaAdmin.php:836
116
  msgid "Themes"
117
  msgstr ""
118
 
119
  #: app/admin/RTMediaAdmin.php:369 app/admin/RTMediaAdmin.php:372
120
- #: app/admin/RTMediaAdmin.php:461 app/admin/RTMediaAdmin.php:841
121
  msgid "Hire Us"
122
  msgstr ""
123
 
@@ -201,113 +201,117 @@ msgstr ""
201
  msgid "Empowering The Web With WordPress"
202
  msgstr ""
203
 
204
- #: app/admin/RTMediaAdmin.php:751
205
  msgid "Save Settings"
206
  msgstr ""
207
 
208
- #: app/admin/RTMediaAdmin.php:913 app/admin/RTMediaAdmin.php:914
209
  msgid "Other Settings"
210
  msgstr ""
211
 
212
- #: app/admin/RTMediaAdmin.php:922 app/admin/RTMediaAdmin.php:923
213
  msgid "Display"
214
  msgstr ""
215
 
216
- #: app/admin/RTMediaAdmin.php:933
217
  msgid "rtMedia BuddyPress"
218
  msgstr ""
219
 
220
- #: app/admin/RTMediaAdmin.php:934
221
  msgid "BuddyPress"
222
  msgstr ""
223
 
224
- #: app/admin/RTMediaAdmin.php:942
225
  msgid "rtMedia Types"
226
  msgstr ""
227
 
228
- #: app/admin/RTMediaAdmin.php:943
229
  msgid "Types"
230
  msgstr ""
231
 
232
- #: app/admin/RTMediaAdmin.php:950
233
  msgid "rtMedia Sizes"
234
  msgstr ""
235
 
236
- #: app/admin/RTMediaAdmin.php:951
237
  msgid "Image Sizes"
238
  msgstr ""
239
 
240
- #: app/admin/RTMediaAdmin.php:958
241
  msgid "rtMedia Privacy"
242
  msgstr ""
243
 
244
- #: app/admin/RTMediaAdmin.php:959
245
  #: app/main/controllers/privacy/RTMediaPrivacy.php:268
246
  msgid "Privacy"
247
  msgstr ""
248
 
249
- #: app/admin/RTMediaAdmin.php:965
250
  msgid "rtMedia Custom CSS"
251
  msgstr ""
252
 
253
- #: app/admin/RTMediaAdmin.php:966
254
  msgid "Custom CSS"
255
  msgstr ""
256
 
257
- #: app/admin/RTMediaAdmin.php:1071
258
  #, php-format
259
- msgid "I use @buddypressmedia http://goo.gl/8Upmv on %s"
260
  msgstr ""
261
 
262
- #: app/admin/RTMediaAdmin.php:1075
263
  msgid "Post to Twitter Now"
264
  msgstr ""
265
 
266
- #: app/admin/RTMediaAdmin.php:1075
267
  msgid "Post to Twitter"
268
  msgstr ""
269
 
270
- #: app/admin/RTMediaAdmin.php:1076
271
  msgid "Share on Facebook Now"
272
  msgstr ""
273
 
274
- #: app/admin/RTMediaAdmin.php:1076
275
  msgid "Share on Facebook"
276
  msgstr ""
277
 
278
- #: app/admin/RTMediaAdmin.php:1077
279
  msgid "Rate rtMedia on Wordpress.org"
280
  msgstr ""
281
 
282
- #: app/admin/RTMediaAdmin.php:1077
283
  msgid "Rate on Wordpress.org"
284
  msgstr ""
285
 
286
- #: app/admin/RTMediaAdmin.php:1078
287
  msgid "Subscribe to our feeds"
288
  msgstr ""
289
 
290
- #: app/admin/RTMediaAdmin.php:1078
291
  msgid "Subscribe to our Feeds"
292
  msgstr ""
293
 
294
- #: app/admin/RTMediaAdmin.php:1084
 
 
 
 
295
  msgid "Spread the Word"
296
  msgstr ""
297
 
298
- #: app/admin/RTMediaAdmin.php:1116 app/admin/RTMediaAdmin.php:1119
299
  msgid "Subscribe"
300
  msgstr ""
301
 
302
- #: app/admin/RTMediaAdmin.php:1141
303
  msgid "Thank you for your time."
304
  msgstr ""
305
 
306
- #: app/admin/RTMediaAdmin.php:1153
307
  msgid "Premium Add-ons"
308
  msgstr ""
309
 
310
- #: app/admin/RTMediaAdmin.php:1167
311
  #, php-format
312
  msgid ""
313
  "You have images enabled on rtMedia but your network allowed filetypes does "
@@ -315,17 +319,17 @@ msgid ""
315
  "settings manually."
316
  msgstr ""
317
 
318
- #: app/admin/RTMediaAdmin.php:1168 app/admin/RTMediaAdmin.php:1179
319
- #: app/admin/RTMediaAdmin.php:1188
320
  msgid "Recommended"
321
  msgstr ""
322
 
323
- #: app/admin/RTMediaAdmin.php:1168 app/admin/RTMediaAdmin.php:1179
324
- #: app/admin/RTMediaAdmin.php:1188
325
  msgid "Update Network Settings Automatically"
326
  msgstr ""
327
 
328
- #: app/admin/RTMediaAdmin.php:1178
329
  #, php-format
330
  msgid ""
331
  "You have video enabled on BuddyPress Media but your network allowed "
@@ -333,7 +337,7 @@ msgid ""
333
  "change your settings manually."
334
  msgstr ""
335
 
336
- #: app/admin/RTMediaAdmin.php:1187
337
  #, php-format
338
  msgid ""
339
  "You have audio enabled on BuddyPress Media but your network allowed "
@@ -341,25 +345,25 @@ msgid ""
341
  "change your settings manually."
342
  msgstr ""
343
 
344
- #: app/admin/RTMediaAdmin.php:1202
345
  msgid "Network settings updated successfully."
346
  msgstr ""
347
 
348
- #: app/admin/RTMediaAdmin.php:1305
349
  msgid "Video is sent to generate thumbnails."
350
  msgstr ""
351
 
352
- #: app/admin/RTMediaAdmin.php:1308
353
  msgid "Video can't be sent to generate thumbnails."
354
  msgstr ""
355
 
356
- #: app/admin/RTMediaAdmin.php:1390
357
  msgid ""
358
  "rtMedia just updated to Foundation 5. Please update rtMedia template files "
359
  "if you have overridden the default rtMedia templates in your theme."
360
  msgstr ""
361
 
362
- #: app/admin/RTMediaAdmin.php:1390 app/importers/RTMediaMigration.php:60
363
  msgid "Hide"
364
  msgstr ""
365
 
@@ -610,79 +614,79 @@ msgstr ""
610
  msgid "Plugins"
611
  msgstr ""
612
 
613
- #: app/helper/RTMediaAddon.php:96
614
  msgid "rtMedia Photo Tagging"
615
  msgstr ""
616
 
617
- #: app/helper/RTMediaAddon.php:99
618
  msgid ""
619
  "rtMedia Photo Tagging add-on enables tagging on photos uploaded using "
620
  "BuddyPress Media."
621
  msgstr ""
622
 
623
- #: app/helper/RTMediaAddon.php:100 app/helper/RTMediaAddon.php:110
624
  #: app/importers/BPMediaAlbumimporter.php:177
625
  msgid "Important"
626
  msgstr ""
627
 
628
- #: app/helper/RTMediaAddon.php:100 app/helper/RTMediaAddon.php:110
629
  #: app/importers/BPMediaAlbumimporter.php:177
630
  msgid ""
631
  "You need to have ImageMagick installed on your server for this addon to work."
632
  msgstr ""
633
 
634
- #: app/helper/RTMediaAddon.php:106
635
  msgid "rtMedia Instagram"
636
  msgstr ""
637
 
638
- #: app/helper/RTMediaAddon.php:109
639
  msgid ""
640
  "rtMedia Instagram adds Instagram like filters to images uploaded with "
641
  "rtMedia."
642
  msgstr ""
643
 
644
- #: app/helper/RTMediaAddon.php:116
645
  msgid "rtMedia Kaltura Add-on"
646
  msgstr ""
647
 
648
- #: app/helper/RTMediaAddon.php:119
649
  msgid "Add support for more video formats using Kaltura video solution."
650
  msgstr ""
651
 
652
- #: app/helper/RTMediaAddon.php:120
653
  msgid "Works with Kaltura.com, self-hosted Kaltura-CE and Kaltura-on-premise."
654
  msgstr ""
655
 
656
- #: app/helper/RTMediaAddon.php:126
657
  msgid "rtMedia FFMPEG Add-on"
658
  msgstr ""
659
 
660
- #: app/helper/RTMediaAddon.php:129
661
  msgid ""
662
  "Add supports for more audio & video formats using open-source media-node."
663
  msgstr ""
664
 
665
- #: app/helper/RTMediaAddon.php:130
666
  msgid "Media node comes with automated setup script for Ubuntu/Debian."
667
  msgstr ""
668
 
669
- #: app/helper/RTMediaAddon.php:142
670
  msgid "rtMedia Addons for Photos"
671
  msgstr ""
672
 
673
- #: app/helper/RTMediaAddon.php:146
674
  msgid "rtMedia Addons for Audio/Video"
675
  msgstr ""
676
 
677
- #: app/helper/RTMediaAddon.php:160
678
  msgid "Coming Soon !!"
679
  msgstr ""
680
 
681
- #: app/helper/RTMediaAddon.php:199 app/importers/BPMediaAlbumimporter.php:181
682
  msgid "Buy Now"
683
  msgstr ""
684
 
685
- #: app/helper/RTMediaAddon.php:200 app/importers/BPMediaAlbumimporter.php:182
686
  msgid "Live Demo"
687
  msgstr ""
688
 
@@ -764,7 +768,7 @@ msgstr ""
764
  msgid "Update Database"
765
  msgstr ""
766
 
767
- #: app/helper/RTMediaSettings.php:288 app/helper/RTMediaSupport.php:347
768
  msgid ""
769
  "If your site has some issues due to BuddyPress Media and you want one on one "
770
  "support then you can create a support topic on the <a target=\"_blank\" href="
@@ -773,7 +777,7 @@ msgid ""
773
  "\">rtCamp Support Forum</a>."
774
  msgstr ""
775
 
776
- #: app/helper/RTMediaSettings.php:289 app/helper/RTMediaSupport.php:348
777
  msgid ""
778
  "If you have any suggestions, enhancements or bug reports, then you can open "
779
  "a new issue on <a target=\"_blank\" href=\"https://github.com/rtCamp/"
@@ -781,12 +785,12 @@ msgid ""
781
  msgstr ""
782
 
783
  #: app/helper/RTMediaSupport.php:40 app/helper/RTMediaSupport.php:41
784
- #: app/helper/RTMediaSupport.php:108
785
  msgid "Premium Support"
786
  msgstr ""
787
 
788
  #: app/helper/RTMediaSupport.php:46 app/helper/RTMediaSupport.php:47
789
- #: app/helper/RTMediaSupport.php:502
790
  msgid "Debug Info"
791
  msgstr ""
792
 
@@ -795,140 +799,140 @@ msgstr ""
795
  msgid "Migration"
796
  msgstr ""
797
 
798
- #: app/helper/RTMediaSupport.php:106
799
  msgid "Service"
800
  msgstr ""
801
 
802
- #: app/helper/RTMediaSupport.php:109
803
  msgid "Bug Report"
804
  msgstr ""
805
 
806
- #: app/helper/RTMediaSupport.php:110
807
  msgid "New Feature"
808
  msgstr ""
809
 
810
- #: app/helper/RTMediaSupport.php:190
811
  msgid "by"
812
  msgstr ""
813
 
814
- #: app/helper/RTMediaSupport.php:190
815
  msgid "version"
816
  msgstr ""
817
 
818
- #: app/helper/RTMediaSupport.php:305
819
  msgid "There is no media found to migrate."
820
  msgstr ""
821
 
822
- #: app/helper/RTMediaSupport.php:311 app/helper/RTMediaThemes.php:95
823
  msgid "Click"
824
  msgstr ""
825
 
826
- #: app/helper/RTMediaSupport.php:311 app/helper/RTMediaThemes.php:95
827
  msgid "here"
828
  msgstr ""
829
 
830
- #: app/helper/RTMediaSupport.php:311
831
  msgid "here to migrate media from rtMedia 2.x to rtMedia 3.0+."
832
  msgstr ""
833
 
834
- #: app/helper/RTMediaSupport.php:335
835
  msgid "Submit a Bug Report"
836
  msgstr ""
837
 
838
- #: app/helper/RTMediaSupport.php:338
839
  msgid "Submit a New Feature Request"
840
  msgstr ""
841
 
842
- #: app/helper/RTMediaSupport.php:341
843
  msgid "Submit a Premium Support Request"
844
  msgstr ""
845
 
846
- #: app/helper/RTMediaSupport.php:358
847
  msgid "Name"
848
  msgstr ""
849
 
850
- #: app/helper/RTMediaSupport.php:361
851
  msgid "Email"
852
  msgstr ""
853
 
854
- #: app/helper/RTMediaSupport.php:364
855
  msgid "Website"
856
  msgstr ""
857
 
858
- #: app/helper/RTMediaSupport.php:367
859
  msgid "Phone"
860
  msgstr ""
861
 
862
- #: app/helper/RTMediaSupport.php:370
863
  msgid "Subject"
864
  msgstr ""
865
 
866
- #: app/helper/RTMediaSupport.php:373 templates/media/album-single-edit.php:16
867
  #: templates/media/media-single-edit.php:19
868
  msgid "Details"
869
  msgstr ""
870
 
871
- #: app/helper/RTMediaSupport.php:384
872
  msgid "Additional Information"
873
  msgstr ""
874
 
875
- #: app/helper/RTMediaSupport.php:389
876
  msgid "Your WP Admin Login:"
877
  msgstr ""
878
 
879
- #: app/helper/RTMediaSupport.php:392
880
  msgid "Your WP Admin password:"
881
  msgstr ""
882
 
883
- #: app/helper/RTMediaSupport.php:395
884
  msgid "Your SSH / FTP host:"
885
  msgstr ""
886
 
887
- #: app/helper/RTMediaSupport.php:398
888
  msgid "Your SSH / FTP login:"
889
  msgstr ""
890
 
891
- #: app/helper/RTMediaSupport.php:401
892
  msgid "Your SSH / FTP password:"
893
  msgstr ""
894
 
895
- #: app/helper/RTMediaSupport.php:432
896
  msgid "rtMedia Premium Support Request from"
897
  msgstr ""
898
 
899
- #: app/helper/RTMediaSupport.php:435
900
  msgid "rtMedia New Feature Request from"
901
  msgstr ""
902
 
903
- #: app/helper/RTMediaSupport.php:438
904
  msgid "rtMedia Bug Report from"
905
  msgstr ""
906
 
907
- #: app/helper/RTMediaSupport.php:441
908
  msgid "rtMedia Contact from"
909
  msgstr ""
910
 
911
- #: app/helper/RTMediaSupport.php:525
912
  msgid "Thank you for your Feedback/Suggestion."
913
  msgstr ""
914
 
915
- #: app/helper/RTMediaSupport.php:527
916
  msgid "Thank you for posting your support request."
917
  msgstr ""
918
 
919
- #: app/helper/RTMediaSupport.php:528
920
  msgid "We will get back to you shortly."
921
  msgstr ""
922
 
923
- #: app/helper/RTMediaSupport.php:533
924
  msgid "Your server failed to send an email."
925
  msgstr ""
926
 
927
- #: app/helper/RTMediaSupport.php:534
928
  msgid "Kindly contact your server support to fix this."
929
  msgstr ""
930
 
931
- #: app/helper/RTMediaSupport.php:535
932
  #, php-format
933
  msgid "You can alternatively create a support request <a href=\"%s\">here</a>"
934
  msgstr ""
@@ -941,21 +945,21 @@ msgstr ""
941
  msgid "3rd Party Themes"
942
  msgstr ""
943
 
944
- #: app/helper/RTMediaThemes.php:77
945
  msgid "Coming Soon..."
946
  msgstr ""
947
 
948
- #: app/helper/RTMediaThemes.php:78
949
  msgid "We are working on some rtMedia themes which will be available shortly."
950
  msgstr ""
951
 
952
- #: app/helper/RTMediaThemes.php:87
953
  msgid ""
954
  "These are the third party themes. For any issues or queries regarding these "
955
  "themes please contact theme developers."
956
  msgstr ""
957
 
958
- #: app/helper/RTMediaThemes.php:94
959
  msgid ""
960
  "SweetDate is a unique, clean and modern Premium Wordpress theme. It is "
961
  "perfect for a dating or community website but can be used as well for any "
@@ -963,21 +967,21 @@ msgid ""
963
  "community system."
964
  msgstr ""
965
 
966
- #: app/helper/RTMediaThemes.php:95
967
  msgid "for preview."
968
  msgstr ""
969
 
970
- #: app/helper/RTMediaThemes.php:100
971
  msgid "Are you a developer?"
972
  msgstr ""
973
 
974
- #: app/helper/RTMediaThemes.php:101
975
  msgid ""
976
  "If you have developed a rtMedia compatible theme and would like it to list "
977
  "here, please email us at"
978
  msgstr ""
979
 
980
- #: app/helper/RTMediaThemes.php:101
981
  msgid "product@rtcamp.com"
982
  msgstr ""
983
 
@@ -1076,7 +1080,7 @@ msgstr ""
1076
 
1077
  #: app/importers/BPMediaAlbumimporter.php:150
1078
  #, php-format
1079
- msgid "I just imported bp-album to @buddypressmedia http://goo.gl/8Upmv on %s"
1080
  msgstr ""
1081
 
1082
  #: app/importers/BPMediaAlbumimporter.php:151
@@ -1201,14 +1205,14 @@ msgid "<strong>Friends</strong> - Visible to user's friends"
1201
  msgstr ""
1202
 
1203
  #: app/main/RTMedia.php:359
1204
- msgid "<strong>Users</strong> - Visible to registered users"
1205
  msgstr ""
1206
 
1207
  #: app/main/RTMedia.php:360
1208
  msgid "<strong>Public</strong> - Visible to the world"
1209
  msgstr ""
1210
 
1211
- #: app/main/RTMedia.php:517 app/main/controllers/template/RTMediaNav.php:142
1212
  msgid "All"
1213
  msgstr ""
1214
 
@@ -1219,8 +1223,8 @@ msgstr ""
1219
 
1220
  #: app/main/RTMedia.php:529 app/main/controllers/media/RTMediaAlbum.php:53
1221
  #: app/main/controllers/media/RTMediaAlbum.php:65
1222
- #: app/main/controllers/template/RTMediaNav.php:91
1223
- #: app/main/controllers/template/RTMediaNav.php:163
1224
  msgid "Albums"
1225
  msgstr ""
1226
 
@@ -1234,140 +1238,140 @@ msgstr ""
1234
  msgid "Wall Post"
1235
  msgstr ""
1236
 
1237
- #: app/main/RTMedia.php:729
1238
  msgid "Wall Posts"
1239
  msgstr ""
1240
 
1241
- #: app/main/RTMedia.php:769
1242
  msgid ": Can't Create Database table. Please check create table permission."
1243
  msgstr ""
1244
 
1245
- #: app/main/RTMedia.php:803
1246
  msgid "Loading media"
1247
  msgstr ""
1248
 
1249
- #: app/main/RTMedia.php:804
1250
  msgid "Please enter some content to post."
1251
  msgstr ""
1252
 
1253
- #: app/main/RTMedia.php:805
1254
  msgid "Empty Comment is not allowed."
1255
  msgstr ""
1256
 
1257
- #: app/main/RTMedia.php:806
1258
  msgid "Are you sure you want to delete this media?"
1259
  msgstr ""
1260
 
1261
- #: app/main/RTMedia.php:807
1262
  msgid "Are you sure you want to delete this comment?"
1263
  msgstr ""
1264
 
1265
- #: app/main/RTMedia.php:808
1266
  msgid "Are you sure you want to delete this Album?"
1267
  msgstr ""
1268
 
1269
- #: app/main/RTMedia.php:809
1270
  msgid "Drop files here"
1271
  msgstr ""
1272
 
1273
- #: app/main/RTMedia.php:810
1274
  msgid "album created successfully."
1275
  msgstr ""
1276
 
1277
- #: app/main/RTMedia.php:811
1278
  msgid "Something went wrong. Please try again."
1279
  msgstr ""
1280
 
1281
- #: app/main/RTMedia.php:812
1282
  msgid "Enter an album name."
1283
  msgstr ""
1284
 
1285
- #: app/main/RTMedia.php:813
1286
  msgid "Max file Size Limit : "
1287
  msgstr ""
1288
 
1289
- #: app/main/RTMedia.php:814
1290
  msgid "Allowed File Formats"
1291
  msgstr ""
1292
 
1293
- #: app/main/RTMedia.php:815 templates/media/album-single-edit.php:58
1294
  msgid "Select All Visible"
1295
  msgstr ""
1296
 
1297
- #: app/main/RTMedia.php:816
1298
  msgid "Unselect All Visible"
1299
  msgstr ""
1300
 
1301
- #: app/main/RTMedia.php:817
1302
  msgid "Please select some media."
1303
  msgstr ""
1304
 
1305
- #: app/main/RTMedia.php:818
1306
  msgid "Are you sure you want to delete the selected medias?"
1307
  msgstr ""
1308
 
1309
- #: app/main/RTMedia.php:819
1310
  msgid "Are you sure you want to move the selected medias?"
1311
  msgstr ""
1312
 
1313
- #: app/main/RTMedia.php:820
1314
  msgid "Waiting"
1315
  msgstr ""
1316
 
1317
- #: app/main/RTMedia.php:821
1318
  msgid "Uploaded"
1319
  msgstr ""
1320
 
1321
- #: app/main/RTMedia.php:822
1322
  msgid "Uploading"
1323
  msgstr ""
1324
 
1325
- #: app/main/RTMedia.php:823
1326
  msgid "Failed"
1327
  msgstr ""
1328
 
1329
- #: app/main/RTMedia.php:824
1330
  msgid "Close"
1331
  msgstr ""
1332
 
1333
- #: app/main/RTMedia.php:825
1334
  #: app/main/controllers/template/rt-template-functions.php:585
1335
  #: app/main/controllers/template/rt-template-functions.php:606
1336
  msgid "Edit"
1337
  msgstr ""
1338
 
1339
- #: app/main/RTMedia.php:826
1340
  #: app/main/controllers/template/rt-template-functions.php:1129
1341
  #: app/main/controllers/template/rt-template-functions.php:1136
1342
  #: templates/media/album-single-edit.php:60
1343
  msgid "Delete"
1344
  msgstr ""
1345
 
1346
- #: app/main/RTMedia.php:827 templates/media/media-single-edit.php:13
1347
  msgid "Edit Media"
1348
  msgstr ""
1349
 
1350
- #: app/main/RTMedia.php:828
1351
  msgid "Remove from queue"
1352
  msgstr ""
1353
 
1354
- #: app/main/RTMedia.php:829
1355
  msgid "Add more files"
1356
  msgstr ""
1357
 
1358
- #: app/main/RTMedia.php:830
1359
  msgid "File not supported"
1360
  msgstr ""
1361
 
1362
- #: app/main/RTMedia.php:831
1363
  msgid "more"
1364
  msgstr ""
1365
 
1366
- #: app/main/RTMedia.php:832
1367
  msgid "less"
1368
  msgstr ""
1369
 
1370
- #: app/main/RTMedia.php:833
1371
  msgid "This media is uploaded. Are you sure you want to delete this media?"
1372
  msgstr ""
1373
 
@@ -1375,6 +1379,221 @@ msgstr ""
1375
  msgid "Media Files"
1376
  msgstr ""
1377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1378
  #: app/main/controllers/group/RTMediaGroupExtension.php:30
1379
  #: app/main/controllers/group/RTMediaGroupExtension.php:92
1380
  msgid "Album Creation Control"
@@ -1880,37 +2099,37 @@ msgstr ""
1880
  msgid "Error Uploading File"
1881
  msgstr ""
1882
 
1883
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:203
1884
  msgid "MP4 file you have uploaded is corrupt."
1885
  msgstr ""
1886
 
1887
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:210
1888
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:215
1889
  msgid ""
1890
  "The MP4 file you have uploaded is using an unsupported video codec. "
1891
  "Supported video codec is H.264."
1892
  msgstr ""
1893
 
1894
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:220
1895
  msgid "The MP4 file you have uploaded is not a video file."
1896
  msgstr ""
1897
 
1898
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:232
1899
  msgid "MP3 file you have uploaded is currupt."
1900
  msgstr ""
1901
 
1902
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:239
1903
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:244
1904
  msgid ""
1905
  "The MP3 file you have uploaded is using an unsupported audio format. "
1906
  "Supported audio format is MP3."
1907
  msgstr ""
1908
 
1909
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:249
1910
  msgid "The MP3 file you have uploaded is not an audio file."
1911
  msgstr ""
1912
 
1913
- #: app/main/controllers/upload/processors/RTMediaUploadFile.php:257
1914
  msgid ""
1915
  "Media File you have tried to upload is not supported. Supported media files "
1916
  "are .jpg, .png, .gif, .mp3, .mov and .mp4."
2
  msgstr ""
3
  "Project-Id-Version: BuddyPress Media\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-02-10 13:13+0530\n"
6
+ "PO-Revision-Date: 2014-02-10 13:13+0530\n"
7
  "Last-Translator: faishal <faishal.saiyed@rtcamp.com>\n"
8
  "Language-Team: rtCamp <info@rtcamp.com>\n"
9
  "Language: en_IN\n"
90
  msgid "Regenerate Thumbnail"
91
  msgstr ""
92
 
93
+ #: app/admin/RTMediaAdmin.php:323 app/admin/RTMediaAdmin.php:805
94
+ #: app/admin/RTMediaAdmin.php:806
95
  msgid "rtMedia"
96
  msgstr ""
97
 
98
  #: app/admin/RTMediaAdmin.php:329 app/admin/RTMediaAdmin.php:332
99
+ #: app/admin/RTMediaAdmin.php:457 app/admin/RTMediaAdmin.php:827
100
  msgid "Settings"
101
  msgstr ""
102
 
103
  #: app/admin/RTMediaAdmin.php:339 app/admin/RTMediaAdmin.php:342
104
+ #: app/admin/RTMediaAdmin.php:458 app/admin/RTMediaAdmin.php:832
105
  msgid "Addons"
106
  msgstr ""
107
 
108
  #: app/admin/RTMediaAdmin.php:349 app/admin/RTMediaAdmin.php:352
109
+ #: app/admin/RTMediaAdmin.php:459 app/admin/RTMediaAdmin.php:847
110
  #: app/helper/RTMediaSettings.php:133
111
  msgid "Support"
112
  msgstr ""
113
 
114
  #: app/admin/RTMediaAdmin.php:359 app/admin/RTMediaAdmin.php:362
115
+ #: app/admin/RTMediaAdmin.php:460 app/admin/RTMediaAdmin.php:837
116
  msgid "Themes"
117
  msgstr ""
118
 
119
  #: app/admin/RTMediaAdmin.php:369 app/admin/RTMediaAdmin.php:372
120
+ #: app/admin/RTMediaAdmin.php:461 app/admin/RTMediaAdmin.php:842
121
  msgid "Hire Us"
122
  msgstr ""
123
 
201
  msgid "Empowering The Web With WordPress"
202
  msgstr ""
203
 
204
+ #: app/admin/RTMediaAdmin.php:752
205
  msgid "Save Settings"
206
  msgstr ""
207
 
208
+ #: app/admin/RTMediaAdmin.php:914 app/admin/RTMediaAdmin.php:915
209
  msgid "Other Settings"
210
  msgstr ""
211
 
212
+ #: app/admin/RTMediaAdmin.php:923 app/admin/RTMediaAdmin.php:924
213
  msgid "Display"
214
  msgstr ""
215
 
216
+ #: app/admin/RTMediaAdmin.php:934
217
  msgid "rtMedia BuddyPress"
218
  msgstr ""
219
 
220
+ #: app/admin/RTMediaAdmin.php:935
221
  msgid "BuddyPress"
222
  msgstr ""
223
 
224
+ #: app/admin/RTMediaAdmin.php:943
225
  msgid "rtMedia Types"
226
  msgstr ""
227
 
228
+ #: app/admin/RTMediaAdmin.php:944
229
  msgid "Types"
230
  msgstr ""
231
 
232
+ #: app/admin/RTMediaAdmin.php:951
233
  msgid "rtMedia Sizes"
234
  msgstr ""
235
 
236
+ #: app/admin/RTMediaAdmin.php:952
237
  msgid "Image Sizes"
238
  msgstr ""
239
 
240
+ #: app/admin/RTMediaAdmin.php:959
241
  msgid "rtMedia Privacy"
242
  msgstr ""
243
 
244
+ #: app/admin/RTMediaAdmin.php:960
245
  #: app/main/controllers/privacy/RTMediaPrivacy.php:268
246
  msgid "Privacy"
247
  msgstr ""
248
 
249
+ #: app/admin/RTMediaAdmin.php:966
250
  msgid "rtMedia Custom CSS"
251
  msgstr ""
252
 
253
+ #: app/admin/RTMediaAdmin.php:967
254
  msgid "Custom CSS"
255
  msgstr ""
256
 
257
+ #: app/admin/RTMediaAdmin.php:1072
258
  #, php-format
259
+ msgid "I use @buddypressmedia http://rt.cx/rtmedia on %s"
260
  msgstr ""
261
 
262
+ #: app/admin/RTMediaAdmin.php:1076
263
  msgid "Post to Twitter Now"
264
  msgstr ""
265
 
266
+ #: app/admin/RTMediaAdmin.php:1076
267
  msgid "Post to Twitter"
268
  msgstr ""
269
 
270
+ #: app/admin/RTMediaAdmin.php:1077
271
  msgid "Share on Facebook Now"
272
  msgstr ""
273
 
274
+ #: app/admin/RTMediaAdmin.php:1077
275
  msgid "Share on Facebook"
276
  msgstr ""
277
 
278
+ #: app/admin/RTMediaAdmin.php:1078
279
  msgid "Rate rtMedia on Wordpress.org"
280
  msgstr ""
281
 
282
+ #: app/admin/RTMediaAdmin.php:1078
283
  msgid "Rate on Wordpress.org"
284
  msgstr ""
285
 
286
+ #: app/admin/RTMediaAdmin.php:1079
287
  msgid "Subscribe to our feeds"
288
  msgstr ""
289
 
290
+ #: app/admin/RTMediaAdmin.php:1079
291
  msgid "Subscribe to our Feeds"
292
  msgstr ""
293
 
294
+ #: app/admin/RTMediaAdmin.php:1080
295
+ msgid "Add link to footer"
296
+ msgstr ""
297
+
298
+ #: app/admin/RTMediaAdmin.php:1086
299
  msgid "Spread the Word"
300
  msgstr ""
301
 
302
+ #: app/admin/RTMediaAdmin.php:1118 app/admin/RTMediaAdmin.php:1121
303
  msgid "Subscribe"
304
  msgstr ""
305
 
306
+ #: app/admin/RTMediaAdmin.php:1143
307
  msgid "Thank you for your time."
308
  msgstr ""
309
 
310
+ #: app/admin/RTMediaAdmin.php:1155
311
  msgid "Premium Add-ons"
312
  msgstr ""
313
 
314
+ #: app/admin/RTMediaAdmin.php:1169
315
  #, php-format
316
  msgid ""
317
  "You have images enabled on rtMedia but your network allowed filetypes does "
319
  "settings manually."
320
  msgstr ""
321
 
322
+ #: app/admin/RTMediaAdmin.php:1170 app/admin/RTMediaAdmin.php:1181
323
+ #: app/admin/RTMediaAdmin.php:1190
324
  msgid "Recommended"
325
  msgstr ""
326
 
327
+ #: app/admin/RTMediaAdmin.php:1170 app/admin/RTMediaAdmin.php:1181
328
+ #: app/admin/RTMediaAdmin.php:1190
329
  msgid "Update Network Settings Automatically"
330
  msgstr ""
331
 
332
+ #: app/admin/RTMediaAdmin.php:1180
333
  #, php-format
334
  msgid ""
335
  "You have video enabled on BuddyPress Media but your network allowed "
337
  "change your settings manually."
338
  msgstr ""
339
 
340
+ #: app/admin/RTMediaAdmin.php:1189
341
  #, php-format
342
  msgid ""
343
  "You have audio enabled on BuddyPress Media but your network allowed "
345
  "change your settings manually."
346
  msgstr ""
347
 
348
+ #: app/admin/RTMediaAdmin.php:1204
349
  msgid "Network settings updated successfully."
350
  msgstr ""
351
 
352
+ #: app/admin/RTMediaAdmin.php:1307
353
  msgid "Video is sent to generate thumbnails."
354
  msgstr ""
355
 
356
+ #: app/admin/RTMediaAdmin.php:1310
357
  msgid "Video can't be sent to generate thumbnails."
358
  msgstr ""
359
 
360
+ #: app/admin/RTMediaAdmin.php:1392
361
  msgid ""
362
  "rtMedia just updated to Foundation 5. Please update rtMedia template files "
363
  "if you have overridden the default rtMedia templates in your theme."
364
  msgstr ""
365
 
366
+ #: app/admin/RTMediaAdmin.php:1392 app/importers/RTMediaMigration.php:60
367
  msgid "Hide"
368
  msgstr ""
369
 
614
  msgid "Plugins"
615
  msgstr ""
616
 
617
+ #: app/helper/RTMediaAddon.php:117
618
  msgid "rtMedia Photo Tagging"
619
  msgstr ""
620
 
621
+ #: app/helper/RTMediaAddon.php:120
622
  msgid ""
623
  "rtMedia Photo Tagging add-on enables tagging on photos uploaded using "
624
  "BuddyPress Media."
625
  msgstr ""
626
 
627
+ #: app/helper/RTMediaAddon.php:121 app/helper/RTMediaAddon.php:131
628
  #: app/importers/BPMediaAlbumimporter.php:177
629
  msgid "Important"
630
  msgstr ""
631
 
632
+ #: app/helper/RTMediaAddon.php:121 app/helper/RTMediaAddon.php:131
633
  #: app/importers/BPMediaAlbumimporter.php:177
634
  msgid ""
635
  "You need to have ImageMagick installed on your server for this addon to work."
636
  msgstr ""
637
 
638
+ #: app/helper/RTMediaAddon.php:127
639
  msgid "rtMedia Instagram"
640
  msgstr ""
641
 
642
+ #: app/helper/RTMediaAddon.php:130
643
  msgid ""
644
  "rtMedia Instagram adds Instagram like filters to images uploaded with "
645
  "rtMedia."
646
  msgstr ""
647
 
648
+ #: app/helper/RTMediaAddon.php:137
649
  msgid "rtMedia Kaltura Add-on"
650
  msgstr ""
651
 
652
+ #: app/helper/RTMediaAddon.php:140
653
  msgid "Add support for more video formats using Kaltura video solution."
654
  msgstr ""
655
 
656
+ #: app/helper/RTMediaAddon.php:141
657
  msgid "Works with Kaltura.com, self-hosted Kaltura-CE and Kaltura-on-premise."
658
  msgstr ""
659
 
660
+ #: app/helper/RTMediaAddon.php:147
661
  msgid "rtMedia FFMPEG Add-on"
662
  msgstr ""
663
 
664
+ #: app/helper/RTMediaAddon.php:150
665
  msgid ""
666
  "Add supports for more audio & video formats using open-source media-node."
667
  msgstr ""
668
 
669
+ #: app/helper/RTMediaAddon.php:151
670
  msgid "Media node comes with automated setup script for Ubuntu/Debian."
671
  msgstr ""
672
 
673
+ #: app/helper/RTMediaAddon.php:163
674
  msgid "rtMedia Addons for Photos"
675
  msgstr ""
676
 
677
+ #: app/helper/RTMediaAddon.php:167
678
  msgid "rtMedia Addons for Audio/Video"
679
  msgstr ""
680
 
681
+ #: app/helper/RTMediaAddon.php:181
682
  msgid "Coming Soon !!"
683
  msgstr ""
684
 
685
+ #: app/helper/RTMediaAddon.php:220 app/importers/BPMediaAlbumimporter.php:181
686
  msgid "Buy Now"
687
  msgstr ""
688
 
689
+ #: app/helper/RTMediaAddon.php:221 app/importers/BPMediaAlbumimporter.php:182
690
  msgid "Live Demo"
691
  msgstr ""
692
 
768
  msgid "Update Database"
769
  msgstr ""
770
 
771
+ #: app/helper/RTMediaSettings.php:288 app/helper/RTMediaSupport.php:367
772
  msgid ""
773
  "If your site has some issues due to BuddyPress Media and you want one on one "
774
  "support then you can create a support topic on the <a target=\"_blank\" href="
777
  "\">rtCamp Support Forum</a>."
778
  msgstr ""
779
 
780
+ #: app/helper/RTMediaSettings.php:289 app/helper/RTMediaSupport.php:368
781
  msgid ""
782
  "If you have any suggestions, enhancements or bug reports, then you can open "
783
  "a new issue on <a target=\"_blank\" href=\"https://github.com/rtCamp/"
785
  msgstr ""
786
 
787
  #: app/helper/RTMediaSupport.php:40 app/helper/RTMediaSupport.php:41
788
+ #: app/helper/RTMediaSupport.php:128
789
  msgid "Premium Support"
790
  msgstr ""
791
 
792
  #: app/helper/RTMediaSupport.php:46 app/helper/RTMediaSupport.php:47
793
+ #: app/helper/RTMediaSupport.php:522
794
  msgid "Debug Info"
795
  msgstr ""
796
 
799
  msgid "Migration"
800
  msgstr ""
801
 
802
+ #: app/helper/RTMediaSupport.php:126
803
  msgid "Service"
804
  msgstr ""
805
 
806
+ #: app/helper/RTMediaSupport.php:129
807
  msgid "Bug Report"
808
  msgstr ""
809
 
810
+ #: app/helper/RTMediaSupport.php:130
811
  msgid "New Feature"
812
  msgstr ""
813
 
814
+ #: app/helper/RTMediaSupport.php:210
815
  msgid "by"
816
  msgstr ""
817
 
818
+ #: app/helper/RTMediaSupport.php:210
819
  msgid "version"
820
  msgstr ""
821
 
822
+ #: app/helper/RTMediaSupport.php:325
823
  msgid "There is no media found to migrate."
824
  msgstr ""
825
 
826
+ #: app/helper/RTMediaSupport.php:331 app/helper/RTMediaThemes.php:116
827
  msgid "Click"
828
  msgstr ""
829
 
830
+ #: app/helper/RTMediaSupport.php:331 app/helper/RTMediaThemes.php:116
831
  msgid "here"
832
  msgstr ""
833
 
834
+ #: app/helper/RTMediaSupport.php:331
835
  msgid "here to migrate media from rtMedia 2.x to rtMedia 3.0+."
836
  msgstr ""
837
 
838
+ #: app/helper/RTMediaSupport.php:355
839
  msgid "Submit a Bug Report"
840
  msgstr ""
841
 
842
+ #: app/helper/RTMediaSupport.php:358
843
  msgid "Submit a New Feature Request"
844
  msgstr ""
845
 
846
+ #: app/helper/RTMediaSupport.php:361
847
  msgid "Submit a Premium Support Request"
848
  msgstr ""
849
 
850
+ #: app/helper/RTMediaSupport.php:378
851
  msgid "Name"
852
  msgstr ""
853
 
854
+ #: app/helper/RTMediaSupport.php:381
855
  msgid "Email"
856
  msgstr ""
857
 
858
+ #: app/helper/RTMediaSupport.php:384
859
  msgid "Website"
860
  msgstr ""
861
 
862
+ #: app/helper/RTMediaSupport.php:387
863
  msgid "Phone"
864
  msgstr ""
865
 
866
+ #: app/helper/RTMediaSupport.php:390
867
  msgid "Subject"
868
  msgstr ""
869
 
870
+ #: app/helper/RTMediaSupport.php:393 templates/media/album-single-edit.php:16
871
  #: templates/media/media-single-edit.php:19
872
  msgid "Details"
873
  msgstr ""
874
 
875
+ #: app/helper/RTMediaSupport.php:404
876
  msgid "Additional Information"
877
  msgstr ""
878
 
879
+ #: app/helper/RTMediaSupport.php:409
880
  msgid "Your WP Admin Login:"
881
  msgstr ""
882
 
883
+ #: app/helper/RTMediaSupport.php:412
884
  msgid "Your WP Admin password:"
885
  msgstr ""
886
 
887
+ #: app/helper/RTMediaSupport.php:415
888
  msgid "Your SSH / FTP host:"
889
  msgstr ""
890
 
891
+ #: app/helper/RTMediaSupport.php:418
892
  msgid "Your SSH / FTP login:"
893
  msgstr ""
894
 
895
+ #: app/helper/RTMediaSupport.php:421
896
  msgid "Your SSH / FTP password:"
897
  msgstr ""
898
 
899
+ #: app/helper/RTMediaSupport.php:452
900
  msgid "rtMedia Premium Support Request from"
901
  msgstr ""
902
 
903
+ #: app/helper/RTMediaSupport.php:455
904
  msgid "rtMedia New Feature Request from"
905
  msgstr ""
906
 
907
+ #: app/helper/RTMediaSupport.php:458
908
  msgid "rtMedia Bug Report from"
909
  msgstr ""
910
 
911
+ #: app/helper/RTMediaSupport.php:461
912
  msgid "rtMedia Contact from"
913
  msgstr ""
914
 
915
+ #: app/helper/RTMediaSupport.php:545
916
  msgid "Thank you for your Feedback/Suggestion."
917
  msgstr ""
918
 
919
+ #: app/helper/RTMediaSupport.php:547
920
  msgid "Thank you for posting your support request."
921
  msgstr ""
922
 
923
+ #: app/helper/RTMediaSupport.php:548
924
  msgid "We will get back to you shortly."
925
  msgstr ""
926
 
927
+ #: app/helper/RTMediaSupport.php:553
928
  msgid "Your server failed to send an email."
929
  msgstr ""
930
 
931
+ #: app/helper/RTMediaSupport.php:554
932
  msgid "Kindly contact your server support to fix this."
933
  msgstr ""
934
 
935
+ #: app/helper/RTMediaSupport.php:555
936
  #, php-format
937
  msgid "You can alternatively create a support request <a href=\"%s\">here</a>"
938
  msgstr ""
945
  msgid "3rd Party Themes"
946
  msgstr ""
947
 
948
+ #: app/helper/RTMediaThemes.php:96
949
  msgid "Coming Soon..."
950
  msgstr ""
951
 
952
+ #: app/helper/RTMediaThemes.php:97
953
  msgid "We are working on some rtMedia themes which will be available shortly."
954
  msgstr ""
955
 
956
+ #: app/helper/RTMediaThemes.php:107
957
  msgid ""
958
  "These are the third party themes. For any issues or queries regarding these "
959
  "themes please contact theme developers."
960
  msgstr ""
961
 
962
+ #: app/helper/RTMediaThemes.php:115
963
  msgid ""
964
  "SweetDate is a unique, clean and modern Premium Wordpress theme. It is "
965
  "perfect for a dating or community website but can be used as well for any "
967
  "community system."
968
  msgstr ""
969
 
970
+ #: app/helper/RTMediaThemes.php:116
971
  msgid "for preview."
972
  msgstr ""
973
 
974
+ #: app/helper/RTMediaThemes.php:122
975
  msgid "Are you a developer?"
976
  msgstr ""
977
 
978
+ #: app/helper/RTMediaThemes.php:123
979
  msgid ""
980
  "If you have developed a rtMedia compatible theme and would like it to list "
981
  "here, please email us at"
982
  msgstr ""
983
 
984
+ #: app/helper/RTMediaThemes.php:123
985
  msgid "product@rtcamp.com"
986
  msgstr ""
987
 
1080
 
1081
  #: app/importers/BPMediaAlbumimporter.php:150
1082
  #, php-format
1083
+ msgid "I just imported bp-album to @buddypressmedia http://rt.cx/rtmedia on %s"
1084
  msgstr ""
1085
 
1086
  #: app/importers/BPMediaAlbumimporter.php:151
1205
  msgstr ""
1206
 
1207
  #: app/main/RTMedia.php:359
1208
+ msgid "<strong>Logged in Users</strong> - Visible to registered users"
1209
  msgstr ""
1210
 
1211
  #: app/main/RTMedia.php:360
1212
  msgid "<strong>Public</strong> - Visible to the world"
1213
  msgstr ""
1214
 
1215
+ #: app/main/RTMedia.php:517 app/main/controllers/template/RTMediaNav.php:143
1216
  msgid "All"
1217
  msgstr ""
1218
 
1223
 
1224
  #: app/main/RTMedia.php:529 app/main/controllers/media/RTMediaAlbum.php:53
1225
  #: app/main/controllers/media/RTMediaAlbum.php:65
1226
+ #: app/main/controllers/template/RTMediaNav.php:92
1227
+ #: app/main/controllers/template/RTMediaNav.php:164
1228
  msgid "Albums"
1229
  msgstr ""
1230
 
1238
  msgid "Wall Post"
1239
  msgstr ""
1240
 
1241
+ #: app/main/RTMedia.php:732
1242
  msgid "Wall Posts"
1243
  msgstr ""
1244
 
1245
+ #: app/main/RTMedia.php:772
1246
  msgid ": Can't Create Database table. Please check create table permission."
1247
  msgstr ""
1248
 
1249
+ #: app/main/RTMedia.php:806
1250
  msgid "Loading media"
1251
  msgstr ""
1252
 
1253
+ #: app/main/RTMedia.php:807
1254
  msgid "Please enter some content to post."
1255
  msgstr ""
1256
 
1257
+ #: app/main/RTMedia.php:808
1258
  msgid "Empty Comment is not allowed."
1259
  msgstr ""
1260
 
1261
+ #: app/main/RTMedia.php:809
1262
  msgid "Are you sure you want to delete this media?"
1263
  msgstr ""
1264
 
1265
+ #: app/main/RTMedia.php:810
1266
  msgid "Are you sure you want to delete this comment?"
1267
  msgstr ""
1268
 
1269
+ #: app/main/RTMedia.php:811
1270
  msgid "Are you sure you want to delete this Album?"
1271
  msgstr ""
1272
 
1273
+ #: app/main/RTMedia.php:812
1274
  msgid "Drop files here"
1275
  msgstr ""
1276
 
1277
+ #: app/main/RTMedia.php:813
1278
  msgid "album created successfully."
1279
  msgstr ""
1280
 
1281
+ #: app/main/RTMedia.php:814
1282
  msgid "Something went wrong. Please try again."
1283
  msgstr ""
1284
 
1285
+ #: app/main/RTMedia.php:815
1286
  msgid "Enter an album name."
1287
  msgstr ""
1288
 
1289
+ #: app/main/RTMedia.php:816
1290
  msgid "Max file Size Limit : "
1291
  msgstr ""
1292
 
1293
+ #: app/main/RTMedia.php:817
1294
  msgid "Allowed File Formats"
1295
  msgstr ""
1296
 
1297
+ #: app/main/RTMedia.php:818 templates/media/album-single-edit.php:58
1298
  msgid "Select All Visible"
1299
  msgstr ""
1300
 
1301
+ #: app/main/RTMedia.php:819
1302
  msgid "Unselect All Visible"
1303
  msgstr ""
1304
 
1305
+ #: app/main/RTMedia.php:820
1306
  msgid "Please select some media."
1307
  msgstr ""
1308
 
1309
+ #: app/main/RTMedia.php:821
1310
  msgid "Are you sure you want to delete the selected medias?"
1311
  msgstr ""
1312
 
1313
+ #: app/main/RTMedia.php:822
1314
  msgid "Are you sure you want to move the selected medias?"
1315
  msgstr ""
1316
 
1317
+ #: app/main/RTMedia.php:823
1318
  msgid "Waiting"
1319
  msgstr ""
1320
 
1321
+ #: app/main/RTMedia.php:824
1322
  msgid "Uploaded"
1323
  msgstr ""
1324
 
1325
+ #: app/main/RTMedia.php:825
1326
  msgid "Uploading"
1327
  msgstr ""
1328
 
1329
+ #: app/main/RTMedia.php:826
1330
  msgid "Failed"
1331
  msgstr ""
1332
 
1333
+ #: app/main/RTMedia.php:827
1334
  msgid "Close"
1335
  msgstr ""
1336
 
1337
+ #: app/main/RTMedia.php:828
1338
  #: app/main/controllers/template/rt-template-functions.php:585
1339
  #: app/main/controllers/template/rt-template-functions.php:606
1340
  msgid "Edit"
1341
  msgstr ""
1342
 
1343
+ #: app/main/RTMedia.php:829
1344
  #: app/main/controllers/template/rt-template-functions.php:1129
1345
  #: app/main/controllers/template/rt-template-functions.php:1136
1346
  #: templates/media/album-single-edit.php:60
1347
  msgid "Delete"
1348
  msgstr ""
1349
 
1350
+ #: app/main/RTMedia.php:830 templates/media/media-single-edit.php:13
1351
  msgid "Edit Media"
1352
  msgstr ""
1353
 
1354
+ #: app/main/RTMedia.php:831
1355
  msgid "Remove from queue"
1356
  msgstr ""
1357
 
1358
+ #: app/main/RTMedia.php:832
1359
  msgid "Add more files"
1360
  msgstr ""
1361
 
1362
+ #: app/main/RTMedia.php:833
1363
  msgid "File not supported"
1364
  msgstr ""
1365
 
1366
+ #: app/main/RTMedia.php:834
1367
  msgid "more"
1368
  msgstr ""
1369
 
1370
+ #: app/main/RTMedia.php:835
1371
  msgid "less"
1372
  msgstr ""
1373
 
1374
+ #: app/main/RTMedia.php:836
1375
  msgid "This media is uploaded. Are you sure you want to delete this media?"
1376
  msgstr ""
1377
 
1379
  msgid "Media Files"
1380
  msgstr ""
1381
 
1382
+ #: app/main/controllers/api/RTMediaJsonApi.php:146
1383
+ msgid "username/password empty"
1384
+ msgstr ""
1385
+
1386
+ #: app/main/controllers/api/RTMediaJsonApi.php:149
1387
+ msgid "incorrect username"
1388
+ msgstr ""
1389
+
1390
+ #: app/main/controllers/api/RTMediaJsonApi.php:152
1391
+ msgid "incorrect password"
1392
+ msgstr ""
1393
+
1394
+ #: app/main/controllers/api/RTMediaJsonApi.php:155
1395
+ msgid "login success"
1396
+ msgstr ""
1397
+
1398
+ #: app/main/controllers/api/RTMediaJsonApi.php:201
1399
+ msgid "fields empty"
1400
+ msgstr ""
1401
+
1402
+ #: app/main/controllers/api/RTMediaJsonApi.php:204
1403
+ msgid "invalid email"
1404
+ msgstr ""
1405
+
1406
+ #: app/main/controllers/api/RTMediaJsonApi.php:207
1407
+ msgid "password do not match"
1408
+ msgstr ""
1409
+
1410
+ #: app/main/controllers/api/RTMediaJsonApi.php:210
1411
+ msgid "username already registered"
1412
+ msgstr ""
1413
+
1414
+ #: app/main/controllers/api/RTMediaJsonApi.php:213
1415
+ msgid "email already exists"
1416
+ msgstr ""
1417
+
1418
+ #: app/main/controllers/api/RTMediaJsonApi.php:216
1419
+ msgid "new user created"
1420
+ msgstr ""
1421
+
1422
+ #: app/main/controllers/api/RTMediaJsonApi.php:277
1423
+ msgid "email empty"
1424
+ msgstr ""
1425
+
1426
+ #: app/main/controllers/api/RTMediaJsonApi.php:280
1427
+ msgid "username/email not registered"
1428
+ msgstr ""
1429
+
1430
+ #: app/main/controllers/api/RTMediaJsonApi.php:283
1431
+ msgid "reset link sent"
1432
+ msgstr ""
1433
+
1434
+ #: app/main/controllers/api/RTMediaJsonApi.php:315
1435
+ msgid ""
1436
+ "Someone has asked to reset the password for the following site and username."
1437
+ msgstr ""
1438
+
1439
+ #: app/main/controllers/api/RTMediaJsonApi.php:317
1440
+ #, php-format
1441
+ msgid "Username: %s"
1442
+ msgstr ""
1443
+
1444
+ #: app/main/controllers/api/RTMediaJsonApi.php:318
1445
+ msgid ""
1446
+ "To reset your password visit the following address, otherwise just ignore "
1447
+ "this email and nothing will happen."
1448
+ msgstr ""
1449
+
1450
+ #: app/main/controllers/api/RTMediaJsonApi.php:321
1451
+ #, php-format
1452
+ msgid "[%s] Password Reset"
1453
+ msgstr ""
1454
+
1455
+ #: app/main/controllers/api/RTMediaJsonApi.php:336
1456
+ msgid "bp activities"
1457
+ msgstr ""
1458
+
1459
+ #: app/main/controllers/api/RTMediaJsonApi.php:339
1460
+ msgid "user activities"
1461
+ msgstr ""
1462
+
1463
+ #: app/main/controllers/api/RTMediaJsonApi.php:369
1464
+ msgid "comment content missing"
1465
+ msgstr ""
1466
+
1467
+ #: app/main/controllers/api/RTMediaJsonApi.php:372
1468
+ msgid "comment posted"
1469
+ msgstr ""
1470
+
1471
+ #: app/main/controllers/api/RTMediaJsonApi.php:419
1472
+ msgid "unliked media"
1473
+ msgstr ""
1474
+
1475
+ #: app/main/controllers/api/RTMediaJsonApi.php:422
1476
+ msgid "liked media"
1477
+ msgstr ""
1478
+
1479
+ #: app/main/controllers/api/RTMediaJsonApi.php:506
1480
+ msgid "no comments"
1481
+ msgstr ""
1482
+
1483
+ #: app/main/controllers/api/RTMediaJsonApi.php:509
1484
+ msgid "media comments"
1485
+ msgstr ""
1486
+
1487
+ #: app/main/controllers/api/RTMediaJsonApi.php:512
1488
+ msgid "my comments"
1489
+ msgstr ""
1490
+
1491
+ #: app/main/controllers/api/RTMediaJsonApi.php:562
1492
+ msgid "no likes"
1493
+ msgstr ""
1494
+
1495
+ #: app/main/controllers/api/RTMediaJsonApi.php:565
1496
+ msgid "media likes"
1497
+ msgstr ""
1498
+
1499
+ #: app/main/controllers/api/RTMediaJsonApi.php:607
1500
+ msgid "invalid comment/media id"
1501
+ msgstr ""
1502
+
1503
+ #: app/main/controllers/api/RTMediaJsonApi.php:610
1504
+ msgid "no comment id"
1505
+ msgstr ""
1506
+
1507
+ #: app/main/controllers/api/RTMediaJsonApi.php:613
1508
+ msgid "comment deleted"
1509
+ msgstr ""
1510
+
1511
+ #: app/main/controllers/api/RTMediaJsonApi.php:656
1512
+ msgid "no profile found"
1513
+ msgstr ""
1514
+
1515
+ #: app/main/controllers/api/RTMediaJsonApi.php:659
1516
+ msgid "profile fields"
1517
+ msgstr ""
1518
+
1519
+ #: app/main/controllers/api/RTMediaJsonApi.php:753
1520
+ msgid "follow user id missing"
1521
+ msgstr ""
1522
+
1523
+ #: app/main/controllers/api/RTMediaJsonApi.php:756
1524
+ msgid "started following"
1525
+ msgstr ""
1526
+
1527
+ #: app/main/controllers/api/RTMediaJsonApi.php:759
1528
+ msgid "already following"
1529
+ msgstr ""
1530
+
1531
+ #: app/main/controllers/api/RTMediaJsonApi.php:791
1532
+ msgid "unfollow id missing"
1533
+ msgstr ""
1534
+
1535
+ #: app/main/controllers/api/RTMediaJsonApi.php:794
1536
+ msgid "stopped following"
1537
+ msgstr ""
1538
+
1539
+ #: app/main/controllers/api/RTMediaJsonApi.php:797
1540
+ msgid "not following"
1541
+ msgstr ""
1542
+
1543
+ #: app/main/controllers/api/RTMediaJsonApi.php:829
1544
+ msgid "name/location empty"
1545
+ msgstr ""
1546
+
1547
+ #: app/main/controllers/api/RTMediaJsonApi.php:832
1548
+ msgid "profile updated"
1549
+ msgstr ""
1550
+
1551
+ #: app/main/controllers/api/RTMediaJsonApi.php:858
1552
+ #: app/main/controllers/api/RTMediaJsonApi.php:885
1553
+ msgid "no file"
1554
+ msgstr ""
1555
+
1556
+ #: app/main/controllers/api/RTMediaJsonApi.php:861
1557
+ #: app/main/controllers/api/RTMediaJsonApi.php:897
1558
+ msgid "upload failed, check size and file type"
1559
+ msgstr ""
1560
+
1561
+ #: app/main/controllers/api/RTMediaJsonApi.php:864
1562
+ msgid "avatar updated"
1563
+ msgstr ""
1564
+
1565
+ #: app/main/controllers/api/RTMediaJsonApi.php:888
1566
+ msgid "invalid file string"
1567
+ msgstr ""
1568
+
1569
+ #: app/main/controllers/api/RTMediaJsonApi.php:891
1570
+ msgid "image type missing"
1571
+ msgstr ""
1572
+
1573
+ #: app/main/controllers/api/RTMediaJsonApi.php:894
1574
+ msgid "no title"
1575
+ msgstr ""
1576
+
1577
+ #: app/main/controllers/api/RTMediaJsonApi.php:900
1578
+ msgid "media updated"
1579
+ msgstr ""
1580
+
1581
+ #: app/main/controllers/api/RTMediaJsonApi.php:1020
1582
+ msgid "media list"
1583
+ msgstr ""
1584
+
1585
+ #: app/main/controllers/api/RTMediaJsonApi.php:1023
1586
+ msgid "no media found for requested media type"
1587
+ msgstr ""
1588
+
1589
+ #: app/main/controllers/api/RTMediaJsonApi.php:1026
1590
+ msgid "media_type not allowed"
1591
+ msgstr ""
1592
+
1593
+ #: app/main/controllers/api/RTMediaJsonApi.php:1111
1594
+ msgid "single media"
1595
+ msgstr ""
1596
+
1597
  #: app/main/controllers/group/RTMediaGroupExtension.php:30
1598
  #: app/main/controllers/group/RTMediaGroupExtension.php:92
1599
  msgid "Album Creation Control"
2099
  msgid "Error Uploading File"
2100
  msgstr ""
2101
 
2102
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:201
2103
  msgid "MP4 file you have uploaded is corrupt."
2104
  msgstr ""
2105
 
2106
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:208
2107
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:213
2108
  msgid ""
2109
  "The MP4 file you have uploaded is using an unsupported video codec. "
2110
  "Supported video codec is H.264."
2111
  msgstr ""
2112
 
2113
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:218
2114
  msgid "The MP4 file you have uploaded is not a video file."
2115
  msgstr ""
2116
 
2117
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:230
2118
  msgid "MP3 file you have uploaded is currupt."
2119
  msgstr ""
2120
 
2121
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:237
2122
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:242
2123
  msgid ""
2124
  "The MP3 file you have uploaded is using an unsupported audio format. "
2125
  "Supported audio format is MP3."
2126
  msgstr ""
2127
 
2128
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:247
2129
  msgid "The MP3 file you have uploaded is not an audio file."
2130
  msgstr ""
2131
 
2132
+ #: app/main/controllers/upload/processors/RTMediaUploadFile.php:255
2133
  msgid ""
2134
  "Media File you have tried to upload is not supported. Supported media files "
2135
  "are .jpg, .png, .gif, .mp3, .mov and .mp4."
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === rtMedia for WordPress, BuddyPress and bbPress ===
2
- Contributors: rtcamp, rahul286, faishal, JoshuaAbenazer, gagan0123, saurabhshukla, desaiuditd, nitun.lanjewar, rittesh.patel, pushpak.pop, umesh.nevase, suhasgirgaonkar, neerukoul, hrishiv90, kanakiyajay, jarretc, tobiaskluge, rafaelfunchal
3
  Donate link: http://rtcamp.com/donate/
4
  Tags: BuddyPress, media, multimedia, album, audio, songs, music, video, photo, image, upload, share, MediaElement.js, ffmpeg, kaltura, media-node, rtMedia, WordPress, bbPress
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: WordPress 3.6
8
  Tested up to: WordPress 3.7 + BuddyPress 1.8.1
9
- Stable tag: 3.5.2.1
10
 
11
  Add albums, photo, audio/video encoding, privacy, sharing, front-end uploads & more. All this works mobile/tablets devices.
12
 
@@ -132,6 +132,10 @@ http://www.youtube.com/watch?v=dJrykKQGDcs
132
  == Changelog ==
133
 
134
  Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
 
 
 
 
135
 
136
  = 3.5.2.1 =
137
  * Admin UI bug fixes
@@ -687,8 +691,8 @@ Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_sou
687
 
688
  == Upgrade Notice ==
689
 
690
- = 3.5.2.1 =
691
- Requires BuddyPress 1.7 or higher, if using BuddyPress. Admin UI bug fixes
692
 
693
  == Sponsors ==
694
 
1
  === rtMedia for WordPress, BuddyPress and bbPress ===
2
+ Contributors: rtcamp, rahul286, faishal, JoshuaAbenazer, gagan0123, saurabhshukla, desaiuditd, nitun.lanjewar, rittesh.patel, pushpak.pop, umesh.nevase, suhasgirgaonkar, neerukoul, hrishiv90, kanakiyajay, jarretc, tobiaskluge, rafaelfunchal, UmeshSingla
3
  Donate link: http://rtcamp.com/donate/
4
  Tags: BuddyPress, media, multimedia, album, audio, songs, music, video, photo, image, upload, share, MediaElement.js, ffmpeg, kaltura, media-node, rtMedia, WordPress, bbPress
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: WordPress 3.6
8
  Tested up to: WordPress 3.7 + BuddyPress 1.8.1
9
+ Stable tag: 3.6
10
 
11
  Add albums, photo, audio/video encoding, privacy, sharing, front-end uploads & more. All this works mobile/tablets devices.
12
 
132
  == Changelog ==
133
 
134
  Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
135
+ = 3.6 =
136
+ * rtMedia JSON API added
137
+ * Updated russian translations
138
+ * Bug fixes
139
 
140
  = 3.5.2.1 =
141
  * Admin UI bug fixes
691
 
692
  == Upgrade Notice ==
693
 
694
+ = 3.6 =
695
+ Requires BuddyPress 1.7 or higher, if using BuddyPress. rtMedia API added, updated russian translations, bug fixes.
696
 
697
  == Sponsors ==
698
 
templates/media/media-gallery.php CHANGED
@@ -1,10 +1,10 @@
1
  <div class="rtmedia-container">
2
  <?php do_action ( 'rtmedia_before_media_gallery' ); ?>
3
- <?php
4
  $title = get_rtmedia_gallery_title();
5
  global $rtmedia_query;
6
  if( isset($rtmedia_query->is_gallery_shortcode) && $rtmedia_query->is_gallery_shortcode == true) { // if gallery is displayed using gallery shortcode
7
- ?>
8
  <h2><?php _e( 'Media Gallery', 'rtmedia' ); ?></h2>
9
  <?php }
10
  else { ?>
@@ -14,7 +14,7 @@
14
  else { _e( 'Media Gallery', 'rtmedia' ); } ?>
15
  </h2>
16
  <div id="rtm-media-options"><?php do_action ( 'rtmedia_media_gallery_actions' ); ?></div>
17
- </div>
18
 
19
  <div id="rtm-media-gallery-uploader">
20
  <?php rtmedia_uploader ( array('is_up_shortcode'=> false) ); ?>
@@ -22,9 +22,9 @@
22
  <?php }
23
  ?>
24
  <?php do_action ( 'rtmedia_after_media_gallery_title' ); ?>
25
-
26
- <ul class="rtmedia-list rtmedia-list-media <?php echo rtmedia_media_gallery_class (); ?>">
27
- <?php if ( have_rtmedia () ) { ?>
28
 
29
  <?php while ( have_rtmedia () ) : rtmedia (); ?>
30
 
@@ -56,14 +56,14 @@
56
  <a id="rtMedia-galary-next" <?php echo $display; ?> href="<?php echo rtmedia_pagination_next_link (); ?>"><?php echo __ ( 'Load more', 'rtmedia' ); ?></a>
57
  </div>
58
  <?php } else { ?>
59
- <p>
60
- <?php
61
  $message = __ ( "Oops !! There's no media found for the request !!", "rtmedia" );
62
  echo apply_filters('rtmedia_no_media_found_message_filter', $message);
63
  ?>
64
  </p>
65
  <?php } ?>
66
- </ul>
67
  <?php do_action ( 'rtmedia_after_media_gallery' ); ?>
68
 
69
  </div>
1
  <div class="rtmedia-container">
2
  <?php do_action ( 'rtmedia_before_media_gallery' ); ?>
3
+ <?php
4
  $title = get_rtmedia_gallery_title();
5
  global $rtmedia_query;
6
  if( isset($rtmedia_query->is_gallery_shortcode) && $rtmedia_query->is_gallery_shortcode == true) { // if gallery is displayed using gallery shortcode
7
+ ?>
8
  <h2><?php _e( 'Media Gallery', 'rtmedia' ); ?></h2>
9
  <?php }
10
  else { ?>
14
  else { _e( 'Media Gallery', 'rtmedia' ); } ?>
15
  </h2>
16
  <div id="rtm-media-options"><?php do_action ( 'rtmedia_media_gallery_actions' ); ?></div>
17
+ </div>
18
 
19
  <div id="rtm-media-gallery-uploader">
20
  <?php rtmedia_uploader ( array('is_up_shortcode'=> false) ); ?>
22
  <?php }
23
  ?>
24
  <?php do_action ( 'rtmedia_after_media_gallery_title' ); ?>
25
+ <?php if ( have_rtmedia () ) { ?>
26
+ <ul class="rtmedia-list rtmedia-list-media <?php echo rtmedia_media_gallery_class (); ?>">
27
+
28
 
29
  <?php while ( have_rtmedia () ) : rtmedia (); ?>
30
 
56
  <a id="rtMedia-galary-next" <?php echo $display; ?> href="<?php echo rtmedia_pagination_next_link (); ?>"><?php echo __ ( 'Load more', 'rtmedia' ); ?></a>
57
  </div>
58
  <?php } else { ?>
59
+ <p>
60
+ <?php
61
  $message = __ ( "Oops !! There's no media found for the request !!", "rtmedia" );
62
  echo apply_filters('rtmedia_no_media_found_message_filter', $message);
63
  ?>
64
  </p>
65
  <?php } ?>
66
+
67
  <?php do_action ( 'rtmedia_after_media_gallery' ); ?>
68
 
69
  </div>