rtMedia for WordPress, BuddyPress and bbPress - Version 3.0.1

Version Description

  • Legacy path support for Addon Updates
  • Added database check for migration
  • Fixed a few errors
Download this release

Release Info

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

Code changes from version 3.0 to 3.0.1

Files changed (46) hide show
  1. app/assets/css/bootstrap-switch.css +0 -0
  2. app/assets/css/font-awesome.min.css +0 -0
  3. app/assets/css/grid-foundation.css +0 -0
  4. app/assets/css/image-edit.css +0 -0
  5. app/assets/css/jquery.powertip.min.css +0 -0
  6. app/assets/css/jquery.sliderTabs.min.css +0 -0
  7. app/assets/font/FontAwesome.otf +0 -0
  8. app/assets/font/fontawesome-webfont.eot +0 -0
  9. app/assets/font/fontawesome-webfont.svg +0 -0
  10. app/assets/font/fontawesome-webfont.ttf +0 -0
  11. app/assets/font/fontawesome-webfont.woff +0 -0
  12. app/assets/img/boxspinner.gif +0 -0
  13. app/assets/img/close.png +0 -0
  14. app/assets/img/donate.gif +0 -0
  15. app/assets/img/donate.png +0 -0
  16. app/assets/img/indicator.png +0 -0
  17. app/assets/img/indicatorActive.png +0 -0
  18. app/assets/img/leftArrow.png +0 -0
  19. app/assets/img/leftPanelArrow.png +0 -0
  20. app/assets/img/mask-square.png +0 -0
  21. app/assets/img/mask.png +0 -0
  22. app/assets/img/private.png +0 -0
  23. app/assets/img/rightArrow.png +0 -0
  24. app/assets/img/rightPanelArrow.png +0 -0
  25. app/assets/img/rtCamp-bullet.png +0 -0
  26. app/assets/img/wpmini-grey.png +0 -0
  27. app/assets/js/bootstrap-switch.js +0 -0
  28. app/assets/js/bp-media-activity-uploader.js +222 -0
  29. app/assets/js/bp-media-uploader.js +119 -0
  30. app/assets/js/jquery.powertip.min.js +0 -0
  31. app/assets/js/jquery.sliderTabs.min.js +0 -0
  32. app/helper/db/RTDBUpdate.php +10 -1
  33. app/helper/rtDimensions.php +0 -0
  34. app/helper/rtForm.php +0 -0
  35. app/helper/rtFormInvalidArgumentsException.php +0 -0
  36. app/helper/rtPluginInfo.php +0 -0
  37. app/helper/rtPluginUpdate.php +0 -0
  38. app/helper/rtPluginUpdateChecker.php +0 -0
  39. app/importers/RTMediaMigration.php +10 -4
  40. app/main/RTMedia.php +18 -3
  41. app/main/controllers/template/rt-template-functions.php +9 -1
  42. app/main/routers/query/RTMediaQuery.php +7 -7
  43. config/index.php +6 -0
  44. index.php +3 -9
  45. log/index.php +9 -0
  46. readme.txt +9 -4
app/assets/css/bootstrap-switch.css CHANGED
File without changes
app/assets/css/font-awesome.min.css CHANGED
File without changes
app/assets/css/grid-foundation.css CHANGED
File without changes
app/assets/css/image-edit.css CHANGED
File without changes
app/assets/css/jquery.powertip.min.css CHANGED
File without changes
app/assets/css/jquery.sliderTabs.min.css CHANGED
File without changes
app/assets/font/FontAwesome.otf CHANGED
File without changes
app/assets/font/fontawesome-webfont.eot CHANGED
File without changes
app/assets/font/fontawesome-webfont.svg CHANGED
File without changes
app/assets/font/fontawesome-webfont.ttf CHANGED
File without changes
app/assets/font/fontawesome-webfont.woff CHANGED
File without changes
app/assets/img/boxspinner.gif CHANGED
File without changes
app/assets/img/close.png ADDED
Binary file
app/assets/img/donate.gif ADDED
Binary file
app/assets/img/donate.png ADDED
Binary file
app/assets/img/indicator.png CHANGED
File without changes
app/assets/img/indicatorActive.png CHANGED
File without changes
app/assets/img/leftArrow.png CHANGED
File without changes
app/assets/img/leftPanelArrow.png CHANGED
File without changes
app/assets/img/mask-square.png CHANGED
File without changes
app/assets/img/mask.png CHANGED
File without changes
app/assets/img/private.png CHANGED
File without changes
app/assets/img/rightArrow.png CHANGED
File without changes
app/assets/img/rightPanelArrow.png CHANGED
File without changes
app/assets/img/rtCamp-bullet.png ADDED
Binary file
app/assets/img/wpmini-grey.png CHANGED
File without changes
app/assets/js/bootstrap-switch.js CHANGED
File without changes
app/assets/js/bp-media-activity-uploader.js ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+
6
+ jQuery(document).ready(function(){
7
+ if ( jQuery('#bp-media-activity-upload-ui').length > 0 ) {
8
+
9
+ jQuery('#whats-new').off('focus');
10
+ jQuery('#whats-new').on('focus', function(){
11
+ jQuery("#whats-new-options").css('height','auto');
12
+ jQuery("form#whats-new-form textarea").animate({
13
+ height:'50px'
14
+ });
15
+ jQuery("#aw-whats-new-submit").prop("disabled", false);
16
+ });
17
+
18
+ jQuery("input#aw-whats-new-submit").off('click');
19
+ jQuery("input#aw-whats-new-submit").on('click',function() {
20
+ var button = jQuery(this);
21
+ var form = button.parent().parent().parent().parent();
22
+
23
+ form.children().each( function() {
24
+ if ( jQuery.nodeName(this, "textarea") || jQuery.nodeName(this, "input") )
25
+ jQuery(this).prop( 'disabled', true );
26
+ });
27
+
28
+ /* Remove any errors */
29
+ jQuery('div.error').remove();
30
+ button.addClass('loading');
31
+ button.prop('disabled', true);
32
+
33
+ /* Default POST values */
34
+ var object = '';
35
+ var item_id = jQuery("#whats-new-post-in").val();
36
+ var content = jQuery("#bp-media-dummy-update").val();
37
+
38
+ /* Set object for non-profile posts */
39
+ if ( item_id > 0 ) {
40
+ object = jQuery("#whats-new-post-object").val();
41
+ }
42
+
43
+ jQuery.post( ajaxurl, {
44
+ action: 'post_update',
45
+ 'cookie': encodeURIComponent(document.cookie),
46
+ '_wpnonce_post_update': jQuery("input#_wpnonce_post_update").val(),
47
+ 'content': content,
48
+ 'object': object,
49
+ 'item_id': item_id,
50
+ '_bp_as_nonce': jQuery('#_bp_as_nonce').val() || ''
51
+ },
52
+ function(response) {
53
+
54
+ form.children().each( function() {
55
+ if ( jQuery.nodeName(this, "textarea") || jQuery.nodeName(this, "input") ) {
56
+ jQuery(this).prop( 'disabled', false );
57
+ }
58
+ });
59
+
60
+ /* Check for errors and append if found. */
61
+ if ( response[0] + response[1] == '-1' ) {
62
+ form.prepend( response.substr( 2, response.length ) );
63
+ jQuery( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
64
+ } else {
65
+ if ( 0 == jQuery("ul.activity-list").length ) {
66
+ jQuery("div.error").slideUp(100).remove();
67
+ jQuery("div#message").slideUp(100).remove();
68
+ jQuery("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
69
+ }
70
+
71
+ jQuery("ul#activity-stream").prepend(response);
72
+ jQuery("ul#activity-stream li:first").addClass('new-update');
73
+
74
+ if ( 0 != jQuery("#latest-update").length ) {
75
+ var l = jQuery("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
76
+ var v = jQuery("ul#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href');
77
+
78
+ var ltext = jQuery("ul#activity-stream li.new-update .activity-content .activity-inner p").text();
79
+
80
+ var u = '';
81
+ if ( ltext != '' )
82
+ u = l + ' ';
83
+
84
+ u += '<a href="' + v + '" rel="nofollow">' + BP_DTheme.view + '</a>';
85
+
86
+ jQuery("#latest-update").slideUp(300,function(){
87
+ jQuery("#latest-update").html( u );
88
+ jQuery("#latest-update").slideDown(300);
89
+ });
90
+ }
91
+
92
+ jQuery("li.new-update").hide().slideDown( 300 );
93
+ jQuery("li.new-update").removeClass( 'new-update' );
94
+ jQuery("textarea#whats-new").val('');
95
+ }
96
+
97
+ jQuery("#whats-new-options").animate({
98
+ height:'0px'
99
+ });
100
+ jQuery("form#whats-new-form textarea").animate({
101
+ height:'20px'
102
+ });
103
+ jQuery("#aw-whats-new-submit").prop("disabled", true).removeClass('loading');
104
+ });
105
+
106
+ return false;
107
+ });
108
+
109
+ $dummy_update_box = jQuery('<input id="bp-media-dummy-update" type="hidden" name="whats-new" />');
110
+ $update_container = jQuery('#whats-new-textarea');
111
+ $update_container.append($dummy_update_box);
112
+
113
+ jQuery('#whats-new').on('keyup',function(){
114
+ $this = jQuery(this);
115
+ $that = jQuery('#bp-media-update-text');
116
+ $that.val($this.val()).change();
117
+ });
118
+ jQuery('#bp-media-update-text').on('change',function(){
119
+ bp_media_overwrite();
120
+ });
121
+ jQuery('#bp-media-update-json').on('change',function(){
122
+ bp_media_overwrite();
123
+ });
124
+
125
+ $bp_media_activity_is_multiple_upload = false;
126
+ $bp_media_activity_uploader=new plupload.Uploader(bp_media_uploader_params);
127
+ $bp_media_activity_album_selected = false;
128
+ $bp_media_activity_uploader.init();
129
+
130
+ $bp_media_activity_uploader.bind('FilesAdded', function(up, files) {
131
+ //bp_media_is_multiple_upload = files.length==1&&jQuery('.bp-media-progressbar').length==0?false:true;
132
+ $bp_media_activity_is_multiple_upload = files.length>1;
133
+ jQuery.each(files, function(i, file) {
134
+ $bp_media_activity_extension = file.name.substr( (file.name.lastIndexOf('.') +1) );
135
+ jQuery('#bp-media-activity-uploaded-files').append('<div id="bp-media-activity-progress-'+file.id+'" class="bp-media-progressbar"><div class="bp-media-progress-text">' + file.name + ' (' + plupload.formatSize(file.size) + ')(<b>0%</b>)</div><div class="bp-media-progress-completed"></div></div>');
136
+ });
137
+ // bp_media_activity_album_selected = jQuery('#bp-media-activity-selected-album').val();
138
+ $bp_media_activity_album_selected = default_album;
139
+ $bp_media_activity_uploader.start();
140
+ up.refresh(); // Reposition Flash/Silverlight
141
+ });
142
+ $bp_media_activity_uploader.bind('UploadProgress', function(up, file) {
143
+ jQuery('input#aw-whats-new-submit').prop('disabled',true).addClass('loading');
144
+ jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-completed').width(file.percent+'%');
145
+ jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-text b').html(file.percent+'%');
146
+ });
147
+
148
+ $bp_media_activity_uploader.bind('Error', function(up, err) {
149
+ jQuery('#bp-media-activity-uploaded-files').html('<div class="error"><p>Error: ' + err.code +
150
+ ', Message: ' + err.message +
151
+ (err.file ? ', File: ' + err.file.name : '') +
152
+ '</p></div>'
153
+ );
154
+ up.refresh();
155
+ });
156
+ $bp_media_activity_uploader.bind('FileUploaded', function(up, file,response) {
157
+ jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-text b').html("100%");
158
+ $album_arr = [];
159
+ $val = jQuery('#bp-media-update-json').val();
160
+ if($val!=''){
161
+ $album_arr= JSON.parse($val);
162
+ }
163
+ $album_arr.push(parseInt(response.response));
164
+ $album_json =JSON.stringify($album_arr);
165
+ jQuery('#bp-media-update-json').val($album_json).change();
166
+ jQuery('#aw-whats-new-submit').prop('disabled',false).removeClass('loading');
167
+
168
+ });
169
+ $bp_media_activity_uploader.bind('BeforeUpload',function(up){
170
+ up.settings.multipart_params.is_multiple_upload = $bp_media_activity_is_multiple_upload;
171
+ up.settings.multipart_params.bp_media_album_id = $bp_media_activity_album_selected;
172
+ up.settings.multipart_params.is_activity = true;
173
+ });
174
+ //jQuery("#aw-whats-new-submit").off( 'click');
175
+
176
+ jQuery("#aw-whats-new-submit").on( 'click', function() {
177
+ $latest = '';
178
+ $val = bp_media_stringify();
179
+ jQuery("#bp-media-dummy-update").val('');
180
+ jQuery("#bp-media-update-json").val('');
181
+ jQuery("#bp-media-update-txt").val('');
182
+ jQuery("#bp-media-activity-uploaded-files").empty();
183
+ setTimeout(function(){
184
+ if($val!=''){
185
+ $album_arr= JSON.parse($val);
186
+ $lastid = parseInt($album_arr.length) - 1;
187
+ $media_id = $album_arr[parseInt($lastid)];
188
+ $activity = (jQuery('#activity-stream').find('li').first().attr('id')).split('-');
189
+ $activity_id = $activity[1];
190
+ var data = {
191
+ action: 'bp_media_get_latest_activity',
192
+ content : $val,
193
+ id: $activity_id
194
+ };
195
+ jQuery.get(ajaxurl,data,function(response){
196
+ $latest = response;
197
+ jQuery('#latest-update').html($latest);
198
+ });
199
+ }
200
+ },1000);
201
+ });
202
+
203
+ $bp_media_activity_uploader.bind('UploadComplete',function(response){
204
+
205
+ });
206
+ }
207
+
208
+
209
+ function bp_media_stringify(){
210
+ $album_json = jQuery('#bp-media-update-json').val();
211
+ $update_txt = jQuery('#bp-media-update-text').val();
212
+ $activity = {
213
+ 'media':$album_json,
214
+ 'update_txt':encodeURIComponent($update_txt)
215
+ };
216
+ return JSON.stringify($activity);
217
+ }
218
+
219
+ function bp_media_overwrite(){
220
+ jQuery('#bp-media-dummy-update').val(bp_media_stringify());
221
+ }
222
+ });
app/assets/js/bp-media-uploader.js ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+
6
+ jQuery(document).ready(function(){
7
+
8
+ var selected = jQuery('#bp-media-album-prompt select').val();
9
+ var in_list = 0;
10
+ if(jQuery('#'+bp_media_uploader_params.container).length==0)
11
+ return false;
12
+ if ( jQuery('#bp-media-album-prompt p').css('display') == 'none' )
13
+ in_list = 1;
14
+ jQuery('#bp-media-album-prompt select').change(function() {
15
+ if ( jQuery(this).val() == 'create_new' ) {
16
+ jQuery('#bp-media-album-prompt select').hide();
17
+ jQuery('#bp-media-album-prompt p').hide();
18
+ jQuery('#bp-media-album-prompt div.hide').show();
19
+ } else
20
+ selected = jQuery(this).val();
21
+ });
22
+ var new_album_flag = 0;
23
+ jQuery('#btn-create-new').click(function(){
24
+ if ( new_album_flag == 1 ) {
25
+ return false;
26
+ }
27
+ var new_album_name = jQuery('#bp_media_album_new').val();
28
+ if(new_album_name.length==0){
29
+ alert(bp_media_uploader_strings.no_name);
30
+ return false;
31
+ } else {
32
+ new_album_flag = 1;
33
+ jQuery(this).val('Wait');
34
+ var data = {
35
+ action: 'bp_media_add_album',
36
+ bp_media_album_name : new_album_name,
37
+ bp_media_group_id : bp_media_uploader_params.multipart_params.bp_media_group_id
38
+ };
39
+ jQuery.post(bp_media_vars.ajaxurl,data,function(response){
40
+ var album = parseInt(response);
41
+ if(album == 0){
42
+ alert(bp_media_uploader_strings.cant_upload_group_album);
43
+ } else {
44
+ jQuery('#bp-media-album-prompt select option').removeAttr('selected');
45
+ jQuery('#bp-media-selected-album').prepend('<option value='+album+' selected="selected">'+new_album_name+'</option>');
46
+ jQuery('#bp-media-album-prompt div.hide').hide();
47
+ jQuery('#bp-media-album-prompt select').show();
48
+ if ( in_list == 0 )
49
+ jQuery('#bp-media-album-prompt p').show();
50
+ }
51
+ });
52
+ }
53
+ });
54
+ jQuery('#btn-create-cancel').click(function(){
55
+ jQuery('#bp-media-album-prompt div.hide').hide();
56
+ jQuery('#bp-media-album-prompt select option').removeAttr('selected');
57
+ jQuery('#bp-media-album-prompt select option[value=' + selected + ']').attr('selected', 'selected');
58
+ jQuery('#bp-media-album-prompt select').show();
59
+ if ( in_list == 0 )
60
+ jQuery('#bp-media-album-prompt p').show();
61
+ });
62
+
63
+ //Normal Uplaoder
64
+ var bp_media_is_multiple_upload = false;
65
+ var bp_media_uploader=new plupload.Uploader(bp_media_uploader_params);
66
+ var bp_media_album_selected = false;
67
+ bp_media_uploader.init();
68
+
69
+ bp_media_uploader.bind('FilesAdded', function(up, files) {
70
+ if ( jQuery('#bp-media-selected-album').val() == 'create_new' ) {
71
+ alert(bp_media_uploader_strings.select_album);
72
+ return false;
73
+ }
74
+ //bp_media_is_multiple_upload = files.length==1&&jQuery('.bp-media-progressbar').length==0?false:true;
75
+ bp_media_is_multiple_upload = files.length>1;
76
+ jQuery.each(files, function(i, file) {
77
+ var extension = file.name.substr( (file.name.lastIndexOf('.') +1) );
78
+ jQuery('#bp-media-uploaded-files').append('<div id="bp-media-progress-'+file.id+'" class="bp-media-progressbar"><div class="bp-media-progress-text">' + file.name + ' (' + plupload.formatSize(file.size) + ')(<b>0%</b>)</div><div class="bp-media-progress-completed"></div></div>');
79
+ });
80
+ bp_media_album_selected = jQuery('#bp-media-selected-album').val();
81
+ bp_media_uploader.start();
82
+ up.refresh(); // Reposition Flash/Silverlight
83
+ });
84
+ bp_media_uploader.bind('UploadProgress', function(up, file) {
85
+ jQuery('#bp-media-progress-'+file.id+' .bp-media-progress-completed').width(file.percent+'%');
86
+ jQuery('#bp-media-progress-'+file.id+' .bp-media-progress-text b').html(file.percent+'%');
87
+ });
88
+
89
+ bp_media_uploader.bind('Error', function(up, err) {
90
+ jQuery('#bp-media-uploaded-files').html('<div class="error"><p>Error: ' + err.code +
91
+ ', Message: ' + err.message +
92
+ (err.file ? ', File: ' + err.file.name : '') +
93
+ '</p></div>'
94
+ );
95
+ up.refresh();
96
+ });
97
+
98
+ bp_media_uploader.bind('FileUploaded', function(up, file) {
99
+ jQuery('#bp-media-progress-'+file.id+' .bp-media-progress-text b').html("100%");
100
+ });
101
+ bp_media_uploader.bind('BeforeUpload',function(up){
102
+ up.settings.multipart_params.is_multiple_upload = bp_media_is_multiple_upload;
103
+ up.settings.multipart_params.bp_media_album_id = bp_media_album_selected;
104
+ });
105
+ bp_media_uploader.bind('UploadComplete',function(){
106
+ var new_location = window.location.href;
107
+ if(new_location.search('/upload/')>0){
108
+ new_location = new_location.replace('/upload/','/albums/');
109
+ if(bp_media_album_selected>0)
110
+ new_location = new_location.concat(bp_media_album_selected);
111
+ else
112
+ new_location = new_location.concat('0/');
113
+ window.location.replace(new_location);
114
+ } else
115
+ location.reload(true);
116
+ });
117
+
118
+
119
+ });
app/assets/js/jquery.powertip.min.js CHANGED
File without changes
app/assets/js/jquery.sliderTabs.min.js CHANGED
File without changes
app/helper/db/RTDBUpdate.php CHANGED
@@ -50,7 +50,7 @@ class RTDBUpdate {
50
 
51
  public function do_upgrade() {
52
  if (version_compare($this->db_version, $this->install_db_version, '>')) {
53
- $path = realpath(__DIR__ . $this->schema_path);
54
  if ($handle = opendir($path)) {
55
  while (false !== ($entry = readdir($handle))) {
56
  if ($entry != "." && $entry != "..") {
@@ -64,6 +64,15 @@ class RTDBUpdate {
64
  update_site_option($this->db_version_option_name, $this->db_version);
65
  }
66
  }
 
 
 
 
 
 
 
 
 
67
 
68
  public function genrate_sql($file_name, $file_content) {
69
  return sprintf($file_content, $this->genrate_table_name($file_name));
50
 
51
  public function do_upgrade() {
52
  if (version_compare($this->db_version, $this->install_db_version, '>')) {
53
+ $path = realpath(dirname(__FILE__) . $this->schema_path);
54
  if ($handle = opendir($path)) {
55
  while (false !== ($entry = readdir($handle))) {
56
  if ($entry != "." && $entry != "..") {
64
  update_site_option($this->db_version_option_name, $this->db_version);
65
  }
66
  }
67
+ static function table_exists($table) {
68
+ global $wpdb;
69
+
70
+ if ($wpdb->query("SHOW TABLES LIKE '" . $table . "'") == 1) {
71
+ return true;
72
+ }
73
+
74
+ return false;
75
+ }
76
 
77
  public function genrate_sql($file_name, $file_content) {
78
  return sprintf($file_content, $this->genrate_table_name($file_name));
app/helper/rtDimensions.php CHANGED
File without changes
app/helper/rtForm.php CHANGED
File without changes
app/helper/rtFormInvalidArgumentsException.php CHANGED
File without changes
app/helper/rtPluginInfo.php CHANGED
File without changes
app/helper/rtPluginUpdate.php CHANGED
File without changes
app/helper/rtPluginUpdateChecker.php CHANGED
File without changes
app/importers/RTMediaMigration.php CHANGED
@@ -317,16 +317,20 @@ class RTMediaMigration {
317
  if( !$this->table_exists($this->bmp_table) ){
318
  $obj = new RTDBUpdate();
319
  $obj->install_db_version = "0";
320
- $obj->do_upgrade();
321
  }
 
 
 
 
 
 
322
  $prog = new rtProgress();
323
  $total = $this->get_total_count();
324
  $done = $this->get_done_count();
325
  if($done >= $total){
326
  $done = $total;
327
- ?>
328
- <!--<div class="error"><p> Please Update your <a href='<?php //admin_url("options-permalink.php") ?>'>Permalink</a> after migration.</p></div>-->
329
- <?php }else{ ?>
330
  <div class="error"><p> Please Backup your <strong>DATABASE</strong> and <strong>UPLOAD</strong> folder before Migration.</p></div>
331
  <?php }
332
 
@@ -416,7 +420,9 @@ class RTMediaMigration {
416
  });
417
  </script>
418
  <hr />
 
419
  <input type="button" id="submit" value="start" class="button button-primary" />
 
420
 
421
  </div>
422
  <?php
317
  if( !$this->table_exists($this->bmp_table) ){
318
  $obj = new RTDBUpdate();
319
  $obj->install_db_version = "0";
320
+ $obj->do_upgrade(true);
321
  }
322
+ global $rtmedia_error;
323
+ if(isset($rtmedia_error) && $rtmedia_error===true){
324
+ ?>
325
+ <div class="error"><p> Please Resolve create database error before migration.</p></div>
326
+ <?php }
327
+
328
  $prog = new rtProgress();
329
  $total = $this->get_total_count();
330
  $done = $this->get_done_count();
331
  if($done >= $total){
332
  $done = $total;
333
+ }else{ ?>
 
 
334
  <div class="error"><p> Please Backup your <strong>DATABASE</strong> and <strong>UPLOAD</strong> folder before Migration.</p></div>
335
  <?php }
336
 
420
  });
421
  </script>
422
  <hr />
423
+ <?php if(!(isset($rtmedia_error) && $rtmedia_error===true)){ ?>
424
  <input type="button" id="submit" value="start" class="button button-primary" />
425
+ <?php } ?>
426
 
427
  </div>
428
  <?php
app/main/RTMedia.php CHANGED
@@ -578,6 +578,9 @@ class RTMedia {
578
  }
579
 
580
  //**
 
 
 
581
  if ( ! $global_album ) {
582
  $global_album = $album->add_global( __( "Wall Posts", "rtmedia", true ) );
583
  }
@@ -601,13 +604,25 @@ class RTMedia {
601
  }
602
 
603
  function update_db() {
 
604
  $update = new RTDBUpdate();
605
  if ( $update->check_upgrade() ) {
606
  $update->do_upgrade();
607
- }
608
- new RTMediaMigration();
 
 
 
 
 
 
 
609
  }
610
-
 
 
 
 
611
  function enqueue_scripts_styles() {
612
  wp_enqueue_script( 'rtmedia-mejs', RTMEDIA_URL . 'lib/media-element/mediaelement-and-player.min.js', '', RTMEDIA_VERSION );
613
  wp_enqueue_style( 'rtmedia-mecss', RTMEDIA_URL . 'lib/media-element/mediaelementplayer.min.css', '', RTMEDIA_VERSION );
578
  }
579
 
580
  //**
581
+ global $rtmedia_error;
582
+ if(isset($rtmedia_error) && $rtmedia_error===true)
583
+ return false;
584
  if ( ! $global_album ) {
585
  $global_album = $album->add_global( __( "Wall Posts", "rtmedia", true ) );
586
  }
604
  }
605
 
606
  function update_db() {
607
+ $rtMigration = new RTMediaMigration();
608
  $update = new RTDBUpdate();
609
  if ( $update->check_upgrade() ) {
610
  $update->do_upgrade();
611
+ }else{
612
+ if($update->table_exists($rtMigration->bmp_table) == false){
613
+ $update->do_upgrade(true);
614
+ if($update->table_exists($rtMigration->bmp_table) == false){
615
+ add_action("admin_notice",array(&$this,"create_table_error_notice"));
616
+ }
617
+ }
618
+ }
619
+
620
  }
621
+ function create_table_error_notice() {
622
+ global $rtmedia_error;
623
+ $rtmedia_error = true;
624
+ echo "<div class='error'><p><strong>rtMedia</strong>: Can't Create Database table. Please check create table permission.</p></div>";
625
+ }
626
  function enqueue_scripts_styles() {
627
  wp_enqueue_script( 'rtmedia-mejs', RTMEDIA_URL . 'lib/media-element/mediaelement-and-player.min.js', '', RTMEDIA_VERSION );
628
  wp_enqueue_style( 'rtmedia-mecss', RTMEDIA_URL . 'lib/media-element/mediaelementplayer.min.css', '', RTMEDIA_VERSION );
app/main/controllers/template/rt-template-functions.php CHANGED
@@ -637,8 +637,16 @@ function rtmedia_global_album_list(){
637
  global $rtmedia_query;
638
  $model = new RTMediaModel();
639
  $global_albums = rtmedia_global_albums();
 
 
 
 
 
 
 
 
640
  $option = NULL;
641
- $albums = implode(',',$global_albums);
642
 
643
  $album_objects = $model->get_media(array('id' => ($albums)), false, false);
644
  if($album_objects){
637
  global $rtmedia_query;
638
  $model = new RTMediaModel();
639
  $global_albums = rtmedia_global_albums();
640
+ if(!empty($global_albums)){
641
+ if(is_array($global_albums)){
642
+ $albums = implode(',',$global_albums);
643
+ } else {
644
+ return;
645
+ }
646
+ return;
647
+ }
648
  $option = NULL;
649
+
650
 
651
  $album_objects = $model->get_media(array('id' => ($albums)), false, false);
652
  if($album_objects){
app/main/routers/query/RTMediaQuery.php CHANGED
@@ -363,7 +363,7 @@ class RTMediaQuery {
363
  */
364
  function &query( $query ) {
365
  $this->query = wp_parse_args($query , $this->query );
366
-
367
  if(isset($this->query) && isset($this->query["global"]) && $this->query["global"]=="true"){
368
  if(isset($this->query["context_id"]))
369
  unset($this->query["context_id"]);
@@ -373,7 +373,7 @@ class RTMediaQuery {
373
  unset($this->query["album_id"]);
374
  unset($this->query["global"]);
375
  }
376
-
377
  $this->set_media_type();
378
  $this->media_query = $this->query;
379
  return $this->get_data();
@@ -448,7 +448,7 @@ class RTMediaQuery {
448
 
449
 
450
  if ( $this->is_album_gallery() ) {
451
-
452
  if ( isset($author) ) {
453
  $query_function = 'get_user_albums';
454
  $context_id = $author;
@@ -456,13 +456,13 @@ class RTMediaQuery {
456
  $query_function = 'get_group_albums';
457
  $context_id = $group_id;
458
  }
459
-
460
  if ( $order_by == ' ' )
461
- $pre_media = $this->model->$query_function( $context_id, ($this->action_query->page - 1) * $this->action_query->per_page_media, $this->action_query->per_page_media );
462
  else
463
- $pre_media = $this->model->$query_function( $context_id, ($this->action_query->page - 1) * $this->action_query->per_page_media, $this->action_query->per_page_media, $order_by );
464
 
465
- $media_for_total_count = $this->model->$query_function( $context_id, false, false );
466
  } else {
467
  /**
468
  * fetch media entries from rtMedia context
363
  */
364
  function &query( $query ) {
365
  $this->query = wp_parse_args($query , $this->query );
366
+
367
  if(isset($this->query) && isset($this->query["global"]) && $this->query["global"]=="true"){
368
  if(isset($this->query["context_id"]))
369
  unset($this->query["context_id"]);
373
  unset($this->query["album_id"]);
374
  unset($this->query["global"]);
375
  }
376
+
377
  $this->set_media_type();
378
  $this->media_query = $this->query;
379
  return $this->get_data();
448
 
449
 
450
  if ( $this->is_album_gallery() ) {
451
+
452
  if ( isset($author) ) {
453
  $query_function = 'get_user_albums';
454
  $context_id = $author;
456
  $query_function = 'get_group_albums';
457
  $context_id = $group_id;
458
  }
459
+
460
  if ( $order_by == ' ' )
461
+ $pre_media = $this->model->{$query_function}( $context_id, ($this->action_query->page - 1) * $this->action_query->per_page_media, $this->action_query->per_page_media );
462
  else
463
+ $pre_media = $this->model->{$query_function}( $context_id, ($this->action_query->page - 1) * $this->action_query->per_page_media, $this->action_query->per_page_media, $order_by );
464
 
465
+ $media_for_total_count = $this->model->{$query_function}( $context_id, false, false );
466
  } else {
467
  /**
468
  * fetch media entries from rtMedia context
config/index.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * To fake it is to stand guard over emptiness.
4
+ * Arthur Herzog
5
+ */
6
+ ?>
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
4
  Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
5
  Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
6
- Version: 3.0.0
7
  Author: rtCamp
8
  Text Domain: rtmedia
9
  Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
@@ -65,7 +65,7 @@ function rtmedia_autoloader( $class_name ) {
65
  $rtlibpath = array(
66
  'app/services/' . $class_name . '.php',
67
  'app/helper/' . $class_name . '.php',
68
- 'app/helper/db/' . $class_name . '.php',
69
  'app/admin/' . $class_name . '.php',
70
  'app/main/interactions/' . $class_name . '.php',
71
  'app/main/routers/' . $class_name . '.php',
@@ -80,17 +80,11 @@ function rtmedia_autoloader( $class_name ) {
80
  'app/main/deprecated/' . $class_name . '.php',
81
  'app/main/contexts/' . $class_name . '.php',
82
  'app/main/' . $class_name . '.php',
83
- 'app/main/activity/' . $class_name . '.php',
84
- 'app/main/profile/' . $class_name . '.php',
85
- 'app/main/group/' . $class_name . '.php',
86
- 'app/main/query/' . $class_name . '.php',
87
- 'app/main/privacy/' . $class_name . '.php',
88
- 'app/main/group/dummy/' . $class_name . '.php',
89
  'app/main/includes/' . $class_name . '.php',
90
  'app/main/widgets/' . $class_name . '.php',
91
  'app/main/upload/' . $class_name . '.php',
92
  'app/main/upload/processors/' . $class_name . '.php',
93
- 'app/main/template/' . $class_name . '.php',
94
  'app/log/' . $class_name . '.php',
95
  'app/importers/' . $class_name . '.php',
96
  );
3
  Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
4
  Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
5
  Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
6
+ Version: 3.0.1
7
  Author: rtCamp
8
  Text Domain: rtmedia
9
  Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
65
  $rtlibpath = array(
66
  'app/services/' . $class_name . '.php',
67
  'app/helper/' . $class_name . '.php',
68
+ 'app/helper/db/' . $class_name . '.php',
69
  'app/admin/' . $class_name . '.php',
70
  'app/main/interactions/' . $class_name . '.php',
71
  'app/main/routers/' . $class_name . '.php',
80
  'app/main/deprecated/' . $class_name . '.php',
81
  'app/main/contexts/' . $class_name . '.php',
82
  'app/main/' . $class_name . '.php',
 
 
 
 
 
 
83
  'app/main/includes/' . $class_name . '.php',
84
  'app/main/widgets/' . $class_name . '.php',
85
  'app/main/upload/' . $class_name . '.php',
86
  'app/main/upload/processors/' . $class_name . '.php',
87
+ 'app/main/template/' . $class_name . '.php',
88
  'app/log/' . $class_name . '.php',
89
  'app/importers/' . $class_name . '.php',
90
  );
log/index.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * I think about that "empty" space a lot. That emptiness is what allows for
4
+ * something to actually evolve in a natural way. I've had to learn that over
5
+ * the years - because one of the traps of being an artist is to always want to
6
+ * be creating, always wanting to produce.
7
+ * Meredith Monk
8
+ */
9
+ ?>
readme.txt CHANGED
@@ -6,7 +6,7 @@ License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: WordPress 3.5
8
  Tested up to: WordPress 3.5.2 + BuddyPress 1.7
9
- Stable tag: 3.0
10
 
11
  rtMedia adds albums, audio/video encoding, privacy/sharing, front-end uploads & more. All this works nicely on mobile/tablets devices.
12
 
@@ -125,7 +125,7 @@ If all your music files is mp3 formats and videos in mp4 formats, you may not ne
125
 
126
  **Important:** Please provide a **URL** of the site/web page when requesting support.
127
 
128
- We only provide support on our [free support forum] (http://rtcamp.com/groups/buddypress-media/forum/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media).
129
 
130
  == Installation ==
131
 
@@ -160,6 +160,11 @@ Please visit [rtMedia's Features page](http://rtcamp.com/buddypress-media/?utm_s
160
 
161
  Please visit [rtMedia's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
162
 
 
 
 
 
 
163
  = 3.0 =
164
  * Renamed to rtMedia for WordPress, BuddyPress and bbPress
165
  * Adds Anywhere uploader
@@ -458,8 +463,8 @@ Please visit [rtMedia's Roadmap page](http://rtcamp.com/buddypress-media/roadmap
458
 
459
  == Upgrade Notice ==
460
 
461
- = 3.0 =
462
- Complete rebuild. Please backup your database and files before updating the database.
463
 
464
  == Sponsors ==
465
 
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: WordPress 3.5
8
  Tested up to: WordPress 3.5.2 + BuddyPress 1.7
9
+ Stable tag: 3.0.1
10
 
11
  rtMedia adds albums, audio/video encoding, privacy/sharing, front-end uploads & more. All this works nicely on mobile/tablets devices.
12
 
125
 
126
  **Important:** Please provide a **URL** of the site/web page when requesting support.
127
 
128
+ We only provide support on our [free support forum](http://rtcamp.com/groups/buddypress-media/forum/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media).
129
 
130
  == Installation ==
131
 
160
 
161
  Please visit [rtMedia's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
162
 
163
+ = 3.0.1 =
164
+ * Legacy path support for Addon Updates
165
+ * Added database check for migration
166
+ * Fixed a few errors
167
+
168
  = 3.0 =
169
  * Renamed to rtMedia for WordPress, BuddyPress and bbPress
170
  * Adds Anywhere uploader
463
 
464
  == Upgrade Notice ==
465
 
466
+ = 3.0.1 =
467
+ Added database check. Fixed some errors. Please backup your database and files before updating the database.
468
 
469
  == Sponsors ==
470