rtMedia for WordPress, BuddyPress and bbPress - Version 2.7

Version Description

  • Added activity uploader
  • Added lightbox
  • Fixed bug in friends' privacy
  • Fixed bug due to which edit/delete buttons would show up
  • Refactored code and styling
Download this release

Release Info

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

Code changes from version 2.6.7 to 2.7

Files changed (43) hide show
  1. app/admin/BPMediaAdmin.php +204 -194
  2. app/assets/css/admin.css +134 -0
  3. app/assets/css/main.css +159 -132
  4. app/assets/img/bp-media-modal.png +0 -0
  5. app/assets/img/bpm-icon-32.png +0 -0
  6. app/assets/img/close.png +0 -0
  7. app/assets/img/private.png +0 -0
  8. app/assets/img/tab-icon.png +0 -0
  9. app/assets/js/bp-media-activity-uploader.js +138 -232
  10. app/assets/js/main.js +504 -75
  11. app/helper/BPMediaFeed.php +2 -2
  12. app/helper/BPMediaSettings.php +485 -460
  13. app/helper/BPMediaSupport.php +72 -65
  14. app/main/BPMediaGroupLoader.php +2 -1
  15. app/main/BPMediaLoader.php +1 -1
  16. app/main/BuddyPressMedia.php +36 -16
  17. app/main/activity/BPMediaActivity.php +121 -113
  18. app/main/group/BPMediaGroupAction.php +7 -4
  19. app/main/includes/BPMediaActions.php +887 -789
  20. app/main/includes/BPMediaFunction.php +16 -7
  21. app/main/includes/BPMediaHostWordpress.php +48 -18
  22. app/main/includes/bp-media-upload-handler.php +1 -2
  23. app/main/privacy/BPMediaPrivacy.php +17 -8
  24. app/main/profile/BPMediaAlbum.php +3 -4
  25. app/main/profile/BPMediaAlbumScreen.php +210 -193
  26. app/main/profile/BPMediaScreen.php +34 -25
  27. app/main/profile/BPMediaTemplate.php +4 -1
  28. app/main/widgets/BPMediaWidget.php +38 -26
  29. index.php +2 -2
  30. languages/buddypress-media-de.mo +0 -0
  31. languages/buddypress-media-es.mo +0 -0
  32. languages/buddypress-media-fr.mo +0 -0
  33. languages/buddypress-media-it.mo +0 -0
  34. languages/buddypress-media-ja.mo +0 -0
  35. languages/buddypress-media-nl.mo +0 -0
  36. languages/buddypress-media-pl.mo +0 -0
  37. languages/buddypress-media-pt_BR.mo +0 -0
  38. languages/buddypress-media-sr.mo +0 -0
  39. languages/buddypress-media.mo +0 -0
  40. languages/buddypress-media.po +306 -316
  41. lib/simplemodal/jquery.simplemodal-1.4.4.js +758 -0
  42. readme.txt +18 -8
  43. screenshot-12.png +0 -0
app/admin/BPMediaAdmin.php CHANGED
@@ -18,7 +18,7 @@ if (!class_exists('BPMediaAdmin')) {
18
public $bp_media_feed;
19
20
public function __construct() {
21
- add_action('init',array($this, 'video_transcoding_survey_response'));
22
$bp_media_feed = new BPMediaFeed();
23
add_action('wp_ajax_bp_media_fetch_feed', array($bp_media_feed, 'fetch_feed'), 1);
24
$this->bp_media_support = new BPMediaSupport();
@@ -28,6 +28,7 @@ if (!class_exists('BPMediaAdmin')) {
28
add_action('wp_ajax_bp_media_fetch_feed', array($bp_media_feed, 'fetch_feed'), 1);
29
add_action('wp_ajax_bp_media_linkback', array($this, 'linkback'), 1);
30
add_action('wp_ajax_bp_media_convert_videos_form', array($this, 'convert_videos_mailchimp_send'), 1);
31
if (is_admin()) {
32
add_action('admin_enqueue_scripts', array($this, 'ui'));
33
add_action(bp_core_admin_hook(), array($this, 'menu'));
@@ -67,12 +68,12 @@ if (!class_exists('BPMediaAdmin')) {
67
public function menu() {
68
add_menu_page(__('BuddyPress Media Component', BP_MEDIA_TXT_DOMAIN), __('BuddyPress Media', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
69
add_submenu_page('bp-media-settings', __('BuddyPress Media Settings', BP_MEDIA_TXT_DOMAIN), __('Settings', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
70
- if ( ! BPMediaPrivacy::is_installed() ) {
71
- add_submenu_page('bp-media-settings', __('BuddyPress Media Database Update', BP_MEDIA_TXT_DOMAIN), __('Update Database', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-privacy', array($this, 'privacy_page'));
72
}
73
add_submenu_page('bp-media-settings', __('BuddyPress Media Addons', BP_MEDIA_TXT_DOMAIN), __('Addons', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-addons', array($this, 'addons_page'));
74
add_submenu_page('bp-media-settings', __('BuddyPress Media Support', BP_MEDIA_TXT_DOMAIN), __('Support ', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-support', array($this, 'support_page'));
75
- if ( bp_get_option('bp-media-survey', true) ) {
76
add_submenu_page('bp-media-settings', __('BuddyPress Media Convert Videos', BP_MEDIA_TXT_DOMAIN), __('Convert Videos', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-convert-videos', array($this, 'convert_videos_page'));
77
}
78
}
@@ -134,7 +135,7 @@ if (!class_exists('BPMediaAdmin')) {
134
<?php settings_errors(); ?>
135
<div class="columns-2">
136
<h3 class="bp-media-settings-tabs"><?php
137
- $this->sub_tabs();
138
?>
139
</h3>
140
@@ -162,103 +163,103 @@ if (!class_exists('BPMediaAdmin')) {
162
</div>
163
</div><!-- .metabox-holder -->
164
</div><!-- .bp-media-admin --><?php
165
- do_action( 'bp_media_admin_page_append', $page );
166
- }
167
-
168
- /**
169
- * Adds a tab for Media settings in the BuddyPress settings page
170
- *
171
- * @global type $bp_media
172
- */
173
- public function tab() {
174
-
175
- $tabs_html = '';
176
- $idle_class = 'nav-tab';
177
- $active_class = 'nav-tab nav-tab-active';
178
- $tabs = array();
179
-
180
- // Check to see which tab we are on
181
- $tab = $this->get_current_tab();
182
- /* BuddyPress Media */
183
- $tabs[] = array(
184
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
185
- 'title' => __('BuddyPress Media', BP_MEDIA_TXT_DOMAIN),
186
- 'name' => __('BuddyPress Media', BP_MEDIA_TXT_DOMAIN),
187
- 'class' => ($tab == 'bp-media-settings' || $tab == 'bp-media-addons' || $tab == 'bp-media-support') ? $active_class : $idle_class
188
- );
189
-
190
-
191
- foreach ($tabs as $tab) {
192
- $tabs_html.= '<a id="bp-media" title= "' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . '">' . $tab['name'] . '</a>';
193
- }
194
- echo $tabs_html;
195
- }
196
-
197
- /**
198
- * Adds a sub tabs to the BuddyPress Media settings page
199
- *
200
- * @global type $bp_media
201
- */
202
- public function sub_tabs() {
203
- $tabs_html = '';
204
- $idle_class = 'nav-tab';
205
- $active_class = 'nav-tab nav-tab-active';
206
- $tabs = array();
207
-
208
- // Check to see which tab we are on
209
- $tab = $this->get_current_tab();
210
- /* BuddyPress Media */
211
- $tabs[] = array(
212
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
213
- 'title' => __('BuddyPress Media Settings', BP_MEDIA_TXT_DOMAIN),
214
- 'name' => __('Settings', BP_MEDIA_TXT_DOMAIN),
215
- 'class' => ($tab == 'bp-media-settings') ? $active_class : $idle_class . ' first_tab'
216
- );
217
-
218
- $tabs[] = array(
219
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-addons'), 'admin.php')),
220
- 'title' => __('BuddyPress Media Addons', BP_MEDIA_TXT_DOMAIN),
221
- 'name' => __('Addons', BP_MEDIA_TXT_DOMAIN),
222
- 'class' => ($tab == 'bp-media-addons') ? $active_class : $idle_class
223
- );
224
-
225
- $tabs[] = array(
226
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-support'), 'admin.php')),
227
- 'title' => __('BuddyPress Media Support', BP_MEDIA_TXT_DOMAIN),
228
- 'name' => __('Support', BP_MEDIA_TXT_DOMAIN),
229
- 'class' => ($tab == 'bp-media-support') ? $active_class : $idle_class . ' last_tab'
230
- );
231
-
232
- if ( bp_get_option('bp-media-survey', true) ) {
233
- $tabs[] = array(
234
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-convert-videos'), 'admin.php')),
235
- 'title' => __('BuddyPress Media Covert Videos', BP_MEDIA_TXT_DOMAIN),
236
- 'name' => __('Convert Videos', BP_MEDIA_TXT_DOMAIN),
237
- 'class' => ($tab == 'bp-media-convert-videos') ? $active_class : $idle_class . ' last_tab'
238
- );
239
- }
240
-
241
- $tabs = apply_filters('bp_media_add_sub_tabs', $tabs, $tab);
242
- foreach ($tabs as $tab) {
243
- $tabs_html.= '<a title="' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . ' ' . sanitize_title($tab['name']) . '">' . $tab['name'] . '</a>';
244
- }
245
- echo $tabs_html;
246
- }
247
-
248
- /*
249
- * Updates the media count of all users.
250
- */
251
-
252
- /**
253
- *
254
- * @global type $wpdb
255
- * @return boolean
256
- */
257
- public function update_count() {
258
- global $wpdb;
259
-
260
- $query =
261
- "SELECT
262
p.post_author,pmp.meta_value,
263
SUM(CASE WHEN post_mime_type LIKE 'image%' THEN 1 ELSE 0 END) as Images,
264
SUM(CASE WHEN post_mime_type LIKE 'audio%' THEN 1 ELSE 0 END) as Audio,
@@ -272,67 +273,67 @@ if (!class_exists('BPMediaAdmin')) {
272
pmp.meta_key = 'bp_media_privacy' AND
273
( post_mime_type LIKE 'image%' OR post_mime_type LIKE 'audio%' OR post_mime_type LIKE 'video%' OR post_type LIKE 'bp_media_album')
274
GROUP BY p.post_author,pmp.meta_value order by p.post_author";
275
- $result = $wpdb->get_results($query);
276
- if (!is_array($result))
277
- return false;
278
- $formatted = array();
279
- foreach ($result as $obj) {
280
- $formatted[$obj->post_author][$obj->meta_value] = array(
281
- 'image' => $obj->Images,
282
- 'video' => $obj->Videos,
283
- 'audio' => $obj->Audio,
284
- 'album' => $obj->Albums,
285
- );
286
- }
287
-
288
- foreach ($formatted as $user => $obj) {
289
- bp_update_user_meta($user, 'bp_media_count', $obj);
290
- }
291
- return true;
292
- }
293
-
294
- /* Multisite Save Options - http://wordpress.stackexchange.com/questions/64968/settings-api-in-multisite-missing-update-message#answer-72503 */
295
-
296
- /**
297
- *
298
- * @global type $bp_media_admin
299
- */
300
- public function save_multisite_options() {
301
- global $bp_media_admin;
302
- if (isset($_POST['refresh-count'])) {
303
- $bp_media_admin->update_count();
304
- }
305
- do_action('bp_media_sanitize_settings', $_POST);
306
-
307
- if (isset($_POST['bp_media_options'])) {
308
- bp_update_option('bp_media_options', $_POST['bp_media_options']);
309
//
310
// // redirect to settings page in network
311
- wp_redirect(
312
- add_query_arg(
313
- array('page' => 'bp-media-settings', 'updated' => 'true'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
314
- )
315
- );
316
- exit;
317
- }
318
- }
319
-
320
- /* Admin Sidebar */
321
-
322
- /**
323
- *
324
- * @global type $bp_media
325
- */
326
- public function admin_sidebar() {
327
- $current_user = wp_get_current_user();
328
-
329
- $message = sprintf(__('I use @buddypressmedia http://goo.gl/8Upmv on %s', BP_MEDIA_TXT_DOMAIN), home_url());
330
- $addons = '<label for="bp-media-add-linkback"><input' . checked(bp_get_option('bp_media_add_linkback', false), true, false) . ' type="checkbox" name="bp-media-add-linkback" value="1" id="bp-media-add-linkback"/> ' . __('Add link to footer', BP_MEDIA_TXT_DOMAIN) . '</label>
331
- <a href="http://twitter.com/home/?status=' . $message . '" class="button button-tweet" target= "_blank">'. __('Tweet', BP_MEDIA_TXT_DOMAIN).'</a>
332
<a href="http://wordpress.org/support/view/plugin-reviews/buddypress-media?rate=5#postform" class="button button-rating" target= "_blank">' . __('Rate on WordPress.org', BP_MEDIA_TXT_DOMAIN) . '</a>';
333
- new BPMediaAdminWidget('spread-the-word', __('Spread the Word', BP_MEDIA_TXT_DOMAIN), $addons);
334
335
- $donate = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
336
<!-- Identify your business so that you can collect the payments. -->
337
<input type="hidden" name="business"
338
value="paypal@rtcamp.com">
@@ -348,10 +349,13 @@ if (!class_exists('BPMediaAdmin')) {
348
<input type="image" id="rt-donate-button" name="submit" border="0"
349
src="' . BP_MEDIA_URL . 'app/assets/img/paypal-donate-button.png"
350
alt="PayPal - The safer, easier way to pay online">
351
- </form>';
352
- new BPMediaAdminWidget('donate', __('Donate', BP_MEDIA_TXT_DOMAIN), $donate);
353
354
- $branding = '<form action="http://rtcamp.us1.list-manage1.com/subscribe/post?u=85b65c9c71e2ba3fab8cb1950&amp;id=9e8ded4470" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
355
<div class="mc-field-group">
356
<input type="email" value="' . $current_user->user_email . '" name="EMAIL" placeholder="Email" class="required email" id="mce-EMAIL">
357
<input style="display:none;" type="checkbox" checked="checked" value="1" name="group[1721][1]" id="mce-group[1721]-1721-0"><label for="mce-group[1721]-1721-0">
@@ -367,38 +371,44 @@ if (!class_exists('BPMediaAdmin')) {
367
<li><a href="' . sprintf('%s', 'https://twitter.com/rtcamp/') . '" title="' . __('Follow us on Twitter', BP_MEDIA_TXT_DOMAIN) . '" class="bp-media-twitter bp-media-social">' . __('Twitter', BP_MEDIA_TXT_DOMAIN) . '</a></li>
368
<li><a href="' . sprintf('%s', 'http://feeds.feedburner.com/rtcamp/') . '" title="' . __('Subscribe to our feeds', BP_MEDIA_TXT_DOMAIN) . '" class="bp-media-rss bp-media-social">' . __('RSS Feed', BP_MEDIA_TXT_DOMAIN) . '</a></li>
369
</ul>';
370
- new BPMediaAdminWidget('branding', __('Subscribe', BP_MEDIA_TXT_DOMAIN), $branding);
371
-
372
- $news = '<img src ="' . admin_url('/images/wpspin_light.gif') . '" /> Loading...';
373
- new BPMediaAdminWidget('latest-news', __('Latest News', BP_MEDIA_TXT_DOMAIN), $news);
374
- }
375
-
376
- public function linkback() {
377
- if (isset($_POST['linkback']) && $_POST['linkback']) {
378
- return bp_update_option('bp_media_add_linkback', true);
379
- } else {
380
- return bp_update_option('bp_media_add_linkback', false);
381
- }
382
- die;
383
- }
384
-
385
- public function convert_videos_mailchimp_send() {
386
- if ($_POST['interested'] == 'Yes' && !empty($_POST['choice'])) {
387
- wp_remote_get(add_query_arg( array('bp-media-convert-videos-form' => 1, 'choice' => $_POST['choice'], 'url'=> urlencode($_POST['url']), 'email' => $_POST['email']),'http://rtcamp.com/'));
388
- } else {
389
- bp_update_option('bp-media-survey', 0);
390
- }
391
- echo 'Thank you for your time.';
392
- die;
393
- }
394
-
395
- public function video_transcoding_survey_response(){
396
- if ( isset($_GET['survey-done']) && ($_GET['survey-done'] == md5('survey-done')) ) {
397
- bp_update_option('bp-media-survey', 0);
398
- }
399
- }
400
-
401
- }
402
403
}
404
?>
18
public $bp_media_feed;
19
20
public function __construct() {
21
+ add_action('init', array($this, 'video_transcoding_survey_response'));
22
$bp_media_feed = new BPMediaFeed();
23
add_action('wp_ajax_bp_media_fetch_feed', array($bp_media_feed, 'fetch_feed'), 1);
24
$this->bp_media_support = new BPMediaSupport();
28
add_action('wp_ajax_bp_media_fetch_feed', array($bp_media_feed, 'fetch_feed'), 1);
29
add_action('wp_ajax_bp_media_linkback', array($this, 'linkback'), 1);
30
add_action('wp_ajax_bp_media_convert_videos_form', array($this, 'convert_videos_mailchimp_send'), 1);
31
+ add_filter('plugin_row_meta', array($this, 'plugin_meta_premium_addon_link'), 1, 4);
32
if (is_admin()) {
33
add_action('admin_enqueue_scripts', array($this, 'ui'));
34
add_action(bp_core_admin_hook(), array($this, 'menu'));
68
public function menu() {
69
add_menu_page(__('BuddyPress Media Component', BP_MEDIA_TXT_DOMAIN), __('BuddyPress Media', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
70
add_submenu_page('bp-media-settings', __('BuddyPress Media Settings', BP_MEDIA_TXT_DOMAIN), __('Settings', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
71
+ if (!BPMediaPrivacy::is_installed()) {
72
+ add_submenu_page('bp-media-settings', __('BuddyPress Media Database Update', BP_MEDIA_TXT_DOMAIN), __('Update Database', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-privacy', array($this, 'privacy_page'));
73
}
74
add_submenu_page('bp-media-settings', __('BuddyPress Media Addons', BP_MEDIA_TXT_DOMAIN), __('Addons', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-addons', array($this, 'addons_page'));
75
add_submenu_page('bp-media-settings', __('BuddyPress Media Support', BP_MEDIA_TXT_DOMAIN), __('Support ', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-support', array($this, 'support_page'));
76
+ if (bp_get_option('bp-media-survey', true)) {
77
add_submenu_page('bp-media-settings', __('BuddyPress Media Convert Videos', BP_MEDIA_TXT_DOMAIN), __('Convert Videos', BP_MEDIA_TXT_DOMAIN), 'manage_options', 'bp-media-convert-videos', array($this, 'convert_videos_page'));
78
}
79
}
135
<?php settings_errors(); ?>
136
<div class="columns-2">
137
<h3 class="bp-media-settings-tabs"><?php
138
+ $this->sub_tabs();
139
?>
140
</h3>
141
163
</div>
164
</div><!-- .metabox-holder -->
165
</div><!-- .bp-media-admin --><?php
166
+ do_action('bp_media_admin_page_append', $page);
167
+ }
168
+
169
+ /**
170
+ * Adds a tab for Media settings in the BuddyPress settings page
171
+ *
172
+ * @global type $bp_media
173
+ */
174
+ public function tab() {
175
+
176
+ $tabs_html = '';
177
+ $idle_class = 'nav-tab';
178
+ $active_class = 'nav-tab nav-tab-active';
179
+ $tabs = array();
180
+
181
+ // Check to see which tab we are on
182
+ $tab = $this->get_current_tab();
183
+ /* BuddyPress Media */
184
+ $tabs[] = array(
185
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
186
+ 'title' => __('BuddyPress Media', BP_MEDIA_TXT_DOMAIN),
187
+ 'name' => __('BuddyPress Media', BP_MEDIA_TXT_DOMAIN),
188
+ 'class' => ($tab == 'bp-media-settings' || $tab == 'bp-media-addons' || $tab == 'bp-media-support') ? $active_class : $idle_class
189
+ );
190
+
191
+
192
+ foreach ($tabs as $tab) {
193
+ $tabs_html.= '<a id="bp-media" title= "' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . '">' . $tab['name'] . '</a>';
194
+ }
195
+ echo $tabs_html;
196
+ }
197
+
198
+ /**
199
+ * Adds a sub tabs to the BuddyPress Media settings page
200
+ *
201
+ * @global type $bp_media
202
+ */
203
+ public function sub_tabs() {
204
+ $tabs_html = '';
205
+ $idle_class = 'nav-tab';
206
+ $active_class = 'nav-tab nav-tab-active';
207
+ $tabs = array();
208
+
209
+ // Check to see which tab we are on
210
+ $tab = $this->get_current_tab();
211
+ /* BuddyPress Media */
212
+ $tabs[] = array(
213
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
214
+ 'title' => __('BuddyPress Media Settings', BP_MEDIA_TXT_DOMAIN),
215
+ 'name' => __('Settings', BP_MEDIA_TXT_DOMAIN),
216
+ 'class' => ($tab == 'bp-media-settings') ? $active_class : $idle_class . ' first_tab'
217
+ );
218
+
219
+ $tabs[] = array(
220
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-addons'), 'admin.php')),
221
+ 'title' => __('BuddyPress Media Addons', BP_MEDIA_TXT_DOMAIN),
222
+ 'name' => __('Addons', BP_MEDIA_TXT_DOMAIN),
223
+ 'class' => ($tab == 'bp-media-addons') ? $active_class : $idle_class
224
+ );
225
+
226
+ $tabs[] = array(
227
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-support'), 'admin.php')),
228
+ 'title' => __('BuddyPress Media Support', BP_MEDIA_TXT_DOMAIN),
229
+ 'name' => __('Support', BP_MEDIA_TXT_DOMAIN),
230
+ 'class' => ($tab == 'bp-media-support') ? $active_class : $idle_class . ' last_tab'
231
+ );
232
+
233
+ if (bp_get_option('bp-media-survey', true)) {
234
+ $tabs[] = array(
235
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-convert-videos'), 'admin.php')),
236
+ 'title' => __('BuddyPress Media Covert Videos', BP_MEDIA_TXT_DOMAIN),
237
+ 'name' => __('Convert Videos', BP_MEDIA_TXT_DOMAIN),
238
+ 'class' => ($tab == 'bp-media-convert-videos') ? $active_class : $idle_class . ' last_tab'
239
+ );
240
+ }
241
+
242
+ $tabs = apply_filters('bp_media_add_sub_tabs', $tabs, $tab);
243
+ foreach ($tabs as $tab) {
244
+ $tabs_html.= '<a title="' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . ' ' . sanitize_title($tab['name']) . '">' . $tab['name'] . '</a>';
245
+ }
246
+ echo $tabs_html;
247
+ }
248
+
249
+ /*
250
+ * Updates the media count of all users.
251
+ */
252
+
253
+ /**
254
+ *
255
+ * @global type $wpdb
256
+ * @return boolean
257
+ */
258
+ public function update_count() {
259
+ global $wpdb;
260
+
261
+ $query =
262
+ "SELECT
263
p.post_author,pmp.meta_value,
264
SUM(CASE WHEN post_mime_type LIKE 'image%' THEN 1 ELSE 0 END) as Images,
265
SUM(CASE WHEN post_mime_type LIKE 'audio%' THEN 1 ELSE 0 END) as Audio,
273
pmp.meta_key = 'bp_media_privacy' AND
274
( post_mime_type LIKE 'image%' OR post_mime_type LIKE 'audio%' OR post_mime_type LIKE 'video%' OR post_type LIKE 'bp_media_album')
275
GROUP BY p.post_author,pmp.meta_value order by p.post_author";
276
+ $result = $wpdb->get_results($query);
277
+ if (!is_array($result))
278
+ return false;
279
+ $formatted = array();
280
+ foreach ($result as $obj) {
281
+ $formatted[$obj->post_author][$obj->meta_value] = array(
282
+ 'image' => $obj->Images,
283
+ 'video' => $obj->Videos,
284
+ 'audio' => $obj->Audio,
285
+ 'album' => $obj->Albums,
286
+ );
287
+ }
288
+
289
+ foreach ($formatted as $user => $obj) {
290
+ bp_update_user_meta($user, 'bp_media_count', $obj);
291
+ }
292
+ return true;
293
+ }
294
+
295
+ /* Multisite Save Options - http://wordpress.stackexchange.com/questions/64968/settings-api-in-multisite-missing-update-message#answer-72503 */
296
+
297
+ /**
298
+ *
299
+ * @global type $bp_media_admin
300
+ */
301
+ public function save_multisite_options() {
302
+ global $bp_media_admin;
303
+ if (isset($_POST['refresh-count'])) {
304
+ $bp_media_admin->update_count();
305
+ }
306
+ do_action('bp_media_sanitize_settings', $_POST);
307
+
308
+ if (isset($_POST['bp_media_options'])) {
309
+ bp_update_option('bp_media_options', $_POST['bp_media_options']);
310
//
311
// // redirect to settings page in network
312
+ wp_redirect(
313
+ add_query_arg(
314
+ array('page' => 'bp-media-settings', 'updated' => 'true'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
315
+ )
316
+ );
317
+ exit;
318
+ }
319
+ }
320
+
321
+ /* Admin Sidebar */
322
+
323
+ /**
324
+ *
325
+ * @global type $bp_media
326
+ */
327
+ public function admin_sidebar() {
328
+ $current_user = wp_get_current_user();
329
+
330
+ $message = sprintf(__('I use @buddypressmedia http://goo.gl/8Upmv on %s', BP_MEDIA_TXT_DOMAIN), home_url());
331
+ $addons = '<label for="bp-media-add-linkback"><input' . checked(bp_get_option('bp_media_add_linkback', false), true, false) . ' type="checkbox" name="bp-media-add-linkback" value="1" id="bp-media-add-linkback"/> ' . __('Add link to footer', BP_MEDIA_TXT_DOMAIN) . '</label>
332
+ <a href="http://twitter.com/home/?status=' . $message . '" class="button button-tweet" target= "_blank">' . __('Tweet', BP_MEDIA_TXT_DOMAIN) . '</a>
333
<a href="http://wordpress.org/support/view/plugin-reviews/buddypress-media?rate=5#postform" class="button button-rating" target= "_blank">' . __('Rate on WordPress.org', BP_MEDIA_TXT_DOMAIN) . '</a>';
334
+ new BPMediaAdminWidget('spread-the-word', __('Spread the Word', BP_MEDIA_TXT_DOMAIN), $addons);
335
336
+ $donate = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
337
<!-- Identify your business so that you can collect the payments. -->
338
<input type="hidden" name="business"
339
value="paypal@rtcamp.com">
349
<input type="image" id="rt-donate-button" name="submit" border="0"
350
src="' . BP_MEDIA_URL . 'app/assets/img/paypal-donate-button.png"
351
alt="PayPal - The safer, easier way to pay online">
352
+ </form><br />
353
+ <center><b>' . __('OR', BP_MEDIA_TXT_DOMAIN) . '</b></center><br />
354
+ <center>' . __('Use <a href="https://rtcamp.com/store/product-category/buddypress/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media">premium add-ons</a> starting from $9', BP_MEDIA_TXT_DOMAIN) . '</center>';
355
+ ;
356
+ new BPMediaAdminWidget('donate', __('Donate', BP_MEDIA_TXT_DOMAIN), $donate);
357
358
+ $branding = '<form action="http://rtcamp.us1.list-manage1.com/subscribe/post?u=85b65c9c71e2ba3fab8cb1950&amp;id=9e8ded4470" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
359
<div class="mc-field-group">
360
<input type="email" value="' . $current_user->user_email . '" name="EMAIL" placeholder="Email" class="required email" id="mce-EMAIL">
361
<input style="display:none;" type="checkbox" checked="checked" value="1" name="group[1721][1]" id="mce-group[1721]-1721-0"><label for="mce-group[1721]-1721-0">
371
<li><a href="' . sprintf('%s', 'https://twitter.com/rtcamp/') . '" title="' . __('Follow us on Twitter', BP_MEDIA_TXT_DOMAIN) . '" class="bp-media-twitter bp-media-social">' . __('Twitter', BP_MEDIA_TXT_DOMAIN) . '</a></li>
372
<li><a href="' . sprintf('%s', 'http://feeds.feedburner.com/rtcamp/') . '" title="' . __('Subscribe to our feeds', BP_MEDIA_TXT_DOMAIN) . '" class="bp-media-rss bp-media-social">' . __('RSS Feed', BP_MEDIA_TXT_DOMAIN) . '</a></li>
373
</ul>';
374
+ new BPMediaAdminWidget('branding', __('Subscribe', BP_MEDIA_TXT_DOMAIN), $branding);
375
+
376
+ $news = '<img src ="' . admin_url('/images/wpspin_light.gif') . '" /> Loading...';
377
+ new BPMediaAdminWidget('latest-news', __('Latest News', BP_MEDIA_TXT_DOMAIN), $news);
378
+ }
379
+
380
+ public function linkback() {
381
+ if (isset($_POST['linkback']) && $_POST['linkback']) {
382
+ return bp_update_option('bp_media_add_linkback', true);
383
+ } else {
384
+ return bp_update_option('bp_media_add_linkback', false);
385
+ }
386
+ die;
387
+ }
388
+
389
+ public function convert_videos_mailchimp_send() {
390
+ if ($_POST['interested'] == 'Yes' && !empty($_POST['choice'])) {
391
+ wp_remote_get(add_query_arg(array('bp-media-convert-videos-form' => 1, 'choice' => $_POST['choice'], 'url' => urlencode($_POST['url']), 'email' => $_POST['email']), 'http://rtcamp.com/'));
392
+ } else {
393
+ bp_update_option('bp-media-survey', 0);
394
+ }
395
+ echo 'Thank you for your time.';
396
+ die;
397
+ }
398
399
+ public function video_transcoding_survey_response() {
400
+ if (isset($_GET['survey-done']) && ($_GET['survey-done'] == md5('survey-done'))) {
401
+ bp_update_option('bp-media-survey', 0);
402
}
403
+ }
404
+
405
+ public function plugin_meta_premium_addon_link($plugin_meta, $plugin_file, $plugin_data, $status) {
406
+ if (plugin_basename(BP_MEDIA_PATH . 'index.php') == $plugin_file)
407
+ $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>';
408
+ return $plugin_meta;
409
+ }
410
+
411
+ }
412
+
413
+ }
414
?>
app/assets/css/admin.css ADDED
@@ -0,0 +1,134 @@
1
+ #wpbody-content div.metabox-fixed{width: 280px;margin-right: -300px;float: right;}
2
+ #wpbody-content div.wrap.bp-media-admin .columns-2{margin-right:300px;padding-top: 0;margin-top: 15px;width: 600px}
3
+ #wpbody-content .bp-media-settings-tabs{margin-bottom: 0; }
4
+ #wpbody-content .bp-media-settings-tabs .media-nav-tab{margin: 0 10px; text-decoration: underline; text-transform: capitalize}
5
+ #wpbody-content .bp-media-settings-tabs .media-nav-tab.media-nav-tab-active{font-weight: bold}
6
+
7
+ #wpbody-content .wrap div.bp-media-metabox-holder{padding-top: 0}
8
+ .bp-media-social{background: url('../img/bp_media_social.png');height: 35px;width: 35px;display: inline-block;font-size: 0px;margin-right:5px;}
9
+ .bp-media-facebook{background-position: 0px 0px;}
10
+ .bp-media-facebook:hover{background-position: 0px 36px;}
11
+ .bp-media-twitter{background-position: 80px 0px;}
12
+ .bp-media-twitter:hover{background-position: 80px 36px;}
13
+ .bp-media-rss{background-position: 35px 0px;}
14
+ .bp-media-rss:hover{background-position: 35px 36px;}
15
+ .bp-media-support .support_list{ margin-left: 25px}
16
+ .bp-media-support .support_list li{list-style: disc;margin-bottom: 10px}
17
+
18
+ #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a{background:url('../img/bpm-icon-16.png') center 1px no-repeat;}
19
+ #adminmenu li.toplevel_page_bp-media-settings:hover .wp-menu-image a,
20
+ #adminmenu li.current.toplevel_page_bp-media-settings .wp-menu-image a{background-position: center 1px;}
21
+ #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a img{display:none;}
22
+ #bp-media-settings-boxes{border:1px solid #CCC; overflow: hidden; padding: 10px; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; float: left; width: 98%;}
23
+ #debug-info{border:1px solid #CCC; overflow: hidden; padding: 10px; margin-top: 10px; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; float: left; width: 588px;}
24
+ .nav-tab-wrapper a#bp-media{background:url('../img/bpm-icon-32.png') transparent no-repeat; padding-left:32px;}
25
+ .nav-tab-wrapper a#bp-media:hover,.nav-tab-wrapper a#bp-media.nav-tab-active{background-position:left -96px;}
26
+ .metabox-holder .postbox#latest-news .inside ul li{background: transparent url('../img/bpm-icon-32.png') -5px 0px no-repeat; padding-left: 32px;}
27
+ .metabox-holder .postbox#latest-news .inside ul li:hover{background-position-y: -96px;}
28
+ #branding #logo{text-align:center;padding: 10px 0;display:block;}
29
+ ul#social{display:block;text-align:center;margin:0;clear: both;}
30
+ #branding #mc-embedded-subscribe-form{float: left;width: 100%;}
31
+ #branding label{float: right;}
32
+ #branding #mc-embedded-subscribe{float: right;padding: 0 3px;}
33
+ #branding #mce-EMAIL{float: left;}
34
+ ul#social li{display:inline;}
35
+ #spread-the-word .button{display:inline-block; margin: 9px 5px 0 5px;}
36
+ #spread-the-word label{display:block;}
37
+ #spread-the-word .inside{text-align: center;}
38
+ #spread-the-word .button-tweet{background: #33ACE6; border-color: #3399DD #3399DD #2288CC; color: #FFFFFF !important; text-shadow: -1px -1px 0 #3399DD;}
39
+ #spread-the-word .button-tweet:hover{background: #3399DD;border-color: #2288CC;box-shadow: 0 0 4px rgba(82, 168, 236, 0.75);}
40
+ #spread-the-word .button-rating{background: #8A8A8A; border-color: #222; color: #FFFFFF !important; text-shadow: -1px -1px 0 #444;}
41
+ #spread-the-word .button-rating:hover{background: #7E7E7E;border-color: #444;box-shadow: 0 0 4px rgba(128,128,128, 0.75);}
42
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab{padding-left:20px;background:url('../img/tab-icon.png') 3px -4px no-repeat;}
43
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.addons{background-position-y:-34px;}
44
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.support{background-position-y:-64px;}
45
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.update-database{background-position-y:-94px;}
46
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.ffmpeg{background-position-y:-154px;}
47
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.kaltura{background-position-y:-184px;}
48
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.convert-videos{background-position-y:-214px;}
49
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.insta{background-position-y:-244px;}
50
+ .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.watermark{background-position-y:-274px;}
51
+ /* Addons page Styling */
52
+
53
+ a.toplevel_page_bp-media-settings div.wp-menu-image{
54
+ background:url('../img/admin-menu.png') 0 -32px no-repeat;
55
+ }
56
+
57
+ #rt-donate-button, .rt-link img{vertical-align: middle;}
58
+ #adminmenu .menu-icon-generic.toplevel_page_bp-media-settings div.wp-menu-image{
59
+ background-position: 0 -32px;
60
+ }
61
+ #adminmenu .menu-icon-generic.wp-has-current-submenu.toplevel_page_bp-media-settings div.wp-menu-image,
62
+ #adminmenu .menu-icon-generic.toplevel_page_bp-media-settings:hover div.wp-menu-image{
63
+ background-position-y:0;
64
+ }
65
+
66
+ #bp-media-addons-list_metabox {background: #ffffff}
67
+ .products ul:after, ul.products:after {clear: both;content: "";display: block;}
68
+ .products ul, ul.products {clear: both;list-style: none outside none;margin: 0 0 14px;padding: 0;}
69
+ .bp-media-addon {margin: 0;}
70
+ .bp-media-addon.first { }
71
+ .bp-media-addon {margin: 20px 10px 30px;padding: 5px;position: relative;border: 1px solid #ccc;}
72
+ .bp-media-addon h4 {background: none repeat scroll 0 0 transparent;border: 0 none;color: #006999;cursor: pointer;font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-size: 20px;font-weight: normal;line-height: 26px;margin: 0 0 10px;}
73
+ .bp-media-addon a {text-decoration: none;}
74
+ .bp-media-addon a img, div.product div.images img {box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);}
75
+ .bp-media-addon a img {display: block;height: auto;margin: 5px 15px 5px 5px;transition: all 0.2s ease-in-out 0s;float: left; width: 200px}
76
+
77
+ .bp-media-addon .price, .bp-media-addon .price .amount, .bp-media-addon .price ins {color: #85AD74;font-size: 25px;font-weight: bold;}
78
+ .bp-media-addon .price {line-height: 1.4em;color: #85AD74;display: block;font-weight: normal;margin-bottom: 0.5em;}
79
+ .coming-soon { background: url("../img/coming-soon.png"); z-index: 5; position:absolute;height:191px; opacity:0.9;}
80
+ .coming-soon.coming-soon-l { background-position: 0 0; width:250px; top:-12px; left:-18px;}
81
+ .coming-soon.coming-soon-r { background-position: 347px 0; width:174px; bottom:-14px; right:-12px;}
82
+ .coming-soon.coming-soon-r:hover{background-position: 175px 0;}
83
+
84
+ .bp-media-addon .product_footer{margin: 20px 0 0;overflow: hidden;}
85
+ .bp-media-addon .add_to_cart_button{background: #C45200; color: #FFFFFF;display: inline-block;font-size: 18px;font-weight: bold; line-height: 1.4em; margin: 0 20px; padding: 4px 15px;text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6)}
86
+ .bp-media-addon .product_footer .product_demo_link{font-size: 16px;margin: 8px 20px; font-weight: bold}
87
+
88
+ .bp-media-addon .add_to_cart_button:hover{background: none repeat scroll 0 0 #D75A00;
89
+ box-shadow: 0 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.4) inset;
90
+ color: #FFFFFF;}
91
+
92
+ /* Admin bar Menu */
93
+ #wpadminbar .bp-media-settings-menu > .ab-item .ab-icon{background: url("../img/bpm-icon-16.png") no-repeat scroll -8px -7px transparent}
94
+ #wpadminbar .bp-media-settings-menu:hover .ab-icon{background-position: -8px -41px}
95
+
96
+ /* BuddyPress media admin support form styling */
97
+ .bp-media-updated, .bp-media-error{border-radius: 3px; padding: 0 7px; margin: 5px 0 15px; border: 1px solid}
98
+ .bp-media-updated p, .bp-media-error p{margin: 0.5em 0;padding: 2px;}
99
+ .bp-media-updated{background-color: #FFFFE0;border-color: #E6DB55;}
100
+ .bp-media-error{background-color: #FFEBE8;border-color: #CC0000;}
101
+ .bp-media-form li{margin-bottom: 10px}
102
+ .bp-media-form .bp-media-label{display: inline-block;margin-right: 10px;width: 150px;vertical-align: top; }
103
+ .bp-media-form .bp-media-input{background-color: #FFFFFF;border: 1px solid #DFDFDF;border-radius: 3px 3px 3px 3px;color: #333333;line-height: 16px;padding: 5px;width: 220px;}
104
+ .bp-media-form .bp-media-checkbox{margin-right: 10px; margin-left: 160px}
105
+ .bp-media-form .bp-media-textarea{background-color: #FFFFFF;border: 1px solid #DFDFDF;border-radius: 3px 3px 3px 3px;color: #333333;height: 175px;line-height: 16px;padding: 5px;width: 400px;}
106
+ .bp-media-form .bp-media-select{margin: 0;max-width: 400px;}
107
+ .bp-media-support-attachment label{float: left}
108
+ .bp-media-support-attachment .more-attachment{margin-left: 160px; margin-top: 10px}
109
+ .bp-media-support-attachment .more-attachment:first-child{margin-top: 0px}
110
+ .bp-media-support-attachment .add-more-attachment-btn{clear: both;display: inline-block;margin-left: 160px;margin-top: 10px;}
111
+ .template_select_label{float: left}
112
+ .template_select_container{overflow-x:scroll; width:405px;float: left}
113
+ #bp_media_settings_form .support_form_laoder{height: 100px; width: 200px; background: url("../img/loader.gif") no-repeat }
114
+ /* Miscellaneous */
115
+ #normal-sortables .postbox .bp-media-form .submit{float: none; margin-left: 150px}
116
+ .rt-success{background-color: #E1FFDF;border-color: #2ACF2A;}
117
+ .rt-update{background-color: #FFEAA6;border-color:#E1CA82;}
118
+ img.bp-media-donation-image{display:block;margin: 10px auto;}
119
+ #donate form{text-align: center;}
120
+ /*Transcoding Teaser*/
121
+ .para-blockquote { background: #E5E5E5; padding: 10px; font-style: italic; }
122
+ #latest-update img, #members-list .update img, #members-list .update {display:block; overflow: hidden;}
123
+ #rtprogressbar {
124
+ background-color: #444;
125
+ border-radius: 13px;
126
+ padding: 3px;
127
+ }
128
+
129
+ #rtprogressbar div {
130
+ background-color: #fb6003;
131
+ width: 0;
132
+ height: 20px;
133
+ border-radius: 10px;
134
+ }
app/assets/css/main.css CHANGED
@@ -1,7 +1,7 @@
1
/*
2
* Default stylesheet for BuddyPress Media
3
*/
4
- .bp_media_content img{max-width:98%;}
5
.bp_media_content .mejs-poster img{max-width: 100%;}
6
.media.albums .album-edit{display:inline;}
7
.media h3 {display:block;font-size:20px;font-weight:bold;}
@@ -19,24 +19,11 @@ ul.bp-media-gallery li span img{height: 150px;}
19
/*li.media div.activity-content div.activity-inner p{display:none;}*/
20
.media h3{margin-bottom:10px;}
21
#bp-media-footer {color: #4D4D4D;text-align: center;text-shadow: #FAFAFA 1px 1px 0;}
22
- #wpbody-content div.metabox-fixed{width: 280px;margin-right: -300px;float: right;}
23
- #wpbody-content div.wrap.bp-media-admin .columns-2{margin-right:300px;padding-top: 0;margin-top: 15px;width: 600px}
24
- #wpbody-content .bp-media-settings-tabs{margin-bottom: 0; }
25
- #wpbody-content .bp-media-settings-tabs .media-nav-tab{margin: 0 10px; text-decoration: underline; text-transform: capitalize}
26
- #wpbody-content .bp-media-settings-tabs .media-nav-tab.media-nav-tab-active{font-weight: bold}
27
-
28
- #wpbody-content .wrap div.bp-media-metabox-holder{padding-top: 0}
29
- .bp-media-social{background: url('../img/bp_media_social.png');height: 35px;width: 35px;display: inline-block;font-size: 0px;margin-right:5px;}
30
- .bp-media-facebook{background-position: 0px 0px;}
31
- .bp-media-facebook:hover{background-position: 0px 36px;}
32
- .bp-media-twitter{background-position: 80px 0px;}
33
- .bp-media-twitter:hover{background-position: 80px 36px;}
34
- .bp-media-rss{background-position: 35px 0px;}
35
- .bp-media-rss:hover{background-position: 35px 36px;}
36
/*#bp-media-upload-ui{position: relative;}*/
37
#item-body:after,ul.bp-media-gallery.item-list:after{content: " ";clear: both;display: block;text-indent: -9999em;}
38
#item-body{position: relative;}
39
40
.bp-media-area-allocate{height: 10px;width: 100%;display: block;}
41
li #bp-media-upload-ui {padding: 0;max-width: 158px;position: relative;}
42
#bp-media-upload-ui #drag-drop-area{border: 4px dashed #DDD;text-align: center;background: url('../img/drag-drop-bg.png') repeat scroll 0 0 transparent;overflow: hidden;padding: 15px 0;}
@@ -75,11 +62,13 @@ li #bp-media-uploaded-files{left: 0;position: absolute;top: 155px;}
75
.bp-media-progress-completed{z-index: 9;width: 0;height: 35px;margin-top: -35px;background-color: #83B4D8;background-image: linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -o-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -moz-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -webkit-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -ms-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);-webkit-border-radius: 3px;border-radius: 3px;-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);}
76
.bpm-aligncenter{display: inline-block;text-align: center;width: 100%;}
77
#bp-media-premium-addons ul,#bp-media-premium-addons li{list-style:disc;margin-left:10px;}
78
- .bp-media-single div.bp_media_content{text-align:center;}
79
.bp-media-single .bp_media_content .mejs-container{margin-left:auto;margin-right:auto;}
80
81
- .bp-media-support .support_list{ margin-left: 25px}
82
- .bp-media-support .support_list li{list-style: disc;margin-bottom: 10px}
83
84
.media-tabs-container .ui-tabs-panel{}
85
.media-tabs-container .ui-tabs-hide{display: none}
@@ -96,134 +85,172 @@ li #bp-media-uploaded-files{left: 0;position: absolute;top: 155px;}
96
.media-tabs-container .widget-item-listing li h3 {margin: 0}
97
.media-tabs-container .widget-item-listing li h3 a{font-size: 13px;font-weight: normal;word-wrap: break-word; }
98
99
- .bp-media-actions{margin:20px 0;}
100
- .bp-media-actions a{display:inline-block;}
101
-
102
-
103
- #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a{background:url('../img/bpm-icon-16.png') center 1px no-repeat;}
104
- #adminmenu li.toplevel_page_bp-media-settings:hover .wp-menu-image a,
105
- #adminmenu li.current.toplevel_page_bp-media-settings .wp-menu-image a{background-position: center 1px;}
106
- #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a img{display:none;}
107
- #bp-media-settings-boxes{border:1px solid #CCC; overflow: hidden; padding: 10px; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; float: left; width: 98%;}
108
- #debug-info{border:1px solid #CCC; overflow: hidden; padding: 10px; margin-top: 10px; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; float: left; width: 588px;}
109
- .nav-tab-wrapper a#bp-media{background:url('../img/bpm-icon-32.png') transparent no-repeat; padding-left:32px;}
110
- .nav-tab-wrapper a#bp-media:hover,.nav-tab-wrapper a#bp-media.nav-tab-active{background-position:left -32px;}
111
- .metabox-holder .postbox#latest-news .inside ul li{background: transparent url('../img/bpm-icon-32.png') -5px 0px no-repeat; padding-left: 32px;}
112
- .metabox-holder .postbox#latest-news .inside ul li:hover{background-position-y: -32px;}
113
- #branding #logo{text-align:center;padding: 10px 0;display:block;}
114
- ul#social{display:block;text-align:center;margin:0;clear: both;}
115
- #branding #mc-embedded-subscribe-form{float: left;width: 100%;}
116
- #branding label{float: right;}
117
- #branding #mc-embedded-subscribe{float: right;padding: 0 3px;}
118
- #branding #mce-EMAIL{float: left;}
119
- ul#social li{display:inline;}
120
- #spread-the-word .button{display:inline-block; margin: 9px 5px 0 5px;}
121
- #spread-the-word label{display:block;}
122
- #spread-the-word .inside{text-align: center;}
123
- #spread-the-word .button-tweet{background: #33ACE6; border-color: #3399DD #3399DD #2288CC; color: #FFFFFF !important; text-shadow: -1px -1px 0 #3399DD;}
124
- #spread-the-word .button-tweet:hover{background: #3399DD;border-color: #2288CC;box-shadow: 0 0 4px rgba(82, 168, 236, 0.75);}
125
- #spread-the-word .button-rating{background: #8A8A8A; border-color: #222; color: #FFFFFF !important; text-shadow: -1px -1px 0 #444;}
126
- #spread-the-word .button-rating:hover{background: #7E7E7E;border-color: #444;box-shadow: 0 0 4px rgba(128,128,128, 0.75);}
127
#bp-media-show-more{width: 200px;margin-left: auto;margin-right: auto;display: block;height: 30px;line-height: 30px;font-size: 20px;}
128
#bp-media-upload-ui.activity-component{margin-left: 74px;margin-top: 10px;}
129
ul#activity-stream li.media.album_updated ul{}
130
- ul#activity-stream li.media.album_updated ul li{float: left;margin-right:2%}
131
132
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab{padding-left:20px;background:url('../img/tab-icon.png') 3px -4px no-repeat;}
133
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.addons{background-position-y:-34px;}
134
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.support{background-position-y:-64px;}
135
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.update-database{background-position-y:-94px;}
136
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.ffmpeg{background-position-y:-154px;}
137
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.kaltura{background-position-y:-184px;}
138
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.convert-videos{background-position-y:-214px;}
139
- /* Addons page Styling */
140
141
- a.toplevel_page_bp-media-settings div.wp-menu-image{
142
- background:url('../img/admin-menu.png') 0 -32px no-repeat;
143
- }
144
.media ul#bp-media-upload-set-privacy li input[type="radio"]{float:left;}
145
- #rt-donate-button, .rt-link img{vertical-align: middle;}
146
- #adminmenu .menu-icon-generic.toplevel_page_bp-media-settings div.wp-menu-image{
147
- background-position: 0 -32px;
148
- }
149
- #adminmenu .menu-icon-generic.wp-has-current-submenu.toplevel_page_bp-media-settings div.wp-menu-image,
150
- #adminmenu .menu-icon-generic.toplevel_page_bp-media-settings:hover div.wp-menu-image{
151
- background-position-y:0;
152
- }
153
-
154
- #bp-media-addons-list_metabox {background: #ffffff}
155
- .products ul:after, ul.products:after {clear: both;content: "";display: block;}
156
- .products ul, ul.products {clear: both;list-style: none outside none;margin: 0 0 14px;padding: 0;}
157
- .bp-media-addon {margin: 0;}
158
- .bp-media-addon.first { }
159
- .bp-media-addon {margin: 20px 10px 30px;padding: 5px;position: relative;border: 1px solid #ccc;}
160
- .bp-media-addon h4 {background: none repeat scroll 0 0 transparent;border: 0 none;color: #006999;cursor: pointer;font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-size: 20px;font-weight: normal;line-height: 26px;margin: 0 0 10px;}
161
- .bp-media-addon a {text-decoration: none;}
162
- .bp-media-addon a img, div.product div.images img {box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);}
163
- .bp-media-addon a img {display: block;height: auto;margin: 5px 15px 5px 5px;transition: all 0.2s ease-in-out 0s;float: left; width: 200px}
164
-
165
- .bp-media-addon .price, .bp-media-addon .price .amount, .bp-media-addon .price ins {color: #85AD74;font-size: 25px;font-weight: bold;}
166
- .bp-media-addon .price {line-height: 1.4em;color: #85AD74;display: block;font-weight: normal;margin-bottom: 0.5em;}
167
- .coming-soon { background: url("../img/coming-soon.png"); z-index: 5; position:absolute;height:191px; opacity:0.9;}
168
- .coming-soon.coming-soon-l { background-position: 0 0; width:250px; top:-12px; left:-18px;}
169
- .coming-soon.coming-soon-r { background-position: 347px 0; width:174px; bottom:-14px; right:-12px;}
170
- .coming-soon.coming-soon-r:hover{background-position: 175px 0;}
171
-
172
- .bp-media-addon .product_footer{margin: 20px 0 0;overflow: hidden;}
173
- .bp-media-addon .add_to_cart_button{background: #C45200; color: #FFFFFF;display: inline-block;font-size: 18px;font-weight: bold; line-height: 1.4em; margin: 0 20px; padding: 4px 15px;text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6)}
174
- .bp-media-addon .product_footer .product_demo_link{font-size: 16px;margin: 8px 20px; font-weight: bold}
175
-
176
- .bp-media-addon .add_to_cart_button:hover{background: none repeat scroll 0 0 #D75A00;
177
- box-shadow: 0 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.4) inset;
178
- color: #FFFFFF;}
179
-
180
- /* Admin bar Menu */
181
- #wpadminbar .bp-media-settings-menu > .ab-item .ab-icon{background: url("../img/bpm-icon-16.png") no-repeat scroll -8px -7px transparent}
182
- #wpadminbar .bp-media-settings-menu:hover .ab-icon{background-position: -8px -41px}
183
-
184
- /* BuddyPress media admin support form styling */
185
- .bp-media-updated, .bp-media-error{border-radius: 3px; padding: 0 7px; margin: 5px 0 15px; border: 1px solid}
186
- .bp-media-updated p, .bp-media-error p{margin: 0.5em 0;padding: 2px;}
187
- .bp-media-updated{background-color: #FFFFE0;border-color: #E6DB55;}
188
- .bp-media-error{background-color: #FFEBE8;border-color: #CC0000;}
189
- .bp-media-form li{margin-bottom: 10px}
190
- .bp-media-form .bp-media-label{display: inline-block;margin-right: 10px;width: 150px;vertical-align: top; }
191
- .bp-media-form .bp-media-input{background-color: #FFFFFF;border: 1px solid #DFDFDF;border-radius: 3px 3px 3px 3px;color: #333333;line-height: 16px;padding: 5px;width: 220px;}
192
- .bp-media-form .bp-media-checkbox{margin-right: 10px; margin-left: 160px}
193
- .bp-media-form .bp-media-textarea{background-color: #FFFFFF;border: 1px solid #DFDFDF;border-radius: 3px 3px 3px 3px;color: #333333;height: 175px;line-height: 16px;padding: 5px;width: 400px;}
194
- .bp-media-form .bp-media-select{margin: 0;max-width: 400px;}
195
- .bp-media-support-attachment label{float: left}
196
- .bp-media-support-attachment .more-attachment{margin-left: 160px; margin-top: 10px}
197
- .bp-media-support-attachment .more-attachment:first-child{margin-top: 0px}
198
- .bp-media-support-attachment .add-more-attachment-btn{clear: both;display: inline-block;margin-left: 160px;margin-top: 10px;}
199
- .template_select_label{float: left}
200
- .template_select_container{overflow-x:scroll; width:405px;float: left}
201
- #bp_media_settings_form .support_form_laoder{height: 100px; width: 200px; background: url("../img/loader.gif") no-repeat }
202
- /* Miscellaneous */
203
- #normal-sortables .postbox .bp-media-form .submit{float: none; margin-left: 150px}
204
- .rt-success{background-color: #E1FFDF;border-color: #2ACF2A;}
205
- .rt-update{background-color: #FFEAA6;border-color:#E1CA82;}
206
- img.bp-media-donation-image{display:block;margin: 10px auto;}
207
- #donate form{text-align: center;}
208
/* Privacy settings */
209
#bp-media-upload-set-privacy li{margin: 10px 0;overflow: hidden;}
210
#bp-media-upload-set-privacy .album-set-privacy-radio{}
211
#bp-media-upload-set-privacy .album-set-privacy-label{margin: 0;font-weight: normal;}
212
- /*Transcoding Teaser*/
213
- .para-blockquote { background: #E5E5E5; padding: 10px; font-style: italic; }
214
215
- #rtprogressbar {
216
- background-color: #444;
217
- border-radius: 13px;
218
- padding: 3px;
219
}
220
221
- #rtprogressbar div {
222
- background-color: #fb6003;
223
- width: 0;
224
- height: 20px;
225
- border-radius: 10px;
226
}
227
228
@media (min-width: 981px) and (max-width: 1096px) {
229
li #bp-media-upload-ui #drag-drop-area{padding: 10px 0;}
1
/*
2
* Default stylesheet for BuddyPress Media
3
*/
4
+ .bp_media_content img{max-width:100%;}
5
.bp_media_content .mejs-poster img{max-width: 100%;}
6
.media.albums .album-edit{display:inline;}
7
.media h3 {display:block;font-size:20px;font-weight:bold;}
19
/*li.media div.activity-content div.activity-inner p{display:none;}*/
20
.media h3{margin-bottom:10px;}
21
#bp-media-footer {color: #4D4D4D;text-align: center;text-shadow: #FAFAFA 1px 1px 0;}
22
/*#bp-media-upload-ui{position: relative;}*/
23
#item-body:after,ul.bp-media-gallery.item-list:after{content: " ";clear: both;display: block;text-indent: -9999em;}
24
#item-body{position: relative;}
25
26
+ #bp-media-activity-upload-ui { width: 50%;}
27
.bp-media-area-allocate{height: 10px;width: 100%;display: block;}
28
li #bp-media-upload-ui {padding: 0;max-width: 158px;position: relative;}
29
#bp-media-upload-ui #drag-drop-area{border: 4px dashed #DDD;text-align: center;background: url('../img/drag-drop-bg.png') repeat scroll 0 0 transparent;overflow: hidden;padding: 15px 0;}
62
.bp-media-progress-completed{z-index: 9;width: 0;height: 35px;margin-top: -35px;background-color: #83B4D8;background-image: linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -o-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -moz-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -webkit-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -ms-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);-webkit-border-radius: 3px;border-radius: 3px;-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);}
63
.bpm-aligncenter{display: inline-block;text-align: center;width: 100%;}
64
#bp-media-premium-addons ul,#bp-media-premium-addons li{list-style:disc;margin-left:10px;}
65
+ .bp-media-single div.bp_media_content{text-align:center;width: auto;
66
+ margin: 0 auto;
67
+ position: relative;}
68
.bp-media-single .bp_media_content .mejs-container{margin-left:auto;margin-right:auto;}
69
70
+ .bp-media-actions{margin:20px 0;}
71
+ .bp-media-actions a{display:inline-block;}
72
73
.media-tabs-container .ui-tabs-panel{}
74
.media-tabs-container .ui-tabs-hide{display: none}
85
.media-tabs-container .widget-item-listing li h3 {margin: 0}
86
.media-tabs-container .widget-item-listing li h3 a{font-size: 13px;font-weight: normal;word-wrap: break-word; }
87
88
#bp-media-show-more{width: 200px;margin-left: auto;margin-right: auto;display: block;height: 30px;line-height: 30px;font-size: 20px;}
89
#bp-media-upload-ui.activity-component{margin-left: 74px;margin-top: 10px;}
90
ul#activity-stream li.media.album_updated ul{}
91
+ ul#activity-stream li.media.album_updated ul li,ul.bp-media-list-media li{float: left;margin-right:2%}
92
93
94
.media ul#bp-media-upload-set-privacy li input[type="radio"]{float:left;}
95
/* Privacy settings */
96
#bp-media-upload-set-privacy li{margin: 10px 0;overflow: hidden;}
97
#bp-media-upload-set-privacy .album-set-privacy-radio{}
98
#bp-media-upload-set-privacy .album-set-privacy-label{margin: 0;font-weight: normal;}
99
100
+ .bp-media-single .delete-activity-single,.bp-media-single .delete-activity{
101
+ color: #ff0000;
102
+ font-weight:bold;
103
+ }
104
+ .simplemodal-overlay{
105
+ background:#333 none;
106
+ z-index: 100000;
107
+ }
108
+ .simplemodal-container{
109
+ background:#fff none;
110
+ }
111
+ .bp-media-mod-title{
112
+ display:none;
113
+ }
114
+
115
+ .bp-media-ajax-single{
116
+ padding:0;
117
+ }
118
+ .simplemodal-container .simplemodal-close{
119
+ background: url("../img/bp-media-modal.png") right bottom no-repeat;
120
+ width:22px;
121
+ height:22px;
122
+ display:block;
123
+ position:absolute;
124
+ right:0px;
125
+ top:0px;
126
+ cursor: pointer;
127
+ }
128
+ .simplemodal-container .simplemodal-close:hover{
129
+ background-position: right top;
130
+ }
131
+ .simplemodal-container a.modal-ctrl{
132
+ position:absolute;
133
+ height:100%;
134
+ height:100px;
135
+ width:100px;
136
+ top:50%;
137
+ margin-top:-50px;
138
+ cursor: pointer;
139
+ }
140
+ .simplemodal-container a.modal-ctrl:hover{
141
+ background: #232323 none;
142
+ }
143
+ .simplemodal-container a.modal-ctrl span.img-icon{
144
+ display: block;
145
+ height:22px;
146
+ width:22px;
147
+ margin:39px auto 39px 10px;
148
+
149
+ background: url("../img/bp-media-modal.png") left bottom no-repeat;
150
+ }
151
+ .simplemodal-container a.modal-next span.img-icon{
152
+ background-position: center bottom;
153
+ margin:39px 10px 39px auto;
154
+ }
155
+ .simplemodal-container a.modal-prev:hover span.img-icon{
156
+ background-position: left top;
157
+ }
158
+ .simplemodal-container a.modal-next:hover span.img-icon{
159
+ background-position: center top;
160
+ }
161
+ .simplemodal-container a.modal-prev:hover,
162
+ .simplemodal-container a.modal-next:hover{
163
+ background:url("../img/") no-repeat;
164
+ }
165
+ .simplemodal-container a.modal-prev{
166
+ left: 0px;
167
+ }
168
+ .simplemodal-container a.modal-next{
169
+ right: 0px;
170
+ }
171
+
172
+ .bp-media-ajax-single .bp-media-mod-title{
173
+ display:block;
174
+ margin-top:22px;
175
+ }
176
+ .bp-media-ajax-single .bp-media-mod-title h2{
177
+ margin: 5px 0;
178
+ padding:0;
179
}
180
+ .bp-media-ajax-single .bp-media-mod-title p{
181
+ line-height:1.4em;
182
+ }
183
+ .bp-media-ajax-single .bp_media_content img,
184
+ .bp-media-ajax-single .bp_media_content video,
185
+ .bp-media-ajax-single .bp_media_content audio{
186
+ max-width: 100%;
187
+ display:inline-block;
188
+ margin:0 auto;
189
+ vertical-align: middle;
190
+ background:#fff none;
191
+ max-height:600px;
192
+ }
193
+ .bp-media-ajax-single .bp_media_author{
194
+ position:absolute;
195
+ top:0;
196
+ left:0;
197
+ }
198
+ .bp-media-ajax-single .bp-media-content-wrap,
199
+ .bp-media-ajax-single .bp_media_content{
200
+ float:left;
201
+ width:auto;
202
+ margin:0;
203
+ position:relative;
204
+ overflow:hidden;
205
+ height:480px;
206
+ min-width:640px;
207
+ background: #333 none;
208
+ display:table;
209
210
}
211
+ .bp-media-ajax-single .bp_media_content{
212
+ display:table-cell;
213
+ vertical-align: middle;
214
+ float:none;
215
+ }
216
+ .bp-media-ajax-single .bp-media-content-wrap .bp_media_description{
217
+ display:block;
218
+ position:absolute;
219
+ bottom:0;
220
+ left:0;
221
+ }
222
+ .bp-media-ajax-single .bp-media-meta-content-wrap{
223
+ float:left;
224
+ width:250px;
225
+ margin:0;
226
+ min-height:480px;
227
+ margin-left:10px;
228
+ overflow:auto;
229
+ }
230
+ .bp-media-ajax-single .bp-media-meta-content-wrap .activity-meta{
231
+ margin:0;
232
+ }
233
+ .bp-media-ajax-single .bp-media-meta-content-wrap .activity-meta a{
234
+ padding: 2px 8px;
235
+ margin: 5px 5px 0 0;
236
+ display:inline-block;
237
+ }
238
+ .bp-media-ajax-single .bp-media-meta-content-wrap div.activity-comments ul li > ul{
239
+ margin-left:0;
240
+ padding-left:0;
241
+ }
242
+ .bp-media-ajax-single .bp-media-meta-content-wrap div.activity-comments form div.ac-reply-content{
243
+ margin-left:0;
244
+ padding-left:0;
245
+ }
246
+ /*.bp-media-ajax-single .bp-media-meta-content-wrap div.activity-meta a {
247
+ padding: 0;
248
+ float:left;
249
+ }*/
250
+ .bp-media-ajax-preloader{
251
+ display:none;
252
+ }
253
+
254
255
@media (min-width: 981px) and (max-width: 1096px) {
256
li #bp-media-upload-ui #drag-drop-area{padding: 10px 0;}
app/assets/img/bp-media-modal.png ADDED
Binary file
app/assets/img/bpm-icon-32.png CHANGED
Binary file
app/assets/img/close.png ADDED
Binary file
app/assets/img/private.png ADDED
Binary file
app/assets/img/tab-icon.png CHANGED
Binary file
app/assets/js/bp-media-activity-uploader.js CHANGED
@@ -1,239 +1,145 @@
1
- /*
2
* To change this template, choose Tools | Templates
3
* and open the template in the editor.
4
*/
5
6
jQuery(document).ready(function(){
7
- if ( jQuery('#bp-media-activity-upload-ui').length > 0 ) {
8
- //Activity Uploader
9
- var bp_media_activity_is_multiple_upload = false;
10
- var bp_media_activity_uploader=new plupload.Uploader(bp_media_uploader_params);
11
- var bp_media_activity_album_selected = false;
12
- bp_media_activity_uploader.init();
13
-
14
- bp_media_activity_uploader.bind('FilesAdded', function(up, files) {
15
- //bp_media_is_multiple_upload = files.length==1&&jQuery('.bp-media-progressbar').length==0?false:true;
16
- bp_media_activity_is_multiple_upload = files.length>1;
17
- jQuery.each(files, function(i, file) {
18
- var bp_media_activity_extension = file.name.substr( (file.name.lastIndexOf('.') +1) );
19
- jQuery('#bp-media-activity-uploaded-files').append('<div id="bp-media-activity-progress-'+file.id+'" class="bp-media-progressbar"><div class="bp-media-progress-text">' + file.name + ' (' + plupload.formatSize(file.size) + ')(<b>0%</b>)</div><div class="bp-media-progress-completed"></div></div>');
20
- });
21
- // bp_media_activity_album_selected = jQuery('#bp-media-activity-selected-album').val();
22
- bp_media_activity_album_selected = '535';
23
- bp_media_activity_uploader.start();
24
- up.refresh(); // Reposition Flash/Silverlight
25
- });
26
- bp_media_activity_uploader.bind('UploadProgress', function(up, file) {
27
- jQuery('input#aw-whats-new-submit').prop('disabled',true);
28
- jQuery('input#bp-media-aw-whats-new-submit').prop('disabled',true);
29
- jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-completed').width(file.percent+'%');
30
- jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-text b').html(file.percent+'%');
31
- });
32
-
33
- bp_media_activity_uploader.bind('Error', function(up, err) {
34
- jQuery('#bp-media-activity-uploaded-files').html('<div class="error"><p>Error: ' + err.code +
35
- ', Message: ' + err.message +
36
- (err.file ? ', File: ' + err.file.name : '') +
37
- '</p></div>'
38
- );
39
- up.refresh();
40
- });
41
-
42
- bp_media_activity_uploader.bind('FileUploaded', function(up, file,response) {
43
- jQuery('input#aw-whats-new-submit').after('<input type="submit" name="bp-media-aw-whats-new-submit" id="bp-media-aw-whats-new-submit" value="Post Media Update">').remove()
44
- jQuery('#bp-media-aw-whats-new-submit').prop('disabled',true);
45
- jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-text b').html("100%");
46
- jQuery('#bp-media-activity-post-update-append').append('<span>'+response.response+'</span>');
47
- jQuery('#bp-media-aw-whats-new-submit').prop('disabled',false);
48
- });
49
- bp_media_activity_uploader.bind('BeforeUpload',function(up){
50
- up.settings.multipart_params.is_multiple_upload = bp_media_activity_is_multiple_upload;
51
- up.settings.multipart_params.bp_media_album_id = bp_media_activity_album_selected;
52
- up.settings.multipart_params.is_activity = true;
53
- });
54
- bp_media_activity_uploader.bind('UploadComplete',function(response){
55
- });
56
-
57
- /* New posts */
58
- jQuery('#whats-new-submit').on('click', 'input#aw-whats-new-submit', function() {
59
- var button = jQuery(this);
60
- var form = button.parent().parent().parent().parent();
61
-
62
- form.children().each( function() {
63
- if ( jQuery.nodeName(this, "textarea") || jQuery.nodeName(this, "input") )
64
- jQuery(this).prop( 'disabled', true );
65
- });
66
-
67
- /* Remove any errors */
68
- jQuery('div.error').remove();
69
- button.addClass('loading');
70
- button.prop('disabled', true);
71
-
72
- /* Default POST values */
73
- var object = '';
74
- var item_id = jQuery("#whats-new-post-in").val();
75
- var content = jQuery("textarea#whats-new").val();
76
-
77
- /* Set object for non-profile posts */
78
- if ( item_id > 0 ) {
79
- object = jQuery("#whats-new-post-object").val();
80
- }
81
-
82
- jQuery.post( ajaxurl, {
83
- action: 'post_update',
84
- 'cookie': encodeURIComponent(document.cookie),
85
- '_wpnonce_post_update': jQuery("input#_wpnonce_post_update").val(),
86
- 'content': content,
87
- 'object': object,
88
- 'item_id': item_id,
89
- '_bp_as_nonce': jQuery('#_bp_as_nonce').val() || ''
90
- },
91
- function(response) {
92
-
93
- form.children().each( function() {
94
- if ( jQuery.nodeName(this, "textarea") || jQuery.nodeName(this, "input") ) {
95
- jQuery(this).prop( 'disabled', false );
96
- }
97
- });
98
-
99
- /* Check for errors and append if found. */
100
- if ( response[0] + response[1] == '-1' ) {
101
- form.prepend( response.substr( 2, response.length ) );
102
- jQuery( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
103
- } else {
104
- if ( 0 == jQuery("ul.activity-list").length ) {
105
- jQuery("div.error").slideUp(100).remove();
106
- jQuery("div#message").slideUp(100).remove();
107
- jQuery("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
108
- }
109
-
110
- jQuery("ul#activity-stream").prepend(response);
111
- jQuery("ul#activity-stream li:first").addClass('new-update');
112
-
113
- if ( 0 != jQuery("#latest-update").length ) {
114
- var l = jQuery("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
115
- var v = jQuery("ul#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href');
116
-
117
- var ltext = jQuery("ul#activity-stream li.new-update .activity-content .activity-inner p").text();
118
-
119
- var u = '';
120
- if ( ltext != '' )
121
- u = l + ' ';
122
-
123
- u += '<a href="' + v + '" rel="nofollow">' + BP_DTheme.view + '</a>';
124
-
125
- jQuery("#latest-update").slideUp(300,function(){
126
- jQuery("#latest-update").html( u );
127
- jQuery("#latest-update").slideDown(300);
128
- });
129
- }
130
-
131
- jQuery("li.new-update").hide().slideDown( 300 );
132
- jQuery("li.new-update").removeClass( 'new-update' );
133
- jQuery("textarea#whats-new").val('');
134
- }
135
-
136
- jQuery("#whats-new-options").animate({
137
- height:'0px'
138
- });
139
- jQuery("form#whats-new-form textarea").animate({
140
- height:'20px'
141
- });
142
- jQuery("#aw-whats-new-submit").prop("disabled", true).removeClass('loading');
143
- });
144
-
145
- return false;
146
- });
147
-
148
- jQuery('#whats-new-submit').on('click', '#bp-media-aw-whats-new-submit', function(e){
149
- var button = jQuery(this);
150
- button.addClass('loading');
151
- var form = button.parent().parent().parent().parent();
152
- /* Default POST values */
153
- var object = '';
154
- var item_id = jQuery("#whats-new-post-in").val();
155
-
156
- /* Set object for non-profile posts */
157
- if ( item_id > 0 ) {
158
- object = jQuery("#whats-new-post-object").val();
159
- }
160
- var media_id = false;
161
- var multiple = 0;
162
- jQuery('#bp-media-activity-post-update-append span').each(function(){
163
- if (media_id){
164
- media_id=media_id+'-'+jQuery(this).text();
165
- multiple = 1;
166
- }else{
167
- media_id=jQuery(this).text();
168
- }
169
- });
170
- var data = {
171
- action: 'bp_media_post_update',
172
- '_wpnonce_post_update': jQuery("input#_wpnonce_post_update").val(),
173
- 'content': jQuery('#whats-new').val(),
174
- 'object': object,
175
- 'item_id': item_id,
176
- 'media_id': media_id,
177
- 'multiple': multiple,
178
- '_bp_as_nonce': jQuery('#_bp_as_nonce').val() || ''
179
};
180
- jQuery.post(activity_ajax_url,data, function (response) {
181
- jQuery('#bp-media-activity-uploaded-files').html('');
182
- jQuery('#bp-media-activity-post-update-append').html('');
183
- jQuery('#bp-media-aw-whats-new-submit').after('<input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="Post Update">').remove();
184
- form.children().each( function() {
185
- if ( jQuery.nodeName(this, "textarea") || jQuery.nodeName(this, "input") ) {
186
- jQuery(this).prop( 'disabled', false );
187
- }
188
- });
189
-
190
- /* Check for errors and append if found. */
191
- if ( response[0] + response[1] == '-1' ) {
192
- form.prepend( response.substr( 2, response.length ) );
193
- jQuery( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
194
- } else {
195
- if ( 0 == jQuery("ul.activity-list").length ) {
196
- jQuery("div.error").slideUp(100).remove();
197
- jQuery("div#message").slideUp(100).remove();
198
- jQuery("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
199
- }
200
-
201
- jQuery("ul#activity-stream").prepend(response);
202
- jQuery("ul#activity-stream li:first").addClass('new-update');
203
-
204
- if ( 0 != jQuery("#latest-update").length ) {
205
- var l = jQuery("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
206
- var v = jQuery("ul#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href');
207
-
208
- var ltext = jQuery("ul#activity-stream li.new-update .activity-content .activity-inner p").text();
209
-
210
- var u = '';
211
- if ( ltext != '' )
212
- u = l + ' ';
213
-
214
- u += '<a href="' + v + '" rel="nofollow">' + BP_DTheme.view + '</a>';
215
-
216
- jQuery("#latest-update").slideUp(300,function(){
217
- jQuery("#latest-update").html( u );
218
- jQuery("#latest-update").slideDown(300);
219
- });
220
- }
221
-
222
- jQuery("li.new-update").hide().slideDown( 300 );
223
- jQuery("li.new-update").removeClass( 'new-update' );
224
- jQuery("textarea#whats-new").val('');
225
- }
226
-
227
- jQuery("#whats-new-options").animate({
228
- height:'0px'
229
- });
230
- jQuery("form#whats-new-form textarea").animate({
231
- height:'20px'
232
- });
233
- jQuery("#aw-whats-new-submit").prop("disabled", true).removeClass('loading');
234
- jQuery("input#aw-whats-new-submit").bind('click');
235
- });
236
- e.preventDefault();
237
- });
238
- }
239
});
1
+ /*
2
* To change this template, choose Tools | Templates
3
* and open the template in the editor.
4
*/
5
6
jQuery(document).ready(function(){
7
+ if ( jQuery('#bp-media-activity-upload-ui').length > 0 ) {
8
+ $dummy_update_box = jQuery('<textarea id="bp-media-dummy-update"></textarea>');
9
+ $update_container = jQuery('#whats-new-textarea');
10
+ $update_container.append($dummy_update_box);
11
+ overlay_dummy();
12
+ jQuery('#bp-media-dummy-update').focus( function(){
13
+ do_bp_jazz();
14
+ });
15
+
16
+ jQuery('#bp-media-dummy-update').on('keyup',function(){
17
+ $this = jQuery(this);
18
+ $that = jQuery('#bp-media-update-text');
19
+ $that.val($this.val()).change();
20
+ });
21
+ jQuery('#bp-media-update-text').on('change',function(){
22
+ bp_media_overwrite();
23
+ });
24
+ jQuery('#bp-media-update-json').on('change',function(){
25
+ bp_media_overwrite();
26
+ });
27
+
28
+ $bp_media_activity_is_multiple_upload = false;
29
+ $bp_media_activity_uploader=new plupload.Uploader(bp_media_uploader_params);
30
+ $bp_media_activity_album_selected = false;
31
+ $bp_media_activity_uploader.init();
32
+
33
+ $bp_media_activity_uploader.bind('FilesAdded', function(up, files) {
34
+ //bp_media_is_multiple_upload = files.length==1&&jQuery('.bp-media-progressbar').length==0?false:true;
35
+ $bp_media_activity_is_multiple_upload = files.length>1;
36
+ jQuery.each(files, function(i, file) {
37
+ $bp_media_activity_extension = file.name.substr( (file.name.lastIndexOf('.') +1) );
38
+ jQuery('#bp-media-activity-uploaded-files').append('<div id="bp-media-activity-progress-'+file.id+'" class="bp-media-progressbar"><div class="bp-media-progress-text">' + file.name + ' (' + plupload.formatSize(file.size) + ')(<b>0%</b>)</div><div class="bp-media-progress-completed"></div></div>');
39
+ });
40
+ // bp_media_activity_album_selected = jQuery('#bp-media-activity-selected-album').val();
41
+ $bp_media_activity_album_selected = default_album;
42
+ $bp_media_activity_uploader.start();
43
+ do_bp_jazz();
44
+ up.refresh(); // Reposition Flash/Silverlight
45
+ });
46
+ $bp_media_activity_uploader.bind('UploadProgress', function(up, file) {
47
+ jQuery('input#aw-whats-new-submit').prop('disabled',true).addClass('loading');
48
+ jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-completed').width(file.percent+'%');
49
+ jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-text b').html(file.percent+'%');
50
+ });
51
+
52
+ $bp_media_activity_uploader.bind('Error', function(up, err) {
53
+ jQuery('#bp-media-activity-uploaded-files').html('<div class="error"><p>Error: ' + err.code +
54
+ ', Message: ' + err.message +
55
+ (err.file ? ', File: ' + err.file.name : '') +
56
+ '</p></div>'
57
+ );
58
+ up.refresh();
59
+ });
60
+ $bp_media_activity_uploader.bind('FileUploaded', function(up, file,response) {
61
+ jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-text b').html("100%");
62
+ $album_arr = [];
63
+ $val = jQuery('#bp-media-update-json').val();
64
+ if($val!=''){
65
+ $album_arr= JSON.parse($val);
66
+ }
67
+ $album_arr.push(parseInt(response.response));
68
+ $album_json =JSON.stringify($album_arr);
69
+ jQuery('#bp-media-update-json').val($album_json).change();
70
+ jQuery('#aw-whats-new-submit').prop('disabled',false).removeClass('loading');
71
+
72
+ });
73
+ $bp_media_activity_uploader.bind('BeforeUpload',function(up){
74
+ up.settings.multipart_params.is_multiple_upload = $bp_media_activity_is_multiple_upload;
75
+ up.settings.multipart_params.bp_media_album_id = $bp_media_activity_album_selected;
76
+ up.settings.multipart_params.is_activity = true;
77
+ });
78
+ //jQuery("#aw-whats-new-submit").off( 'click');
79
+
80
+ jQuery("#aw-whats-new-submit").on( 'click', function() {
81
+ $latest = '';
82
+ $val = bp_media_stringify();
83
+ jQuery("#bp-media-dummy-update").val('');
84
+ jQuery("#bp-media-update-json").val('');
85
+ jQuery("#bp-media-update-txt").val('');
86
+ jQuery("#bp-media-activity-uploaded-files").empty();
87
+ setTimeout(function(){
88
+ if($val!=''){
89
+ $album_arr= JSON.parse($val);
90
+ $lastid = parseInt($album_arr.length) - 1;
91
+ $media_id = $album_arr[parseInt($lastid)];
92
+ $activity = (jQuery('#activity-stream').find('li').first().attr('id')).split('-');
93
+ $activity_id = $activity[1];
94
+ var data = {
95
+ action: 'bp_media_get_latest_activity',
96
+ content : $val,
97
+ id: $activity_id
98
+ };
99
+ jQuery.get(ajaxurl,data,function(response){
100
+ $latest = response;
101
+ jQuery('#latest-update').html($latest);
102
+ });
103
+ }
104
+ },1000);
105
+ });
106
+
107
+ $bp_media_activity_uploader.bind('UploadComplete',function(response){
108
+
109
+ });
110
+ }
111
+
112
+ function overlay_dummy(){
113
+ $update_box = jQuery('#whats-new');
114
+ $position = $update_box.position();
115
+ $dummy_update_box.css({
116
+ 'position' : 'absolute',
117
+ 'top' : $position.top,
118
+ 'left' : $position.left,
119
+ 'width' : $update_box.width(),
120
+ 'height' : $update_box.height()
121
+ });
122
+ }
123
+
124
+ function bp_media_stringify(){
125
+ $album_json = jQuery('#bp-media-update-json').val();
126
+ $update_txt = jQuery('#bp-media-update-text').val();
127
+ $activity = {
128
+ 'media':$album_json,
129
+ 'update_txt':$update_txt
130
};
131
+ return JSON.stringify($activity);
132
+ }
133
+
134
+ function bp_media_overwrite(){
135
+ jQuery('#whats-new').val(bp_media_stringify());
136
+ }
137
+
138
+ function do_bp_jazz(){
139
+ jQuery("#whats-new-options").css('height','auto');
140
+ jQuery("#whats-new-form textarea").animate({
141
+ height:'50px'
142
+ });
143
+ jQuery("#aw-whats-new-submit").prop("disabled", false);
144
+ }
145
});
app/assets/js/main.js CHANGED
@@ -3,83 +3,512 @@
3
*/
4
5
function bp_media_create_element(id){
6
- jQuery('#'+id).mediaelementplayer({
7
- enableKeyboard: false,
8
- startVolume: 1,
9
- success: function(mediaElement,domElement){
10
- var $thisMediaElement = (mediaElement.id) ? jQuery("#"+mediaElement.id) : jQuery(mediaElement);
11
- $thisMediaElement.parents('.mejs-container').find(".mejs-volume-current").css("top","8px");
12
- $thisMediaElement.parents('.mejs-container').find(".mejs-volume-handle").css("top","5px");
13
- }
14
- });
15
}
16
-
17
jQuery(document).ready(function(){
18
19
- var bp_media_recent_tabs = jQuery('.media-tabs-container-tabs');
20
- if(bp_media_recent_tabs.length>0){
21
- jQuery(bp_media_recent_tabs).tabs();
22
- }
23
-
24
- var tallest = 0;
25
- jQuery('#recent-media-tabs .bp-media-tab-panel').each(function() {
26
-
27
- var thisHeight = jQuery(this).height();
28
- if(thisHeight > tallest) {
29
- tallest = thisHeight;
30
- }
31
- }).height(tallest);
32
-
33
-
34
- jQuery('#bp-media-show-more').click(function(e){
35
- e.preventDefault();
36
- var data = {
37
- action: 'bp_media_load_more',
38
- page:++bp_media_vars.page,
39
- current_action : bp_media_vars.current_action,
40
- action_variables : bp_media_vars.action_variables,
41
- displayed_user : bp_media_vars.displayed_user,
42
- loggedin_user : bp_media_vars.loggedin_user,
43
- current_group : bp_media_vars.current_group
44
- };
45
-
46
- // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
47
- jQuery.post(bp_media_vars.ajaxurl, data, function(response) {
48
- if(response.length==0)
49
- jQuery('#bp-media-show-more').parent().remove();
50
- else
51
- jQuery('#bp-media-list').append(response);
52
- });
53
- });
54
- setTimeout(function(){
55
- jQuery('.media album_updated .delete-activity,.media_upload .delete-activity').unbind('click').click(function(e){
56
- if(confirm('Are you sure you want to delete this activity and associated media?')){
57
- return true;
58
- }
59
- else{
60
- return false;
61
- }
62
- });
63
-
64
- },1000);
65
-
66
- /* Add Featured Image */
67
- jQuery('.activity-meta').on('click','.bp-media-featured',function(e){
68
- e.preventDefault();
69
- var post_id = jQuery(this).attr('data-post-id');
70
- var album_id = jQuery(this).attr('data-album-id');
71
- var curr_obj = jQuery(this);
72
- var data = {
73
- action: 'bp_media_set_album_cover',
74
- post_id:post_id,
75
- album_id:album_id
76
- };
77
- jQuery.post(bp_media_vars.ajaxurl,data,function( response )
78
- {
79
- curr_obj.text(response);
80
- curr_obj.attr('title',response);
81
- }
82
- );
83
- });
84
85
});
3
*/
4
5
function bp_media_create_element(id){
6
+ jQuery('#'+id).mediaelementplayer({
7
+ enableKeyboard: false,
8
+ startVolume: 1,
9
+ success: function(mediaElement,domElement){
10
+ var $thisMediaElement = (mediaElement.id) ? jQuery("#"+mediaElement.id) : jQuery(mediaElement);
11
+ $thisMediaElement.parents('.mejs-container').find(".mejs-volume-current").css("top","8px");
12
+ $thisMediaElement.parents('.mejs-container').find(".mejs-volume-handle").css("top","5px");
13
+ }
14
+ });
15
}
16
+ var $current;
17
jQuery(document).ready(function(){
18
19
+ var bp_media_recent_tabs = jQuery('.media-tabs-container-tabs');
20
+ if(bp_media_recent_tabs.length>0){
21
+ jQuery(bp_media_recent_tabs).tabs();
22
+ }
23
+
24
+ var tallest = 0;
25
+ jQuery('#recent-media-tabs .bp-media-tab-panel').each(function() {
26
+
27
+ var thisHeight = jQuery(this).height();
28
+ if(thisHeight > tallest) {
29
+ tallest = thisHeight;
30
+ }
31
+ }).height(tallest);
32
+
33
+
34
+ jQuery('#bp-media-show-more').click(function(e){
35
+ e.preventDefault();
36
+ var data = load_more_data();
37
+ jQuery.get(bp_media_vars.ajaxurl, data, function(response) {
38
+ if(response.length==0)
39
+ jQuery('#bp-media-show-more').parent().remove();
40
+ else
41
+ jQuery('.bp-media-gallery').append(response);
42
+ });
43
+ });
44
+ setTimeout(function(){
45
+ jQuery('.media album_updated .delete-activity,.media_upload .delete-activity').unbind('click').click(function(e){
46
+ if(confirm('Are you sure you want to delete this activity and associated media?')){
47
+ return true;
48
+ }
49
+ else{
50
+ return false;
51
+ }
52
+ });
53
+
54
+ },1000);
55
+
56
+ /* Add Featured Image */
57
+ jQuery('.activity-meta').on('click','.bp-media-featured',function(e){
58
+ e.preventDefault();
59
+ var post_id = jQuery(this).attr('data-post-id');
60
+ var album_id = jQuery(this).attr('data-album-id');
61
+ var curr_obj = jQuery(this);
62
+ var data = {
63
+ action: 'bp_media_set_album_cover',
64
+ post_id:post_id,
65
+ album_id:album_id
66
+ };
67
+ jQuery.get(bp_media_vars.ajaxurl,data,function( response )
68
+ {
69
+ curr_obj.text(response);
70
+ curr_obj.attr('title',response);
71
+ }
72
+ );
73
+ });
74
+
75
+
76
+ jQuery('#bp-media-list').on('click','li a',function(e){
77
+ e.preventDefault();
78
+ $current = jQuery(this);
79
+ load_media($current);
80
+ });
81
+ jQuery('body').on('click','a.modal-next', function(e){
82
+ e.preventDefault();
83
+ $next_current = $current.closest('li').next().find('a');
84
+ if($next_current.length<1){
85
+ var args = load_more_data();
86
+ var request = jQuery.get(bp_media_vars.ajaxurl, args);
87
+ chained = request.then(function( data ) {
88
+ if(data.length==0){
89
+ jQuery('#bp-media-show-more').parent().remove();
90
+ return false;
91
+ }else{
92
+ jQuery('#bp-media-list').append(data);
93
+ return true;
94
+ }
95
+ });
96
+
97
+ chained.done(function( truth ) {
98
+ if(truth!=false){
99
+ $next_current = $current.closest('li').next().find('a');
100
+ $current = $next_current;
101
+ transit_media($current);
102
+ }
103
+ });
104
+ }else{
105
+ $current = $next_current;
106
+ transit_media($next_current);
107
+ }
108
+
109
+
110
+ });
111
+ jQuery('body').on('click','a.modal-prev', function(e){
112
+ e.preventDefault();
113
+ if($current.closest('li').prev().length>0 && $current.closest('li').prev().find('#bp-media-upload-ui').length<1 ){
114
+ $current = $current.closest('li').prev().find('a');
115
+
116
+ transit_media($current);
117
+ }
118
+ });
119
+ jQuery(document.documentElement).keyup(function (event) {
120
+ if (event.keyCode == 37) {
121
+ jQuery('a.modal-prev').trigger('click');
122
+ } else if (event.keyCode == 39) {
123
+ jQuery('a.modal-next').trigger('click');
124
+ }
125
+ });
126
+
127
+ function load_media($current){
128
+ jQuery.get($current.attr('href'),function(response){
129
+ $mediacontent = jQuery(response).find('.bp-media-single');
130
+ $medialoaded = jQuery('<div class="bp-media-ajax-single"></div>');
131
+ $medialoaded.append($mediacontent);
132
+ jQuery.modal($medialoaded,{
133
+ 'zIndex':99999,
134
+ 'autoResize':true,
135
+ 'opacity': 90
136
+ });
137
+ do_fixes($medialoaded);
138
+ });
139
+ }
140
+ function transit_media($current){
141
+ jQuery.get($current.attr('href'),function(response){
142
+ $mediacontent = jQuery(response).find('.bp-media-single');
143
+ $medialoaded = jQuery('.bp-media-ajax-single');
144
+ $medialoaded.empty();
145
+ $medialoaded.append($mediacontent);
146
+ do_fixes($medialoaded);
147
+
148
+ });
149
+ }
150
+
151
+ function do_fixes($medialoaded){
152
+ $medialoaded.find('.bp-media-content-wrap').append('<a class="modal-prev modal-ctrl"><span class="img-icon"></span></a><a class="modal-next modal-ctrl"><span class="img-icon"></span></a>');
153
+ $medialoaded.find('.bp_media_description').remove();
154
+ $image = $medialoaded.find('.bp-media-content-wrap .bp_media_content img');
155
+ if($image.length<1){
156
+ $image = $medialoaded.find('.bp-media-content-wrap .bp_media_content video');
157
+ $dimensions = adjust_dimensions($image);
158
+ adjust_comment_div($dimensions[0]);
159
+ jQuery.modal.update($dimensions[0],$dimensions[1]);
160
+ }
161
+ $form = $medialoaded.find('form.ac-form');
162
+ if($form.length>0){
163
+ $form.find('.ac-reply-avatar').remove();
164
+ $form.html($form.html().replace('&nbsp; or press esc to cancel.',''));
165
+ }
166
+ $image.load(function(){
167
+ $dimensions = adjust_dimensions($image);
168
+ adjust_comment_div($dimensions[0]);
169
+ jQuery.modal.update($dimensions[0],$dimensions[1]);
170
+ })
171
+ }
172
+
173
+ function adjust_dimensions($image){
174
+
175
+ $height = ($image.height()>480)?$image.height():480;
176
+ $width = ($image.width()>640)?$image.width():640;
177
+ $width = $width +280;
178
+ return [$height,$width];
179
+ }
180
+
181
+ function adjust_comment_div($height){
182
+ $medialoaded.find('.bp-media-meta-content-wrap').css({
183
+ 'height': $height,
184
+ 'overflow':'auto'
185
+ });
186
+ }
187
+ function load_more_data(){
188
+ var data = {
189
+ action: 'bp_media_load_more',
190
+ page:++bp_media_vars.page,
191
+ current_action : bp_media_vars.current_action,
192
+ action_variables : bp_media_vars.action_variables,
193
+ displayed_user : bp_media_vars.displayed_user,
194
+ loggedin_user : bp_media_vars.loggedin_user,
195
+ current_group : bp_media_vars.current_group
196
+ };
197
+ return data;
198
+ }
199
+
200
+ /**** Activity Comments *******************************************************/
201
+
202
+ /* Hide all activity comment forms */
203
+ jQuery('form.ac-form').hide();
204
+
205
+ /* Hide excess comments */
206
+ // if ( jQuery('.activity-comments').length )
207
+ // bp_legacy_theme_hide_comments();
208
+
209
+ /* Activity list event delegation */
210
+ jQuery('body').on( 'click', '.bp-media-ajax-single div.activity',function(event) {
211
+ var target = jQuery(event.target);
212
+ if ( target.hasClass('bp-media-featured') ) {
213
+ var post_id = target.attr('data-post-id');
214
+ var album_id = target.attr('data-album-id');
215
+ var data = {
216
+ action: 'bp_media_set_album_cover',
217
+ post_id:post_id,
218
+ album_id:album_id
219
+ };
220
+ target.addClass('loading');
221
+ jQuery.get(bp_media_vars.ajaxurl,data,function( response )
222
+ {
223
+ target.removeClass('loading');
224
+ target.fadeOut( 200, function() {
225
+ jQuery(this).html(response);
226
+ jQuery(this).attr('title',response);
227
+ jQuery(this).fadeIn(200);
228
+ });
229
+
230
+ }
231
+ );
232
+ }
233
+
234
+ /* Favoriting activity stream items */
235
+ if ( target.hasClass('fav') || target.hasClass('unfav') ) {
236
+ console.log('hua');
237
+ event.preventDefault();
238
+ var type = target.hasClass('fav') ? 'fav' : 'unfav';
239
+ var parent = target.closest('.activity_update');
240
+ var parent_id = parent.attr('id').substr( 9, parent.attr('id').length );
241
+
242
+ target.addClass('loading');
243
+
244
+ jQuery.post( ajaxurl, {
245
+ action: 'activity_mark_' + type,
246
+ 'cookie': encodeURIComponent(document.cookie),
247
+ 'id': parent_id
248
+ },
249
+ function(response) {
250
+ target.removeClass('loading');
251
+
252
+ target.fadeOut( 200, function() {
253
+ jQuery(this).html(response);
254
+ jQuery(this).attr('title', 'fav' == type ? BP_DTheme.remove_fav : BP_DTheme.mark_as_fav);
255
+ jQuery(this).fadeIn(200);
256
+ });
257
+
258
+ if ( 'fav' == type ) {
259
+ if ( !jQuery('.item-list-tabs #activity-favorites').length )
260
+ jQuery('.item-list-tabs ul #activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>');
261
+
262
+ target.removeClass('fav');
263
+ target.addClass('unfav');
264
+
265
+ jQuery('.item-list-tabs ul #activity-favorites span').html( Number( jQuery('.item-list-tabs ul #activity-favorites span').html() ) + 1 );
266
+ } else {
267
+ target.removeClass('unfav');
268
+ target.addClass('fav');
269
+
270
+ jQuery('.item-list-tabs ul #activity-favorites span').html( Number( jQuery('.item-list-tabs ul #activity-favorites span').html() ) - 1 );
271
+
272
+ if ( !Number( jQuery('.item-list-tabs ul #activity-favorites span').html() ) ) {
273
+ if ( jQuery('.item-list-tabs ul #activity-favorites').hasClass('selected') )
274
+ bp_activity_request( null, null );
275
+
276
+ jQuery('.item-list-tabs ul #activity-favorites').remove();
277
+ }
278
+ }
279
+
280
+ if ( 'activity-favorites' == jQuery( '.item-list-tabs li.selected').attr('id') )
281
+ target.parent().parent().parent().slideUp(100);
282
+ });
283
+
284
+ return false;
285
+ }
286
+ /* Comment / comment reply links */
287
+ if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') ) {
288
+ if ( target.parent().hasClass('acomment-reply') )
289
+ target = target.parent();
290
+
291
+ var id = target.attr('id');
292
+ ids = id.split('-');
293
+
294
+ var a_id = ids[2]
295
+ var c_id = target.attr('href').substr( 10, target.attr('href').length );
296
+ var form = jQuery( '#ac-form-' + a_id );
297
+
298
+ form.css( 'display', 'none' );
299
+ form.removeClass('root');
300
+ jQuery('.ac-form').hide();
301
+
302
+ /* Hide any error messages */
303
+ form.children('div').each( function() {
304
+ if ( jQuery(this).hasClass( 'error' ) )
305
+ jQuery(this).hide();
306
+ });
307
+
308
+ if ( ids[1] != 'comment' ) {
309
+ jQuery('#acomment-' + c_id).append( form );
310
+ } else {
311
+ jQuery('#activity-' + a_id + ' .activity-comments').append( form );
312
+ }
313
+
314
+ if ( form.parent().hasClass( 'activity-comments' ) )
315
+ form.addClass('root');
316
+
317
+ form.slideDown( 200 );
318
+ jQuery.scrollTo( form, 500, {
319
+ offset:-100,
320
+ easing:'easeOutQuad'
321
+ } );
322
+ jQuery('#ac-form-' + ids[2] + ' textarea').focus();
323
+
324
+ return false;
325
+ }
326
+
327
+ /* Activity comment posting */
328
+ if ( target.attr('name') == 'ac_form_submit' ) {
329
+ var form = target.parents( 'form' );
330
+ var form_parent = form.parent();
331
+ var form_id = form.attr('id').split('-');
332
+
333
+ if ( !form_parent.hasClass('activity-comments') ) {
334
+ var tmp_id = form_parent.attr('id').split('-');
335
+ var comment_id = tmp_id[1];
336
+ } else {
337
+ var comment_id = form_id[2];
338
+ }
339
+
340
+ var content = jQuery( '#' + form.attr('id') + ' textarea' );
341
+
342
+ /* Hide any error messages */
343
+ jQuery( '#' + form.attr('id') + ' div.error').hide();
344
+ target.addClass('loading').prop('disabled', true);
345
+ content.addClass('loading').prop('disabled', true);
346
+
347
+ var ajaxdata = {
348
+ action: 'new_activity_comment',
349
+ 'cookie': encodeURIComponent(document.cookie),
350
+ '_wpnonce_new_activity_comment': jQuery("#_wpnonce_new_activity_comment").val(),
351
+ 'comment_id': comment_id,
352
+ 'form_id': form_id[2],
353
+ 'content': content.val()
354
+ };
355
+
356
+ // Akismet
357
+ var ak_nonce = jQuery('#_bp_as_nonce_' + comment_id).val();
358
+ if ( ak_nonce ) {
359
+ ajaxdata['_bp_as_nonce_' + comment_id] = ak_nonce;
360
+ }
361
+
362
+ jQuery.post( ajaxurl, ajaxdata, function(response) {
363
+ target.removeClass('loading');
364
+ content.removeClass('loading');
365
+
366
+ /* Check for errors and append if found. */
367
+ if ( response[0] + response[1] == '-1' ) {
368
+ form.append( jQuery( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) );
369
+ } else {
370
+ form.fadeOut( 200, function() {
371
+ if ( 0 == form.parent().children('ul').length ) {
372
+ if ( form.parent().hasClass('activity-comments') ) {
373
+ form.parent().prepend('<ul></ul>');
374
+ } else {
375
+ form.parent().append('<ul></ul>');
376
+ }
377
+ }
378
+
379
+ /* Preceeding whitespace breaks output with jQuery 1.9.0 */
380
+ var the_comment = jQuery.trim( response );
381
+
382
+ form.parent().children('ul').append( jQuery( the_comment ).hide().fadeIn( 200 ) );
383
+ form.children('textarea').val('');
384
+ form.parent().parent().addClass('has-comments');
385
+ } );
386
+ jQuery( '#' + form.attr('id') + ' textarea').val('');
387
+
388
+ /* Increase the "Reply (X)" button count */
389
+ jQuery('#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jQuery('#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );
390
+ }
391
+
392
+ jQuery(target).prop("disabled", false);
393
+ jQuery(content).prop("disabled", false);
394
+ });
395
+
396
+ return false;
397
+ }
398
+
399
+ /* Deleting an activity comment */
400
+ if ( target.hasClass('acomment-delete') ) {
401
+ var link_href = target.attr('href');
402
+ var comment_li = target.parent().parent();
403
+ var form = comment_li.parents('div.activity-comments').children('form');
404
+
405
+ var nonce = link_href.split('_wpnonce=');
406
+ nonce = nonce[1];
407
+
408
+ var comment_id = link_href.split('cid=');
409
+ comment_id = comment_id[1].split('&');
410
+ comment_id = comment_id[0];
411
+
412
+ target.addClass('loading');
413
+
414
+ /* Remove any error messages */
415
+ jQuery('.activity-comments ul .error').remove();
416
+
417
+ /* Reset the form position */
418
+ comment_li.parents('.activity-comments').append(form);
419
+
420
+ jQuery.post( ajaxurl, {
421
+ action: 'delete_activity_comment',
422
+ 'cookie': encodeURIComponent(document.cookie),
423
+ '_wpnonce': nonce,
424
+ 'id': comment_id
425
+ },
426
+ function(response) {
427
+ /* Check for errors and append if found. */
428
+ if ( response[0] + response[1] == '-1' ) {
429
+ comment_li.prepend( jQuery( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) );
430
+ } else {
431
+ var children = jQuery( '#' + comment_li.attr('id') + ' ul' ).children('li');
432
+ var child_count = 0;
433
+ jQuery(children).each( function() {
434
+ if ( !jQuery(this).is(':hidden') )
435
+ child_count++;
436
+ });
437
+ comment_li.fadeOut(200);
438
+
439
+ /* Decrease the "Reply (X)" button count */
440
+ var count_span = jQuery('#' + comment_li.parents('#activity-stream > li').attr('id') + ' a.acomment-reply span');
441
+ var new_count = count_span.html() - ( 1 + child_count );
442
+ count_span.html(new_count);
443
+
444
+ /* If that was the last comment for the item, remove the has-comments class to clean up the styling */
445
+ if ( 0 == new_count ) {
446
+ jQuery(comment_li.parents('#activity-stream > li')).removeClass('has-comments');
447
+ }
448
+ }
449
+ });
450
+
451
+ return false;
452
+ }
453
+
454
+ // Spam an activity stream comment
455
+ if ( target.hasClass( 'spam-activity-comment' ) ) {
456
+ var link_href = target.attr( 'href' );
457
+ var comment_li = target.parent().parent();
458
+
459
+ target.addClass('loading');
460
+
461
+ // Remove any error messages
462
+ jQuery( '.activity-comments ul div.error' ).remove();
463
+
464
+ // Reset the form position
465
+ comment_li.parents( '.activity-comments' ).append( comment_li.parents( '.activity-comments' ).children( 'form' ) );
466
+
467
+ jQuery.post( ajaxurl, {
468
+ action: 'bp_spam_activity_comment',
469
+ 'cookie': encodeURIComponent( document.cookie ),
470
+ '_wpnonce': link_href.split( '_wpnonce=' )[1],
471
+ 'id': link_href.split( 'cid=' )[1].split( '&' )[0]
472
+ },
473
+
474
+ function ( response ) {
475
+ // Check for errors and append if found.
476
+ if ( response[0] + response[1] == '-1' ) {
477
+ comment_li.prepend( jQuery( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) );
478
+
479
+ } else {
480
+ var children = jQuery( '#' + comment_li.attr( 'id' ) + ' ul' ).children( 'li' );
481
+ var child_count = 0;
482
+ jQuery(children).each( function() {
483
+ if ( !jQuery( this ).is( ':hidden' ) ) {
484
+ child_count++;
485
+ }
486
+ });
487
+ comment_li.fadeOut( 200 );
488
+
489
+ // Decrease the "Reply (X)" button count
490
+ var parent_li = comment_li.parents( '#activity-stream > li' );
491
+ jQuery( '#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html( jQuery( '#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html() - ( 1 + child_count ) );
492
+ }
493
+ });
494
+
495
+ return false;
496
+ }
497
+
498
+ /* Showing hidden comments - pause for half a second */
499
+ if ( target.parent().hasClass('show-all') ) {
500
+ target.parent().addClass('loading');
501
+
502
+ setTimeout( function() {
503
+ target.parent().parent().children('li').fadeIn(200, function() {
504
+ target.parent().remove();
505
+ });
506
+ }, 600 );
507
+
508
+ return false;
509
+ }
510
+ });
511
+
512
+
513
514
});
app/helper/BPMediaFeed.php CHANGED
@@ -8,7 +8,7 @@
8
*/
9
class BPMediaFeed {
10
11
- public $feed_url = 'http://rtcamp.com/tag/buddypress/feed/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media';
12
13
public function __construct($feed_url = '') {
14
if ($feed_url)
@@ -46,7 +46,7 @@ class BPMediaFeed {
46
foreach ($rss_items as $item) {
47
?>
48
<li>
49
- <a href='<?php echo $item->get_permalink(); ?>' title='<?php echo __('Posted ', BP_MEDIA_TXT_DOMAIN) . $item->get_date('j F Y | g:i a'); ?>'><?php echo $item->get_title(); ?></a>
50
</li><?php
51
}
52
}
8
*/
9
class BPMediaFeed {
10
11
+ public $feed_url = 'http://rtcamp.com/tag/buddypress/feed/';
12
13
public function __construct($feed_url = '') {
14
if ($feed_url)
46
foreach ($rss_items as $item) {
47
?>
48
<li>
49
+ <a href='<?php echo $item->get_permalink(); ?>?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media' title='<?php echo __('Posted ', BP_MEDIA_TXT_DOMAIN) . $item->get_date('j F Y | g:i a'); ?>'><?php echo $item->get_title(); ?></a>
50
</li><?php
51
}
52
}
app/helper/BPMediaSettings.php CHANGED
@@ -5,222 +5,237 @@
5
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
6
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
*/
8
- if ( ! class_exists( 'BPMediaSettings' ) ) {
9
-
10
- class BPMediaSettings {
11
-
12
- public function __construct() {
13
- add_action( 'admin_init', array( $this, 'settings' ) );
14
- if ( is_multisite() ) {
15
- add_action( 'network_admin_notices', array( $this, 'privacy_notice' ) );
16
- } else {
17
- add_action( 'admin_notices', array( $this, 'privacy_notice' ) );
18
- }
19
- }
20
-
21
- /**
22
- * Register Settings
23
- *
24
- * @global string BP_MEDIA_TXT_DOMAIN
25
- */
26
-
27
- /**
28
- *
29
- * @global BPMediaAddon $bp_media_addon
30
- */
31
- public function settings() {
32
- global $bp_media, $bp_media_addon;
33
- add_settings_section( 'bpm-settings', __( 'Enabled Media Types', BP_MEDIA_TXT_DOMAIN ), is_multisite() ? array( $this, 'network_notices' ) : '', 'bp-media-settings' );
34
- add_settings_field( 'bpm-image', __( 'Photos', BP_MEDIA_TXT_DOMAIN ), array( $this, 'checkbox' ), 'bp-media-settings', 'bpm-settings', array(
35
- 'setting' => 'bp_media_options',
36
- 'option' => 'images_enabled',
37
- 'desc' => __( 'Enable Photos', BP_MEDIA_TXT_DOMAIN )
38
- ) );
39
- add_settings_field( 'bpm-video', __( 'Video', BP_MEDIA_TXT_DOMAIN ), array( $this, 'checkbox' ), 'bp-media-settings', 'bpm-settings', array(
40
- 'setting' => 'bp_media_options',
41
- 'option' => 'videos_enabled',
42
- 'desc' => __( 'Enable Video', BP_MEDIA_TXT_DOMAIN )
43
- ) );
44
- add_settings_field( 'bpm-audio', __( 'Audio', BP_MEDIA_TXT_DOMAIN ), array( $this, 'checkbox' ), 'bp-media-settings', 'bpm-settings', array(
45
- 'setting' => 'bp_media_options',
46
- 'option' => 'audio_enabled',
47
- 'desc' => __( 'Enable Audio', BP_MEDIA_TXT_DOMAIN )
48
- ) );
49
-
50
- if ( bp_is_active( 'groups' ) ) {
51
- add_settings_section( 'bpm-media-type', __( 'Groups Integration', BP_MEDIA_TXT_DOMAIN ), '', 'bp-media-settings' );
52
// add_settings_field('bpm-admin-profile', __('User profiles', BP_MEDIA_TXT_DOMAIN), array($this, 'checkbox'), 'bp-media-settings', 'bpm-media-type', array(
53
// 'setting' => 'bp_media_options',
54
// 'option' => 'enable_on_profile',
55
// 'desc' => __('Check to enable BuddyPress Media on User profiles', BP_MEDIA_TXT_DOMAIN)
56
// )
57
// );
58
- add_settings_field( 'bpm-admin-group', __( 'Groups', BP_MEDIA_TXT_DOMAIN ), array( $this, 'checkbox' ), 'bp-media-settings', 'bpm-media-type', array(
59
- 'setting' => 'bp_media_options',
60
- 'option' => 'enable_on_group',
61
- 'desc' => __( 'Allow Media in Groups', BP_MEDIA_TXT_DOMAIN )
62
- )
63
- );
64
- }
65
-
66
-
67
-
68
- add_settings_section( 'bpm-media-fine', __( 'Display Settings', BP_MEDIA_TXT_DOMAIN ), '', 'bp-media-settings' );
69
- add_settings_field( 'bpm-media-count', __( 'Number of media', BP_MEDIA_TXT_DOMAIN ), array( $this, 'textbox' ), 'bp-media-settings', 'bpm-media-fine', array(
70
- 'setting' => 'bp_media_options',
71
- 'option' => 'default_count'
72
- ) );
73
- add_settings_field( 'bpm-download', __( 'Download Button', BP_MEDIA_TXT_DOMAIN ), array( $this, 'checkbox' ), 'bp-media-settings', 'bpm-media-fine', array(
74
- 'setting' => 'bp_media_options',
75
- 'option' => 'download_enabled',
76
- 'desc' => __( 'Display download button under media', BP_MEDIA_TXT_DOMAIN )
77
- ) );
78
-
79
- if ( BPMediaPrivacy::is_installed() ) {
80
- add_settings_section( 'bpm-privacy', __( 'Privacy Settings', BP_MEDIA_TXT_DOMAIN ), '', 'bp-media-settings' );
81
- add_settings_field( 'bpm-privacy-enabled', __( 'Enable Privacy', BP_MEDIA_TXT_DOMAIN ), array( $this, 'checkbox' ), 'bp-media-settings', 'bpm-privacy', array(
82
- 'setting' => 'bp_media_options',
83
- 'option' => 'privacy_enabled',
84
- 'desc' => __( 'Enable privacy', BP_MEDIA_TXT_DOMAIN )
85
- ) );
86
-
87
- $settings = array(
88
- 6 => __( '<strong>Private</strong> - Visible only to the user', BP_MEDIA_TXT_DOMAIN ),
89
- 4 => __( '<strong>Friends</strong> - Visible to user\'s friends', BP_MEDIA_TXT_DOMAIN ),
90
- 2 => __( '<strong>Users</strong> - Visible to registered users', BP_MEDIA_TXT_DOMAIN ),
91
- 0 => __( '<strong>Public</strong> - Visible to the world', BP_MEDIA_TXT_DOMAIN )
92
- );
93
- if ( ! bp_is_active( 'friends' ) ) {
94
- unset( $settings[ 4 ] );
95
- }
96
- add_settings_field( 'bpm-privacy-private-enabled', __( 'Default Privacy', BP_MEDIA_TXT_DOMAIN ), array( $this, 'radio' ), 'bp-media-settings', 'bpm-privacy', array(
97
- 'setting' => 'bp_media_options',
98
- 'option' => 'default_privacy_level',
99
- 'radios' => $settings,
100
- 'default' => 0,
101
- ) );
102
- add_settings_field( 'bpm-privacy-override-enabled', __( 'User Override', BP_MEDIA_TXT_DOMAIN ), array( $this, 'checkbox' ), 'bp-media-settings', 'bpm-privacy', array(
103
- 'setting' => 'bp_media_options',
104
- 'option' => 'privacy_override_enabled',
105
- 'desc' => __( 'Allow users to override admin defaults (<em>Recommended</em>)', BP_MEDIA_TXT_DOMAIN )
106
- ) );
107
- }
108
- add_settings_section( 'bpm-miscellaneous', __( 'Other Settings', BP_MEDIA_TXT_DOMAIN ), '', 'bp-media-settings' );
109
-
110
- add_settings_field( 'bpm-admin-bar-menu', __( 'Admin bar menu', BP_MEDIA_TXT_DOMAIN ), array( $this, 'checkbox' ), 'bp-media-settings', 'bpm-miscellaneous', array(
111
- 'setting' => 'bp_media_options',
112
- 'option' => 'show_admin_menu',
113
- 'desc' => __( 'Enable menu in WordPress admin bar', BP_MEDIA_TXT_DOMAIN )
114
- )
115
- );
116
- add_settings_field( 'bpm-other-settings', __( 'Recount', BP_MEDIA_TXT_DOMAIN ), array( $this, 'button' ), 'bp-media-settings', 'bpm-miscellaneous', array(
117
- 'option' => 'refresh-count',
118
- 'name' => __( 'Recount', BP_MEDIA_TXT_DOMAIN ),
119
- 'desc' => __( 'Repair media counts', BP_MEDIA_TXT_DOMAIN )
120
- ) );
121
-
122
- $bp_media_addon = new BPMediaAddon();
123
- add_settings_section( 'bpm-addons', __( 'BuddyPress Media Addons for Audio/Video Conversion', BP_MEDIA_TXT_DOMAIN ), array( $bp_media_addon, 'get_addons' ), 'bp-media-addons' );
124
- add_settings_section( 'bpm-support', __( 'Submit a request form', BP_MEDIA_TXT_DOMAIN ), '', 'bp-media-support' );
125
- add_settings_field( 'bpm-request', __( 'Request Type', BP_MEDIA_TXT_DOMAIN ), array( $this, 'dropdown' ), 'bp-media-support', 'bpm-support', array( 'option' => 'select-request', 'none' => false, 'values' => array(
126
- '' => '-- ' . __( 'Select One', BP_MEDIA_TXT_DOMAIN ) . ' --',
127
- 'premium_support' => __( 'Premium Support', BP_MEDIA_TXT_DOMAIN ),
128
- 'new_feature' => __( 'Suggest a New Feature', BP_MEDIA_TXT_DOMAIN ),
129
- 'bug_report' => __( 'Submit a Bug Report', BP_MEDIA_TXT_DOMAIN ) )
130
- ) );
131
- if ( ! BPMediaPrivacy::is_installed() ) {
132
- $bp_media_privacy = new BPMediaPrivacySettings();
133
- add_filter( 'bp_media_add_sub_tabs', array( $bp_media_privacy, 'ui' ), 99, 2 );
134
- add_settings_section( 'bpm-privacy', __( 'Update Database', BP_MEDIA_TXT_DOMAIN ), array( $bp_media_privacy, 'init' ), 'bp-media-privacy' );
135
- }
136
-
137
- add_settings_section( 'bpm-convert-videos', '', array( $this, 'convert_videos_form' ), 'bp-media-convert-videos' );
138
-
139
- register_setting( 'bp_media', 'bp_media_options', array( $this, 'sanitize' ) );
140
- }
141
-
142
- public function convert_videos_form() {
143
- global $current_user;
144
- get_currentuserinfo();
145
- ?>
146
- <div id="video-transcoding-main-container">
147
- <h2>Survey</h2>
148
- <p class="para-blockquote">We are planning an encoding service where you can convert videos without having to install/configure anything on your server.</p>
149
- <h3>Would you be interested?</h3>
150
- <label><input class="interested" name="interested" type="radio" value="Yes" required="required" /> Yes</label>&nbsp;&nbsp;&nbsp;
151
- <label><input class="not-interested" name="interested" type="radio" value="No" required="required" /> No</label>
152
- <div class="interested-container hidden">
153
- <p class="para-blockquote">Glad to see your interest.<br />
154
- Please provide a little more information to help us plan this service better.</p>
155
- <label><h3>Email</h3> <input class="email" type="email" name="email" size="35" value="<?php echo $current_user->user_email; ?>" placeholder="Email" /></label>
156
-
157
- <h3>How would you use this feature?</h3>
158
- <ul>
159
- <li><label><input class="choice-free" type="radio" name="choice" value="Free" /> Free-only. I will use free-encoding quota only.</label></li>
160
- <li><label><input type="radio" name="choice" value="$9" /> I am ready to pay $9 per month for generous encoding quota.</label></li>
161
- <li><label><input type="radio" name="choice" value="$99" /> I am ready to pay $99 per month for unlimited video encoding!</label></li>
162
- </div>
163
- <input class="url" type="hidden" name="url" value="<?php echo home_url(); ?>" />
164
- <br />
165
- <br />
166
- <input class="button button-primary video-transcoding-survey" type="submit" value="Submit" />
167
- </div><?php
168
- }
169
-
170
- public function network_notices() {
171
- $flag = 1;
172
- if ( get_site_option( 'bpm-media-enable', false ) ) {
173
- echo '<div id="setting-error-bpm-media-enable" class="error"><p><strong>' . get_site_option( 'bpm-media-enable' ) . '</strong></p></div>';
174
- delete_site_option( 'bpm-media-enable' );
175
- $flag = 0;
176
- }
177
- if ( get_site_option( 'bpm-media-type', false ) ) {
178
- echo '<div id="setting-error-bpm-media-type" class="error"><p><strong>' . get_site_option( 'bpm-media-type' ) . '</strong></p></div>';
179
- delete_site_option( 'bpm-media-type' );
180
- $flag = 0;
181
- }
182
-
183
- if ( get_site_option( 'bpm-recount-success', false ) ) {
184
- echo '<div id="setting-error-bpm-recount-success" class="updated"><p><strong>' . get_site_option( 'bpm-recount-success' ) . '</strong></p></div>';
185
- delete_site_option( 'bpm-recount-success' );
186
- $flag = 0;
187
- } elseif ( get_site_option( 'bpm-recount-fail', false ) ) {
188
- echo '<div id="setting-error-bpm-recount-fail" class="error"><p><strong>' . get_site_option( 'bpm-recount-fail' ) . '</strong></p></div>';
189
- delete_site_option( 'bpm-recount-fail' );
190
- $flag = 0;
191
- }
192
-
193
- if ( get_site_option( 'bpm-settings-saved' ) && $flag ) {
194
- echo '<div id="setting-error-bpm-settings-saved" class="updated"><p><strong>' . get_site_option( 'bpm-settings-saved' ) . '</strong></p></div>';
195
- }
196
- delete_site_option( 'bpm-settings-saved' );
197
- }
198
-
199
- /**
200
- * Sanitizes the settings
201
- */
202
-
203
- /**
204
- *
205
- * @global type $bp_media_admin
206
- * @param type $input
207
- * @return type
208
- */
209
- public function sanitize( $input ) {
210
- global $bp_media_admin;
211
- if ( isset( $_POST[ 'refresh-count' ] ) ) {
212
- if ( $bp_media_admin->update_count() ) {
213
- if ( is_multisite() )
214
- update_site_option( 'bpm-recount-success', __( 'Recounting of media files done successfully', BP_MEDIA_TXT_DOMAIN ) );
215
- else
216
- add_settings_error( __( 'Recount Success', BP_MEDIA_TXT_DOMAIN ), 'bpm-recount-success', __( 'Recounting of media files done successfully', BP_MEDIA_TXT_DOMAIN ), 'updated' );
217
-