From 22d5c2d24a24ebb33fb39adddf266510f8f561d1 Mon Sep 17 00:00:00 2001 From: ultimatemember Date: Sat, 7 Mar 2015 13:07:49 +0200 Subject: [PATCH] Update 1.0.76 --- addons/bp_avatar_transfer.php | 108 ++++++++++++++++++ admin/assets/css/um-admin-redux.css | 69 +++++++---- admin/core/um-admin-actions.php | 2 +- admin/core/um-admin-dashboard.php | 2 +- admin/core/um-admin-metabox.php | 6 +- admin/core/um-admin-redux.php | 2 +- admin/um-admin-init.php | 6 +- assets/css/um-account.css | 4 +- assets/css/um-members.css | 6 +- assets/css/um-profile.css | 8 +- assets/css/um-responsive.css | 47 +------- assets/css/um.min.css | 2 +- assets/dynamic_css/dynamic_directory.php | 8 +- assets/dynamic_css/dynamic_global.php | 30 ++--- assets/dynamic_css/dynamic_profile.php | 2 +- assets/js/um-functions.js | 8 +- assets/js/um.min.js | 2 +- core/um-actions-account.php | 30 ++--- core/um-actions-form.php | 6 + core/um-actions-password.php | 8 +- core/um-cron.php | 7 ++ core/um-files.php | 22 +++- core/um-filters-addons.php | 33 ++++++ core/um-form.php | 4 +- core/um-permalinks.php | 2 +- core/um-setup.php | 10 ++ core/um-shortcodes.php | 8 +- .../um-tracking.php | 25 ++-- index.php | 2 +- readme.txt | 29 ++++- templates/email/approval_email.html | 20 ++-- templates/email/changedpw_email.html | 18 +-- templates/email/checkmail_email.html | 18 +-- templates/email/deletion_email.html | 20 ++-- templates/email/inactive_email.html | 18 +-- templates/email/pending_email.html | 18 +-- templates/email/rejected_email.html | 18 +-- templates/email/resetpw_email.html | 18 +-- templates/email/welcome_email.html | 20 ++-- um-config.php | 10 ++ um-init.php | 19 +++ 41 files changed, 453 insertions(+), 242 deletions(-) create mode 100644 addons/bp_avatar_transfer.php create mode 100644 core/um-filters-addons.php rename admin/core/um-admin-tracking.php => core/um-tracking.php (88%) diff --git a/addons/bp_avatar_transfer.php b/addons/bp_avatar_transfer.php new file mode 100644 index 00000000..d195545a --- /dev/null +++ b/addons/bp_avatar_transfer.php @@ -0,0 +1,108 @@ +addon = $ultimatemember->addons['bp_avatar_transfer']; + add_submenu_page('ultimatemember', $this->addon[0], $this->addon[0], 'manage_options', 'bp_avatar_transfer', array(&$this, 'content') ); + + } + + /*** + *** @Runs a custom hook + ***/ + function um_admin_addon_hook( $hook ) { + global $ultimatemember; + switch( $hook ) { + case 'bp_avatar_transfer': + if ( class_exists('BuddyPress') ) { + + $path = bp_core_avatar_upload_path() . '/avatars'; + + $files = glob( $path . '/*'); + $i = 0; + foreach( $files as $key ) { + $q = (count(glob("$key/*")) === 0) ? 0 : 1; + if ( $q == 1 ) { + $photo = glob( $key . '/*'); + foreach( $photo as $file ) { + if ( strstr( $file, 'bpfull' ) ) { + $get_user_id = explode('/', $file); + array_pop($get_user_id); + $user_id = end($get_user_id); + if ( !file_exists( $ultimatemember->files->upload_basedir . $user_id . '/profile_photo.jpg' ) ) { + $ultimatemember->files->new_user( $user_id ); + copy( $file, $ultimatemember->files->upload_basedir . $user_id . '/profile_photo.jpg' ); + update_user_meta($user_id, 'profile_photo', 'profile_photo.jpg'); + $i++; + } + } + } + } + } + + $this->content = '

Done. Process completed!

'; + $this->content .= $i . ' user(s) changed.

'; + + } + break; + } + } + + /*** + *** @Change admin content + ***/ + function admin_init() { + if ( isset( $_REQUEST['um-addon-hook'] ) ) { + $hook = $_REQUEST['um-addon-hook']; + do_action("um_admin_addon_hook", $hook); + } + } + + function content() { + + $this->process_link = add_query_arg('um-addon-hook','bp_avatar_transfer'); + + ?> + +
+ +

Ultimate Member

+ +

addon[0]; ?>

+ + content ) ) { + echo $this->content; + } else { ?> + +

This tool allows you to move all custom user photos/avatars from BuddyPress to Ultimate Member platform. This can help you If you are switching from BuddyPress.

+

Depending on your users database, this could take a few moments. To start the process, click the following button.

+ +

Start transferring avatars

+ + + +
+ + send_checkin(true); exit( wp_redirect( remove_query_arg('um_adm_action') ) ); diff --git a/admin/core/um-admin-dashboard.php b/admin/core/um-admin-dashboard.php index b3f90f9e..58347b35 100644 --- a/admin/core/um-admin-dashboard.php +++ b/admin/core/um-admin-dashboard.php @@ -154,7 +154,7 @@ class UM_Admin_Dashboard { function admin_page() { $page = $_REQUEST['page']; - if ( $page == 'ultimatemember' ) { + if ( $page == 'ultimatemember' && !isset($_REQUEST['um-addon']) ) { ?> diff --git a/admin/core/um-admin-metabox.php b/admin/core/um-admin-metabox.php index 1b1fae63..0c26b61d 100644 --- a/admin/core/um-admin-metabox.php +++ b/admin/core/um-admin-metabox.php @@ -428,15 +428,15 @@ class UM_Admin_Metabox { } // needed on forms only - if ( isset( $screen->id ) && strstr( $screen->id, 'um_form' ) ) { + if ( !isset( $this->is_loaded ) && isset( $screen->id ) && strstr( $screen->id, 'um_form' ) ) { $settings['textarea_rows'] = 8; - echo '