rtMedia for WordPress, BuddyPress and bbPress - Version 3.2.10

Version Description

  • Add support in some strings translations thanks to rafaelfunchal for pull request
  • Bug Fixes
Download this release

Release Info

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

Code changes from version 3.2.9 to 3.2.10

Files changed (34) hide show
  1. app/admin/RTMediaAdmin.php +107 -70
  2. app/admin/RTMediaFormHandler.php +4 -4
  3. app/assets/css/admin.css +33 -5
  4. app/assets/js/admin.js +14 -0
  5. app/helper/RTMediaAddon.php +6 -6
  6. app/helper/RTMediaSettings.php +1 -1
  7. app/helper/RTMediaSupport.php +8 -8
  8. app/helper/rtFormInvalidArgumentsException.php +1 -2
  9. app/helper/rtPluginInfo.php +2 -2
  10. app/helper/rtPluginUpdateChecker.php +11 -13
  11. app/importers/BPMediaAlbumimporter.php +25 -25
  12. app/importers/RTMediaMigration.php +12 -12
  13. app/main/RTMedia.php +3 -3
  14. app/main/controllers/activity/RTMediaBuddyPressActivity.php +1 -1
  15. app/main/controllers/group/RTMediaGroupExtension.php +15 -15
  16. app/main/controllers/media/RTMediaAlbum.php +1 -1
  17. app/main/controllers/media/RTMediaFeatured.php +2 -2
  18. app/main/controllers/media/RTMediaLike.php +3 -3
  19. app/main/controllers/media/RTMediaMedia.php +6 -2
  20. app/main/controllers/privacy/RTMediaPrivacy.php +3 -3
  21. app/main/controllers/shortcodes/RTMediaUploadShortcode.php +1 -1
  22. app/main/controllers/template/RTMediaTemplate.php +6 -6
  23. app/main/controllers/template/rt-template-functions.php +173 -180
  24. app/main/controllers/upload/RTMediaUploadView.php +2 -2
  25. app/main/controllers/upload/processors/RTMediaUploadFile.php +9 -9
  26. index.php +1 -1
  27. languages/rtmedia-pt_BR.mo +0 -0
  28. languages/rtmedia.mo +0 -0
  29. languages/rtmedia.po +521 -216
  30. readme.txt +8 -4
  31. templates/media/album-gallery.php +4 -4
  32. templates/media/album-single-edit.php +6 -6
  33. templates/media/media-gallery.php +5 -5
  34. templates/media/media-single.php +1 -1
app/admin/RTMediaAdmin.php CHANGED
@@ -67,9 +67,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
67
add_action ( 'admin_enqueue_scripts', array( $this, 'ui' ) );
68
//bp_core_admin_hook();
69
add_action ( 'admin_menu', array( $this, 'menu' ), 1 );
70
-
71
- if ( current_user_can ( 'manage_options' ) )
72
- add_action ( 'bp_admin_tabs', array( $this, 'tab' ) );
73
if ( is_multisite () )
74
add_action ( 'network_admin_edit_rtmedia', array( $this, 'save_multisite_options' ) );
75
}
@@ -77,7 +75,24 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
77
$this->rtmedia_encoding = new RTMediaEncoding();
78
if(! defined("RTMEDIA_PRO_VERSION"))
79
add_action ( 'rtmedia_before_default_admin_widgets', array( $this, 'rtmedia_advertisement' ),1);
80
}
81
function rtmedia_advertisement(){ ?>
82
<div class='rtmedia-admin-ad'>
83
<a href='http://rtcamp.com/store/rtmedia-pro/' target='_blank' title='rtMedia Pro'>
@@ -117,7 +132,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
117
</table>
118
</div>
119
<div class="table table_discussion">
120
- <p class="sub"><?php _e ( "Usage Stats" ); ?></p>
121
<table>
122
<tbody> <?php
123
$sql = "select count(*) from {$wpdb->users}";
@@ -125,7 +140,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
125
?>
126
<tr>
127
<td class = "b"> <?php echo $results; ?> </td>
128
- <td class = "t"><?php _e ( "Total " ) ?></td>
129
</tr>
130
<?php
131
$sql = "select count(distinct media_author) from {$rtMedia_model->table_name}";
@@ -133,7 +148,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
133
?>
134
<tr>
135
<td class = "b"> <?php echo $results; ?> </td>
136
- <td class = "t"><?php _e ( "With Media" ) ?></td>
137
</tr>
138
<?php
139
$sql = "select count(*) from $wpdb->comments where comment_post_ID in (select media_id from {$rtMedia_model->table_name})";
@@ -141,7 +156,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
141
?>
142
<tr>
143
<td class = "b"> <?php echo $results; ?> </td>
144
- <td class = "t"><?php _e ( "Comments " ) ?></td>
145
</tr>
146
<?php
147
$sql = "select sum(likes) from {$rtMedia_model->table_name}";
@@ -149,7 +164,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
149
?>
150
<tr>
151
<td class = "b"> <?php echo $results; ?> </td>
152
- <td class = "t"><?php _e ( "Likes" ) ?></td>
153
</tr>
154
155
</tbody>
@@ -157,7 +172,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
157
</div>
158
<div class="versions">
159
<p>
160
- <b>rtMedia Links:</b> <a href="http://rtcamp.com">Homepage</a> | <a href="admin.php?page=rtmedia-support#rtmedia-general">Free Support</a> | <a href="http://rtcamp.com/rtmedia/addons/">Premium Addons</a>
161
</p>
162
</div>
163
</div>
@@ -167,7 +182,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
167
// Create the function use in the action hook
168
169
function add_dashboard_widgets () {
170
- wp_add_dashboard_widget ( 'rtmedia_dashboard_widget', __ ( 'Right Now in rtMedia' ), array( &$this, 'rtMedia_dashboard_widget_function' ) );
171
global $wp_meta_boxes;
172
173
// Get the regular dashboard widgets array
@@ -201,7 +216,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
201
202
$mime_type_array = explode("/", $post->post_mime_type);
203
if(is_array($mime_type_array) && $mime_type_array != "" && $mime_type_array[0] == "video") {
204
- $actions['reencode'] = "<a class='submitdelete' onclick='return rtmedia_regenerate_thumbs(".$post->ID.")' href='#'>Regenerate Thumbnail</a>";
205
}
206
return $actions;
207
}
@@ -222,36 +237,36 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
222
'title' => 'rtMedia',
223
'href' => admin_url ( 'admin.php?page=rtmedia-settings' ),
224
'meta' => array(
225
- 'title' => __ ( 'rtMedia' ),
226
),
227
) );
228
$admin_bar->add_menu ( array(
229
'id' => 'rt-media-dashborad',
230
'parent' => 'rtMedia',
231
- 'title' => __ ( 'Settings', "rtmedia" ),
232
'href' => admin_url ( 'admin.php?page=rtmedia-settings' ),
233
'meta' => array(
234
- 'title' => __ ( 'Settings' ),
235
'target' => '_self',
236
),
237
) );
238
$admin_bar->add_menu ( array(
239
'id' => 'rt-media-addons',
240
'parent' => 'rtMedia',
241
- 'title' => __ ( 'Addons', "rtmedia" ),
242
'href' => admin_url ( 'admin.php?page=rtmedia-addons' ),
243
'meta' => array(
244
- 'title' => __ ( 'Addons' ),
245
'target' => '_self',
246
),
247
) );
248
$admin_bar->add_menu ( array(
249
'id' => 'rt-media-support',
250
'parent' => 'rtMedia',
251
- 'title' => __ ( 'Support', "rtmedia" ),
252
'href' => admin_url ( 'admin.php?page=rtmedia-support' ),
253
'meta' => array(
254
- 'title' => __ ( 'Support' ),
255
'target' => '_self',
256
),
257
) );
@@ -301,10 +316,10 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
301
}
302
303
$rtmedia_admin_strings = array(
304
- 'no_refresh' => __ ( 'Please do not refresh this page.', 'rtmedia' ),
305
'something_went_wrong' => __ ( 'Something went wronng. Please <a href onclick="location.reload();">refresh</a> page.', 'rtmedia' ),
306
- 'are_you_sure' => __ ( 'This will subscribe you to the free plan.', 'rtmedia' ),
307
- 'disable_encoding' => __ ( 'Are you sure you want to disable the encoding service? Make sure you note your api key before disabling it incase you want to activate it in future.', 'rtmedia' )
308
);
309
wp_localize_script ( 'rtmedia-admin', 'rtmedia_admin_strings', $rtmedia_admin_strings );
310
wp_localize_script ( 'rtmedia-admin', 'settings_url', add_query_arg (
@@ -320,6 +335,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
320
wp_enqueue_style ( 'grid-foundation', RTMEDIA_URL . 'app/assets/css/grid-foundation.css', '', RTMEDIA_VERSION );
321
wp_enqueue_style ( 'rtmedia-main', RTMEDIA_URL . 'app/assets/css/main.css', '', RTMEDIA_VERSION );
322
wp_enqueue_style ( 'rtmedia-admin', RTMEDIA_URL . 'app/assets/css/admin.css', '', RTMEDIA_VERSION );
323
if(isset($_REQUEST['page']) && $_REQUEST['page']== "rtmedia-settings") {
324
wp_enqueue_style ( 'foundation-admin-css', RTMEDIA_URL . 'app/assets/css/settings.css', '', RTMEDIA_VERSION );
325
}
@@ -336,16 +352,16 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
336
*/
337
public function menu () {
338
add_menu_page ( 'rtMedia', 'rtMedia', 'manage_options', 'rtmedia-settings', array( $this, 'settings_page' ) );
339
- add_submenu_page ( 'rtmedia-settings', __ ( 'Settings', 'rtmedia' ), __ ( 'Settings', 'rtmedia' ), 'manage_options', 'rtmedia-settings', array( $this, 'settings_page' ) );
340
- add_submenu_page ( 'rtmedia-settings', __ ( 'Addons', 'rtmedia' ), __ ( 'Addons', 'rtmedia' ), 'manage_options', 'rtmedia-addons', array( $this, 'addons_page' ) );
341
- add_submenu_page ( 'rtmedia-settings', __ ( 'Support', 'rtmedia' ), __ ( 'Support ', 'rtmedia' ), 'manage_options', 'rtmedia-support', array( $this, 'support_page' ) );
342
if(! defined("RTMEDIA_PRO_VERSION")) {
343
- add_submenu_page ( 'rtmedia-settings', __ ( 'Premium', 'rtmedia' ), __ ( 'Premium ', 'rtmedia' ), 'manage_options', 'rtmedia-premium', array( $this, 'premium_page' ) );
344
}
345
346
$obj_encoding = new RTMediaEncoding(true);
347
if ($obj_encoding->api_key)
348
- add_submenu_page ( 'rtmedia-settings', __ ( 'Regenerate Thumbnail', 'rtmedia' ), __ ( 'Regen. Thumbnail ', 'rtmedia' ), 'manage_options', 'rtmedia-regenerate', array( $this, 'rt_regenerate_thumbnail' ) );
349
350
// add_submenu_page('rtmedia-settings', __('Importer', 'rtmedia'), __('Importer', 'rtmedia'), 'manage_options', 'rtmedia-importer', array($this, 'rt_importer_page'));
351
// if (!BPMediaPrivacy::is_installed()) {
@@ -358,7 +374,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
358
$done = 0;
359
?>
360
<div class="wrap">
361
- <h2> <?php _e("Regenerate Video Thumbnails"); ?> </h2>
362
<?php
363
if (isset($_REQUEST["media_ids"]) && trim($_REQUEST["media_ids"]) != "") {
364
$requested = false;
@@ -375,7 +391,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
375
<?php
376
if(!isset($requested)) {?>
377
<br /> <br />
378
- <input type="button" class="button button-primary" id="rt-start-media-regenerate" value ="<?php _e("Regenerate Pending Thumbnails"); ?>" />
379
<?php } ?>
380
<div id="rt-migration-progress">
381
<br /> <br />
@@ -383,9 +399,9 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
383
$temp = $prog->progress ( $done, $total );
384
$prog->progress_ui ( $temp, true );
385
?>
386
- <p> <?php _e("Total Videos") ?> : <span class='rt-total'><?php echo $total; ?></span></p>
387
- <p> <?php _e("Sent of regenerate thumbails") ?> : <span class='rt-done'>0</span></p>
388
- <p> <?php _e("Fail to regenerate thumbails") ?> : <span class='rt-fail'>0</span></p>
389
390
</div>
391
<?php
@@ -427,7 +443,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
427
}
428
});
429
} else {
430
- alert("<?php _e("Regenerate Video Thumbnails Done"); ?>");
431
}
432
}
433
function handle_regenrate_fail(){
@@ -462,7 +478,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
462
if(isset($videos_without_thumbs) && is_array($videos_without_thumbs) && sizeof($videos_without_thumbs) > 0 ) {
463
echo '<div class="error rtmedia-regenerate-video-thumb-error">
464
<p>
465
- ' . sprintf ( __ ( 'You have total '. sizeof($videos_without_thumbs) .' videos without thumbnails. Click <a href="'. admin_url('admin.php?page=rtmedia-regenerate') .'"> here </a> to generate thumbnails. <a href="#" onclick="rtmedia_hide_video_thumb_notice()" style="float:right">Hide</a>' ) ) . '
466
</p>
467
</div>';
468
@@ -505,7 +521,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
505
}
506
else {
507
$response['status'] = false;
508
- $response['message'] = "not a video ...";
509
}
510
echo json_encode($response);
511
die();
@@ -606,9 +622,9 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
606
<div class="clearfix">&nbsp;</div>
607
<div class="row">
608
<input type="hidden" name="rtmedia-options-save" value="true">
609
- <input type="submit" id="rtmedia-settings-submit" class="rtmedia-settings-submit button" value="<?php echo __ ( "Save Settings", "rtmedia" ); ?>">
610
</div>
611
- <div class="rt-link alignright"><?php _e ( 'By', 'rtmedia' ); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e ( 'Empowering The Web With WordPress', 'rtmedia' ); ?>"><img src="<?php echo RTMEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
612
</div>
613
</form><?php } else {
614
?>
@@ -627,7 +643,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
627
<?php
628
do_action ( 'rtmedia_admin_page_insert', $page );
629
?>
630
- <div class="rt-link alignright"><?php _e ( 'By', 'rtmedia' ); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e ( 'Empowering The Web With WordPress', 'rtmedia' ); ?>"><img src="<?php echo RTMEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
631
</div><?php
632
do_action ( 'rtmedia_admin_page_append', $page );
633
}
@@ -639,6 +655,27 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
639
<?php $this->admin_sidebar (); ?>
640
</div>
641
</div><!-- .metabox-holder -->
642
</div><!-- .bp-media-admin --><?php
643
}
644
@@ -681,17 +718,17 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
681
$tabs = array(
682
array(
683
'href' => get_admin_url ( null, add_query_arg ( array( 'page' => 'rtmedia-settings' ), 'admin.php' ) ),
684
- 'name' => __ ( 'Settings', 'rtmedia' ),
685
'slug' => 'rtmedia-settings'
686
),
687
array(
688
'href' => get_admin_url ( null, add_query_arg ( array( 'page' => 'rtmedia-addons' ), 'admin.php' ) ),
689
- 'name' => __ ( 'Addons', 'rtmedia' ),
690
'slug' => 'rtmedia-addons'
691
),
692
array(
693
'href' => get_admin_url ( null, add_query_arg ( array( 'page' => 'rtmedia-support' ), 'admin.php' ) ),
694
- 'name' => __ ( 'Support', 'rtmedia' ),
695
'slug' => 'rtmedia-support'
696
)//,
697
// array(
@@ -756,39 +793,39 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
756
$tabs[ ] = array(
757
'href' => '#rtmedia-general',
758
'icon' => 'icon-cogs',
759
- 'title' => __ ( 'rtMedia General', 'rtmedia' ),
760
- 'name' => __ ( 'General', 'rtmedia' ),
761
'callback' => array( 'RTMediaFormHandler', 'general_content' )
762
);
763
$tabs[ ] = array(
764
'href' => '#rtmedia-types',
765
'icon' => 'icon-film',
766
- 'title' => __ ( 'rtMedia Types', 'rtmedia' ),
767
- 'name' => __ ( 'Types', 'rtmedia' ),
768
'callback' => array( 'RTMediaFormHandler', 'types_content' )
769
);
770
771
$tabs[ ] = array(
772
'href' => '#rtmedia-sizes',
773
'icon' => 'icon-resize-full',
774
- 'title' => __ ( 'rtMedia Sizes', 'rtmedia' ),
775
- 'name' => __ ( 'Sizes', 'rtmedia' ),
776
'callback' => array( 'RTMediaFormHandler', 'sizes_content' )
777
);
778
779
$tabs[ ] = array(
780
'href' => '#rtmedia-privacy',
781
'icon' => 'icon-lock',
782
- 'title' => __ ( 'rtMedia Privacy', 'rtmedia' ),
783
- 'name' => __ ( 'Privacy', 'rtmedia' ),
784
'callback' => array( 'RTMediaFormHandler', 'privacy_content' )
785
);
786
if ( class_exists ( "BuddyPress" ) ) {
787
$tabs[ ] = array(
788
'href' => '#rtmedia-bp',
789
'icon' => 'icon-group',
790
- 'title' => __ ( 'rtMedia BuddyPress', 'rtmedia' ),
791
- 'name' => __ ( 'BuddyPress', 'rtmedia' ),
792
'callback' => array( 'RTMediaFormHandler', 'buddypress_content' ) //change it to BuddyPress Content
793
);
794
}
@@ -894,21 +931,21 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
894
// $contest = '<a target="_blank" href="http://rtcamp.com/news/buddypress-media-review-contest/?utm_source=dashboard&#038;utm_medium=plugin&#038;utm_campaign=buddypress-media"><img src="'.RTMEDIA_URL.'app/assets/img/bpm-contest-banner.jpg" alt="BuddyPress Media Review Contest" /></a>';
895
// new BPMediaAdminWidget('bpm-contest', __('', 'rtmedia'), $contest);
896
897
- $message = sprintf ( __ ( 'I use @buddypressmedia http://goo.gl/8Upmv on %s', 'rtmedia' ), home_url () );
898
$addons = '<div id="social" class="row">
899
- <label class="columns large-6 large-offset-3" for="bp-media-add-linkback"><input' . checked ( rtmedia_get_site_option ( 'rtmedia-add-linkback', false ), true, false ) . ' type="checkbox" name="bp-media-add-linkback" value="1" id="bp-media-add-linkback"/> ' . __ ( 'Add link to footer', 'rtmedia' ) . '</label>
900
<div class="row">
901
<div class="columns large-6"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Frtcamp.com%2Fbuddypress-media%2F&amp;send=false&amp;layout=button_count&amp;width=72&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:21px; margin-top: 5px;" allowTransparency="true"></iframe></div>
902
<div class="columns large-6"><a href="https://www.facebook.com/sharer/sharer.php?u=http://rtcamp.com/buddypress-media/" class="button" target="_blank"> <i class="icon-facebook"></i> ' . __ ( 'Share', 'rtmedia' ) . '</a></div>
903
<div class="columns large-6"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="//platform.twitter.com/widgets/follow_button.html?screen_name=buddypressmedia&show_count=false" style="width:62px; height:21px; margin-top: 5px;"></iframe></div>
904
- <div class="columns large-6"><a href="http://twitter.com/home/?status=' . $message . '" class="button button-tweet" target= "_blank"><i class="icon-twitter"></i> ' . __ ( 'Tweet', 'rtmedia' ) . '</a></div>
905
- <div class="columns large-6"><a href="http://wordpress.org/support/view/plugin-reviews/buddypress-media?rate=5#postform" class="button bpm-wp-button" target= "_blank"><span class="bpm-wp-icon">&nbsp;</span> ' . __ ( 'Review', 'rtmedia' ) . '</a></div>
906
<div class="columns large-6"><a href="' . sprintf ( '%s', 'http://feeds.feedburner.com/rtcamp/' ) . '" title="' . __ ( 'Subscribe to our feeds', 'rtmedia' ) . '" class="button" target="_blank"><i class="bp-media-rss icon-rss"></i> ' . __ ( 'Feeds', 'rtmedia' ) . '</a></div>
907
</div>
908
</div>';
909
//<li><a href="' . sprintf('%s', 'http://www.facebook.com/rtCamp.solutions/') . '" title="' . __('Become a fan on Facebook', 'rtmedia') . '" class="bp-media-facebook bp-media-social">' . __('Facebook', 'rtmedia') . '</a></li>
910
//<li><a href="' . sprintf('%s', 'https://twitter.com/rtcamp/') . '" title="' . __('Follow us on Twitter', 'rtmedia') . '" class="bp-media-twitter bp-media-social">' . __('Twitter', 'rtmedia') . '</a></li> ;
911
- new RTMediaAdminWidget ( 'spread-the-word', __ ( 'Spread the Word', 'rtmedia' ), $addons );
912
913
// $donate = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
914
// <!-- Identify your business so that you can collect the payments. -->
@@ -940,13 +977,13 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
940
<div class="response" id="mce-error-response" style="display:none"></div>
941
<div class="response" id="mce-success-response" style="display:none"></div>
942
</div>
943
- <input type="submit" value="' . __ ( 'Subscribe', 'rtmedia' ) . '" name="subscribe" id="mc-embedded-subscribe" class="button">
944
</div>
945
</form>';
946
- new RTMediaAdminWidget ( 'branding', __ ( 'Subscribe', 'rtmedia' ), $branding );
947
948
$news = '<img src ="' . admin_url ( '/images/wpspin_light.gif' ) . '" /> Loading...';
949
- new RTMediaAdminWidget ( 'latest-news', __ ( 'Latest News', 'rtmedia' ), $news );
950
do_action ( 'rtmedia_after_default_admin_widgets' );
951
}
952
@@ -965,7 +1002,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
965
} else {
966
rtmedia_update_site_option ( 'rtmedia-survey', 0 );
967
}
968
- echo 'Thank you for your time.';
969
die;
970
}
971
@@ -977,7 +1014,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
977
978
public function plugin_meta_premium_addon_link ( $plugin_meta, $plugin_file, $plugin_data, $status ) {
979
if ( plugin_basename ( RTMEDIA_PATH . 'index.php' ) == $plugin_file )
980
- $plugin_meta[ ] = '<a href="https://rtcamp.com/store/product-category/buddypress/?utm_source=dashboard&#038;utm_medium=plugin&#038;utm_campaign=buddypress-media" title="Premium Add-ons">Premium Add-ons</a>';
981
return $plugin_meta;
982
}
983
@@ -991,8 +1028,8 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
991
if ( ! empty ( $not_supported_image ) ) {
992
echo '<div class="error upload-filetype-network-settings-error">
993
<p>
994
- ' . sprintf ( __ ( 'You have images enabled on rtMedia but your network allowed filetypes does not allow uploading of %s. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia' ), implode ( ', ', $not_supported_image ), network_admin_url ( 'settings.php#upload_filetypes' ) ) . '
995
- <br /><strong>' . __ ( 'Recommended', 'rtmedia' ) . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __ ( 'Update Network Settings Automatically', 'rtmedia' ) . '"> <img style="display:none;" src="' . admin_url ( 'images/wpspin_light.gif' ) . '" />
996
</p>
997
</div>';
998
$flag = true;
@@ -1002,8 +1039,8 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
1002
if ( ! in_array ( 'mp4', $upload_filetypes ) ) {
1003
echo '<div class="error upload-filetype-network-settings-error">
1004
<p>
1005
- ' . sprintf ( __ ( 'You have video enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of mp4. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia' ), network_admin_url ( 'settings.php#upload_filetypes' ) ) . '
1006
- <br /><strong>' . __ ( 'Recommended', 'rtmedia' ) . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __ ( 'Update Network Settings Automatically', 'rtmedia' ) . '"> <img style="display:none;" src="' . admin_url ( 'images/wpspin_light.gif' ) . '" />
1007
</p>
1008
</div>';
1009
$flag = true;
@@ -1011,8 +1048,8 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
1011
}
1012
if ( isset ( $rtmedia->options[ 'audio_enabled' ] ) && $rtmedia->options[ 'audio_enabled' ] ) {
1013
if ( ! in_array ( 'mp3', $upload_filetypes ) ) {
1014
- echo '<div class="error upload-filetype-network-settings-error"><p>' . sprintf ( __ ( 'You have audio enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of mp3. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia' ), network_admin_url ( 'settings.php#upload_filetypes' ) ) . '
1015
- <br /><strong>' . __ ( 'Recommended', 'rtmedia' ) . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __ ( 'Update Network Settings Automatically', 'rtmedia' ) . '"> <img style="display:none;" src="' . admin_url ( 'images/wpspin_light.gif' ) . '" />
1016
</p>
1017
</div>';
1018
$flag = true;
@@ -1026,7 +1063,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
1026
jQuery('.update-network-settings-upload-filetypes').prop('disabled', true);
1027
jQuery.post(ajaxurl, {action: 'rtmedia_correct_upload_filetypes'}, function(response) {
1028
if (response) {
1029
- jQuery('.upload-filetype-network-settings-error:first').after('<div style="display: none;" class="updated rtmedia-network-settings-updated-successfully"><p><?php _e ( 'Network settings updated successfully.', 'rtmedia' ); ?></p></div>')
1030
jQuery('.upload-filetype-network-settings-error').remove();
1031
jQuery('.bp-media-network-settings-updated-successfully').show();
1032
}
@@ -1129,10 +1166,10 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
1129
jQuery.post(ajaxurl,data, function(data) {
1130
data = JSON.parse(data);
1131
if(data.status === true) {
1132
- alert("<?php _e('Video is sent to generate thumbnails.') ?>");
1133
}
1134
else {
1135
- alert("<?php _e('Video can\'t be sent to generate thumbnails.') ?>");
1136
}
1137
});
1138
}
@@ -1146,7 +1183,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
1146
?>
1147
<script type="text/javascript">
1148
jQuery(document).ready(function($){
1149
- $('select[name^="action"] option:last-child').before('<option value="bulk_video_regenerate_thumbnails"><?php echo esc_attr( __( 'Regenerate Video Thumbnails', 'regenerate-video-thumbnails' ) ); ?></option>');
1150
});
1151
</script>
1152
<?php
67
add_action ( 'admin_enqueue_scripts', array( $this, 'ui' ) );
68
//bp_core_admin_hook();
69
add_action ( 'admin_menu', array( $this, 'menu' ), 1 );
70
+ add_action( 'init', array( $this,'bp_admin_tabs' ) );
71
if ( is_multisite () )
72
add_action ( 'network_admin_edit_rtmedia', array( $this, 'save_multisite_options' ) );
73
}
75
$this->rtmedia_encoding = new RTMediaEncoding();
76
if(! defined("RTMEDIA_PRO_VERSION"))
77
add_action ( 'rtmedia_before_default_admin_widgets', array( $this, 'rtmedia_advertisement' ),1);
78
+ add_action ( 'wp_ajax_rtmedia_addon_popup_not_show_again', array( $this, 'rtmedia_addon_popup_not_show_again' ), 1 );
79
}
80
+
81
+ function rtmedia_addon_popup_not_show_again() {
82
+ if( rtmedia_update_site_option( "rtmedia-addon-popup", "hide" ) ) {
83
+ echo "1";
84
+ } else {
85
+ echo "0";
86
+ }
87
+ die();
88
+ }
89
+
90
+ function bp_admin_tabs() {
91
+ if ( current_user_can ( 'manage_options' ) ) {
92
+ add_action ( 'bp_admin_tabs', array( $this, 'tab' ) );
93
+ }
94
+ }
95
+
96
function rtmedia_advertisement(){ ?>
97
<div class='rtmedia-admin-ad'>
98
<a href='http://rtcamp.com/store/rtmedia-pro/' target='_blank' title='rtMedia Pro'>
132
</table>
133
</div>
134
<div class="table table_discussion">
135
+ <p class="sub"><?php _e( 'Usage Stats', 'rtmedia' ); ?></p>
136
<table>
137
<tbody> <?php
138
$sql = "select count(*) from {$wpdb->users}";
140
?>
141
<tr>
142
<td class = "b"> <?php echo $results; ?> </td>
143
+ <td class = "t"><?php _e( 'Total ', 'rtmedia' ) ?></td>
144
</tr>
145
<?php
146
$sql = "select count(distinct media_author) from {$rtMedia_model->table_name}";
148
?>
149
<tr>
150
<td class = "b"> <?php echo $results; ?> </td>
151
+ <td class = "t"><?php _e ( 'With Media', 'rtmedia' ) ?></td>
152
</tr>
153
<?php
154
$sql = "select count(*) from $wpdb->comments where comment_post_ID in (select media_id from {$rtMedia_model->table_name})";
156
?>
157
<tr>
158
<td class = "b"> <?php echo $results; ?> </td>
159
+ <td class = "t"><?php _e ( 'Comments ', 'rtmedia' ) ?></td>
160
</tr>
161
<?php
162
$sql = "select sum(likes) from {$rtMedia_model->table_name}";
164
?>
165
<tr>
166
<td class = "b"> <?php echo $results; ?> </td>
167
+ <td class = "t"><?php _e( 'Likes', 'rtmedia' ) ?></td>
168
</tr>
169
170
</tbody>
172
</div>
173
<div class="versions">
174
<p>
175
+ <b>rtMedia Links:</b> <a href="http://rtcamp.com"><?php _e( 'Homepage', 'rtmedia' ); ?></a> | <a href="admin.php?page=rtmedia-support#rtmedia-general"><?php _e( 'Free Support', 'rtmedia' ); ?></a> | <a href="http://rtcamp.com/rtmedia/addons/"><?php _e( 'Premium Addons', 'rtmedia' ); ?></a>
176
</p>
177
</div>
178
</div>
182
// Create the function use in the action hook
183
184
function add_dashboard_widgets () {
185
+ wp_add_dashboard_widget ( 'rtmedia_dashboard_widget', __( 'Right Now in rtMedia', 'rtmedia' ), array( &$this, 'rtMedia_dashboard_widget_function' ) );
186
global $wp_meta_boxes;
187
188
// Get the regular dashboard widgets array
216
217
$mime_type_array = explode("/", $post->post_mime_type);
218
if(is_array($mime_type_array) && $mime_type_array != "" && $mime_type_array[0] == "video") {
219
+ $actions['reencode'] = "<a class='submitdelete' onclick='return rtmedia_regenerate_thumbs(".$post->ID.")' href='#'>". __( 'Regenerate Thumbnail', 'rtmedia' ) ."</a>";
220
}
221
return $actions;
222
}
237
'title' => 'rtMedia',
238
'href' => admin_url ( 'admin.php?page=rtmedia-settings' ),
239
'meta' => array(
240
+ 'title' => __( 'rtMedia', 'rtmedia' ),
241
),
242
) );
243
$admin_bar->add_menu ( array(
244
'id' => 'rt-media-dashborad',
245
'parent' => 'rtMedia',
246
+ 'title' => __( 'Settings', 'rtmedia' ),
247
'href' => admin_url ( 'admin.php?page=rtmedia-settings' ),
248
'meta' => array(
249
+ 'title' => __( 'Settings', 'rtmedia' ),
250
'target' => '_self',
251
),
252
) );
253
$admin_bar->add_menu ( array(
254
'id' => 'rt-media-addons',
255
'parent' => 'rtMedia',
256
+ 'title' => __( 'Addons', "rtmedia" ),
257
'href' => admin_url ( 'admin.php?page=rtmedia-addons' ),
258
'meta' => array(
259
+ 'title' => __( 'Addons', 'rtmedia' ),
260
'target' => '_self',
261
),
262
) );
263
$admin_bar->add_menu ( array(
264
'id' => 'rt-media-support',
265
'parent' => 'rtMedia',
266
+ 'title' => __ ( 'Support', 'rtmedia' ),
267
'href' => admin_url ( 'admin.php?page=rtmedia-support' ),
268
'meta' => array(
269
+ 'title' => __ ( 'Support', 'rtmedia' ),
270
'target' => '_self',
271
),
272
) );
316
}
317
318
$rtmedia_admin_strings = array(
319
+ 'no_refresh' => __( 'Please do not refresh this page.', 'rtmedia' ),
320
'something_went_wrong' => __ ( 'Something went wronng. Please <a href onclick="location.reload();">refresh</a> page.', 'rtmedia' ),
321
+ 'are_you_sure' => __( 'This will subscribe you to the free plan.', 'rtmedia' ),
322
+ 'disable_encoding' => __( 'Are you sure you want to disable the encoding service? Make sure you note your api key before disabling it incase you want to activate it in future.', 'rtmedia' )
323
);
324
wp_localize_script ( 'rtmedia-admin', 'rtmedia_admin_strings', $rtmedia_admin_strings );
325
wp_localize_script ( 'rtmedia-admin', 'settings_url', add_query_arg (
335
wp_enqueue_style ( 'grid-foundation', RTMEDIA_URL . 'app/assets/css/grid-foundation.css', '', RTMEDIA_VERSION );
336
wp_enqueue_style ( 'rtmedia-main', RTMEDIA_URL . 'app/assets/css/main.css', '', RTMEDIA_VERSION );
337
wp_enqueue_style ( 'rtmedia-admin', RTMEDIA_URL . 'app/assets/css/admin.css', '', RTMEDIA_VERSION );
338
+ wp_enqueue_style ( 'rtmedia-admin', RTMEDIA_URL . 'app/assets/css/rtmedia-addon-popup.css', '', RTMEDIA_VERSION );
339
if(isset($_REQUEST['page']) && $_REQUEST['page']== "rtmedia-settings") {
340
wp_enqueue_style ( 'foundation-admin-css', RTMEDIA_URL . 'app/assets/css/settings.css', '', RTMEDIA_VERSION );
341
}
352
*/
353
public function menu () {
354
add_menu_page ( 'rtMedia', 'rtMedia', 'manage_options', 'rtmedia-settings', array( $this, 'settings_page' ) );
355
+ add_submenu_page ( 'rtmedia-settings', __( 'Settings', 'rtmedia' ), __( 'Settings', 'rtmedia' ), 'manage_options', 'rtmedia-settings', array( $this, 'settings_page' ) );
356
+ add_submenu_page ( 'rtmedia-settings', __( 'Addons', 'rtmedia' ), __( 'Addons', 'rtmedia' ), 'manage_options', 'rtmedia-addons', array( $this, 'addons_page' ) );
357
+ add_submenu_page ( 'rtmedia-settings', __( 'Support', 'rtmedia' ), __( 'Support', 'rtmedia' ), 'manage_options', 'rtmedia-support', array( $this, 'support_page' ) );
358
if(! defined("RTMEDIA_PRO_VERSION")) {
359
+ add_submenu_page ( 'rtmedia-settings', __( 'Premium', 'rtmedia' ), __( 'Premium ', 'rtmedia' ), 'manage_options', 'rtmedia-premium', array( $this, 'premium_page' ) );
360
}
361
362
$obj_encoding = new RTMediaEncoding(true);
363
if ($obj_encoding->api_key)
364
+ add_submenu_page ( 'rtmedia-settings', __( 'Regenerate Thumbnail', 'rtmedia' ), __( 'Regen. Thumbnail ', 'rtmedia' ), 'manage_options', 'rtmedia-regenerate', array( $this, 'rt_regenerate_thumbnail' ) );
365
366
// add_submenu_page('rtmedia-settings', __('Importer', 'rtmedia'), __('Importer', 'rtmedia'), 'manage_options', 'rtmedia-importer', array($this, 'rt_importer_page'));
367
// if (!BPMediaPrivacy::is_installed()) {
374
$done = 0;
375
?>
376
<div class="wrap">
377
+ <h2> <?php _e( 'Regenerate Video Thumbnails', 'rtmedia' ); ?> </h2>
378
<?php
379
if (isset($_REQUEST["media_ids"]) && trim($_REQUEST["media_ids"]) != "") {
380
$requested = false;
391
<?php
392
if(!isset($requested)) {?>
393
<br /> <br />
394
+ <input type="button" class="button button-primary" id="rt-start-media-regenerate" value ="<?php _e( 'Regenerate Pending Thumbnails', 'rtmedia' ); ?>" />
395
<?php } ?>
396
<div id="rt-migration-progress">
397
<br /> <br />
399
$temp = $prog->progress ( $done, $total );
400
$prog->progress_ui ( $temp, true );
401
?>
402
+ <p> <?php _e( 'Total Videos', 'rtmedia' ) ?> : <span class='rt-total'><?php echo $total; ?></span></p>
403
+ <p> <?php _e( 'Sent of regenerate thumbails', 'rtmedia' ) ?> : <span class='rt-done'>0</span></p>
404
+ <p> <?php _e( 'Fail to regenerate thumbails', 'rtmedia' ) ?> : <span class='rt-fail'>0</span></p>
405
406
</div>
407
<?php
443
}
444
});
445
} else {
446
+ alert("<?php _e( 'Regenerate Video Thumbnails Done', 'rtmedia' ); ?>");
447
}
448
}
449
function handle_regenrate_fail(){
478
if(isset($videos_without_thumbs) && is_array($videos_without_thumbs) && sizeof($videos_without_thumbs) > 0 ) {
479
echo '<div class="error rtmedia-regenerate-video-thumb-error">
480
<p>
481
+ '. sprintf ( __( "You have total %s videos without thumbnails. Click <a href='%s'> here </a> to generate thumbnails. <a href='#' onclick='rtmedia_hide_video_thumb_notice()' style='float:right'>Hide</a>", 'rtmedia' ), sizeof($videos_without_thumbs), admin_url('admin.php?page=rtmedia-regenerate') ) .'
482
</p>
483
</div>';
484
521
}
522
else {
523
$response['status'] = false;
524
+ $response['message'] = __( 'not a video ...', 'rtmedia' );
525
}
526
echo json_encode($response);
527
die();
622
<div class="clearfix">&nbsp;</div>
623
<div class="row">
624
<input type="hidden" name="rtmedia-options-save" value="true">
625
+ <input type="submit" id="rtmedia-settings-submit" class="rtmedia-settings-submit button" value="<?php _e( 'Save Settings', 'rtmedia' ); ?>">
626
</div>
627
+ <div class="rt-link alignright"><?php _e( 'By', 'rtmedia' ); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e ( 'Empowering The Web With WordPress', 'rtmedia' ); ?>"><img src="<?php echo RTMEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
628
</div>
629
</form><?php } else {
630
?>
643
<?php
644
do_action ( 'rtmedia_admin_page_insert', $page );
645
?>
646
+ <div class="rt-link alignright"><?php _e( 'By', 'rtmedia' ); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e( 'Empowering The Web With WordPress', 'rtmedia' ); ?>"><img src="<?php echo RTMEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
647
</div><?php
648
do_action ( 'rtmedia_admin_page_append', $page );
649
}
655
<?php $this->admin_sidebar (); ?>
656
</div>
657
</div><!-- .metabox-holder -->
658
+ <!-- rtmedia addon popup -->
659
+ <?php
660
+ $site_option = rtmedia_get_site_option("rtmedia-addon-popup");
661
+ if(!$site_option || $site_option != "hide") {
662
+ rtmedia_update_site_option("rtmedia-addon-popup", "show");
663
+ ?>
664
+ <?php add_thickbox(); ?>
665
+ <div id="rtmedia-addon-add-parent" style="display:none;">
666
+ <div id="rtmedia-addon-add-container">
667
+ <div style="text-align:right"><a href="#" id="rtmedia-addon-do-not-show" onclick="return rtmedia_addon_do_not_show();"><?php _e('Do not show again','rtmedia');?></a></div>
668
+ <h1 id="rtmedia-flat-50-message"><?php _e('Flat','rtmedia'); ?> <span class="alert"><?php _e('50%','rtmedia'); ?></span> <?php _e('Discount On All rtMedia Addons','rtmedia'); ?></h1>
669
+ <h3 id="rtmedia-flat-50-link"><span class="regular"><a href="http://rtcamp.com/promo/flat-50-discount-rtcamp-products" target="_blank"><?php _e('Read More','rtmedia') ?></a><span></h3>
670
+ <h2 id="rtmedia-flat-50-code"><span class="regular"><?php _e('Use Promo Code:','rtmedia'); ?></span> <span class="alert">RTMEDIA50</span></h2>
671
+ <h5 id="rtmedia-flat-50-valid"><span class="regular"> <?php _e('Offer Valid Till:','rtmedia');?> December 3, 11:59PM PST</span></h5>
672
+ </div>
673
+ </div>
674
+ <a href="#TB_inline?width=600&height=170&inlineId=rtmedia-addon-add-parent" style="display:none;" class="thickbox rtmedia-addon-thickbox">rtMedia Addons</a>
675
+ <?php
676
+ }
677
+ ?>
678
+ <!-- E.O. rtMedia addon popup -->
679
</div><!-- .bp-media-admin --><?php
680
}
681
718
$tabs = array(
719
array(
720
'href' => get_admin_url ( null, add_query_arg ( array( 'page' => 'rtmedia-settings' ), 'admin.php' ) ),
721
+ 'name' => __( 'Settings', 'rtmedia' ),
722
'slug' => 'rtmedia-settings'
723
),
724
array(
725
'href' => get_admin_url ( null, add_query_arg ( array( 'page' => 'rtmedia-addons' ), 'admin.php' ) ),
726
+ 'name' => __( 'Addons', 'rtmedia' ),
727
'slug' => 'rtmedia-addons'
728
),
729
array(
730
'href' => get_admin_url ( null, add_query_arg ( array( 'page' => 'rtmedia-support' ), 'admin.php' ) ),
731
+ 'name' => __( 'Support', 'rtmedia' ),
732
'slug' => 'rtmedia-support'
733
)//,
734
// array(
793
$tabs[ ] = array(
794
'href' => '#rtmedia-general',
795
'icon' => 'icon-cogs',
796
+ 'title' => __( 'rtMedia General', 'rtmedia' ),
797
+ 'name' => __( 'General', 'rtmedia' ),
798
'callback' => array( 'RTMediaFormHandler', 'general_content' )
799
);
800
$tabs[ ] = array(
801
'href' => '#rtmedia-types',
802
'icon' => 'icon-film',
803
+ 'title' => __( 'rtMedia Types', 'rtmedia' ),
804
+ 'name' => __( 'Types', 'rtmedia' ),
805
'callback' => array( 'RTMediaFormHandler', 'types_content' )
806
);
807
808
$tabs[ ] = array(
809
'href' => '#rtmedia-sizes',
810
'icon' => 'icon-resize-full',
811
+ 'title' => __( 'rtMedia Sizes', 'rtmedia' ),
812
+ 'name' => __( 'Sizes', 'rtmedia' ),
813
'callback' => array( 'RTMediaFormHandler', 'sizes_content' )
814
);
815
816
$tabs[ ] = array(
817
'href' => '#rtmedia-privacy',
818
'icon' => 'icon-lock',
819
+ 'title' => __( 'rtMedia Privacy', 'rtmedia' ),
820
+ 'name' => __( 'Privacy', 'rtmedia' ),
821
'callback' => array( 'RTMediaFormHandler', 'privacy_content' )
822
);
823
if ( class_exists ( "BuddyPress" ) ) {
824
$tabs[ ] = array(
825
'href' => '#rtmedia-bp',
826
'icon' => 'icon-group',
827
+ 'title' => __( 'rtMedia BuddyPress', 'rtmedia' ),
828
+ 'name' => __( 'BuddyPress', 'rtmedia' ),
829
'callback' => array( 'RTMediaFormHandler', 'buddypress_content' ) //change it to BuddyPress Content
830
);
831
}
931
// $contest = '<a target="_blank" href="http://rtcamp.com/news/buddypress-media-review-contest/?utm_source=dashboard&#038;utm_medium=plugin&#038;utm_campaign=buddypress-media"><img src="'.RTMEDIA_URL.'app/assets/img/bpm-contest-banner.jpg" alt="BuddyPress Media Review Contest" /></a>';
932
// new BPMediaAdminWidget('bpm-contest', __('', 'rtmedia'), $contest);
933
934
+ $message = sprintf ( __( 'I use @buddypressmedia http://goo.gl/8Upmv on %s', 'rtmedia' ), home_url() );
935
$addons = '<div id="social" class="row">
936
+ <label class="columns large-6 large-offset-3" for="bp-media-add-linkback"><input' . checked ( rtmedia_get_site_option ( 'rtmedia-add-linkback', false ), true, false ) . ' type="checkbox" name="bp-media-add-linkback" value="1" id="bp-media-add-linkback"/> ' . __( 'Add link to footer', 'rtmedia' ) . '</label>
937
<div class="row">
938
<div class="columns large-6"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Frtcamp.com%2Fbuddypress-media%2F&amp;send=false&amp;layout=button_count&amp;width=72&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:21px; margin-top: 5px;" allowTransparency="true"></iframe></div>
939
<div class="columns large-6"><a href="https://www.facebook.com/sharer/sharer.php?u=http://rtcamp.com/buddypress-media/" class="button" target="_blank"> <i class="icon-facebook"></i> ' . __ ( 'Share', 'rtmedia' ) . '</a></div>
940
<div class="columns large-6"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="//platform.twitter.com/widgets/follow_button.html?screen_name=buddypressmedia&show_count=false" style="width:62px; height:21px; margin-top: 5px;"></iframe></div>
941
+ <div class="columns large-6"><a href="http://twitter.com/home/?status=' . $message . '" class="button button-tweet" target= "_blank"><i class="icon-twitter"></i> ' . __( 'Tweet', 'rtmedia' ) . '</a></div>
942
+ <div class="columns large-6"><a href="http://wordpress.org/support/view/plugin-reviews/buddypress-media?rate=5#postform" class="button bpm-wp-button" target= "_blank"><span class="bpm-wp-icon">&nbsp;</span> ' . __( 'Review', 'rtmedia' ) . '</a></div>
943
<div class="columns large-6"><a href="' . sprintf ( '%s', 'http://feeds.feedburner.com/rtcamp/' ) . '" title="' . __ ( 'Subscribe to our feeds', 'rtmedia' ) . '" class="button" target="_blank"><i class="bp-media-rss icon-rss"></i> ' . __ ( 'Feeds', 'rtmedia' ) . '</a></div>
944
</div>
945
</div>';
946
//<li><a href="' . sprintf('%s', 'http://www.facebook.com/rtCamp.solutions/') . '" title="' . __('Become a fan on Facebook', 'rtmedia') . '" class="bp-media-facebook bp-media-social">' . __('Facebook', 'rtmedia') . '</a></li>
947
//<li><a href="' . sprintf('%s', 'https://twitter.com/rtcamp/') . '" title="' . __('Follow us on Twitter', 'rtmedia') . '" class="bp-media-twitter bp-media-social">' . __('Twitter', 'rtmedia') . '</a></li> ;
948
+ new RTMediaAdminWidget ( 'spread-the-word', __( 'Spread the Word', 'rtmedia' ), $addons );
949
950
// $donate = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
951
// <!-- Identify your business so that you can collect the payments. -->
977
<div class="response" id="mce-error-response" style="display:none"></div>
978
<div class="response" id="mce-success-response" style="display:none"></div>
979
</div>
980
+ <input type="submit" value="' . __( 'Subscribe', 'rtmedia' ) . '" name="subscribe" id="mc-embedded-subscribe" class="button">
981
</div>
982
</form>';
983
+ new RTMediaAdminWidget ( 'branding', __( 'Subscribe', 'rtmedia' ), $branding );
984
985
$news = '<img src ="' . admin_url ( '/images/wpspin_light.gif' ) . '" /> Loading...';
986
+ new RTMediaAdminWidget ( 'latest-news', __( 'Latest News', 'rtmedia' ), $news );
987
do_action ( 'rtmedia_after_default_admin_widgets' );
988
}
989
1002
} else {
1003
rtmedia_update_site_option ( 'rtmedia-survey', 0 );
1004
}
1005
+ _e( 'Thank you for your time.', 'rtmedia' );
1006
die;
1007
}
1008
1014
1015
public function plugin_meta_premium_addon_link ( $plugin_meta, $plugin_file, $plugin_data, $status ) {
1016
if ( plugin_basename ( RTMEDIA_PATH . 'index.php' ) == $plugin_file )
1017
+ $plugin_meta[ ] = '<a href="https://rtcamp.com/store/product-category/buddypress/?utm_source=dashboard&#038;utm_medium=plugin&#038;utm_campaign=buddypress-media" title="'. __( 'Premium Add-ons', 'rtmedia' ) .'">'. __( 'Premium Add-ons', 'rtmedia' ) .'</a>';
1018
return $plugin_meta;
1019
}
1020
1028
if ( ! empty ( $not_supported_image ) ) {
1029
echo '<div class="error upload-filetype-network-settings-error">
1030
<p>
1031
+ ' . sprintf ( __( 'You have images enabled on rtMedia but your network allowed filetypes does not allow uploading of %s. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia' ), implode ( ', ', $not_supported_image ), network_admin_url ( 'settings.php#upload_filetypes' ) ) . '
1032
+ <br /><strong>' . __( 'Recommended', 'rtmedia' ) . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __( 'Update Network Settings Automatically', 'rtmedia' ) . '"> <img style="display:none;" src="' . admin_url ( 'images/wpspin_light.gif' ) . '" />
1033
</p>
1034
</div>';
1035
$flag = true;
1039
if ( ! in_array ( 'mp4', $upload_filetypes ) ) {
1040
echo '<div class="error upload-filetype-network-settings-error">
1041
<p>
1042
+ ' . sprintf ( __( 'You have video enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of mp4. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia' ), network_admin_url ( 'settings.php#upload_filetypes' ) ) . '
1043
+ <br /><strong>' . __( 'Recommended', 'rtmedia' ) . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __( 'Update Network Settings Automatically', 'rtmedia' ) . '"> <img style="display:none;" src="' . admin_url ( 'images/wpspin_light.gif' ) . '" />
1044
</p>
1045
</div>';
1046
$flag = true;
1048
}
1049
if ( isset ( $rtmedia->options[ 'audio_enabled' ] ) && $rtmedia->options[ 'audio_enabled' ] ) {
1050
if ( ! in_array ( 'mp3', $upload_filetypes ) ) {
1051
+ echo '<div class="error upload-filetype-network-settings-error"><p>' . sprintf ( __( 'You have audio enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of mp3. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia' ), network_admin_url ( 'settings.php#upload_filetypes' ) ) . '
1052
+ <br /><strong>' . __( 'Recommended', 'rtmedia' ) . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __( 'Update Network Settings Automatically', 'rtmedia' ) . '"> <img style="display:none;" src="' . admin_url ( 'images/wpspin_light.gif' ) . '" />
1053
</p>
1054
</div>';
1055
$flag = true;
1063
jQuery('.update-network-settings-upload-filetypes').prop('disabled', true);
1064
jQuery.post(ajaxurl, {action: 'rtmedia_correct_upload_filetypes'}, function(response) {
1065
if (response) {
1066
+ jQuery('.upload-filetype-network-settings-error:first').after('<div style="display: none;" class="updated rtmedia-network-settings-updated-successfully"><p><?php _e( 'Network settings updated successfully.', 'rtmedia' ); ?></p></div>')
1067
jQuery('.upload-filetype-network-settings-error').remove();
1068
jQuery('.bp-media-network-settings-updated-successfully').show();
1069
}
1166
jQuery.post(ajaxurl,data, function(data) {
1167
data = JSON.parse(data);
1168
if(data.status === true) {
1169
+ alert("<?php _e('Video is sent to generate thumbnails.', 'rtmedia') ?>");
1170
}
1171
else {
1172
+ alert("<?php _e('Video can\'t be sent to generate thumbnails.', 'rtmedia') ?>");
1173
}
1174
});
1175
}
1183
?>
1184
<script type="text/javascript">
1185
jQuery(document).ready(function($){
1186
+ $('select[name^="action"] option:last-child').before('<option value="bulk_video_regenerate_thumbnails"><?php esc_attr_e( 'Regenerate Video Thumbnails', 'rtmedia'); ?></option>');
1187
});
1188
</script>
1189
<?php
app/admin/RTMediaFormHandler.php CHANGED
@@ -341,10 +341,10 @@ class RTMediaFormHandler {
341
<div class="rt-table large-12">
342
<div class="row rt-header">
343
<?php do_action("rtmedia_type_settings_before_heading"); ?>
344
- <h4 class="columns large-3"><?php echo __("Media Type","rtmedia") ?></h4>
345
- <h4 class="columns large-3 rtm-show-tooltip" title="<?php echo __("Allows you to upload a particular media type on your post.","rtmedia"); ?>"><abbr><?php echo __("Allow Upload","rtmedia"); ?></abbr></h4>
346
- <h4 class="columns large-3 rtm-show-tooltip" title="<?php echo __("Put a specific media as a featured content on the post.","rtmedia"); ?>"><abbr><?php echo __("Set Featured","rtmedia"); ?></abbr></h4>
347
- <h4 class="columns large-3 rtm-show-tooltip" title="<?php echo __("File extensions that can be uploaded on the website.","rtmedia"); ?>"><abbr><?php echo __("File Extensions","rtmedia"); ?></abbr></h4>
348
<?php do_action("rtmedia_type_settings_after_heading"); ?>
349
</div>
350
341
<div class="rt-table large-12">
342
<div class="row rt-header">
343
<?php do_action("rtmedia_type_settings_before_heading"); ?>
344
+ <h4 class="columns large-3"><?php _e("Media Type","rtmedia") ?></h4>
345
+ <h4 class="columns large-3 rtm-show-tooltip" title="<?php _e("Allows you to upload a particular media type on your post.","rtmedia"); ?>"><abbr><?php _e("Allow Upload","rtmedia"); ?></abbr></h4>
346
+ <h4 class="columns large-3 rtm-show-tooltip" title="<?php _e("Put a specific media as a featured content on the post.","rtmedia"); ?>"><abbr><?php _e("Set Featured","rtmedia"); ?></abbr></h4>
347
+ <h4 class="columns large-3 rtm-show-tooltip" title="<?php _e("File extensions that can be uploaded on the website.","rtmedia"); ?>"><abbr><?php _e("File Extensions","rtmedia"); ?></abbr></h4>
348
<?php do_action("rtmedia_type_settings_after_heading"); ?>
349
</div>
350
app/assets/css/admin.css CHANGED
@@ -657,12 +657,12 @@ abbr {
657
width:100%;
658
}
659
660
- .bp-media-admin .rtm-premium {
661
- background-color: #DDD;
662
}
663
664
- .bp-media-admin .premium-title {
665
- color: #444;
666
border-bottom: 1px solid #DDD ;
667
padding-bottom: 10px;
668
}
@@ -674,4 +674,32 @@ abbr {
674
.bp-media-admin .premium-page-container .rtm-premium-icon-pro {
675
margin-top: 9px;
676
width: 40px;
677
- }
657
width:100%;
658
}
659
660
+ .bp-media-admin .rtm-premium {
661
+ background-color: #DDD;
662
}
663
664
+ .bp-media-admin .premium-title {
665
+ color: #444;
666
border-bottom: 1px solid #DDD ;
667
padding-bottom: 10px;
668
}
674
.bp-media-admin .premium-page-container .rtm-premium-icon-pro {
675
margin-top: 9px;
676
width: 40px;
677
+ }
678
+ #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-message, #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-link,#TB_window #rtmedia-addon-add-container #rtmedia-flat-50-code {
679
+ text-align: center;
680
+ }
681
+ #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-message {
682
+ color: #3481C4;
683
+ }
684
+ #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-message .alert, #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-link .alert, #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-code .alert, #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-valid .alert {
685
+ color: #E6321F;
686
+ }
687
+ #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-message .regular, #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-link .regular, #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-code .regular, #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-valid .regular {
688
+ color: #6B757E;
689
+ }
690
+ #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-link span a:hover{
691
+ color:#49A600;
692
+ }
693
+ #TB_window #rtmedia-addon-add-container #rtmedia-flat-50-link span a{
694
+ text-decoration: none;
695
+ font-size: 20px;
696
+ color:#125DAC;
697
+ }
698
+ #rtmedia-flat-50-valid {
699
+ text-align: right;
700
+ }
701
+ #rtmedia-addon-do-not-show {
702
+ text-decoration: none;
703
+ font-size: 15px;
704
+ }
705
+
app/assets/js/admin.js CHANGED
@@ -635,4 +635,18 @@ jQuery(document).ready(function($) {
635
});
636
if(jQuery(document).foundation !== undefined)
637
jQuery(document).foundation('section');
638
});
635
});
636
if(jQuery(document).foundation !== undefined)
637
jQuery(document).foundation('section');
638
+ });
639
+
640
+ function rtmedia_addon_do_not_show() {
641
+ var data = {
642
+ action: 'rtmedia_addon_popup_not_show_again'
643
+ };
644
+ jQuery.post(rtmedia_admin_ajax, data, function(response) {
645
+ jQuery('#TB_window').remove();
646
+ jQuery('#TB_overlay').remove();
647
+ });
648
+ }
649
+
650
+ jQuery(window).load(function(){
651
+ jQuery('.rtmedia-addon-thickbox').trigger('click');
652
});
app/helper/RTMediaAddon.php CHANGED
@@ -48,20 +48,20 @@ if (!class_exists('RTMediaAddon')) {
48
$tabs = array();
49
global $rtmedia_admin;
50
$tabs[] = array(
51
- 'title' => 'Audio/Video Encoding',
52
'name' => __('Audio/Video Encoding', 'rtmedia'),
53
'href' => '#rtm-services',
54
'callback' => array($rtmedia_admin->rtmedia_encoding, 'encoding_service_intro')
55
);
56
$tabs[] = array(
57
- 'title' => 'Plugins',
58
'name' => __('Plugins', 'rtmedia'),
59
'href' => '#rtm-plugins',
60
'callback' => array($this, 'plugins_content')
61
);
62
63
/* $tabs[] = array(
64
- 'title' => 'Themes',
65
'name' => __('Themes', 'rtmedia'),
66
'href' => '#bpm-themes',
67
'callback' => array($this, 'themes_content')
@@ -139,11 +139,11 @@ if (!class_exists('RTMediaAddon')) {
139
140
if($key == 0) {
141
echo '<h3>';
142
- _e('rtMedia Addons for Photos');
143
echo '</h3>';
144
} else if($key == 2) {
145
echo '<h3>';
146
- _e('rtMedia Addons for Audio/Video');
147
echo '</h3>';
148
}
149
$this->addon($value);
@@ -157,7 +157,7 @@ if (!class_exists('RTMediaAddon')) {
157
}
158
159
public function themes_content($args = '') {
160
- echo '<h3>Coming Soon !!</h3>';
161
}
162
163
48
$tabs = array();
49
global $rtmedia_admin;
50
$tabs[] = array(
51
+ 'title' => __('Audio/Video Encoding', 'rtmedia'),
52
'name' => __('Audio/Video Encoding', 'rtmedia'),
53
'href' => '#rtm-services',
54
'callback' => array($rtmedia_admin->rtmedia_encoding, 'encoding_service_intro')
55
);
56
$tabs[] = array(
57
+ 'title' => __('Plugins', 'rtmedia'),
58
'name' => __('Plugins', 'rtmedia'),
59
'href' => '#rtm-plugins',
60
'callback' => array($this, 'plugins_content')
61
);
62
63
/* $tabs[] = array(
64
+ 'title' => __('Themes', 'rtmedia'),
65
'name' => __('Themes', 'rtmedia'),
66
'href' => '#bpm-themes',
67
'callback' => array($this, 'themes_content')
139
140
if($key == 0) {
141
echo '<h3>';
142
+ _e( 'rtMedia Addons for Photos', 'rtmedia' );
143
echo '</h3>';
144
} else if($key == 2) {
145
echo '<h3>';
146
+ _e( 'rtMedia Addons for Audio/Video', 'rtmedia' );
147
echo '</h3>';
148
}
149
$this->addon($value);
157
}
158
159
public function themes_content($args = '') {
160
+ echo '<h3>'. __( 'Coming Soon !!', 'rtmedia' ) .'</h3>';
161
}
162
163
app/helper/RTMediaSettings.php CHANGED
@@ -76,7 +76,7 @@ if (!class_exists('RTMediaSettings')) {
76
return $options;
77
}
78
function add_max_video_thumb_notice(){
79
- echo '<div class="error"><p>' . __("Max Video thumbnail size is ") .' <strong>10</strong></p></div>';
80
}
81
/**
82
*
76
return $options;
77
}
78
function add_max_video_thumb_notice(){
79
+ echo '<div class="error"><p>' . __( 'Max Video thumbnail size is ', 'rtmedia' ) .' <strong>10</strong></p></div>';
80
}
81
/**
82
*
app/helper/RTMediaSupport.php CHANGED
@@ -37,19 +37,19 @@ if (!class_exists('RTMediaSupport')) {
37
$tabs = array();
38
global $rtmedia_admin;
39
$tabs[] = array(
40
- 'title' => 'Premium Support',
41
'name' => __('Premium Support', 'rtmedia'),
42
'href' => '#support',
43
'callback' => array($this, 'call_get_form')
44
);
45
$tabs[] = array(
46
- 'title' => 'Debug Info',
47
'name' => __('Debug Info', 'rtmedia'),
48
'href' => '#debug',
49
'callback' => array($this, 'debug_info_html')
50
);
51
$tabs[] = array(
52
- 'title' => 'Migration',
53
'name' => __('Migration', 'rtmedia'),
54
'href' => '#migration',
55
'callback' => array($this, 'migration_html')
@@ -103,11 +103,11 @@ if (!class_exists('RTMediaSupport')) {
103
<p>
104
<label class="bp-media-label" for="select_support"><?php _e('Service', 'rtmedia'); ?>:</label>
105
<select name="rtmedia_service_select">
106
- <option value="premium_support" <?php if($_POST['form']=="premium_support") echo "selected"; ?>>Premium Support</option>
107
- <option value="bug_report" <?php if($_POST['form']=="bug_report") echo "selected"; ?>>Bug Report</option>
108
- <option value="new_feature" <?php if($_POST['form']=="new_feature") echo "selected"; ?>>New Feature</option>
109
</select>
110
- <input name="support_submit" value="Submit" type="submit" class="button" />
111
</p>
112
</form>
113
</div>
@@ -298,7 +298,7 @@ if (!class_exists('RTMediaSupport')) {
298
$content = apply_filters("rtmedia_migration_content_filter", $content);
299
if( $flag ) {
300
$content.= ' <div class="rtmedia-migration-support">';
301
- $content.=' <p>'.__('Click','rtmedia').' <a href="'.get_admin_url().'admin.php?page=rtmedia-migration">'. _e('here','rtmedia').'</a>'. __('here to migrate media from rtMedia 2.x to rtMedia 3.0+.','rtmedia').'</p>';
302
$content.='</div>';
303
}
304
?>
37
$tabs = array();
38
global $rtmedia_admin;
39
$tabs[] = array(
40
+ 'title' => __('Premium Support', 'rtmedia'),
41
'name' => __('Premium Support', 'rtmedia'),
42
'href' => '#support',
43
'callback' => array($this, 'call_get_form')
44
);
45
$tabs[] = array(
46
+ 'title' => __('Debug Info', 'rtmedia'),
47
'name' => __('Debug Info', 'rtmedia'),
48
'href' => '#debug',
49
'callback' => array($this, 'debug_info_html')
50
);
51
$tabs[] = array(
52
+ 'title' => __('Migration', 'rtmedia'),
53
'name' => __('Migration', 'rtmedia'),
54
'href' => '#migration',
55
'callback' => array($this, 'migration_html')
103
<p>
104
<label class="bp-media-label" for="select_support"><?php _e('Service', 'rtmedia'); ?>:</label>
105
<select name="rtmedia_service_select">
106
+ <option value="premium_support" <?php if($_POST['form']=="premium_support") echo "selected"; ?>><?php _e( 'Premium Support', 'rtmedia' ); ?></option>
107
+ <option value="bug_report" <?php if($_POST['form']=="bug_report") echo "selected"; ?>><?php _e( 'Bug Report', 'rtmedia' ); ?></option>
108
+ <option value="new_feature" <?php if($_POST['form']=="new_feature") echo "selected"; ?>><?php _e( 'New Feature', 'rtmedia' ); ?></option>
109
</select>
110
+ <input name="support_submit" value="<?php esc_attr_e( 'Submit', 'rtmedia' ); ?>" type="submit" class="button" />
111
</p>
112
</form>
113
</div>
298
$content = apply_filters("rtmedia_migration_content_filter", $content);
299
if( $flag ) {
300
$content.= ' <div class="rtmedia-migration-support">';
301
+ $content.=' <p>'.__('Click','rtmedia').' <a href="'.get_admin_url().'admin.php?page=rtmedia-migration">'. __('here','rtmedia').'</a>'. __('here to migrate media from rtMedia 2.x to rtMedia 3.0+.','rtmedia').'</p>';
302
$content.='</div>';
303
}
304
?>
app/helper/rtFormInvalidArgumentsException.php CHANGED
@@ -18,8 +18,7 @@ if(!class_exists("rtFormsInvalidArgumentsException")) {
18
public function __construct($msg) {
19
20
//Error Message
21
- $errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile() .
22
- ' : <b>The method expects an array in arguments for ' . $msg . ' provided.</b>';
23
24
echo $errorMsg;
25
}
18
public function __construct($msg) {
19
20
//Error Message
21
+ $errorMsg = sprintf( __( "Error on line %s in %s : <b>The method expects an array in arguments for %s provided.</b>", 'rtmedia'), $this->getLine(), $this->getFile(), $msg );
22
23
echo $errorMsg;
24
}
app/helper/rtPluginInfo.php CHANGED
@@ -47,7 +47,7 @@ class rtPluginInfo {
47
if (empty($apiResponse) || !is_object($apiResponse)) {
48
if ($triggerErrors) {
49
trigger_error(
50
- "Failed to parse plugin metadata. Try validating your .json file with http://jsonlint.com/", E_USER_NOTICE
51
);
52
}
53
return null;
@@ -58,7 +58,7 @@ class rtPluginInfo {
58
if (!$valid) {
59
if ($triggerErrors) {
60
trigger_error(
61
- "The plugin metadata file does not contain the required 'name' and/or 'version' keys.", E_USER_NOTICE
62
);
63
}
64
return null;
47
if (empty($apiResponse) || !is_object($apiResponse)) {
48
if ($triggerErrors) {
49
trigger_error(
50
+ sprintf( __( "Failed to parse plugin metadata. Try validating your .json file with %s", 'rtmedia' ), 'http://jsonlint.com/' ), E_USER_NOTICE
51
);
52
}
53
return null;
58
if (!$valid) {
59
if ($triggerErrors) {
60
trigger_error(
61
+ __( "The plugin metadata file does not contain the required 'name' and/or 'version' keys.", 'rtmedia'), E_USER_NOTICE
62
);
63
}
64
return null;
app/helper/rtPluginUpdateChecker.php CHANGED
@@ -120,7 +120,7 @@ class rtPluginUpdateChecker {
120
$scheduleName = 'every' . $this->checkPeriod . 'hours';
121
$schedules[$scheduleName] = array(
122
'interval' => $this->checkPeriod * 3600,
123
- 'display' => sprintf('Every %d hours', $this->checkPeriod),
124
);
125
}
126
return $schedules;
@@ -193,13 +193,13 @@ class rtPluginUpdateChecker {
193
if (!is_wp_error($result) && isset($result['response']['code']) && ($result['response']['code'] == 200) && !empty($result['body'])) {
194
$pluginInfo = rtPluginInfo::fromJson($result['body'], $this->debugMode);
195
} else if ($this->debugMode) {
196
- $message = sprintf("The URL %s does not point to a valid plugin metadata file. ", $url);
197
if (is_wp_error($result)) {
198
- $message .= "WP HTTP error: " . $result->get_error_message();
199
} else if (isset($result['response']['code'])) {
200
- $message .= "HTTP response code is " . $result['response']['code'] . " (expected: 200)";
201
} else {
202
- $message .= "wp_remote_get() returned an unexpected result.";
203
}
204
trigger_error($message, E_USER_WARNING);
205
}
@@ -256,9 +256,7 @@ class rtPluginUpdateChecker {
256
//This can happen if the filename is wrong or the plugin is installed in mu-plugins.
257
if ($this->debugMode) {
258
trigger_error(
259
- sprintf(
260
- "Can't to read the Version header for %s. The filename may be incorrect, or the file is not present in /wp-content/plugins.", $this->pluginFile
261
- ), E_USER_WARNING
262
);
263
}
264
return null;
@@ -282,7 +280,7 @@ class rtPluginUpdateChecker {
282
if ($installedVersion === null) {
283
if ($this->debugMode) {
284
trigger_error(
285
- sprintf('Skipping update check for %s - installed version unknown.', $this->pluginFile), E_USER_WARNING
286
);
287
}
288
return null;
@@ -510,7 +508,7 @@ class rtPluginUpdateChecker {
510
), 'puc_check_for_updates'
511
);
512
513
- $linkText = apply_filters('puc_manual_check_link-' . $this->slug, 'Check for updates');
514
if (!empty($linkText)) {
515
$pluginMeta[] = sprintf('<a href="%s">%s</a>', esc_attr($linkUrl), $linkText);
516
}
@@ -553,11 +551,11 @@ class rtPluginUpdateChecker {
553
if (isset($_GET['puc_update_check_result'], $_GET['puc_slug']) && ($_GET['puc_slug'] == $this->slug)) {
554
$status = strval($_GET['puc_update_check_result']);
555
if ($status == 'no_update') {
556
- $message = 'This plugin is up to date.';
557
} else if ($status == 'update_available') {
558
- $message = 'A new version of this plugin is available.';
559
} else {
560
- $message = sprintf('Unknown update checker status "%s"', htmlentities($status));
561
}
562
printf(
563
'<div class="updated"><p>%s</p></div>', apply_filters('puc_manual_check_message-' . $this->slug, $message, $status)
120
$scheduleName = 'every' . $this->checkPeriod . 'hours';
121
$schedules[$scheduleName] = array(
122
'interval' => $this->checkPeriod * 3600,
123
+ 'display' => sprintf( __( "Every %d hours", 'rtmedia' ), $this->checkPeriod),
124
);
125
}
126
return $schedules;
193
if (!is_wp_error($result) && isset($result['response']['code']) && ($result['response']['code'] == 200) && !empty($result['body'])) {
194
$pluginInfo = rtPluginInfo::fromJson($result['body'], $this->debugMode);
195
} else if ($this->debugMode) {
196
+ $message = sprintf( __( "The URL %s does not point to a valid plugin metadata file.", 'rtmedia'), $url );
197
if (is_wp_error($result)) {
198
+ $message .= sprintf( __( "WP HTTP error: %s", 'rtmedia'), $result->get_error_message() );
199
} else if (isset($result['response']['code'])) {
200
+ $message .= sprintf( __( "HTTP response code is %s (expected: 200)", 'rtmedia'), $result['response']['code'] );
201
} else {
202
+ $message .= __( 'wp_remote_get() returned an unexpected result.', 'rtmedia' );
203
}
204
trigger_error($message, E_USER_WARNING);
205
}
256
//This can happen if the filename is wrong or the plugin is installed in mu-plugins.
257
if ($this->debugMode) {
258
trigger_error(
259
+ sprintf( __( "Can't to read the Version header for %s. The filename may be incorrect, or the file is not present in /wp-content/plugins.", 'rtmedia' ), $this->pluginFile ), E_USER_WARNING
260
);
261
}
262
return null;
280
if ($installedVersion === null) {
281
if ($this->debugMode) {
282
trigger_error(
283
+ sprintf( __( "Skipping update check for %s - installed version unknown.", 'rtmedia'), $this->pluginFile ), E_USER_WARNING
284
);
285
}
286
return null;
508
), 'puc_check_for_updates'
509
);
510
511
+ $linkText = apply_filters('puc_manual_check_link-' . $this->slug, __( 'Check for updates', 'rtmedia' ) );
512
if (!empty($linkText)) {
513
$pluginMeta[] = sprintf('<a href="%s">%s</a>', esc_attr($linkUrl), $linkText);
514
}
551
if (isset($_GET['puc_update_check_result'], $_GET['puc_slug']) && ($_GET['puc_slug'] == $this->slug)) {
552
$status = strval($_GET['puc_update_check_result']);
553
if ($status == 'no_update') {
554
+ $message = __( 'This plugin is up to date.', 'rtmedia' );
555
} else if ($status == 'update_available') {
556
+ $message = __( 'A new version of this plugin is available.', 'rtmedia' );
557
} else {
558
+ $message = sprintf( __( "Unknown update checker status \"%s\"", 'rtmedia' ), htmlentities($status));
559
}
560
printf(
561
'<div class="updated"><p>%s</p></div>', apply_filters('puc_manual_check_message-' . $this->slug, $message, $status)
app/importers/BPMediaAlbumimporter.php CHANGED
@@ -69,16 +69,16 @@ class BPMediaAlbumimporter extends BPMediaImporter {
69
if (($finished[0]->media != $total[0]->media) || ( $users['total_users'] > $completed_users_favorites )) {
70
if ($bp_album_active != 1) {
71
echo '<div id="setting-error-bp-album-importer" class="error settings-error below-h2">
72
- <p><strong>' . __('Warning!', 'buddypress-media') . '</strong> ' . sprintf(__('This import process is irreversible. Although everything is tested, please take a <a target="_blank" href="http://codex.wordpress.org/WordPress_Backups">backup of your database and files</a>, before proceeding. If you don\'t know your way around databases and files, consider <a target="_blank" href="%s">hiring us</a>, or another professional.', 'buddypress-media'), 'http://rtcamp.com/contact/?purpose=buddypress&utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media') . '</p>';
73
- echo '<p>' . __('If you have set "WP_DEBUG" in you wp-config.php file, please make sure it is set to "false", so that it doesn\'t conflict with the import process.', 'buddypress-media') . '</p></div>';
74
- echo '<div class="bp-album-import-accept"><p><strong><label for="bp-album-import-accept"><input type="checkbox" value="accept" name="bp-album-import-accept" id="bp-album-import-accept" /> ' . __('I have taken a backup of the database and files of this site.', 'buddypress-media') . '</label></strong></p></div>';
75
echo '<button id="bpmedia-bpalbumimport" class="button button-primary">';
76
- _e('Start Import', 'buddypress-media');
77
echo '</button>';
78
echo '<div class="bp-album-importer-wizard">';
79
echo '<div class="bp-album-users">';
80
echo '<strong>';
81
- echo __('Users', 'buddypress-media') . ': <span class="finished">' . $finished_users[0]->users . '</span> / <span class="total">' . $total[0]->users . '</span>';
82
echo '</strong>';
83
if ($total[0]->users != 0) {
84
$users_progress = $this->progress->progress($finished_users[0]->users, $total[0]->users);
@@ -88,7 +88,7 @@ class BPMediaAlbumimporter extends BPMediaImporter {
88
echo '<br />';
89
echo '<div class="bp-album-media">';
90
echo '<strong>';
91
- echo __('Media', 'buddypress-media') . ': <span class="finished">' . $finished[0]->media . '</span> / <span class="total">' . $total[0]->media . '</span>';
92
echo '</strong>';
93
$progress = 100;
94
if ($total[0]->media != 0) {
@@ -108,20 +108,20 @@ class BPMediaAlbumimporter extends BPMediaImporter {
108
echo '<div class="bp-album-comments">';
109
if ($total_comments != 0) {
110
echo '<strong>';
111
- echo __('Comments', 'buddypress-media') . ': <span class="finished">' . $finished_comments . '</span> / <span class="total">' . $total_comments . '</span>';
112
echo '</strong>';
113
$comments_progress = $this->progress->progress($finished_comments, $total_comments);
114
$this->progress->progress_ui($comments_progress);
115
echo '<br />';
116
} else {
117
- echo '<p><strong>' . __('Comments: 0/0 (No comments to import)', 'buddypress-media') . '</strong></p>';
118
}
119
echo '</div>';
120
if ($completed_users_favorites != 0) {
121
echo '<br />';
122
echo '<div class="bp-album-favorites">';
123
echo '<strong>';
124
- echo __('User\'s Favorites', 'buddypress-media') . ': <span class="finished">' . $completed_users_favorites . '</span> / <span class="total">' . $users['total_users'] . '</span>';
125
echo '</strong>';
126
$favorites_progress = $this->progress->progress($completed_users_favorites, $users['total_users']);
127
$this->progress->progress_ui($favorites_progress);
@@ -130,15 +130,15 @@ class BPMediaAlbumimporter extends BPMediaImporter {
130
echo '</div>';
131
} else {
132
$deactivate_link = wp_nonce_url(admin_url('plugins.php?action=deactivate&amp;plugin=' . urlencode($this->path)), 'deactivate-plugin_' . $this->path);
133
- echo '<p>' . __('BP-Album is active on your site and will cause problems with the import.', 'buddypress-media') . '</p>';
134
- echo '<p><a class="button button-primary deactivate-bp-album" href="' . $deactivate_link . '">' . __('Click here to deactivate BP-Album and continue importing', 'buddypress-media') . '</a></p>';
135
}
136
} else {
137
$corrupt_media = BPMediaAlbumimporter::get_corrupt_media();
138
if ($corrupt_media) {
139
echo '<div class="error below-h2">';
140
- echo '<p><strong>' . __('Some of the media failed to import. The file might be corrupt or deleted.', 'buddypress-media') . '</strong></p>';
141
- echo '<p>' . sprintf(__('The following %d BP Album Media id\'s could not be imported', 'buddypress-media'), count($corrupt_media)) . ': </p>';
142
$corrupt_prefix_path = str_replace('/wp-content', '', WP_CONTENT_URL);
143
foreach ($corrupt_media as $corrupt) {
144
echo '<p>' . $corrupt->id . ' => <a href="' . $corrupt_prefix_path . $corrupt->pic_org_url . '">' . $corrupt->title . '</a></p>';
@@ -147,45 +147,45 @@ class BPMediaAlbumimporter extends BPMediaImporter {
147
} else {
148
echo '<div class="bp-album-import-accept i-accept">';
149
echo '<p class="info">';
150
- $message = sprintf(__('I just imported bp-album to @buddypressmedia http://goo.gl/8Upmv on %s', 'buddypress-media'), home_url());
151
- echo '<strong>' . __('Congratulations!', 'buddypress-media') . '</strong> ' . __('All media from BP Album has been imported.', 'buddypress-media');
152
- echo ' <a href="http://twitter.com/home/?status=' . $message . '" class="button button-import-tweet" target= "_blank">' . __('Tweet this', 'buddypress-media') . '</a>';
153
echo '</p>';
154
echo '</div>';
155
}
156
- echo '<p>' . __('However, a lot of unnecessary files and a database table are still eating up your resources. If everything seems fine, you can clean this data up.', 'buddypress-media') . '</p>';
157
echo '<br />';
158
echo '<button id="bpmedia-bpalbumimport-cleanup" class="button btn-warning">';
159
- _e('Clean up Now', 'buddypress-media');
160
echo '</button>';
161
echo ' <a href="' . add_query_arg(
162
array('page' => 'bp-media-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
163
) . '" id="bpmedia-bpalbumimport-cleanup-later" class="button">';
164
- _e('Clean up Later', 'buddypress-media');
165
echo '</a>';
166
echo '<br />';
167
echo '<br />';
168
echo '<br />';
169
- echo '<strong>' . __('Why don\'t you try adding some instagram like effects to your images?', 'buddypress-media') . '</strong>';
170
echo '<div class="bp-media-addon">
171
<a href="http://rtcamp.com/store/buddypress-media-instagram/?utm_source=dashboard&amp;utm_medium=plugin&amp;utm_campaign=buddypress-media&amp;utm_content=bp-album-importer" title="BuddyPress-Media Instagram" target="_blank">
172
<img width="240" height="184" title="BuddyPress-Media Instagram" alt="BuddyPress-Media Instagram" src="http://rtcamp.com/wp-content/uploads/2013/03/BuddyPressMedia-Instagram.png?ref=bp-album-importer">
173
</a>
174
<h4><a href="http://rtcamp.com/store/buddypress-media-instagram/?utm_source=dashboard&amp;utm_medium=plugin&amp;utm_campaign=buddypress-media&amp;utm_content=bp-album-importer" title="BuddyPress-Media Instagram" target="_blank">BuddyPress-Media Instagram</a></h4>
175
<div class="product_desc">
176
- <p>'.__('BuddyPress Media Instagram adds Instagram like filters to images uploaded with BuddyPress Media.', 'buddypress-media').'</p>
177
- <p><strong>'.__('Important','buddypress-media').':</strong> '.__('You need to have ImageMagick installed on your server for this addon to work.','buddypress-media').'</p>
178
</div>
179
<div class="product_footer">
180
<span class="price alignleft"><span class="amount">$19</span></span>
181
- <a class="add_to_cart_button alignright product_type_simple" href="http://rtcamp.com/store/?utm_source=dashboard&amp;utm_medium=plugin&amp;utm_campaign=buddypress-media&amp;utm_content=bp-album-importer&amp;add-to-cart=34379" target="_blank">'.__('Buy Now','buddypress-media').'</a>
182
- <a class="alignleft product_demo_link" href="http://demo.rtcamp.com/buddypress-media/?utm_source=dashboard&amp;utm_medium=plugin&amp;utm_campaign=buddypress-media&amp;utm_content=bp-album-importer" title="BuddyPress-Media Instagram" target="_blank">'.__('Live Demo','buddypress-media').'</a>
183
</div></div>';
184
}
185
echo '</div>';
186
} else {
187
echo '<p>'.__('Looks like you don\'t use BP Album. Is there any other BuddyPress Plugin you want an importer for?').'</p>';
188
- echo '<p>'.sprintf(__('<a href="%s">Create an issue</a> on GitHub requesting the same.','buddypress-media'),'https://github.com/rtCamp/buddypress-media/issues/new').'</p>';
189
}
190
}
191
69
if (($finished[0]->media != $total[0]->media) || ( $users['total_users'] > $completed_users_favorites )) {
70
if ($bp_album_active != 1) {
71
echo '<div id="setting-error-bp-album-importer" class="error settings-error below-h2">
72
+ <p><strong>' . __('Warning!', 'rtmedia') . '</strong> ' . sprintf(__('This import process is irreversible. Although everything is tested, please take a <a target="_blank" href="http://codex.wordpress.org/WordPress_Backups">backup of your database and files</a>, before proceeding. If you don\'t know your way around databases and files, consider <a target="_blank" href="%s">hiring us</a>, or another professional.', 'rtmedia'), 'http://rtcamp.com/contact/?purpose=buddypress&utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media') . '</p>';
73
+ echo '<p>' . __('If you have set "WP_DEBUG" in you wp-config.php file, please make sure it is set to "false", so that it doesn\'t conflict with the import process.', 'rtmedia') . '</p></div>';
74
+ echo '<div class="bp-album-import-accept"><p><strong><label for="bp-album-import-accept"><input type="checkbox" value="accept" name="bp-album-import-accept" id="bp-album-import-accept" /> ' . __('I have taken a backup of the database and files of this site.', 'rtmedia') . '</label></strong></p></div>';
75
echo '<button id="bpmedia-bpalbumimport" class="button button-primary">';
76
+ _e('Start Import', 'rtmedia');
77
echo '</button>';
78
echo '<div class="bp-album-importer-wizard">';
79
echo '<div class="bp-album-users">';
80
echo '<strong>';
81
+ echo __('Users', 'rtmedia') . ': <span class="finished">' . $finished_users[0]->users . '</span> / <span class="total">' . $total[0]->users . '</span>';
82
echo '</strong>';
83
if ($total[0]->users != 0) {
84
$users_progress = $this->progress->progress($finished_users[0]->users, $total[0]->users);
88
echo '<br />';
89
echo '<div class="bp-album-media">';
90
echo '<strong>';
91
+ echo __('Media', 'rtmedia') . ': <span class="finished">' . $finished[0]->media . '</span> / <span class="total">' . $total[0]->media . '</span>';
92
echo '</strong>';
93
$progress = 100;
94
if ($total[0]->media != 0) {
108
echo '<div class="bp-album-comments">';
109
if ($total_comments != 0) {
110
echo '<strong>';
111
+ echo __('Comments', 'rtmedia') . ': <span class="finished">' . $finished_comments . '</span> / <span class="total">' . $total_comments . '</span>';
112
echo '</strong>';
113
$comments_progress = $this->progress->progress($finished_comments, $total_comments);
114
$this->progress->progress_ui($comments_progress);
115
echo '<br />';
116
} else {
117
+ echo '<p><strong>' . __('Comments: 0/0 (No comments to import)', 'rtmedia') . '</strong></p>';
118
}
119
echo '</div>';
120
if ($completed_users_favorites != 0) {
121
echo '<br />';
122
echo '<div class="bp-album-favorites">';
123
echo '<strong>';
124
+ echo __('User\'s Favorites', 'rtmedia') . ': <span class="finished">' . $completed_users_favorites . '</span> / <span class="total">' . $users['total_users'] . '</span>';
125
echo '</strong>';
126
$favorites_progress = $this->progress->progress($completed_users_favorites, $users['total_users']);
127
$this->progress->progress_ui($favorites_progress);
130
echo '</div>';
131
} else {
132
$deactivate_link = wp_nonce_url(admin_url('plugins.php?action=deactivate&amp;plugin=' . urlencode($this->path)), 'deactivate-plugin_' . $this->path);
133
+ echo '<p>' . __('BP-Album is active on your site and will cause problems with the import.', 'rtmedia') . '</p>';
134
+ echo '<p><a class="button button-primary deactivate-bp-album" href="' . $deactivate_link . '">' . __('Click here to deactivate BP-Album and continue importing', 'rtmedia') . '</a></p>';
135
}
136
} else {
137
$corrupt_media = BPMediaAlbumimporter::get_corrupt_media();
138
if ($corrupt_media) {
139
echo '<div class="error below-h2">';
140
+ echo '<p><strong>' . __('Some of the media failed to import. The file might be corrupt or deleted.', 'rtmedia') . '</strong></p>';
141
+ echo '<p>' . sprintf(__('The following %d BP Album Media id\'s could not be imported', 'rtmedia'), count($corrupt_media)) . ': </p>';
142
$corrupt_prefix_path = str_replace('/wp-content', '', WP_CONTENT_URL);
143
foreach ($corrupt_media as $corrupt) {
144
echo '<p>' . $corrupt->id . ' => <a href="' . $corrupt_prefix_path . $corrupt->pic_org_url . '">' . $corrupt->title . '</a></p>';
147
} else {
148
echo '<div class="bp-album-import-accept i-accept">';
149
echo '<p class="info">';
150
+ $message = sprintf(__('I just imported bp-album to @buddypressmedia http://goo.gl/8Upmv on %s', 'rtmedia'), home_url());
151
+ echo '<strong>' . __('Congratulations!', 'rtmedia') . '</strong> ' . __('All media from BP Album has been imported.', 'rtmedia');
152
+ echo ' <a href="http://twitter.com/home/?status=' . $message . '" class="button button-import-tweet" target= "_blank">' . __('Tweet this', 'rtmedia') . '</a>';
153
echo '</p>';
154
echo '</div>';
155
}
156
+ echo '<p>' . __('However, a lot of unnecessary files and a database table are still eating up your resources. If everything seems fine, you can clean this data up.', 'rtmedia') . '</p>';
157
echo '<br />';
158
echo '<button id="bpmedia-bpalbumimport-cleanup" class="button btn-warning">';
159
+ _e('Clean up Now', 'rtmedia');
160
echo '</button>';
161
echo ' <a href="' . add_query_arg(
162
array('page' => 'bp-media-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
163
) . '" id="bpmedia-bpalbumimport-cleanup-later" class="button">';
164
+ _e('Clean up Later', 'rtmedia');
165
echo '</a>';
166
echo '<br />';
167
echo '<br />';
168
echo '<br />';
169
+ echo '<strong>' . __('Why don\'t you try adding some instagram like effects to your images?', 'rtmedia') . '</strong>';
170
echo '<div class="bp-media-addon">
171
<a href="http://rtcamp.com/store/buddypress-media-instagram/?utm_source=dashboard&amp;utm_medium=plugin&amp;utm_campaign=buddypress-media&amp;utm_content=bp-album-importer" title="BuddyPress-Media Instagram" target="_blank">
172
<img width="240" height="184" title="BuddyPress-Media Instagram" alt="BuddyPress-Media Instagram" src="http://rtcamp.com/wp-content/uploads/2013/03/BuddyPressMedia-Instagram.png?ref=bp-album-importer">
173
</a>
174
<h4><a href="http://rtcamp.com/store/buddypress-media-instagram/?utm_source=dashboard&amp;utm_medium=plugin&amp;utm_campaign=buddypress-media&amp;utm_content=bp-album-importer" title="BuddyPress-Media Instagram" target="_blank">BuddyPress-Media Instagram</a></h4>
175
<div class="product_desc">
176
+ <p>'.__('BuddyPress Media Instagram adds Instagram like filters to images uploaded with BuddyPress Media.', 'rtmedia').'</p>
177
+ <p><strong>'.__('Important','rtmedia').':</strong> '.__('You need to have ImageMagick installed on your server for this addon to work.','rtmedia').'</p>
178
</div>
179
<div class="product_footer">
180
<span class="price alignleft"><span class="amount">$19</span></span>
181
+ <a class="add_to_cart_button alignright product_type_simple" href="http://rtcamp.com/store/?utm_source=dashboard&amp;utm_medium=plugin&amp;utm_campaign=buddypress-media&amp;utm_content=bp-album-importer&amp;add-to-cart=34379" target="_blank">'.__('Buy Now','rtmedia').'</a>
182
+ <a class="alignleft product_demo_link" href="http://demo.rtcamp.com/buddypress-media/?utm_source=dashboard&amp;utm_medium=plugin&amp;utm_campaign=buddypress-media&amp;utm_content=bp-album-importer" title="BuddyPress-Media Instagram" target="_blank">'.__('Live Demo','rtmedia').'</a>
183
</div></div>';
184
}
185
echo '</div>';
186
} else {
187
echo '<p>'.__('Looks like you don\'t use BP Album. Is there any other BuddyPress Plugin you want an importer for?').'</p>';
188
+ echo '<p>'.sprintf(__('<a href="%s">Create an issue</a> on GitHub requesting the same.','rtmedia'),'https://github.com/rtCamp/buddypress-media/issues/new').'</p>';
189
}
190
}
191
app/importers/RTMediaMigration.php CHANGED
@@ -57,7 +57,7 @@ class RTMediaMigration {
57
58
function add_migration_notice () {
59
if ( current_user_can ( 'manage_options' ) )
60
- $this->create_notice ( "<p><strong>rtMedia</strong> : Please Migrate your Database <a href='" . admin_url ( "admin.php?page=rtmedia-migration&force=true" ) . "'>Click Here</a>. <a href='" . admin_url ( "admin.php?page=rtmedia-migration&hide=true" ) . "' style='float:right'>" . __ ( "Hide" ) . "</a> </p>" );
61
}
62
63
function create_notice ( $message, $type = "error" ) {
@@ -75,7 +75,7 @@ class RTMediaMigration {
75
}
76
77
function menu () {
78
- add_submenu_page ( 'rtmedia-setting', __ ( 'Migration', 'buddypress-media' ), __ ( 'Migration', 'buddypress-media' ), 'manage_options', 'rtmedia-migration', array( $this, 'test' ) );
79
}
80
81
function get_total_count () {
@@ -359,14 +359,14 @@ class RTMediaMigration {
359
$done = $total;
360
} else {
361
?>
362
- <div class="error"><p> Please Backup your <strong>DATABASE</strong> and <strong>UPLOAD</strong> folder before Migration.</p></div>
363
<?php }
364
?>
365
366
<div class="wrap">
367
368
- <h2>rtMedia Migration</h2>
369
- <h3><?php _e ( "It will migrate following things" ); ?> </h3>
370
User Albums : <?php echo $_SESSION[ "migration_user_album" ]; ?><br />
371
<?php if ( isset ( $_SESSION[ "migration_group_album" ] ) ) { ?>
372
Groups Albums : <?php echo $_SESSION[ "migration_group_album" ]; ?><br />
@@ -434,7 +434,7 @@ class RTMediaMigration {
434
}
435
},
436
error: function() {
437
- alert("Error During Migration, Please Refresh Page then try again");
438
jQuery("#submit").removeAttr('disabled');
439
}
440
});
@@ -454,7 +454,7 @@ class RTMediaMigration {
454
</script>
455
<hr />
456
<?php if ( ! (isset ( $rtmedia_error ) && $rtmedia_error === true) ) { ?>
457
- <input type="button" id="submit" value="start" class="button button-primary" />
458
<?php } ?>
459
460
</div>
@@ -999,25 +999,25 @@ class RTMediaMigration {
999
$timeComponents = array( );
1000
1001
if ( $days > 0 ) {
1002
- $timeComponents[ ] = $days . " day" . ($days > 1 ? "s" : "");
1003
}
1004
1005
if ( $hours > 0 ) {
1006
- $timeComponents[ ] = $hours . " hour" . ($hours > 1 ? "s" : "");
1007
}
1008
1009
if ( $minutes > 0 ) {
1010
- $timeComponents[ ] = $minutes . " minute" . ($minutes > 1 ? "s" : "");
1011
}
1012
1013
if ( $seconds > 0 ) {
1014
- $timeComponents[ ] = $seconds . " second" . ($seconds > 1 ? "s" : "");
1015
}
1016
if ( count ( $timeComponents ) > 0 ) {
1017
$formattedTimeRemaining = implode ( ", ", $timeComponents );
1018
$formattedTimeRemaining = trim ( $formattedTimeRemaining );
1019
} else {
1020
- $formattedTimeRemaining = "No time remaining.";
1021
}
1022
1023
return $formattedTimeRemaining;
57
58
function add_migration_notice () {
59
if ( current_user_can ( 'manage_options' ) )
60
+ $this->create_notice ( "<p><strong>rtMedia</strong>: ". __( 'Please Migrate your Database', 'rtmedia' ) ." <a href='" . admin_url ( "admin.php?page=rtmedia-migration&force=true" ) . "'>". __( 'Click Here', 'rtmedia' ) ."</a>. <a href='" . admin_url ( "admin.php?page=rtmedia-migration&hide=true" ) . "' style='float:right'>". __( 'Hide', 'rtmedia' ) ."</a> </p>" );
61
}
62
63
function create_notice ( $message, $type = "error" ) {
75
}
76
77
function menu () {
78
+ add_submenu_page ( 'rtmedia-setting', __ ( 'Migration', 'rtmedia' ), __ ( 'Migration', 'rtmedia' ), 'manage_options', 'rtmedia-migration', array( $this, 'test' ) );
79
}
80
81
function get_total_count () {
359
$done = $total;
360
} else {
361
?>
362
+ <div class="error"><p><?php _e( 'Please Backup your <strong>DATABASE</strong> and <strong>UPLOAD</strong> folder before Migration.', 'rtmedia' ); ?></p></div>
363
<?php }
364
?>
365
366
<div class="wrap">
367
368
+ <h2><?php _e( 'rtMedia Migration', 'rtmedia' ); ?></h2>
369
+ <h3><?php _e( 'It will migrate following things', 'rtmedia' ); ?> </h3>
370
User Albums : <?php echo $_SESSION[ "migration_user_album" ]; ?><br />
371
<?php if ( isset ( $_SESSION[ "migration_group_album" ] ) ) { ?>
372
Groups Albums : <?php echo $_SESSION[ "migration_group_album" ]; ?><br />
434
}
435
},
436
error: function() {
437
+ alert("<?php _e( 'Error During Migration, Please Refresh Page then try again', 'rtmedia'); ?>");
438
jQuery("#submit").removeAttr('disabled');
439
}
440
});
454
</script>
455
<hr />
456
<?php if ( ! (isset ( $rtmedia_error ) && $rtmedia_error === true) ) { ?>
457
+ <input type="button" id="submit" value="<?php esc_attr_e( 'Start', 'rtmedia' ); ?>" class="button button-primary" />
458
<?php } ?>
459
460
</div>
999
$timeComponents = array( );
1000
1001
if ( $days > 0 ) {
1002
+ $timeComponents[ ] = $days . __( ' day', 'rtmedia' ) . ($days > 1 ? "s" : "");
1003
}
1004
1005
if ( $hours > 0 ) {
1006
+ $timeComponents[ ] = $hours . __( ' hour', 'rtmedia' ) . ($hours > 1 ? "s" : "");
1007
}
1008
1009
if ( $minutes > 0 ) {
1010
+ $timeComponents[ ] = $minutes . __( ' minute', 'rtmedia' ) . ($minutes > 1 ? "s" : "");
1011
}
1012
1013
if ( $seconds > 0 ) {
1014
+ $timeComponents[ ] = $seconds . __( ' second', 'rtmedia' ) . ($seconds > 1 ? "s" : "");
1015
}
1016
if ( count ( $timeComponents ) > 0 ) {
1017
$formattedTimeRemaining = implode ( ", ", $timeComponents );
1018
$formattedTimeRemaining = trim ( $formattedTimeRemaining );
1019
} else {
1020
+ $formattedTimeRemaining = __( 'No time remaining.', 'rtmedia' );
1021
}
1022
1023
return $formattedTimeRemaining;
app/main/RTMedia.php CHANGED
@@ -717,7 +717,7 @@ class RTMedia
717
function create_table_error_notice() {
718
global $rtmedia_error;
719
$rtmedia_error = true;
720
- echo "<div class='error'><p><strong>rtMedia</strong>" . __(": Can't Create Database table. Please check create table permission.") . "</p></div>";
721
}
722
723
function enqueue_scripts_styles() {
@@ -901,9 +901,9 @@ function get_rtmedia_user_link($id) {
901
902
function rtmedia_update_site_option($option_name, $option_value) {
903
if( is_multisite() ) {
904
- update_option($option_name, $option_value);
905
} else {
906
- update_site_option($option_name, $option_value);
907
}
908
}
909
717
function create_table_error_notice() {
718
global $rtmedia_error;
719
$rtmedia_error = true;
720
+ echo "<div class='error'><p><strong>rtMedia</strong>" . __(": Can't Create Database table. Please check create table permission.", "rtmedia") . "</p></div>";
721
}
722
723
function enqueue_scripts_styles() {
901
902
function rtmedia_update_site_option($option_name, $option_value) {
903
if( is_multisite() ) {
904
+ return update_option($option_name, $option_value);
905
} else {
906
+ return update_site_option($option_name, $option_value);
907
}
908
}
909
app/main/controllers/activity/RTMediaBuddyPressActivity.php CHANGED
@@ -145,7 +145,7 @@ class RTMediaBuddyPressActivity {
145
'browse_button' => 'rtmedia-add-media-button-post-update',// browse button assigned to "Attach Files" Button.
146
'container' => 'rtmedia-whts-new-upload-container',
147
'drop_element' => 'whats-new-textarea',// drag-drop area assigned to activity update textarea
148
- 'filters' => apply_filters ( 'rtmedia_plupload_files_filter', array( array( 'title' => "Media Files", 'extensions' => get_rtmedia_allowed_upload_type () ) ) ),
149
'max_file_size' => min ( array( ini_get ( 'upload_max_filesize' ), ini_get ( 'post_max_size' ) ) ),
150
'multipart' => true,
151
'urlstream_upload' => true,
145
'browse_button' => 'rtmedia-add-media-button-post-update',// browse button assigned to "Attach Files" Button.
146
'container' => 'rtmedia-whts-new-upload-container',
147
'drop_element' => 'whats-new-textarea',// drag-drop area assigned to activity update textarea
148
+ 'filters' => apply_filters ( 'rtmedia_plupload_files_filter', array( array( 'title' => __( 'Media Files', 'rtmedia' ), 'extensions' => get_rtmedia_allowed_upload_type () ) ) ),
149
'max_file_size' => min ( array( ini_get ( 'upload_max_filesize' ), ini_get ( 'post_max_size' ) ) ),
150
'multipart' => true,
151
'urlstream_upload' => true,
app/main/controllers/group/RTMediaGroupExtension.php CHANGED
@@ -20,20 +20,20 @@ if ( class_exists ( 'BP_Group_Extension' ) ) :// Recommended, to prevent problem
20
if ( ! bp_is_group_creation_step ( $this->slug ) )
21
return false;
22
?>
23
- <h4><?php _e ( "Album Creation Control", 'rtmedia' ); ?></h4>
24
- <p><?php _e ( "Who can create Albums in this group?", 'rtmedia' ); ?></p>
25
<div class="radio">
26
<label>
27
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_all" checked="checked" value="all">
28
- <strong><?php _e ( "All Group Members", 'rtmedia' ); ?></strong>
29
</label>
30
<label>
31
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="moderators">
32
- <strong><?php _e ( "Group Admins and Mods only", 'rtmedia' ); ?></strong>
33
</label>
34
<label>
35
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_admin" value="admin">
36
- <strong><?php _e ( "Group Admin only", 'rtmedia' ); ?></strong>
37
</label>
38
</div>
39
@@ -72,27 +72,27 @@ if ( class_exists ( 'BP_Group_Extension' ) ) :// Recommended, to prevent problem
72
}
73
?>
74
75
- <h4><?php _e ( "Album Creation Control", 'rtmedia' ); ?></h4>
76
- <p><?php _e ( "Who can create Albums in this group?", 'rtmedia' ); ?></p>
77
<div class="radio">
78
<label>
79
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="all"<?php checked ( $current_level, 'all', true ) ?>>
80
- <strong><?php _e ( "All Group Members", 'rtmedia' ); ?></strong>
81
</label>
82
<label>
83
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="moderators" <?php checked ( $current_level, 'moderators', true ) ?>>
84
- <strong><?php _e ( "Group Admins and Mods only", 'rtmedia' ); ?></strong>
85
</label>
86
<label>
87
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_admin" value="admin" <?php checked ( $current_level, 'admin', true ) ?>>
88
- <strong><?php _e ( "Group Admin only", 'rtmedia' ); ?></strong>
89
</label>
90
</div>
91
<hr>
92
93
94
<?php do_action('rtmedia_playlist_creation_settings_groups_edit'); ?>
95
- <input type="submit" name="save" value="<?php _e ( "Save Changes", 'rtmedia' ); ?>" />
96
<?php
97
wp_nonce_field ( 'groups_edit_save_' . $this->slug );
98
}
@@ -121,9 +121,9 @@ if ( class_exists ( 'BP_Group_Extension' ) ) :// Recommended, to prevent problem
121
122
/* To post an error/success message to the screen, use the following */
123
if ( ! $success )
124
- bp_core_add_message ( __ ( 'There was an error saving, please try again', 'rtmedia' ), 'error' );
125
else
126
- bp_core_add_message ( __ ( 'Settings saved successfully', 'rtmedia' ) );
127
128
bp_core_redirect ( bp_get_group_permalink ( $bp->groups->current_group ) . '/admin/' . $this->slug );
129
}
@@ -143,8 +143,8 @@ if ( class_exists ( 'BP_Group_Extension' ) ) :// Recommended, to prevent problem
143
<div class="info-group" >
144
<h4><?php echo esc_attr ( $this->name ) ?></h4>
145
<p>
146
- <?php _e ( "You could display a small snippet of information from your group extension here. It will show on the group
147
- home screen.", 'rtmedia' ); ?>
148
</p>
149
</div>
150
<?php
20
if ( ! bp_is_group_creation_step ( $this->slug ) )
21
return false;
22
?>
23
+ <h4><?php _e( 'Album Creation Control', 'rtmedia' ); ?></h4>
24
+ <p><?php _e( 'Who can create Albums in this group?', 'rtmedia' ); ?></p>
25
<div class="radio">
26
<label>
27
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_all" checked="checked" value="all">
28
+ <strong><?php _e( 'All Group Members', 'rtmedia' ); ?></strong>
29
</label>
30
<label>
31
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="moderators">
32
+ <strong><?php _e( 'Group Admins and Mods only', 'rtmedia' ); ?></strong>
33
</label>
34
<label>
35
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_admin" value="admin">
36
+ <strong><?php _e( 'Group Admin only', 'rtmedia' ); ?></strong>
37
</label>
38
</div>
39
72
}
73
?>
74
75
+ <h4><?php _e( 'Album Creation Control', 'rtmedia' ); ?></h4>
76
+ <p><?php _e( 'Who can create Albums in this group?', 'rtmedia' ); ?></p>
77
<div class="radio">
78
<label>
79
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="all"<?php checked ( $current_level, 'all', true ) ?>>
80
+ <strong><?php _e( 'All Group Members', 'rtmedia' ); ?></strong>
81
</label>
82
<label>
83
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="moderators" <?php checked ( $current_level, 'moderators', true ) ?>>
84
+ <strong><?php _e( 'Group Admins and Mods only', 'rtmedia' ); ?></strong>
85
</label>
86
<label>
87
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_admin" value="admin" <?php checked ( $current_level, 'admin', true ) ?>>
88
+ <strong><?php _e ( 'Group Admin only', 'rtmedia' ); ?></strong>
89
</label>
90
</div>
91
<hr>
92
93
94
<?php do_action('rtmedia_playlist_creation_settings_groups_edit'); ?>
95
+ <input type="submit" name="save" value="<?php _e( 'Save Changes', 'rtmedia' ); ?>" />
96
<?php
97
wp_nonce_field ( 'groups_edit_save_' . $this->slug );
98
}
121
122
/* To post an error/success message to the screen, use the following */
123
if ( ! $success )
124
+ bp_core_add_message ( __( 'There was an error saving, please try again', 'rtmedia' ), 'error' );
125
else
126
+ bp_core_add_message ( __( 'Settings saved successfully', 'rtmedia' ) );
127
128
bp_core_redirect ( bp_get_group_permalink ( $bp->groups->current_group ) . '/admin/' . $this->slug );
129
}
143
<div class="info-group" >
144
<h4><?php echo esc_attr ( $this->name ) ?></h4>
145
<p>
146
+ <?php _e( 'You could display a small snippet of information from your group extension here. It will show on the group
147
+ home screen.', 'rtmedia' ); ?>
148
</p>
149
</div>
150
<?php
app/main/controllers/media/RTMediaAlbum.php CHANGED
@@ -124,7 +124,7 @@ class RTMediaAlbum {
124
125
/* Album Details which will be passed to Database query to add the album */
126
$post_vars = array(
127
- 'post_title' => (empty ( $title )) ? 'Untitled Album' : $title,
128
'post_type' => 'rtmedia_album',
129
'post_author' => $author_id,
130
'post_status' => 'publish'
124
125
/* Album Details which will be passed to Database query to add the album */
126
$post_vars = array(
127
+ 'post_title' => (empty ( $title )) ? __( 'Untitled Album', 'rtmedia' ) : $title,
128
'post_type' => 'rtmedia_album',
129
'post_author' => $author_id,
130
'post_status' => 'publish'
app/main/controllers/media/RTMediaFeatured.php CHANGED
@@ -22,9 +22,9 @@ class RTMediaFeatured extends RTMediaUserInteraction {
22
function __construct ( $user_id = false, $flag = false ) {
23
$args = array(
24
'action' => 'featured',
25
- 'label' => __('Set Featured'),
26
'plural' => '',
27
- 'undo_label' => __('Unset Featured'),
28
'privacy' => 60,
29
'countable' => false,
30
'single' => true,
22
function __construct ( $user_id = false, $flag = false ) {
23
$args = array(
24
'action' => 'featured',
25
+ 'label' => __( 'Set Featured', 'rtmedia' ),
26
'plural' => '',
27
+ 'undo_label' => __( 'Unset Featured', 'rtmedia' ),
28
'privacy' => 60,
29
'countable' => false,
30
'single' => true,
app/main/controllers/media/RTMediaLike.php CHANGED
@@ -14,9 +14,9 @@ class RTMediaLike extends RTMediaUserInteraction {
14
function __construct() {
15
$args = array(
16
'action' => 'like',
17
- 'label' => __('Like'),
18
- 'plural' => __('Likes'),
19
- 'undo_label' => __('Unlike'),
20
'privacy' => 20,
21
'countable' => true,
22
'single' => false,
14
function __construct() {
15
$args = array(
16
'action' => 'like',
17
+ 'label' => __( 'Like', 'rtmedia' ),
18
+ 'plural' => __( 'Likes', 'rtmedia' ),
19
+ 'undo_label' => __( 'Unlike', 'rtmedia' ),
20
'privacy' => 20,
21
'countable' => true,
22
'single' => false,
app/main/controllers/media/RTMediaMedia.php CHANGED
@@ -398,7 +398,7 @@ class RTMediaMedia {
398
wp_update_attachment_metadata ( $attachment_id, wp_generate_attachment_metadata ( $attachment_id, $file_object[ $key ][ 'file' ] ) );
399
} else {
400
unlink ( $file_object[ $key ][ 'file' ] );
401
- throw new Exception ( __ ( 'Error creating attachment for the media file, please try again', 'buddypress-media' ) );
402
}
403
$updated_attachment_ids[ ] = $attachment_id;
404
}
@@ -495,7 +495,7 @@ class RTMediaMedia {
495
$media_str = constant ( $media_const );
496
497
$action = sprintf (
498
- _n (
499
'%s added a %s', '%s added %d %s.', $count, 'rtmedia'
500
), $username, $media->media_type, $media_str
501
);
@@ -514,6 +514,10 @@ class RTMediaMedia {
514
515
if ( $media->context == 'group' || 'profile' ) {
516
$activity_args[ 'component' ] = $media->context;
517
}
518
519
$activity_id = bp_activity_add ( $activity_args );
398
wp_update_attachment_metadata ( $attachment_id, wp_generate_attachment_metadata ( $attachment_id, $file_object[ $key ][ 'file' ] ) );
399
} else {
400
unlink ( $file_object[ $key ][ 'file' ] );
401
+ throw new Exception ( __( 'Error creating attachment for the media file, please try again', 'rtmedia' ) );
402
}
403
$updated_attachment_ids[ ] = $attachment_id;
404
}
495
$media_str = constant ( $media_const );
496
497
$action = sprintf (
498
+ _n(
499
'%s added a %s', '%s added %d %s.', $count, 'rtmedia'
500
), $username, $media->media_type, $media_str
501
);
514
515
if ( $media->context == 'group' || 'profile' ) {
516
$activity_args[ 'component' ] = $media->context;
517
+ if( $media->context == 'group' ) {
518
+ $activity_args[ 'component' ] = "groups";
519
+ $activity_args[ 'item_id' ] = $media->context_id;
520
+ }
521
}
522
523
$activity_id = bp_activity_add ( $activity_args );
app/main/controllers/privacy/RTMediaPrivacy.php CHANGED
@@ -237,7 +237,7 @@ class RTMediaPrivacy {
237
<form method='post'>
238
<div class="">
239
<div class="section">
240
- <div class="columns large-2"><h2><?php echo __ ( "Default Privacy" , "rtmedia" ) ; ?></h2></div>
241
<div class="columns large-5">
242
<?php foreach ( $rtmedia -> privacy_settings[ 'levels' ] as $level => $data ) { ?>
243
<label><input type='radio' value='<?php echo $level ; ?>' name ='rtmedia-default-privacy' <?php echo ($default_privacy == $level) ? "checked" : "" ; ?> /> <?php _e ( $data ) ; ?></label><br/>
@@ -247,14 +247,14 @@ class RTMediaPrivacy {
247
</div>
248
<br/>
249
<div class="submit">
250
- <input type="submit" name="submit" value="<?php _e ( "Save Changes" ) ; ?>" id="submit" class="auto">
251
</div>
252
</form>
253
<?php
254
}
255
256
function title () {
257
- return __ ( 'Privacy' , 'rtmedia' ) ;
258
}
259
260
function activity_privacy ( $sql , $select_sql , $from_sql , $where_sql , $sort , $pag_sql = '' ) {
237
<form method='post'>
238
<div class="">
239
<div class="section">
240
+ <div class="columns large-2"><h2><?php _e( "Default Privacy" , "rtmedia" ) ; ?></h2></div>
241
<div class="columns large-5">
242
<?php foreach ( $rtmedia -> privacy_settings[ 'levels' ] as $level => $data ) { ?>
243
<label><input type='radio' value='<?php echo $level ; ?>' name ='rtmedia-default-privacy' <?php echo ($default_privacy == $level) ? "checked" : "" ; ?> /> <?php _e ( $data ) ; ?></label><br/>
247
</div>
248
<br/>
249
<div class="submit">
250
+ <input type="submit" name="submit" value="<?php esc_attr_e( 'Save Changes', 'rtmedia' ); ?>" id="submit" class="auto">
251
</div>
252
</form>
253
<?php
254
}
255
256
function title () {
257
+ return __( 'Privacy', 'rtmedia' ) ;
258
}
259
260
function activity_privacy ( $sql , $select_sql , $from_sql , $where_sql , $sort , $pag_sql = '' ) {
app/main/controllers/shortcodes/RTMediaUploadShortcode.php CHANGED
@@ -67,7 +67,7 @@ class RTMediaUploadShortcode {
67
68
if ( self::display_allowed () || ( isset( $attr['allow_anonymous'] ) && $attr['allow_anonymous'] === true ) ) {
69
if ( ! _device_can_upload () ) {
70
- echo '<p>' . __ ( 'The web browser on your device cannot be used to upload files.' ) . '</p>';
71
return;
72
}
73
ob_start ();
67
68
if ( self::display_allowed () || ( isset( $attr['allow_anonymous'] ) && $attr['allow_anonymous'] === true ) ) {
69
if ( ! _device_can_upload () ) {
70
+ echo '<p>' . __( 'The web browser on your device cannot be used to upload files.', 'rtmedia' ) . '</p>';
71
return;
72
}
73
ob_start ();
app/main/controllers/template/RTMediaTemplate.php CHANGED
@@ -196,18 +196,18 @@ class RTMediaTemplate {
196
add_action ( "rtmedia_before_template_load", array( &$this, "media_update_success_error" ) );
197
}
198
} else {
199
- echo __ ( "Ooops !!! Invalid access. No nonce was found !!", "rtmedia" );
200
}
201
}
202
203
function media_update_success_messege () {
204
- $message = apply_filters ( "rtmedia_update_media_message", "Media updated Sucessfully", false );
205
$html = "<div class='rtmedia-success media-edit-messge'>" . __ ( $message, "rtmedia" ) . "</div>";
206
echo apply_filters ( "rtmedia_update_media_message_html", $html, $message, false );
207
}
208
209
function media_update_success_error () {
210
- $message = apply_filters ( "rtmedia_update_media_message", "Error in updating Media", true );
211
$html = "<div class='rtmedia-error media-edit-messge'>" . __ ( $message, "rtmedia" ) . "</div>";
212
echo apply_filters ( "rtmedia_update_media_message_html", $html, $message, true );
213
}
@@ -258,7 +258,7 @@ class RTMediaTemplate {
258
wp_safe_redirect ( get_rtmedia_permalink ( $rtmedia_query->media_query[ 'album_id' ] ) . 'edit/' );
259
die();
260
} else {
261
- echo __ ( "Ooops !!! Invalid access. No nonce was found !!", "rtmedia" );
262
}
263
}
264
@@ -331,7 +331,7 @@ class RTMediaTemplate {
331
wp_safe_redirect ( $redirect_url );
332
die();
333
} else {
334
- echo __ ( "Ooops !!! Invalid access. No nonce was found !!", "rtmedia" );
335
}
336
}
337
@@ -429,7 +429,7 @@ class RTMediaTemplate {
429
exit;
430
}
431
} else {
432
- echo "Ooops !!! Invalid access. No nonce was found !!";
433
}
434
}
435
}
196
add_action ( "rtmedia_before_template_load", array( &$this, "media_update_success_error" ) );
197
}
198
} else {
199
+ _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
200
}
201
}
202
203
function media_update_success_messege () {
204
+ $message = apply_filters ( "rtmedia_update_media_message", __( 'Media updated Sucessfully', 'rtmedia' ), false );
205
$html = "<div class='rtmedia-success media-edit-messge'>" . __ ( $message, "rtmedia" ) . "</div>";
206
echo apply_filters ( "rtmedia_update_media_message_html", $html, $message, false );
207
}
208
209
function media_update_success_error () {
210
+ $message = apply_filters ( "rtmedia_update_media_message", __( 'Error in updating Media', 'rtmedia' ), true );
211
$html = "<div class='rtmedia-error media-edit-messge'>" . __ ( $message, "rtmedia" ) . "</div>";
212
echo apply_filters ( "rtmedia_update_media_message_html", $html, $message, true );
213
}
258
wp_safe_redirect ( get_rtmedia_permalink ( $rtmedia_query->media_query[ 'album_id' ] ) . 'edit/' );
259
die();
260
} else {
261
+ _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
262
}
263
}
264
331
wp_safe_redirect ( $redirect_url );
332
die();
333
} else {
334
+ _e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
335
}
336
}
337
429
exit;
430
}
431
} else {
432
+ _e ( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
433
}
434
}
435
}
app/main/controllers/template/rt-template-functions.php CHANGED
@@ -152,9 +152,9 @@ function rtmedia_id ( $media_id = false ) {
152
if ( $media_id ) {
153
$model = new RTMediaModel();
154
$media = $model->get_media ( array( 'media_id' => $media_id ), 0, 1 );
155
- if(isset($media) && sizeof($media) > 0 ) {
156
- return $media[ 0 ]->id;
157
- }
158
return false;
159
} else {
160
global $rtmedia_media;
@@ -288,12 +288,12 @@ function rtmedia_image ( $size = 'rt_media_thumbnail', $id = false ,$recho = tru
288
} else {
289
$thumbnail_id = false;
290
}
291
- if($media_object->media_type == 'music' && $thumbnail_id == "") {
292
- $thumbnail_id = get_music_cover_art(get_attached_file($media_object->media_id),$media_object->id);
293
- }
294
- if($media_object->media_type == 'music' && $thumbnail_id == "-1") {
295
- $thumbnail_id = false;
296
- }
297
298
} else {
299
$src = false;
@@ -410,10 +410,10 @@ function rtmedia_description_input () {
410
411
$name = 'description';
412
if(isset($rtmedia_media->post_content)) {
413
- $value = $rtmedia_media->post_content;
414
} else {
415
- $post_details = get_post($rtmedia_media->media_id);
416
- $value = $post_details->post_content;
417
}
418
419
@@ -504,7 +504,7 @@ function rtmedia_actions () {
504
if ( is_user_logged_in () && rtmedia_edit_allowed () ) {
505
506
$actions[ ] = '<form action="' . get_rtmedia_permalink ( rtmedia_id () ) . 'edit/">
507
- <button type="submit" >' . __ ( 'Edit', 'rtmedia' ) . '</button></form>';
508
}
509
$actions = apply_filters ( 'rtmedia_action_buttons_before_delete', $actions );
510
foreach ( $actions as $action ) {
@@ -523,7 +523,7 @@ function rtmedia_actions () {
523
}
524
525
/**
526
- * rendering comments section
527
*/
528
function rtmedia_comments () {
529
@@ -541,7 +541,7 @@ function rtmedia_comments () {
541
if( $comment_list != "") {
542
$html .= $comment_list;
543
} else {
544
- $html .= "<li id='rtmedia-no-comments'>". __(apply_filters('rtmedia_single_media_no_comment_messege','There are no comments on this media yet.')) . "</li>";
545
}
546
547
$html .= '</ul>';
@@ -627,7 +627,7 @@ function rtmedia_pagination_next_link () {
627
$link .= $site_url . bp_get_groups_root_slug () . '/' . bp_get_current_group_slug () . '/';
628
} else {
629
//$post = get_post ( $rtmedia_media->post_parent );
630
- $post = get_post ( get_post_field("post_parent", $rtmedia_media->media_id));
631
632
$link .= $site_url . $post->post_name . '/';
633
}
@@ -654,9 +654,9 @@ function rtmedia_comments_enabled () {
654
function is_rtmedia_gallery () {
655
global $rtmedia_query;
656
if ( $rtmedia_query )
657
- return $rtmedia_query->is_gallery ();
658
else
659
- return false;
660
}
661
662
/**
@@ -666,9 +666,9 @@ function is_rtmedia_gallery () {
666
function is_rtmedia_album_gallery () {
667
global $rtmedia_query;
668
if ( $rtmedia_query )
669
- return $rtmedia_query->is_album_gallery ();
670
else
671
- return false;
672
}
673
674
/**
@@ -802,9 +802,9 @@ function rtmedia_vedio_editor() {
802
}
803
804
function update_activity_after_thumb_set($id) {
805
- $model = new RTMediaModel();
806
- $mediaObj = new RTMediaMedia();
807
- $media = $model->get(array('id' => $id));
808
$privacy = $media[0]->privacy;
809
$activity_id = rtmedia_activity_id($id);
810
$same_medias = $mediaObj->model->get ( array( 'activity_id' => $activity_id ) );
@@ -822,14 +822,14 @@ function update_activity_after_thumb_set($id) {
822
$activity = $activity_get['activities'][0];
823
$activity_body = $activity->content;
824
bp_activity_update_meta ($activity_id, "bp_old_activity_content", $activity_body);
825
- //extract activity text from old content
826
$activity_text = strip_tags($activity_body, '<span>');
827
- $activity_text = explode("</span>", $activity_text);
828
- $activity_text = strip_tags($activity_text[0]);
829
bp_activity_update_meta ($activity_id, "bp_activity_text", $activity_text);
830
}
831
- $activity_text = bp_activity_get_meta($activity_id, "bp_activity_text");
832
- $objActivity->activity_text =$activity_text;
833
$wpdb->update ( $bp->activity->table_name, array( "type" => "rtmedia_update", "content" => $objActivity->create_activity_html () ), array( "id" => $activity_id ) );
834
}
835
@@ -838,7 +838,7 @@ function set_video_thumbnail($id) {
838
if ('video' == $media_type) {
839
$model = new RTMediaModel();
840
$model->update(array('cover_art' => $_POST['rtmedia-thumbnail']), array('id' => $id));
841
- update_activity_after_thumb_set($id);
842
// code to update activity
843
844
}
@@ -857,8 +857,8 @@ function rtmedia_image_editor () {
857
$nonce = wp_create_nonce ( "image_editor-$media_id" );
858
echo '<div id="imgedit-response-' . $media_id . '"></div>';
859
echo '<div class="wp_attachment_image" id="media-head-' . $media_id . '">
860
- <p id="thumbnail-head-' . $id . '"><img class="thumbnail" src="' . set_url_scheme ( $thumb_url[ 0 ] ) . '" alt="" /></p>
861
- <p><input type="button" class="rtmedia-image-edit" id="imgedit-open-btn-' . $media_id . '" onclick="imageEdit.open( \'' . $media_id . '\', \'' . $nonce . '\' )" class="button" value="Modify Image"> <span class="spinner"></span></p></div>';
862
echo '</div>';
863
}
864
@@ -890,10 +890,10 @@ function rtmedia_comment_form () {
890
<form method="post" id="rt_media_comment_form" action="<?php echo get_rtmedia_permalink ( rtmedia_id () ); ?>comment/">
891
<div class="row">
892
<div class="large-12 columns">
893
- <textarea style="width:100%" placeholder="<?php _e ( "Type Comment...", 'rtmedia' ); ?>" name="comment_content" id="comment_content"></textarea>
894
</div>
895
</div>
896
- <input type="submit" id="rt_media_comment_submit" value="<?php _e ( 'Comment', 'rtmedia' ); ?>">
897
<?php RTMediaComment::comment_nonce_generator (); ?>
898
</form>
899
<?php
@@ -925,7 +925,7 @@ function rtmedia_delete_form () {
925
echo $html;
926
RTMediaMedia::media_nonce_generator ( rtmedia_id (), true );
927
do_action("rtmedia_media_single_delete_form");
928
- echo '<button type="submit" class="rtmedia-delete-media">' . __ ( 'Delete', 'rtmedia' ) . '</button></form>';
929
}
930
931
/**
@@ -1023,9 +1023,9 @@ function rtmedia_user_album_list ( $get_all = false ) {
1023
}
1024
$option = "$global_option";
1025
if($profile_option != "")
1026
- $option.= "<optgroup label='".__("Profile Albums","rtmedia")." ' value = 'profile'>$profile_option</optgroup>";
1027
if($option_group != "")
1028
- $option.="<optgroup label='".__("Group Albums","rtmedia")."' value = 'group'>$option_group</optgroup>";
1029
if ( $option )
1030
return $option;
1031
else
@@ -1050,13 +1050,13 @@ function rtmedia_group_album_list () {
1050
if ( $album_objects ) {
1051
foreach ( $album_objects as $album ) {
1052
if ( ! in_array ( $album->id, $global_albums ) && (( isset ( $rtmedia_query->media_query[ 'album_id' ] ) && ($album->id != $rtmedia_query->media_query[ 'album_id' ])) || ! isset ( $rtmedia_query->media_query[ 'album_id' ] ) ) )
1053
- $option_group .= '<option value="' . $album->id . '">' . $album->media_title . '</option>';
1054
1055
}
1056
}
1057
$option = $global_option;
1058
if($option_group != "")
1059
- $option.="<optgroup label='".__("Group Albums")."' value = 'group'>$option_group</optgroup>";
1060
if ( $option )
1061
return $option;
1062
else
@@ -1069,12 +1069,12 @@ add_action ( 'rtmedia_album_gallery_actions', 'rtmedia_create_album' );
1069
1070
function rtmedia_create_album () {
1071
if ( ! is_rtmedia_album_enable () ) {
1072
- return;
1073
}
1074
$return = true;
1075
$return = apply_filters("rtm_is_album_create_enable", $return);
1076
if(!$return) {
1077
- return;
1078
}
1079
global $rtmedia_query;
1080
$user_id = get_current_user_id ();
@@ -1083,9 +1083,9 @@ function rtmedia_create_album () {
1083
switch ( $rtmedia_query->query[ 'context' ] ) {
1084
case 'profile':
1085
if ( $rtmedia_query->query[ 'context_id' ] == $user_id ) {
1086
- $display = true;
1087
- $display = apply_filters("rtm_display_create_album_button", $display,$user_id);
1088
- }
1089
break;
1090
case 'group':
1091
$group_id = $rtmedia_query->query[ 'context_id' ];
@@ -1097,7 +1097,7 @@ function rtmedia_create_album () {
1097
}
1098
if ( $display === true ) {
1099
?>
1100
- <i class="rtmedia-reveal-modal icon-plus-sign icon-2x" data-reveal-id="rtmedia-create-album-modal" title="<?php _e ( "Create New Album", "rtmedia" ); ?>"></i>
1101
<div class="reveal-modal rtm-modal small" id='rtmedia-create-album-modal'>
1102
<div id="rtm-modal-container">
1103
<h2 class="rtm-modal-title"><?php _e('Create New Album', 'rtmedia'); ?></h2>
@@ -1106,7 +1106,7 @@ function rtmedia_create_album () {
1106
<input type="text" id="rtmedia_album_name" value="" class="rtm-input-medium" />
1107
<input type="hidden" id="rtmedia_album_context" value="<?php echo $rtmedia_query->query[ 'context' ]; ?>">
1108
<input type="hidden" id="rtmedia_album_context_id" value="<?php echo $rtmedia_query->query[ 'context_id' ]; ?>">
1109
- <button type="button" id="rtmedia_create_new_album"><?php _e ( "Create Album", "rtmedia" ); ?></button>
1110
</p>
1111
<?php do_action("rtmedia_add_album_privacy"); ?>
1112
</div>
@@ -1147,7 +1147,7 @@ function rtmedia_album_edit () {
1147
<?php
1148
if ( isset ( $rtmedia_query->media_query ) && ! in_array ( $rtmedia_query->media_query[ 'album_id' ], rtmedia_get_site_option ( 'rtmedia-global-albums' ) ) ) {
1149
//if ( isset ( $rtmedia_query->media_query[ 'media_author' ] ) && get_current_user_id () == $rtmedia_query->media_query[ 'media_author' ] ) {
1150
- if ( rtmedia_is_album_editable() || is_rt_admin() ) {
1151
?>
1152
<a href="edit/" class="icon-edit rtmedia-edit icon-2x" title="<?php _e ( 'Edit', 'rtmedia' ); ?>"></a>
1153
<form method="post" class="album-delete-form rtmedia-inline" action="delete/">
@@ -1156,21 +1156,21 @@ function rtmedia_album_edit () {
1156
</form>
1157
1158
<?php
1159
- if(is_rtmedia_group_album())
1160
- $album_list = rtmedia_group_album_list();
1161
- else
1162
- $album_list = rtmedia_user_album_list();
1163
- if ( $album_list ) {
1164
- ?>
1165
- <i class="icon-code-fork rtmedia-reveal-modal icon-2x" data-reveal-id="rtmedia-merge" title="<?php _e ( 'Merge', 'rtmedia' ); ?>" ></i>
1166
<div class="rtmedia-merge-container reveal-modal small rtm-modal" id="rtmedia-merge">
1167
<div id="rtm-modal-container">
1168
- <h2 class="rtm-modal-title"><?php _e ( 'Merge Album', 'rtmedia' ); ?></h2>
1169
<form method="post" class="album-merge-form" action="merge/">
1170
<?php _e('Select Album to merge with : ','rtmedia'); ?>
1171
<?php echo '<select name="album" class="rtmedia-merge-user-album-list">' . $album_list . '</select>'; ?>
1172
<?php wp_nonce_field ( 'rtmedia_merge_album_' . $rtmedia_query->media_query[ 'album_id' ], 'rtmedia_merge_album_nonce' ); ?>
1173
- <input type="submit" class="rtmedia-move-selected" name="merge-album" value="<?php _e ( 'Merge Album', 'rtmedia' ); ?>" />
1174
</form>
1175
</div>
1176
<a class="close-reveal-modal" >&#215;</a>
@@ -1361,9 +1361,9 @@ function get_rtmedia_like($media_id = false) {
1361
$mediamodel = new RTMediaModel();
1362
$actions = $mediamodel->get( array( 'id' => rtmedia_id($media_id) ) );
1363
if(isset($actions[ 0 ]->likes)){
1364
- $actions = intval($actions[ 0 ]->likes);
1365
}else{
1366
- $actions = 0;
1367
}
1368
return $actions;
1369
}
@@ -1386,27 +1386,27 @@ function add_music_cover_art($file_object, $upload_obj) {
1386
$mediaObj = new RTMediaMedia();
1387
$media = $mediaObj->model->get ( array( 'id' => $upload_obj->media_ids[ 0 ] ) );
1388
if ( $media[ 0 ]->media_type == "music" ) {
1389
- //$cover_art = get_music_cover_art($file_object[0]['file'], $upload_obj->media_ids[ 0 ]);
1390
}
1391
}
1392
1393
function get_music_cover_art($file, $id) {
1394
$mediaObj = new RTMediaMedia();
1395
if ( ! class_exists ( "getID3" ) ) {
1396
- include_once(trailingslashit ( RTMEDIA_PATH ) . 'lib/getid3/getid3.php');
1397
}
1398
$getID3 = new getID3;
1399
$file_info = $getID3->analyze ( $file );
1400
if( isset($file_info['id3v2']['APIC']) && is_array ( $file_info['id3v2']['APIC'] ) && $file_info['id3v2']['APIC'] != "" ) {
1401
- $title = "cover_art";
1402
- if(isset($file_info['id3v2']['comments']['title'][0])) {
1403
- $title = $file_info['id3v2']['comments']['title'][0];
1404
- }
1405
- $thumb_upload_info = wp_upload_bits($file_info['id3v2']['comments']['title'][0].".jpeg", null, $file_info['id3v2']['APIC'][0]['data']);
1406
- if( is_array ( $thumb_upload_info ) && $thumb_upload_info['url'] != "") {
1407
- $mediaObj->model->update ( array( 'cover_art' => $thumb_upload_info['url'] ), array( 'id' => $id ) );
1408
- return $thumb_upload_info['url'];
1409
- }
1410
}
1411
$mediaObj->model->update ( array( 'cover_art' => "-1" ), array( 'id' => $id ) );
1412
return false;
@@ -1415,13 +1415,13 @@ function get_music_cover_art($file, $id) {
1415
add_filter("media_add_tabs","rtmedia_admin_premium_tab", 99, 1);
1416
function rtmedia_admin_premium_tab($tabs) {
1417
if(sizeof($tabs) == 0) {
1418
- $tabs = array();
1419
}
1420
$tabs[] = array(
1421
'href' => get_admin_url ( null, add_query_arg ( array( 'page' => 'rtmedia-premium' ), 'admin.php' ) ),
1422
'name' => __ ( 'Premium', 'rtmedia' ),
1423
'slug' => 'rtmedia-premium',
1424
- 'class' => array('rtm-premium')
1425
);
1426
return $tabs;
1427
}
@@ -1431,116 +1431,109 @@ add_action("rtmedia_admin_page_insert", "rtmedia_admin_premium_page", 99, 1);
1431
function rtmedia_admin_premium_page($page) {
1432
if ('rtmedia-premium' == $page) {
1433
?>
1434
- <div class="premium-page-container">
1435
- <div class="row">
1436
- <h1 class="premium-title">Reasons to buy rtMedia-PRO</h1>
1437
- </div>
1438
- <div class="row">
1439
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-rss icon-3x"></i></div>
1440
- <div class="columns large-10">
1441
- <h2>RSS feed and Podcast Support</h2>
1442
- <p>You can view media with RSS reader and enjoy media through Podcast.</p>
1443
- </div>
1444
- </div>
1445
- <div class="row">
1446
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-comments icon-3x"></i></div>
1447
- <div class="columns large-10">
1448
- <h2>WordPress Comment Attachment</h2>
1449
- <p>You can attach files to WordPress comments.</p>
1450
- </div>
1451
- </div>
1452
- <div class="row">
1453
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-user icon-3x"></i></div>
1454
- <div class="columns large-10">
1455
- <h2>bbPress Attachment</h2>
1456
- <p>You can attach files to bbPress topic and reply.</p>
1457
- </div>
1458
- </div>
1459
- <div class="row">
1460
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-file-alt icon-3x"></i></div>
1461
- <div class="columns large-10">
1462
- <h2>Document Support</h2>
1463
- <p>You can add, view and download documents like txt, doc, pdf, also add and upload other file types like zip, tar and tar.gz etc.</p>
1464
- </div>
1465
- </div>
1466
- <div class="row">
1467
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-gamepad icon-3x"></i></div>
1468
- <div class="columns large-10">
1469
- <h2>CubePoints & MyCRED Integration</h2>
1470
- <p>Integrating CubePoints/myCRED with rtMedia, you can reward users with virtual points on rtMedia activities.</p>
1471
- </div>
1472
- </div>
1473
- <div class="row">
1474
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-lock icon-3x"></i></div>
1475
- <div class="columns large-10">
1476
- <h2>Album Privacy</h2>
1477
- <p>This will allow you to set album privacy while creating albums or change album privacy with editing albums too.</p>
1478
- </div>
1479
- </div>
1480
- <div class="row">
1481
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-play icon-3x"></i></div>
1482
- <div class="columns large-10">
1483
- <h2>Audio Playlist</h2>
1484
- <p>With this feature you can create your audio playlists and listen to your favorite music at will.</p>
1485
- </div>
1486
- </div>
1487
- <div class="row">
1488
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-warning-sign icon-3x"></i></div>
1489
- <div class="columns large-10">
1490
- <h2>Report Button & Moderation Tools</h2>
1491
- <p>Users can report media if they find it offensive. Set number of reports to automatically take down media.</p>
1492
- </div>
1493
- </div>
1494
- <div class="row">
1495
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-download-alt icon-3x"></i></div>
1496
- <div class="columns large-10">
1497
- <h2>Download Button For Media</h2>
1498
- <p>Users can download photos, videos and music. Admin has option to allow download the media.</p>
1499
- </div>
1500
- </div>
1501
- <div class="row">
1502
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-align-right icon-3x"></i></div>
1503
- <div class="columns large-10">
1504
- <h2>Sidebar widgets</h2>
1505
- <p>These will let you display a gallery or an uploader in a sidebar. Several of them can be used in a single sidebar.</p>
1506
- </div>
1507
- </div>
1508
- <div class="row">
1509
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-edit icon-3x"></i></div>
1510
- <div class="columns large-10">
1511
- <h2>Post-editor button</h2>
1512
- <p>With this button, a UI appears to quickly generate shortcodes for special pages like ‘Editorial Picks’.</p>
1513
- </div>
1514
- </div>
1515
- <div class="row">
1516
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-star icon-3x"></i></div>
1517
- <div class="columns large-10">
1518
- <h2>Star-Rating option</h2>
1519
- <p>Users can give up to five stars to rate media. This data can be used for ‘Most Rated Media’ in sidebars.</p>
1520
- </div>
1521
- </div>
1522
- <div class="row">
1523
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-picture icon-3x"></i></div>
1524
- <div class="columns large-10">
1525
- <h2>Global Albums</h2>
1526
- <p>Multiple global albums can be created beforehand. One of these can be chosen as the default album.</p>
1527
- </div>
1528
- </div>
1529
- <div class="row">
1530
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-wrench icon-3x"></i></div>
1531
- <div class="columns large-10">
1532
- <h2>Premium one-to-one support</h2>
1533
- <p>Without leaving your WordPress dashboard, you can contact us for help using a support form.</p>
1534
- </div>
1535
- </div>
1536
- <div class="row">
1537
- <div class="columns large-1 rtm-premium-icon-pro"><i class="icon-code icon-3x"></i></div>
1538
- <div class="columns large-10">
1539
- <h2>Premium & Open-Source</h2>
1540
- <p>Developers get full control over rtMedia-PRO’s source. They’ll get access to <a href="http://git.rtcamp.com/" target="_blank">git.rtcamp.com</a> to dive into the code.</p>
1541
- </div>
1542
- </div>
1543
- </div>
1544
<?php
1545
}
1546
}
152
if ( $media_id ) {
153
$model = new RTMediaModel();
154
$media = $model->get_media ( array( 'media_id' => $media_id ), 0, 1 );
155
+ if(isset($media) && sizeof($media) > 0 ) {
156
+ return $media[ 0 ]->id;
157
+ }
158
return false;
159
} else {
160
global $rtmedia_media;
288
} else {
289
$thumbnail_id = false;
290
}
291
+ if($media_object->media_type == 'music' && $thumbnail_id == "") {
292
+ $thumbnail_id = get_music_cover_art(get_attached_file($media_object->media_id),$media_object->id);
293
+ }
294
+ if($media_object->media_type == 'music' && $thumbnail_id == "-1") {
295
+ $thumbnail_id = false;
296
+ }
297
298
} else {
299
$src = false;
410
411
$name = 'description';
412
if(isset($rtmedia_media->post_content)) {
413
+ $value = $rtmedia_media->post_content;
414
} else {
415
+ $post_details = get_post($rtmedia_media->media_id);
416
+ $value = $post_details->post_content;
417
}
418
419
504
if ( is_user_logged_in () && rtmedia_edit_allowed () ) {
505
506
$actions[ ] = '<form action="' . get_rtmedia_permalink ( rtmedia_id () ) . 'edit/">
507
+ <button type="submit" >' . __ ( 'Edit', 'rtmedia' ) . '</button></form>';
508
}
509
$actions = apply_filters ( 'rtmedia_action_buttons_before_delete', $actions );
510
foreach ( $actions as $action ) {
523
}
524
525
/**
526
+ * rendering comments section
527
*/
528
function rtmedia_comments () {
529
541
if( $comment_list != "") {
542
$html .= $comment_list;
543
} else {
544
+ $html .= "<li id='rtmedia-no-comments'>". __(apply_filters('rtmedia_single_media_no_comment_messege', __( 'There are no comments on this media yet.', 'rtmedia' ) )) . "</li>";
545
}
546
547
$html .= '</ul>';
627
$link .= $site_url . bp_get_groups_root_slug () . '/' . bp_get_current_group_slug () . '/';
628
} else {
629
//$post = get_post ( $rtmedia_media->post_parent );
630
+ $post = get_post ( get_post_field("post_parent", $rtmedia_media->media_id));
631
632
$link .= $site_url . $post->post_name . '/';
633
}
654
function is_rtmedia_gallery () {
655
global $rtmedia_query;
656
if ( $rtmedia_query )
657
+ return $rtmedia_query->is_gallery ();
658
else
659
+ return false;
660
}
661
662
/**
666
function is_rtmedia_album_gallery () {
667
global $rtmedia_query;
668
if ( $rtmedia_query )
669
+ return $rtmedia_query->is_album_gallery ();
670
else
671
+ return false;
672
}
673
674
/**
802
}
803
804
function update_activity_after_thumb_set($id) {
805
+ $model = new RTMediaModel();
806
+ $mediaObj = new RTMediaMedia();
807
+ $media = $model->get(array('id' => $id));
808
$privacy = $media[0]->privacy;
809
$activity_id = rtmedia_activity_id($id);
810
$same_medias = $mediaObj->model->get ( array( 'activity_id' => $activity_id ) );
822
$activity = $activity_get['activities'][0];
823
$activity_body = $activity->content;
824
bp_activity_update_meta ($activity_id, "bp_old_activity_content", $activity_body);
825
+ //extract activity text from old content
826
$activity_text = strip_tags($activity_body, '<span>');
827
+ $activity_text = explode("</span>", $activity_text);
828
+ $activity_text = strip_tags($activity_text[0]);
829
bp_activity_update_meta ($activity_id, "bp_activity_text", $activity_text);
830
}
831
+ $activity_text = bp_activity_get_meta($activity_id, "bp_activity_text");
832
+ $objActivity->activity_text =$activity_text;
833
$wpdb->update ( $bp->activity->table_name, array( "type" => "rtmedia_update", "content" => $objActivity->create_activity_html () ), array( "id" => $activity_id ) );
834
}
835
838
if ('video' == $media_type) {
839
$model = new RTMediaModel();
840
$model->update(array('cover_art' => $_POST['rtmedia-thumbnail']), array('id' => $id));
841
+ update_activity_after_thumb_set($id);
842
// code to update activity
843
844
}
857
$nonce = wp_create_nonce ( "image_editor-$media_id" );
858
echo '<div id="imgedit-response-' . $media_id . '"></div>';
859
echo '<div class="wp_attachment_image" id="media-head-' . $media_id . '">
860
+ <p id="thumbnail-head-' . $id . '"><img class="thumbnail" src="' . set_url_scheme ( $thumb_url[ 0 ] ) . '" alt="" /></p>
861
+ <p><input type="button" class="rtmedia-image-edit" id="imgedit-open-btn-' . $media_id . '" onclick="imageEdit.open( \'' . $media_id . '\', \'' . $nonce . '\' )" class="button" value="Modify Image"> <span class="spinner"></span></p></div>';
862
echo '</div>';
863
}
864
890
<form method="post" id="rt_media_comment_form" action="<?php echo get_rtmedia_permalink ( rtmedia_id () ); ?>comment/">
891
<div class="row">
892
<div class="large-12 columns">
893
+ <textarea style="width:100%" placeholder="<?php _e( 'Type Comment...', 'rtmedia' ); ?>" name="comment_content" id="comment_content"></textarea>
894
</div>
895
</div>
896
+ <input type="submit" id="rt_media_comment_submit" value="<?php _e( 'Comment', 'rtmedia' ); ?>">
897
<?php RTMediaComment::comment_nonce_generator (); ?>
898
</form>
899
<?php
925
echo $html;
926
RTMediaMedia::media_nonce_generator ( rtmedia_id (), true );
927
do_action("rtmedia_media_single_delete_form");
928
+ echo '<button type="submit" class="rtmedia-delete-media">' . __( 'Delete', 'rtmedia' ) . '</button></form>';
929
}
930
931
/**
1023
}
1024
$option = "$global_option";
1025
if($profile_option != "")
1026
+ $option.= "<optgroup label='".__("Profile Albums","rtmedia")." ' value = 'profile'>$profile_option</optgroup>";
1027
if($option_group != "")
1028
+ $option.="<optgroup label='".__("Group Albums","rtmedia")."' value = 'group'>$option_group</optgroup>";
1029
if ( $option )
1030
return $option;
1031
else
1050
if ( $album_objects ) {
1051
foreach ( $album_objects as $album ) {
1052
if ( ! in_array ( $album->id, $global_albums ) && (( isset ( $rtmedia_query->media_query[ 'album_id' ] ) && ($album->id != $rtmedia_query->media_query[ 'album_id' ])) || ! isset ( $rtmedia_query->media_query[ 'album_id' ] ) ) )
1053
+ $option_group .= '<option value="' . $album->id . '">' . $album->media_title . '</option>';
1054
1055
}
1056
}
1057
$option = $global_option;
1058
if($option_group != "")
1059
+ $option.="<optgroup label='".__("Group Albums", "rtmedia" )."' value = 'group'>$option_group</optgroup>";
1060
if ( $option )
1061
return $option;
1062
else
1069
1070
function rtmedia_create_album () {
1071
if ( ! is_rtmedia_album_enable () ) {
1072
+ return;
1073
}
1074
$return = true;
1075
$return = apply_filters("rtm_is_album_create_enable", $return);
1076
if(!$return) {
1077
+ return;
1078
}
1079
global $rtmedia_query;
1080
$user_id = get_current_user_id ();
1083
switch ( $rtmedia_query->query[ 'context' ] ) {
1084
case 'profile':
1085
if ( $rtmedia_query->query[ 'context_id' ] == $user_id ) {
1086
+ $display = true;
1087
+ $display = apply_filters("rtm_display_create_album_button", $display,$user_id);
1088
+ }
1089
break;
1090
case 'group':
1091
$group_id = $rtmedia_query->query[ 'context_id' ];
1097
}
1098
if ( $display === true ) {
1099
?>
1100
+ <i class="rtmedia-reveal-modal icon-plus-sign icon-2x" data-reveal-id="rtmedia-create-album-modal" title="<?php _e( 'Create New Album', 'rtmedia' ); ?>"></i>
1101
<div class="reveal-modal rtm-modal small" id='rtmedia-create-album-modal'>
1102
<div id="rtm-modal-container">
1103
<h2 class="rtm-modal-title"><?php _e('Create New Album', 'rtmedia'); ?></h2>
1106
<input type="text" id="rtmedia_album_name" value="" class="rtm-input-medium" />
1107
<input type="hidden" id="rtmedia_album_context" value="<?php echo $rtmedia_query->query[ 'context' ]; ?>">
1108
<input type="hidden" id="rtmedia_album_context_id" value="<?php echo $rtmedia_query->query[ 'context_id' ]; ?>">
1109
+ <button type="button" id="rtmedia_create_new_album"><?php _e( "Create Album", "rtmedia" ); ?></button>
1110
</p>
1111
<?php do_action("rtmedia_add_album_privacy"); ?>
1112
</div>
1147
<?php
1148
if ( isset ( $rtmedia_query->media_query ) && ! in_array ( $rtmedia_query->media_query[ 'album_id' ], rtmedia_get_site_option ( 'rtmedia-global-albums' ) ) ) {
1149
//if ( isset ( $rtmedia_query->media_query[ 'media_author' ] ) && get_current_user_id () == $rtmedia_query->media_query[ 'media_author' ] ) {
1150
+ if ( rtmedia_is_album_editable() || is_rt_admin() ) {
1151
?>
1152
<a href="edit/" class="icon-edit rtmedia-edit icon-2x" title="<?php _e ( 'Edit', 'rtmedia' ); ?>"></a>
1153
<form method="post" class="album-delete-form rtmedia-inline" action="delete/">
1156
</form>
1157
1158
<?php
1159
+ if(is_rtmedia_group_album())
1160
+