Version 1.0.48

This commit is contained in:
ultimatemember
2015-02-10 02:05:27 +02:00
parent 5487c7b6d1
commit b4f313e8bc
21 changed files with 192 additions and 32 deletions
+12 -2
View File
@@ -54,10 +54,20 @@
line-height: 34px;
}
.um-admin-tag.small {font-size: 13px;height:28px;line-height: 28px;display:inline;padding: 4px 10px;background: transparent;color: #666;border-radius:0;}
.um-admin-tag.ok {border-left: 2px solid #93ba37}
.um-admin-tag.approved {border-left: 2px solid #7ACF58}
.um-admin-tag.pending {border-left: 2px solid #b76767}
.um-admin-txtspace {margin: 0 0 0 10px;}
.um-adm-ico {font-size: 20px;margin-top: 5px;display:inline-block;color:#3ba1da}
.um-adm-ico {
font-size: 20px;
width: 20px;
text-align: center;
margin-top: 5px;
display: inline-block;
color: #7ACF58;
}
.um-adm-ico.inactive {color: #b76767}
.um-adm-ico.pointer {cursor: pointer}
+1 -1
View File
@@ -3,7 +3,7 @@
}
.wrap a.red,
.wrap span.red {color:#A00}
.wrap span.red {color:#b76767}
.wrap span.ok {color:#7ACF58}
+3 -1
View File
@@ -115,9 +115,11 @@ body.um-admin-modal-open {
margin: 0 0 8px 0 !important;
padding: 0!important;
font-size: 13px;
color: #888;
color: #666;
}
.um-admin-metabox label strong {color: #222}
.um-admin-metabox input[type=text]:disabled{
opacity: 0.7 !important;
color: #aaa !important;
+3 -2
View File
@@ -67,7 +67,6 @@
$locale = get_option('WPLANG');
if ( !$locale ) return;
if ( file_exists( WP_LANG_DIR . '/plugins/ultimatemember-'.$locale.'.mo' ) ) return;
if ( !isset( $ultimatemember->available_languages[$locale] ) ) return;
$path = $ultimatemember->files->upload_basedir;
@@ -86,7 +85,9 @@
copy( $remote2_tmp, $path . 'ultimatemember-' . $locale . '.mo' );
unlink( $remote2_tmp );
exit( wp_redirect( remove_query_arg('um_adm_action') ) );
$url = remove_query_arg('um_adm_action', $ultimatemember->permalinks->get_current_url() );
$url = add_query_arg('update','language_updated',$url);
exit( wp_redirect($url) );
}
+61 -2
View File
@@ -50,7 +50,8 @@ class UM_Admin_Dashboard {
*** @load metabox stuff
***/
function on_load_page() {
global $ultimatemember;
wp_enqueue_script('common');
wp_enqueue_script('wp-lists');
wp_enqueue_script('postbox');
@@ -62,7 +63,33 @@ class UM_Admin_Dashboard {
add_meta_box('um-metaboxes-contentbox-1', __('Users Overview','ultimatemember'), array(&$this, 'users_overview'), $this->pagehook, 'normal', 'core');
add_meta_box('um-metaboxes-sidebox-1', __('Purge Temp Files','ultimatemember'), array(&$this, 'purge_temp'), $this->pagehook, 'side', 'core');
if ( $this->language_avaialable_not_installed() ) {
add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'dl_language'), $this->pagehook, 'side', 'core');
} else if ( $this->language_avaialable_installed() ) {
add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'up_language'), $this->pagehook, 'side', 'core');
} else if ( $this->language_not_available() ) {
add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'ct_language'), $this->pagehook, 'side', 'core');
}
}
function up_language() {
global $ultimatemember;
$locale = get_option('WPLANG');
include_once um_path . 'admin/templates/dashboard/language-update.php';
}
function dl_language() {
global $ultimatemember;
$locale = get_option('WPLANG');
include_once um_path . 'admin/templates/dashboard/language-download.php';
}
function ct_language() {
global $ultimatemember;
$locale = get_option('WPLANG');
include_once um_path . 'admin/templates/dashboard/language-contrib.php';
}
function users_overview() {
@@ -75,6 +102,38 @@ class UM_Admin_Dashboard {
include_once um_path . 'admin/templates/dashboard/purge.php';
}
/***
*** @language not available
***/
function language_not_available() {
$locale = get_option('WPLANG');
if ( $locale && !isset( $ultimatemember->available_languages[$locale] ) && !file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
return true;
return false;
}
/***
*** @language available but not installed
***/
function language_avaialable_not_installed() {
global $ultimatemember;
$locale = get_option('WPLANG');
if ( $locale && isset( $ultimatemember->available_languages[$locale] ) && !file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
return true;
return false;
}
/***
*** @language available and installed
***/
function language_avaialable_installed() {
global $ultimatemember;
$locale = get_option('WPLANG');
if ( $locale && isset( $ultimatemember->available_languages[$locale] ) && file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
return true;
return false;
}
/***
*** @get a directory size
***/
+4 -1
View File
@@ -122,7 +122,10 @@ class UM_Admin_Metabox {
***/
function ui_on_off( $id, $default=0, $is_conditional=false, $cond1='', $cond1_show='', $cond1_hide='', $yes='', $no='' ) {
$meta = get_post_meta( get_the_ID(), $id, true );
$meta = (string)get_post_meta( get_the_ID(), $id, true );
if ( $meta === '0' && $default > 0 ) {
$default = $meta;
}
$yes = ( !empty( $yes ) ) ? $yes : __('Yes');
$no = ( !empty( $no ) ) ? $no : __('No');
+6
View File
@@ -27,7 +27,9 @@ class UM_Admin_Notices {
$path = str_replace('//','/',$path);
if ( !file_exists( $path ) ) {
$old = umask(0);
@mkdir( $path, 0777, true);
umask($old);
}
}
@@ -111,6 +113,10 @@ class UM_Admin_Notices {
$update = $_REQUEST['update'];
switch($update) {
case 'language_updated':
$messages[0]['content'] = __('Your translation files have been updated successfully.','ultimatemember');
break;
case 'purged_temp':
$messages[0]['content'] = __('Your temp uploads directory is now clean.','ultimatemember');
break;
+1 -1
View File
@@ -248,7 +248,7 @@ class UM_Admin_Users {
um_fetch_user( $user_id );
if ( um_user('account_status') == 'approved' ) {
$output = '<span class="um-admin-tag small ok">'.um_user('account_status_name').'</span>';
$output = '<span class="um-admin-tag small approved">'.um_user('account_status_name').'</span>';
} else {
$output = '<span class="um-admin-tag small pending">'.um_user('account_status_name').'</span>';
}
@@ -0,0 +1,3 @@
<p><?php printf(__('Ultimate Member is not yet available in your language: <strong>%1$s</strong>.','ultimatemember'), $locale); ?></p>
<p><?php _e('If you want to contribute this translation to the plugin, please add it on our <a href="https://ultimatemember.com/forums/"><forums</a>.','ultimatemember'); ?></p>
@@ -0,0 +1,3 @@
<p><?php printf(__('Ultimate Member is available in your language: <strong>%1$s (%2$s)</strong>.','ultimatemember'), $ultimatemember->available_languages[$locale], $locale); ?></p>
<p><a href="<?php echo add_query_arg( 'um_adm_action', 'um_language_downloader' ); ?>" class="button"><?php _e('Download Translation','ultimatemember'); ?></a></p>
@@ -0,0 +1,3 @@
<p><?php printf(__('You are currently using Ultimate Member in your language: <strong>%1$s (%2$s)</strong>.','ultimatemember'), $ultimatemember->available_languages[$locale], $locale); ?></p>
<p><a href="<?php echo add_query_arg( 'um_adm_action', 'um_language_downloader' ); ?>" class="button"><?php _e('Force Update Translation','ultimatemember'); ?></a></p>
+1 -1
View File
@@ -16,7 +16,7 @@ if(isset($_FILES[$id]['name'])) {
$temp = $_FILES[$id]["tmp_name"];
$file = $_FILES[$id]["name"];
$file = str_replace(array('(',')','+','&','?','%','{','}','[',']','=',',',';',' '),'',$file);
$error = $ultimatemember->files->check_image_upload( $temp, $id );
if ( $error ){
+6 -2
View File
@@ -15,15 +15,19 @@ class UM_Access {
*** @do actions based on priority
***/
function template_redirect() {
global $ultimatemember;
do_action('um_access_homepage_per_role');
do_action('um_access_global_settings');
do_action('um_access_post_settings');
if ( $this->redirect_handler && !$this->allow_access )
if ( $this->redirect_handler && !$this->allow_access ) {
$curr = $ultimatemember->permalinks->get_current_url();
$this->redirect_handler = add_query_arg('redirect_to', $curr, $this->redirect_handler);
exit( wp_redirect( $this->redirect_handler ) );
}
}
+37 -11
View File
@@ -114,30 +114,56 @@ class UM_Account {
function get_tab_output( $id ) {
global $ultimatemember;
$output = null;
switch( $id ) {
case 'privacy' :
case 'notifications':
$output = apply_filters("um_account_content_hook_{$id}", $output);
return $output;
break;
case 'privacy':
$args = 'profile_privacy,hide_in_members';
$fields = $ultimatemember->builtin->get_specific_fields( $args );
foreach( $fields as $key => $data ){
$output .= $ultimatemember->fields->edit_field( $key, $data );
}
return $output;
break;
case 'delete' :
case 'delete':
$args = 'single_user_password';
$fields = $ultimatemember->builtin->get_specific_fields( $args );
foreach( $fields as $key => $data ){
$output .= $ultimatemember->fields->edit_field( $key, $data );
}
return $output;
break;
case 'general' :
case 'general':
$args = 'user_login,first_name,last_name,user_email';
$fields = $ultimatemember->builtin->get_specific_fields( $args );
foreach( $fields as $key => $data ){
$output .= $ultimatemember->fields->edit_field( $key, $data );
}
return $output;
break;
case 'password' :
case 'password':
$args = 'user_password';
$fields = $ultimatemember->builtin->get_specific_fields( $args );
foreach( $fields as $key => $data ){
$output .= $ultimatemember->fields->edit_field( $key, $data );
}
return $output;
break;
default :
$args = null;
break;
}
$fields = $ultimatemember->builtin->get_specific_fields( $args );
$output = null;
foreach( $fields as $key => $data ){
$output .= $ultimatemember->fields->edit_field( $key, $data );
}
return $output;
}
/***
+1 -1
View File
@@ -114,7 +114,7 @@
case 2:
if ( !is_user_logged_in() ){
if ( !$access_redirect ) $access_redirect = home_url();
if ( !$access_redirect ) $access_redirect = um_get_core_page('login');
$redirect_to = $access_redirect;
}
+26
View File
@@ -38,6 +38,8 @@
}
}
do_action('um_pre_account_update');
$tab = ( get_query_var('um_tab') ) ? get_query_var('um_tab') : 'general';
exit( wp_redirect( $ultimatemember->account->tab_link( $tab ) ) );
@@ -218,6 +220,30 @@
}
}
/***
*** @display tab "Notifications"
***/
add_action('um_account_tab__notifications', 'um_account_tab__notifications');
function um_account_tab__notifications( $info ) {
global $ultimatemember;
extract( $info );
extract( $info );
$output = $ultimatemember->account->get_tab_output('notifications');
if ( $output ) { ?>
<div class="um-account-heading uimob340-hide uimob500-hide"><i class="<?php echo $icon; ?>"></i><?php echo $title; ?></div>
<?php echo $output; ?>
<div class="um-col-alt um-col-alt-b"><div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Notifications','ultimatemember'); ?>" class="um-button" /></div><div class="um-clear"></div></div>
<?php
}
}
/***
*** @display account photo and username
***/
+1 -1
View File
@@ -11,7 +11,7 @@ class UM_Mail {
/***
*** @mandrill compatibility
***/
function mandrill_nl2br($nl2br, $message) {
function mandrill_nl2br($nl2br, $message = '') {
// text emails
$nl2br = true;
+1 -1
View File
@@ -181,7 +181,7 @@ class UM_Query {
$real_role_slug = $role_slug;
}
} else {
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_name = '$role_slug'");
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_name = '$role_slug'");
$real_role_slug = $role_slug;
}
+5 -3
View File
@@ -98,12 +98,14 @@ class UM_Shortcodes {
}
$args = apply_filters('um_shortcode_args_filter', $args );
if ( um_profile_id() && isset( $args['role'] ) && $args['role'] && $args['role'] != $ultimatemember->query->get_role_by_userid( um_profile_id() ) )
return;
extract( $args, EXTR_SKIP );
// for profiles only
if ( $mode == 'profile' && um_profile_id() && isset( $args['role'] ) && $args['role'] &&
$args['role'] != $ultimatemember->query->get_role_by_userid( um_profile_id() ) )
return;
do_action("um_pre_{$mode}_shortcode", $args);
do_action("um_before_form_is_loaded", $args);
+1 -1
View File
@@ -3,7 +3,7 @@
Plugin Name: Ultimate Member
Plugin URI: http://ultimatemember.com/
Description: Ultimate Member is a powerful community and membership plugin that allows you to create beautiful community and membership sites with WordPress
Version: 1.0.47
Version: 1.0.48
Author: Ultimate Member
Author URI: http://ultimatemember.com/
*/
+13 -1
View File
@@ -7,7 +7,7 @@ Tags: access control, author, authors, author profile, comments, community, comm
Requires at least: 4.1
Tested up to: 4.1
Stable Tag: 1.0.47
Stable Tag: 1.0.48
License: GNU Version 2 or Any Later Version
@@ -186,6 +186,18 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
== Changelog ==
= 1.0.48: February 10, 2015 =
* New: added translation downloader/updater in plugin dashboard
* New: added admin notice when language is updated or downloaded
* Tweak: redirect to login page by default if content is restricted
* Tweak: redirect back to the protected content after successful login
* Tweak: small modifications to plugin admin css
* Fixed: issue with registration form per role not appearing (when logged in)
* Fixed: image and file uploads strip illegal characters from file name
* Fixed: small issue with mandrill plugin
* Fixed: bug with role creation that have used slugs that exist in database
= 1.0.47: February 9, 2015 =
* New: A more native dashboard for Ultimate Member