Tarea #1044 -> En el registro del usuario, hay que tener 18 años como mínimo
git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@143 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
parent
edac15a11d
commit
68ab9e8145
2471
wp-content/plugins/bp-xtra-signup/_inc/MCAPI.class.php
Normal file
2471
wp-content/plugins/bp-xtra-signup/_inc/MCAPI.class.php
Normal file
File diff suppressed because it is too large
Load Diff
458
wp-content/plugins/bp-xtra-signup/_inc/bpxs-core.php
Normal file
458
wp-content/plugins/bp-xtra-signup/_inc/bpxs-core.php
Normal file
@ -0,0 +1,458 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage BuddyPress
|
||||
* @sub-subpackage BP Xtra Signup
|
||||
* @author Boris Glumpler
|
||||
* @copyright 2010, ShabuShabu Webdesign
|
||||
* @link http://shabushabu.eu/bp-xtra-signup
|
||||
* @license http://www.opensource.org/licenses/gpl-2.0.php GPL License
|
||||
*/
|
||||
|
||||
require( BPXS_ABSPATH .'_inc/bpxs-js-css.php' );
|
||||
|
||||
/**
|
||||
* Add custom userdata from register.php
|
||||
* @since 1.0
|
||||
*/
|
||||
function bpxs_add_to_signup( $usermeta )
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( $bpxs->options->tos == true )
|
||||
$usermeta['accept_tos'] = $_POST['accept_tos'];
|
||||
|
||||
if( $bpxs->options->newsletter == true )
|
||||
{
|
||||
if( isset( $_POST['newsletter'] ) )
|
||||
$usermeta['newsletter'] = $_POST['newsletter'];
|
||||
}
|
||||
|
||||
return $usermeta;
|
||||
}
|
||||
add_filter( 'bp_signup_usermeta', 'bpxs_add_to_signup' );
|
||||
|
||||
/**
|
||||
* Perform checks for custom registration data
|
||||
* @since 1.0
|
||||
*/
|
||||
function bpxs_check_additional_signup()
|
||||
{
|
||||
global $bp, $bpxs;
|
||||
|
||||
if( $bpxs->options->tos == true )
|
||||
{
|
||||
if( $_POST['accept_tos'] != 'agreed' )
|
||||
$bp->signup->errors['accept_tos'] = stripcslashes( $bpxs->options->tos_error_text );
|
||||
}
|
||||
|
||||
if( $bpxs->options->date_of_birth == true && ! empty( $bpxs->options->dob_field ) )
|
||||
{
|
||||
$dob = $_POST['field_'. $bpxs->options->dob_field .'_year'] .'-'. bpxs_get_month_number( $_POST['field_'. $bpxs->options->dob_field .'_month'] ) .'-'. $_POST['field_'. $bpxs->options->dob_field .'_day'];
|
||||
|
||||
if( ! bpxs_check_dob( $dob ) )
|
||||
$bp->signup->errors['field_' . $bpxs->options->dob_field] = sprintf( __( 'You need to be at least %d years old to join this network.', 'bpxs' ), $bpxs->options->dob_age );
|
||||
}
|
||||
}
|
||||
add_action( 'bp_signup_validate', 'bpxs_check_additional_signup' );
|
||||
|
||||
/**
|
||||
* Update usermeta with custom registration data
|
||||
* @since 1.0
|
||||
*/
|
||||
function bpxs_user_activate_fields( $user_id, $user_login, $user_password, $user_email, $usermeta )
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( $bpxs->options->tos == true )
|
||||
update_usermeta( $user_id, 'accept_tos', $usermeta['accept_tos'] );
|
||||
|
||||
if( $bpxs->options->newsletter == true )
|
||||
update_usermeta( $user_id, 'newsletter', $usermeta['newsletter'] );
|
||||
|
||||
return $user_id;
|
||||
}
|
||||
add_action( 'bp_core_signup_user', 'bpxs_user_activate_fields', 5, 5 );
|
||||
|
||||
/**
|
||||
* Subscribes a user to our newsletter if checked
|
||||
* @since 4.0
|
||||
*/
|
||||
function bpxs_subscribe_newsletter( $user_id, $user_login, $user_password, $user_email, $usermeta )
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( $bpxs->options->newsletter == true )
|
||||
{
|
||||
if( $usermeta['newsletter'] == 'agreed' )
|
||||
{
|
||||
require_once( BPXS_ABSPATH . '_inc/MCAPI.class.php' );
|
||||
|
||||
$api = new MCAPI( $bpxs->options->mcapi_key );
|
||||
|
||||
$u = get_userdata( $user_id );
|
||||
|
||||
$merge_vars = array( 'FNAME' => $u->nickname, 'LNAME'=> '' );
|
||||
|
||||
$retval = $api->listSubscribe( $bpxs->options->mcapi_list_id, $u->user_email, $merge_vars );
|
||||
|
||||
if( $api->errorCode && ! empty( $bpxs->options->email_recipient ) )
|
||||
{
|
||||
$body = stripslashes( $bpxs->options->email_message );
|
||||
$body = str_replace( '{ERROR_CODE}', $api->errorCode, $body );
|
||||
$body = str_replace( '{ERROR_MESSAGE}', $api->errorMessage, $body );
|
||||
$body = str_replace( '{USER_ID}', $user_id, $body );
|
||||
$body = str_replace( '{USER_NAME}', $auth->nickname, $body );
|
||||
$body = str_replace( '{USER_EMAIL}', $auth->user_email, $body );
|
||||
|
||||
wp_mail( $bpxs->options->email_recipient, $bpxs->options->email_subject, $body );
|
||||
}
|
||||
}
|
||||
else
|
||||
update_usermeta( $user_id, 'newsletter', 'declined' );
|
||||
}
|
||||
}
|
||||
add_action( 'bp_core_signup_user', 'bpxs_subscribe_newsletter', 5, 5 );
|
||||
|
||||
/**
|
||||
* Add newsletter and TOS to register page
|
||||
* @since 1.0
|
||||
*/
|
||||
function bpxs_add_to_registration()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
?>
|
||||
<div id="tos" class="register-section">
|
||||
<h4><?php echo stripslashes( $bpxs->options->signup_title ) ?></h4>
|
||||
|
||||
<?php if( $bpxs->options->tos == true ) { ?>
|
||||
<?php do_action( 'bp_accept_tos_errors' ) ?>
|
||||
<label><input type="checkbox" name="accept_tos" id="accept_tos" value="agreed" /> <?php echo stripslashes( $bpxs->options->tos_text ) ?></label>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( $bpxs->options->newsletter == true ) { ?>
|
||||
<label><input type="checkbox" name="newsletter" id="newsletter" value="agreed" /> <?php echo stripslashes( $bpxs->options->newsletter_text ) ?></label>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_action( 'bp_before_registration_submit_buttons', 'bpxs_add_to_registration' );
|
||||
|
||||
/**
|
||||
* Add email confirmation to register page
|
||||
* Code by Francesco Laffi
|
||||
* http://flweb.it/2010/05/add-confirm-email-field-in-buddypress-signup-page/
|
||||
* @since 1.2
|
||||
*/
|
||||
function bpxs_add_email_confirm()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( $bpxs->options->email_confirmation == true )
|
||||
{
|
||||
$email = empty( $_POST['signup_email_first'] ) ? '' : $_POST['signup_email_first'];
|
||||
|
||||
do_action( 'bp_signup_email_first_errors' ); ?>
|
||||
|
||||
<input type="text" name="signup_email_first" id="signup_email_first" value="<?php echo $email ?>" />
|
||||
|
||||
<label><?php _e( 'Confirm Email (required)', 'bpxs' ); ?></label>
|
||||
<?php do_action( 'bp_signup_email_second_errors' );
|
||||
}
|
||||
}
|
||||
add_action( 'bp_signup_email_errors', 'bpxs_add_email_confirm', 20 );
|
||||
|
||||
/**
|
||||
* Check email confirmation
|
||||
* Code by Francesco Laffi
|
||||
* http://flweb.it/2010/05/add-confirm-email-field-in-buddypress-signup-page/
|
||||
* @since 1.2
|
||||
*/
|
||||
function bpxs_check_email_confirm()
|
||||
{
|
||||
global $bp, $bpxs;
|
||||
|
||||
if( $bpxs->options->email_confirmation == true )
|
||||
{
|
||||
// unset any existing errors
|
||||
unset( $bp->signup->errors['signup_email'] );
|
||||
|
||||
//check if email address is correct and set an error message for the first field if any
|
||||
$account_details = bp_core_validate_user_signup( $_POST['signup_username'], $_POST['signup_email_first'] );
|
||||
|
||||
if( ! empty( $account_details['errors']->errors['user_email'] ) )
|
||||
$bp->signup->errors['signup_email_first'] = $account_details['errors']->errors['user_email'][0];
|
||||
|
||||
if( ! empty( $_POST['signup_email_first'] ) )
|
||||
{
|
||||
if( empty( $_POST['signup_email'] ) )
|
||||
$bp->signup->errors['signup_email_second'] = __( 'Please make sure you enter your email twice', 'bpxs' );
|
||||
|
||||
elseif( $_POST['signup_email'] != $_POST['signup_email_first'] )
|
||||
$bp->signup->errors['signup_email_second'] = __( 'The emails you entered do not match.', 'bpxs' );
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action('bp_signup_validate', 'bpxs_check_email_confirm');
|
||||
|
||||
/**
|
||||
* Check username availability
|
||||
* Code mostly by Brajesh Singh
|
||||
* http://buddydev.com/buddypress/creating-a-buddypress-wordpress-username-availability-checker-for-your-site/
|
||||
* @since 1.3
|
||||
*/
|
||||
function bpxs_check_username()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( $bpxs->options->u_availability == true )
|
||||
{
|
||||
if( ! empty( $_POST['user_name'] ) )
|
||||
{
|
||||
$user_name = sanitize_user( $_POST['user_name'] );
|
||||
|
||||
if( bpxs_username_exists( $user_name ) )
|
||||
{
|
||||
$new_name = bpxs_next_username( $user_name );
|
||||
$msg = array( 'code' => 'taken', 'message' => sprintf( __( 'This usename is taken, please choose another one, e.g. %s', 'bpxs' ), $new_name ) );
|
||||
}
|
||||
|
||||
if( empty( $msg ) )
|
||||
{
|
||||
$check = bpxs_validate_username( $user_name );
|
||||
|
||||
if( empty( $check ) )
|
||||
$msg = array( 'code' => 'success', 'message' => __( 'This username is available.', 'bpxs' ) );
|
||||
else
|
||||
$msg = array( 'code' => 'error', 'message' => $check );
|
||||
}
|
||||
}
|
||||
else
|
||||
$msg = array( 'code' => 'error', 'message' => __( 'You have to chose a username.', 'bpxs' ) );
|
||||
|
||||
$msg = apply_filters( 'bpxs_custom_message_filter', $msg );
|
||||
|
||||
echo json_encode( $msg );
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_check_username', 'bpxs_check_username' );
|
||||
|
||||
/**
|
||||
* Check if a username exists already
|
||||
* @since 1.3.1
|
||||
*/
|
||||
function bpxs_username_exists( $user_name )
|
||||
{
|
||||
include_once( ABSPATH. WPINC . '/registration.php' );
|
||||
|
||||
if( username_exists( $user_name ) )
|
||||
return true;
|
||||
|
||||
elseif( defined( 'WP_ALLOW_MULTISITE' ) )
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
if( $user = $wpdb->get_row( $wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE user_login = %s", $user_name ) ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Look for the next available username
|
||||
* @since 1.3.1
|
||||
*/
|
||||
function bpxs_next_username( $user_name )
|
||||
{
|
||||
$new_name = $user_name . '2';
|
||||
$check = bpxs_username_exists( $new_name );
|
||||
|
||||
if( $check )
|
||||
{
|
||||
$suffix = 3;
|
||||
do {
|
||||
$alt_user_name = $user_name . $suffix;
|
||||
$check = bpxs_username_exists( $user_name . $suffix );
|
||||
$suffix++;
|
||||
} while ( $check );
|
||||
|
||||
$new_name = $alt_user_name;
|
||||
}
|
||||
|
||||
return apply_filters( 'bpxs_next_available_username', $new_name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a username
|
||||
* Code by Brajesh Singh
|
||||
* http://buddydev.com/buddypress/creating-a-buddypress-wordpress-username-availability-checker-for-your-site/
|
||||
* @since 1.3
|
||||
*/
|
||||
function bpxs_validate_username( $user_name )
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
$maybe = array();
|
||||
preg_match( "/[a-z0-9]+/", $user_name, $maybe );
|
||||
|
||||
$db_illegal_names = get_option( 'illegal_names' );
|
||||
$filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', BP_GROUPS_SLUG, BP_MEMBERS_SLUG, BP_FORUMS_SLUG, BP_BLOGS_SLUG, BP_REGISTER_SLUG, BP_ACTIVATION_SLUG ) );
|
||||
|
||||
$illegal_names = array_merge( (array)$db_illegal_names, (array)$filtered_illegal_names );
|
||||
|
||||
if( ! validate_username( $user_name ) || $user_name != $maybe[0] )
|
||||
$error = __( 'Only lowercase letters and numbers allowed.', 'bpxs' );
|
||||
|
||||
if( in_array( $user_name, (array)$illegal_names ) )
|
||||
$error = __( 'This username is reserved. Please chose another one.', 'bpxs' );
|
||||
|
||||
if( strlen( $user_name ) < 4 )
|
||||
$error = __( 'Username must be at least 4 characters.', 'bpxs' ) ;
|
||||
|
||||
if( strpos( ' ' . $user_name, '_' ) != false )
|
||||
$error = __( 'Usernames must not contain the character "_"!', 'bpxs' ) ;
|
||||
|
||||
$match = array();
|
||||
preg_match( '/[0-9]*/', $user_name, $match );
|
||||
|
||||
if( $match[0] == $user_name )
|
||||
$error = __( 'Usernames must contain letters too!', 'bpxs' ) ;
|
||||
|
||||
$error = apply_filters( 'bpxs_custom_error', $error, $user_name );
|
||||
|
||||
return $error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add js translation strings for password strength meter
|
||||
* @since 1.3
|
||||
*/
|
||||
function bpxs_add_js_l10n()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( $bpxs->options->psw_strength == true )
|
||||
{
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
/* <![CDATA[ */
|
||||
var pwsL10n = {
|
||||
empty: "<?php echo esc_js( __( 'Strength indicator', 'bpxs' ) ); ?>",
|
||||
short: "<?php echo esc_js( __( 'Very weak', 'bpxs' ) ); ?>",
|
||||
bad: "<?php echo esc_js( __( 'Weak', 'bpxs' ) ); ?>",
|
||||
good: "<?php echo esc_js( _x( 'Medium', 'password strength', 'bpxs' ) ); ?>",
|
||||
strong: "<?php echo esc_js( __( 'Strong', 'bpxs' ) ); ?>",
|
||||
mismatch: "<?php echo esc_js( __( 'Mismatch', 'bpxs' ) ); ?>",
|
||||
title: "<?php echo esc_js( __( 'Strength indicator', 'bpxs' ) ); ?>",
|
||||
desc: "<?php echo esc_js( __( 'Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).', 'bpxs' ) ); ?>"
|
||||
};
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
if( $bpxs->options->email_check == true )
|
||||
{
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
/* <![CDATA[ */
|
||||
<?php if( $bpxs->options->email_confirmation == true ) : ?>
|
||||
var signup_mail_field = 'input#signup_email_first';
|
||||
var compare_error = "<?php echo esc_js( __( "The emails don't match!", 'bpxs' ) ); ?>";
|
||||
<?php else : ?>
|
||||
var signup_mail_field = 'input#signup_email';
|
||||
<?php endif; ?>
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
if( $bpxs->options->email_confirmation == true )
|
||||
{
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
/* <![CDATA[ */
|
||||
var compare_error = "<?php echo esc_js( __( "The emails don't match!", 'bpxs' ) ); ?>";
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
add_action( 'bp_after_registration_submit_buttons', 'bpxs_add_js_l10n' );
|
||||
|
||||
/**
|
||||
* Check the D.O.B.
|
||||
* @since 1.4
|
||||
*/
|
||||
function bpxs_check_dob( $dob )
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
list( $y, $m, $d ) = explode( "-", $dob );
|
||||
$age = ( date( "md" ) < $m . $d ) ? date( "Y" ) - $y - 1 : date( "Y" ) - $y;
|
||||
|
||||
if( $age >= $bpxs->options->dob_age )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform month names into their numbers
|
||||
* @since 1.4
|
||||
*/
|
||||
function bpxs_get_month_number( $name )
|
||||
{
|
||||
$names = array(
|
||||
1 => __( 'January', 'bpxs' ),
|
||||
2 => __( 'February', 'bpxs' ),
|
||||
3 => __( 'March', 'bpxs' ),
|
||||
4 => __( 'April', 'bpxs' ),
|
||||
5 => __( 'May', 'bpxs' ),
|
||||
6 => __( 'June', 'bpxs' ),
|
||||
7 => __( 'July', 'bpxs' ),
|
||||
8 => __( 'August', 'bpxs' ),
|
||||
9 => __( 'September', 'bpxs' ),
|
||||
10 => __( 'October', 'bpxs' ),
|
||||
11 => __( 'November', 'bpxs' ),
|
||||
12 => __( 'December', 'bpxs' )
|
||||
);
|
||||
|
||||
return array_search( $name, $names );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for existing email
|
||||
* @since 1.5
|
||||
*/
|
||||
function bpxs_check_useremail()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( $bpxs->options->email_check == true )
|
||||
{
|
||||
include_once( ABSPATH. WPINC . '/registration.php' );
|
||||
|
||||
if( ! empty( $_POST['email'] ) )
|
||||
{
|
||||
if( ! is_email( $_POST['email'] ) )
|
||||
$msg = array( 'code' => 'error', 'message' => __( 'Please enter a valid email address.', 'bpxs' ) );
|
||||
|
||||
if( email_exists( $_POST['email'] ) )
|
||||
$msg = array( 'code' => 'error', 'message' => __( 'Sorry, that email address is already in use!', 'bpxs' ) );
|
||||
|
||||
if( ! $msg )
|
||||
$msg = array( 'code' => 'success', 'message' => __( 'This email address is valid.', 'bpxs' ) );
|
||||
}
|
||||
else
|
||||
$msg = array( 'code' => 'error', 'message' => __( 'You have to enter an email address.', 'bpxs' ) );
|
||||
|
||||
$msg = apply_filters( 'bpxs_custom_email_message_filter', $msg );
|
||||
|
||||
echo json_encode( $msg );
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_check_email', 'bpxs_check_useremail' );
|
||||
?>
|
||||
39
wp-content/plugins/bp-xtra-signup/_inc/bpxs-js-css.php
Normal file
39
wp-content/plugins/bp-xtra-signup/_inc/bpxs-js-css.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage BuddyPress
|
||||
* @sub-subpackage BP Xtra Signup
|
||||
* @author Boris Glumpler
|
||||
* @copyright 2010, ShabuShabu Webdesign
|
||||
* @link http://shabushabu.eu/bp-xtra-signup
|
||||
* @license http://www.opensource.org/licenses/gpl-2.0.php GPL License
|
||||
*/
|
||||
|
||||
class BPXS_JS_CSS
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
if( ! is_admin() )
|
||||
{
|
||||
add_action( 'wp_print_scripts', array( &$this, 'load_scripts' ) );
|
||||
add_action( 'wp_print_styles', array( &$this, 'load_styles' ) );
|
||||
}
|
||||
}
|
||||
|
||||
function load_styles()
|
||||
{
|
||||
if( bp_is_register_page() )
|
||||
wp_enqueue_style( 'bpxs-register-css', BPXS_URLPATH .'css/style.css' );
|
||||
}
|
||||
|
||||
function load_scripts()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( bp_is_register_page() )
|
||||
if( $bpxs->options->u_availability == true || $bpxs->options->psw_strength == true || $bpxs->options->email_check == true )
|
||||
wp_enqueue_script( 'bpxs-js', BPXS_URLPATH .'js/js.php', array( 'jquery' ), '1.0', true );
|
||||
}
|
||||
}
|
||||
$bpxs_js_css = new BPXS_JS_CSS();
|
||||
?>
|
||||
119
wp-content/plugins/bp-xtra-signup/admin/bpxs-admin.php
Normal file
119
wp-content/plugins/bp-xtra-signup/admin/bpxs-admin.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage BuddyPress
|
||||
* @sub-subpackage BP Xtra Signup
|
||||
* @author Boris Glumpler
|
||||
* @copyright 2010, ShabuShabu Webdesign
|
||||
* @link http://shabushabu.eu/bp-xtra-signup
|
||||
* @license http://www.opensource.org/licenses/gpl-2.0.php GPL License
|
||||
*/
|
||||
|
||||
class BPXS_Admin_Loader
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
* @since 1.0
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
add_action( 'admin_menu', array( &$this, 'add_menu' ), 20 );
|
||||
add_action( 'admin_print_scripts', array( &$this, 'load_scripts' ) );
|
||||
add_action( 'admin_print_styles', array( &$this, 'load_styles' ) );
|
||||
add_filter( 'contextual_help', array( &$this, 'show_help' ), 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the options page
|
||||
* @since 1.0
|
||||
*/
|
||||
function add_menu()
|
||||
{
|
||||
add_submenu_page( 'bp-general-settings', __( 'BP Xtra Signup', 'bpxs' ), __( 'BP Xtra Signup', 'bpxs' ), 'manage_options', BPXS_FOLDER, array( &$this, 'show_menu' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the options page
|
||||
* @since 1.0
|
||||
*/
|
||||
function show_menu()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
include_once( dirname( __FILE__ ). '/bpxs-settings.php' );
|
||||
$bpxs->options_page = new BPXS_Options();
|
||||
$bpxs->options_page->controller();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load necessary scripts
|
||||
* @since 1.0
|
||||
*/
|
||||
function load_scripts()
|
||||
{
|
||||
// no need to go on if it's not a plugin page
|
||||
if( ! isset( $_GET['page'] ) )
|
||||
return;
|
||||
|
||||
if( $_GET['page'] == BPXS_FOLDER )
|
||||
{
|
||||
wp_enqueue_script( 'jquery-ui-tabs' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load necessary styles
|
||||
* @since 1.0
|
||||
*/
|
||||
function load_styles()
|
||||
{
|
||||
// no need to go on if it's not a plugin page
|
||||
if( ! isset( $_GET['page'] ) )
|
||||
return;
|
||||
|
||||
if( $_GET['page'] == BPXS_FOLDER )
|
||||
{
|
||||
wp_enqueue_style( 'bpxstabs', BPXS_URLPATH .'admin/css/jquery.ui.tabs.css', false, '1.0', 'screen' );
|
||||
wp_enqueue_style( 'bpxsadmin', BPXS_URLPATH .'admin/css/bpxs-admin.css', false, '1.0', 'screen' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add some helpful links
|
||||
* @since 1.0
|
||||
*/
|
||||
function show_help( $help, $screen_id )
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if( $screen_id == 'buddypress_page_'. BPXS_FOLDER )
|
||||
{
|
||||
$help = '<h5>' . __( 'Get help for BP Xtra Signup', 'bpxs' ) . '</h5>';
|
||||
$help .= '<div class="metabox-prefs">';
|
||||
$help .= '<a href="'. $bpxs->home_url .'forums/">' . __( 'Support Forums', 'bpxs' ) . '</a><br />';
|
||||
$help .= '<a href="'. $bpxs->home_url .'donation/">' . __( 'Donate', 'bpxs' ) . '</a><br />';
|
||||
$help .= '</div>';
|
||||
|
||||
return $help;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a success message
|
||||
* @since 1.0
|
||||
*/
|
||||
function show_message( $message )
|
||||
{
|
||||
echo '<div class="wrap"><h2></h2><div class="updated fade" id="message"><p>' . $message . '</p></div></div>' . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Show an error message
|
||||
* @since 1.0
|
||||
*/
|
||||
function show_error( $error )
|
||||
{
|
||||
echo '<div class="wrap"><h2></h2><div class="error" id="error"><p>' . $error . '</p></div></div>' . "\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
68
wp-content/plugins/bp-xtra-signup/admin/bpxs-install.php
Normal file
68
wp-content/plugins/bp-xtra-signup/admin/bpxs-install.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage BuddyPress
|
||||
* @sub-subpackage BP Xtra Signup
|
||||
* @author Boris Glumpler
|
||||
* @copyright 2010, ShabuShabu Webdesign
|
||||
* @link http://shabushabu.eu/bp-xtra-signup
|
||||
* @license http://www.opensource.org/licenses/gpl-2.0.php GPL License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Setup the default options
|
||||
* @since 1.0
|
||||
*/
|
||||
function bpxs_install()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
$options = get_option( 'bpxs_options' );
|
||||
|
||||
if( ! $options )
|
||||
{
|
||||
$bpxs->options = new stdClass;
|
||||
$bpxs->options->tos = true;
|
||||
$bpxs->options->email_confirmation = false;
|
||||
$bpxs->options->newsletter = false;
|
||||
$bpxs->options->psw_strength = true;
|
||||
$bpxs->options->u_availability = true;
|
||||
$bpxs->options->email_check = true;
|
||||
$bpxs->options->date_of_birth = true;
|
||||
$bpxs->options->dob_field = '';
|
||||
$bpxs->options->dob_age = 13;
|
||||
$bpxs->options->mcapi_list_id = '';
|
||||
$bpxs->options->mcapi_key = '';
|
||||
$bpxs->options->signup_title = __( "Don't forget", 'bpxs' );
|
||||
$bpxs->options->newsletter_text = __( 'Check this box if you want to subscribe to our newsletter.', 'bpxs' );
|
||||
$bpxs->options->tos_text = __( 'Please make sure to read our <a href="">Terms of Service</a> and then check this box (required).', 'bpxs' );
|
||||
$bpxs->options->tos_error_text = __( 'You have to check our Terms Of Service to continue.', 'bpxs' );
|
||||
$bpxs->options->email_recipient = get_option( 'admin_email' );
|
||||
$bpxs->options->email_subject = __( 'Unsuccessful newsletter signup', 'bpxs' );
|
||||
$bpxs->options->email_message = __( 'Hello,
|
||||
|
||||
there has been an error with a new subscriber to your newsletter! Check the error and send a message to the user if signup to the newsletter has been unsuccessful.
|
||||
|
||||
Unable to load listSubscribe()!
|
||||
|
||||
UserID: {USER_ID}
|
||||
Name: {USER_NAME}
|
||||
Email: {USER_EMAIL}
|
||||
|
||||
Code: {ERROR_CODE}
|
||||
Msg: {ERROR_MESSAGE}', 'bpxs' );
|
||||
|
||||
// write to the database
|
||||
update_option( 'bpxs_options', $bpxs->options );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all options and database tables
|
||||
* @since 1.0
|
||||
*/
|
||||
function bpxs_uninstall()
|
||||
{
|
||||
delete_option( 'bpxs_options' );
|
||||
}
|
||||
?>
|
||||
590
wp-content/plugins/bp-xtra-signup/admin/bpxs-settings.php
Normal file
590
wp-content/plugins/bp-xtra-signup/admin/bpxs-settings.php
Normal file
@ -0,0 +1,590 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage BuddyPress
|
||||
* @sub-subpackage BP Xtra Signup
|
||||
* @author Boris Glumpler
|
||||
* @copyright 2010, ShabuShabu Webdesign
|
||||
* @link http://shabushabu.eu/bp-xtra-signup
|
||||
* @license http://www.opensource.org/licenses/gpl-2.0.php GPL License
|
||||
*/
|
||||
|
||||
class BPXS_Options
|
||||
{
|
||||
var $price_url;
|
||||
var $filepath;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @since 1.0
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
$this->filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
|
||||
$this->price_url = $bpxs->home_url . 'prices.php';
|
||||
|
||||
// only process if $_POST vars are available
|
||||
if( ! empty( $_POST ) )
|
||||
$this->processor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process any $_POST variables
|
||||
* @since 1.0
|
||||
*/
|
||||
function processor()
|
||||
{
|
||||
global $bpxs;
|
||||
|
||||
if ( isset( $_POST['update_bpxs'] ) )
|
||||
{
|
||||
check_admin_referer( 'bpxs_settings' );
|
||||
|
||||
$error = false;
|
||||
$message = '';
|
||||
|
||||
if( $_POST['newsletter'] == true )
|
||||
{
|
||||
if( empty( $_POST['mcapi_list_id'] ) || empty( $_POST['mcapi_key'] ) )
|
||||
{
|
||||
$message .= __( 'You need to enter a Mailchimp List ID and an API Key.', 'bpxs' );
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if( ! empty( $_POST['email_recipient'] ) )
|
||||
{
|
||||
if( ! is_email( $_POST['email_recipient'] ) )
|
||||
{
|
||||
$message .= __( 'You need to enter a valid email address.', 'bpxs' );
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $_POST['date_of_birth'] == true )
|
||||
{
|
||||
if( empty( $_POST['dob_field'] ) )
|
||||
{
|
||||
$message .= __( 'You need to specify a date of birth profile field.', 'bpxs' );
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if( empty( $_POST['dob_age'] ) || $_POST['dob_age'] == '----' )
|
||||
{
|
||||
$message .= __( 'You need to specify an age.', 'bpxs' );
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
|
||||
// proceed if there is no error
|
||||
if( ! $error )
|
||||
{
|
||||
if( $_POST['page_options'] )
|
||||
$options = explode( ',', stripslashes( $_POST['page_options'] ) );
|
||||
|
||||
if( $options )
|
||||
{
|
||||
foreach( $options as $option )
|
||||
{
|
||||
$option = trim( $option );
|
||||
$value = trim( $_POST[$option] );
|
||||
|
||||
// make sure all boolean values get saved as such
|
||||
if( in_array( $option, array( 'tos', 'newsletter', 'email_confirmation', 'u_availability', 'psw_strength', 'date_of_birth', 'email_check' ) ) )
|
||||
$bpxs->options->{$option} = (bool)$value;
|
||||
else
|
||||
$bpxs->options->{$option} = $value;
|
||||
}
|
||||
}
|
||||
// Save options
|
||||
update_option( 'bpxs_options', $bpxs->options );
|
||||
|
||||
BPXS_Admin_Loader::show_message( __( 'Update Successfully', 'bpxs' ) );
|
||||
}
|
||||
// or show any errors
|
||||
else
|
||||
{
|
||||
BPXS_Admin_Loader::show_error( $message );
|
||||
}
|
||||
}
|
||||
do_action( 'bpxs_update_options_page' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the page content
|
||||
* @since 1.0
|
||||
*/
|
||||
function controller()
|
||||
{
|
||||
// get list of tabs
|
||||
$tabs = $this->tabs_order();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
jQuery('#slider').tabs({ fxFade: true, fxSpeed: 'fast' });
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="slider" class="wrap">
|
||||
|
||||
<ul id="tabs">
|
||||
<?php
|
||||
foreach( $tabs as $tab_key => $tab_name )
|
||||
echo "\n\t\t<li><a href='#$tab_key'>$tab_name</a></li>";
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
foreach( $tabs as $tab_key => $tab_name )
|
||||
{
|
||||
echo "\n\t<div id='$tab_key'>\n";
|
||||
|
||||
// Looks for the internal class function, otherwise enable a hook for plugins
|
||||
if( method_exists( $this, "tab_$tab_key" ) )
|
||||
call_user_func( array( &$this , "tab_$tab_key" ) );
|
||||
else
|
||||
do_action( 'bpxs_tab_content_' . $tab_key );
|
||||
|
||||
echo "\n\t</div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Create array for tabs and add a filter for other plugins to inject more tabs
|
||||
* @since 1.0
|
||||
*/
|
||||
function tabs_order()
|
||||
{
|
||||
$tabs = array();
|
||||
|
||||
$tabs['settings'] = __( 'Settings', 'bpxs' );
|
||||
$tabs['help'] = __( 'Help', 'bpxs' );
|
||||
$tabs['donate'] = __( 'Donate', 'bpxs' );
|
||||
|
||||
$tabs = apply_filters( 'bpxs_settings_tabs', $tabs );
|
||||
|
||||
return $tabs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Content of the General Options tab
|
||||
* @since 1.0
|
||||
*/
|
||||
function tab_settings()
|
||||
{
|
||||
global $bpxs, $wpdb, $bp;
|
||||
|
||||
$field_ids = $wpdb->get_results( $wpdb->prepare( "SELECT id, name FROM {$bp->profile->table_name_fields} WHERE parent_id = 0" ) );
|
||||
$field_ids = array_merge( array(''), (array)$field_ids );
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('.postbox.close-me').addClass('closed');
|
||||
jQuery('.postbox h3').click( function() {
|
||||
jQuery(this).parent('.postbox').toggleClass('closed');
|
||||
});
|
||||
jQuery('#show_all').click(function() {
|
||||
if( jQuery(this).is(':checked') ){
|
||||
jQuery('.postbox').removeClass('closed');
|
||||
} else {
|
||||
jQuery('.postbox').addClass('closed');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<h2><?php _e( 'Settings','bpxs' ); ?></h2>
|
||||
|
||||
<form name="general" method="post" action="<?php echo $this->filepath ?>" >
|
||||
|
||||
<label id="show_all_label" for="show_all"><input type="checkbox" id="show_all" name="show_all" value="1" /> <?php _e( 'Click to open all option boxes.', 'bpxs' ) ?></label>
|
||||
|
||||
<?php wp_nonce_field( 'bpxs_settings' ) ?>
|
||||
<input type="hidden" name="page_options" value="tos,signup_title,tos_text,tos_error_text,mcapi_list_id,mcapi_key,newsletter_text,newsletter,email_recipient,email_subject,email_message,email_confirmation,u_availability,psw_strength,date_of_birth,dob_field,dob_age,email_check" />
|
||||
<div id="poststuff" class="meta-box-sortables">
|
||||
<div class="postbox close-me">
|
||||
<div class="handlediv" title="<?php _e( 'Click to toggle', 'bpxs' ) ?>"><br /></div>
|
||||
<h3><?php _e( 'Terms of Service', 'bpxs' ) ?></h3>
|
||||
<div class="inside">
|
||||
<table id="bpxs-tos" class="form-table">
|
||||
<tr>
|
||||
<th><?php _e( 'Activate TOS', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<select id="bpgs_tos" name="tos">
|
||||
<option <?php selected( true, $bpxs->options->tos ) ?> value="1"><?php _e( 'Yes', 'bpgs' ) ?></option>
|
||||
<option <?php selected( false, $bpxs->options->tos ) ?> value="0"><?php _e( 'No', 'bpgs' ) ?></option>
|
||||
</select> <small>(<?php _e( 'Show the TOS checkbox on the registration screen?', 'bpxs' ); ?>)</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'Signup Title', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<input type="text" class="large-text" id="bpxs_signup_title" name="signup_title" value="<?php echo stripslashes( $bpxs->options->signup_title ); ?>" /><br />
|
||||
<small>(<?php _e( 'The header title of the extra signup options.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'Checkbox Text', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<input type="text" class="large-text" id="bpxs_tos_text" name="tos_text" value="<?php echo htmlentities( stripslashes( $bpxs->options->tos_text ) ); ?>" /><br />
|
||||
<small>(<?php _e( 'Will be displayed next to the checkbox a new user needs to check.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'Error Text', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<input type="text" class="large-text" id="bpxs_tos_error_text" name="tos_error_text" value="<?php echo stripslashes( $bpxs->options->tos_error_text ); ?>" /><br />
|
||||
<small>(<?php _e( 'The text that appears when a user does not check the TOS checkbox.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postbox close-me">
|
||||
<div class="handlediv" title="<?php _e( 'Click to toggle', 'bpxs' ) ?>"><br /></div>
|
||||
<h3><?php _e( 'Mailchimp Integration', 'bpxs' ) ?></h3>
|
||||
<div class="inside">
|
||||
<table id="bpxs-newsletter" class="form-table">
|
||||
<tr>
|
||||
<th><?php _e( 'Activate Newsletter', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<select id="bpxs_newsletter" name="newsletter">
|
||||
<option <?php selected( true, $bpxs->options->newsletter ) ?> value="1"><?php _e( 'Yes', 'bpxs' ) ?></option>
|
||||
<option <?php selected( false, $bpxs->options->newsletter ) ?> value="0"><?php _e( 'No', 'bpxs' ) ?></option>
|
||||
</select> <small>(<?php _e( 'Only activate the newsletter if you have a Mailchimp account.', 'bpxs' ); ?>)</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'Newsletter Text', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<input type="text" class="large-text" id="bpxs_newsletter_text" name="newsletter_text" value="<?php echo stripslashes( $bpxs->options->newsletter_text ); ?>" /><br />
|
||||
<small>(<?php _e( 'The text next to the checkbox on the registration page.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'API Key', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<input type="text" class="large-text" id="bpxs_mcapi_key" name="mcapi_key" value="<?php echo stripslashes( $bpxs->options->mcapi_key ); ?>" /><br />
|
||||
<small>(<?php _e( 'Your Mailchimp API key.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'List ID', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<input type="text" class="large-text" id="bpxs_mcapi_list_id" name="mcapi_list_id" value="<?php echo stripslashes( $bpxs->options->mcapi_list_id ); ?>" /><br />
|
||||
<small>(<?php _e( 'The list ID you want new users to subscribe to.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'Email Recipient', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<input type="text" class="large-text" id="bpxs_email_recipient" name="email_recipient" value="<?php echo stripslashes( $bpxs->options->email_recipient ); ?>" /><br />
|
||||
<small>(<?php _e( 'Enter an email address you want newsletter signup errors sent to.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'Email Subject', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<input type="text" class="large-text" id="bpxs_email_subject" name="email_subject" value="<?php echo stripslashes( $bpxs->options->email_subject ); ?>" /><br />
|
||||
<small>(<?php _e( 'The subject of the error message.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php _e( 'Email Message', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<textarea rows="8" class="large-text" id="bpxs_email_message" name="email_message"><?php echo stripslashes( $bpxs->options->email_message ); ?></textarea><br />
|
||||
<small>(<?php _e( 'The body of the error message.', 'bpxs' ); ?>)</small>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postbox close-me">
|
||||
<div class="handlediv" title="<?php _e( 'Click to toggle', 'bpxs' ) ?>"><br /></div>
|
||||
<h3><?php _e( 'Email Confirmation', 'bpxs' ) ?></h3>
|
||||
<div class="inside">
|
||||
<table id="bpxs-email-confirmation" class="form-table">
|
||||
<tr>
|
||||
<th><?php _e( 'Activate Email Confirmation', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<select id="bpxs_email_confirmation" name="email_confirmation">
|
||||
<option <?php selected( true, $bpxs->options->email_confirmation ) ?> value="1"><?php _e( 'Yes', 'bpxs' ) ?></option>
|
||||
<option <?php selected( false, $bpxs->options->email_confirmation ) ?> value="0"><?php _e( 'No', 'bpxs' ) ?></option>
|
||||
</select> <small>(<?php _e( 'Select yes if you want your users to confirm their email address.', 'bpxs' ); ?>)</small></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postbox close-me">
|
||||
<div class="handlediv" title="<?php _e( 'Click to toggle', 'bpxs' ) ?>"><br /></div>
|
||||
<h3><?php _e( 'Ajax Username Availability', 'bpxs' ) ?></h3>
|
||||
<div class="inside">
|
||||
<table id="bpxs-u-availability" class="form-table">
|
||||
<tr>
|
||||
<th><?php _e( 'Activate Username Check', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<select id="bpxs_u_availability" name="u_availability">
|
||||
<option <?php selected( true, $bpxs->options->u_availability ) ?> value="1"><?php _e( 'Yes', 'bpxs' ) ?></option>
|
||||
<option <?php selected( false, $bpxs->options->u_availability ) ?> value="0"><?php _e( 'No', 'bpxs' ) ?></option>
|
||||
</select> <small>(<?php _e( 'Select yes if you want to activate the ajax username availability check.', 'bpxs' ); ?>)</small></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postbox close-me">
|
||||
<div class="handlediv" title="<?php _e( 'Click to toggle', 'bpxs' ) ?>"><br /></div>
|
||||
<h3><?php _e( 'Ajax Email Check', 'bpxs' ) ?></h3>
|
||||
<div class="inside">
|
||||
<table id="bpxs-email-check" class="form-table">
|
||||
<tr>
|
||||
<th><?php _e( 'Activate Email Check', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<select id="bpxs_email_check" name="email_check">
|
||||
<option <?php selected( true, $bpxs->options->email_check ) ?> value="1"><?php _e( 'Yes', 'bpxs' ) ?></option>
|
||||
<option <?php selected( false, $bpxs->options->email_check ) ?> value="0"><?php _e( 'No', 'bpxs' ) ?></option>
|
||||
</select> <small>(<?php _e( 'Select yes if you want to activate the ajax email check.', 'bpxs' ); ?>)</small></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postbox close-me">
|
||||
<div class="handlediv" title="<?php _e( 'Click to toggle', 'bpxs' ) ?>"><br /></div>
|
||||
<h3><?php _e( 'Password Strength Meter', 'bpxs' ) ?></h3>
|
||||
<div class="inside">
|
||||
<table id="bpxs-psw-strength" class="form-table">
|
||||
<tr>
|
||||
<th><?php _e( 'Activate Password Strength Meter', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<select id="bpxs_psw_strength" name="psw_strength">
|
||||
<option <?php selected( true, $bpxs->options->psw_strength ) ?> value="1"><?php _e( 'Yes', 'bpxs' ) ?></option>
|
||||
<option <?php selected( false, $bpxs->options->psw_strength ) ?> value="0"><?php _e( 'No', 'bpxs' ) ?></option>
|
||||
</select> <small>(<?php _e( 'Select yes if you want to activate the password strength meter.', 'bpxs' ); ?>)</small></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postbox close-me">
|
||||
<div class="handlediv" title="<?php _e( 'Click to toggle', 'bpxs' ) ?>"><br /></div>
|
||||
<h3><?php _e( 'Date of Birth Check', 'bpxs' ) ?></h3>
|
||||
<div class="inside">
|
||||
<table id="bpxs-dob-check" class="form-table">
|
||||
<tr>
|
||||
<th><?php _e( 'Activate DOB Check', 'bpxs' ) ?></th>
|
||||
<td>
|
||||
<select id="bpxs_date_of_birth" name="date_of_birth">
|
||||
<option <?php selected( true, $bpxs->options->date_of_birth ) ?> value="1"><?php _e( 'Yes', 'bpxs' ) ?></option>
|
||||
<option <?php selected( false, $bpxs->options->date_of_birth ) ?> value="0"><?php _e( 'No', 'bpxs' ) ?></option>
|
||||
</select> <small>(<?php _e( 'Select yes if you want to activate the date of birth check.', 'bpxs' ); ?>)</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="dob_field"><?php _e( 'DOB Field ID', 'bpxs' ); ?></label></th>
|
||||
<td>
|
||||
<select id="dob_field" name="dob_field">
|
||||
<?php foreach( $field_ids as $key => $val ) { ?>
|
||||
<option value="<?php echo $val->id ?>" <?php selected( $val->id, $bpxs->options->dob_field ) ?>><?php echo $val->name ?></option>
|
||||
<?php } ?>
|
||||
</select> <small>(<?php _e( 'Select the profile field that represents the date of birth.', 'bpxs' ); ?>)</small></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="dob_age"><?php _e( 'Pick your age', 'bpxs' ); ?></label></th>
|
||||
<td>
|
||||
<select id="dob_age" name="dob_age">
|
||||
<option value="">----</option>
|
||||
<?php for( $i = 10; $i <= 21; $i++ ) { ?>
|
||||
<option value="<?php echo $i ?>" <?php selected( $i, $bpxs->options->dob_age ) ?>><?php echo $i ?></option>
|
||||
<?php } ?>
|
||||
</select> <small>(<?php _e( 'Select the age you need your users to be above.', 'bpxs' ); ?>)</small></td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="submit"><input type="submit" name="update_bpxs" value="<?php _e( 'Update' ) ;?> »"/></div>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Content of the Help tab
|
||||
* @since 1.0
|
||||
*/
|
||||
function tab_help()
|
||||
{
|
||||
global $jb;
|
||||
|
||||
$shabu = get_option( 'shabu_software' );
|
||||
|
||||
$diff = strtotime( date( 'Y-m-d H:i:s' ) ) - strtotime( $shabu['time'] );
|
||||
// one ping per day
|
||||
$api_time_seconds = 86400;
|
||||
|
||||
if( ! $shabu || $diff >= $api_time_seconds )
|
||||
{
|
||||
if( ! class_exists( 'WP_Http' ) )
|
||||
include_once( ABSPATH . WPINC. '/class-http.php' );
|
||||
|
||||
$request = new WP_Http;
|
||||
$http = $request->request( $this->price_url );
|
||||
|
||||
if( is_array( $http ) )
|
||||
{
|
||||
$result = unserialize( $http['body'] );
|
||||
|
||||
$shabu_array = array( 'time' => date( 'Y-m-d H:i:s' ), 'info' => $result );
|
||||
|
||||
update_option( 'shabu_software', $shabu_array );
|
||||
}
|
||||
else
|
||||
$http_error = true;
|
||||
}
|
||||
else
|
||||
$result = $shabu['info'];
|
||||
|
||||
if( ! $http_error )
|
||||
{
|
||||
?>
|
||||
<h2><?php _e( 'Help', 'jobs' ); ?></h2>
|
||||
|
||||
<p><?php printf( __( 'To receive support for this plugin, please <a href="%s">register</a> on <a href="%s">ShabuShabu.eu</a>.', 'jobs' ), $jb->home_url . 'membership-options/', $jb->home_url ); ?></p>
|
||||
<p><?php _e( 'Registration is free. Support, however, will only be provided within the support group of this plugin, for which we charge a small monthly subscription fee.', 'jobs' ); ?></p>
|
||||
|
||||
<table id="jb-prices" class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="manage-column" scope="col"><?php _e('Description', 'jobs' ); ?></th>
|
||||
<th class="manage-column" scope="col"><?php _e('Price', 'jobs' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php foreach( $result['prices'] as $desc => $price )
|
||||
{
|
||||
$alt = $this->alternate( 'odd', 'even' );
|
||||
?>
|
||||
<tr class="<?php echo $alt; ?>">
|
||||
<td><?php echo $desc ?></td>
|
||||
<td>EUR <?php echo $price ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<p><?php _e( 'Below you find a list of all our available and planned plugins and themes. Items that have a price tag attached come with 3 months free support.', 'jobs' ); ?></p>
|
||||
|
||||
<h3><?php _e( 'Plugins', 'jobs' ) ?></h3>
|
||||
<table class="widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="manage-column" scope="col"><?php _e('Name', 'jobs' ); ?></th>
|
||||
<th class="manage-column" scope="col"><?php _e('Description', 'jobs' ); ?></th>
|
||||
<th class="manage-column" scope="col"><?php _e('Release Date', 'jobs' ); ?></th>
|
||||
<th class="manage-column" scope="col"><?php _e('Price', 'jobs' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php foreach( $result['plugins'] as $plugin )
|
||||
{
|
||||
$alt = $this->alternate( 'odd', 'even' );
|
||||
?>
|
||||
<tr class="<?php echo $alt; ?>">
|
||||
<td>
|
||||
<?php if( ! empty( $plugin['url'] ) ) { ?>
|
||||
<a href="<?php echo $plugin['url']; ?>"><?php echo $plugin['name'] . ' ' . $plugin['version'] ; ?></a>
|
||||
<?php } else { ?>
|
||||
<?php echo $plugin['name'] . ' ' . $plugin['version'] ; ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php echo $plugin['desc']; ?></td>
|
||||
<td><?php echo $plugin['release']; ?></td>
|
||||
<td><?php echo $plugin['cost']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
||||
|
||||
<?php if( $result['themes'] ) : ?>
|
||||
|
||||
<h3><?php _e( 'Themes', 'jobs' ) ?></h3>
|
||||
<table class="widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="manage-column" scope="col"><?php _e('Name', 'jobs' ); ?></th>
|
||||
<th class="manage-column" scope="col"><?php _e('Description', 'jobs' ); ?></th>
|
||||
<th class="manage-column" scope="col"><?php _e('Release Date', 'jobs' ); ?></th>
|
||||
<th class="manage-column" scope="col"><?php _e('Price', 'jobs' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php foreach( $result['themes'] as $theme )
|
||||
{
|
||||
$alt = $this->alternate( 'odd', 'even' );
|
||||
?>
|
||||
<tr class="<?php echo $alt; ?>">
|
||||
<td>
|
||||
<?php if( ! empty( $theme['url'] ) ) { ?>
|
||||
<a href="<?php echo $theme['url']; ?>"><?php echo $theme['name'] . ' ' . $theme['version'] ; ?></a>
|
||||
<?php } else { ?>
|
||||
<?php echo $theme['name'] . ' ' . $theme['version'] ; ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php echo $theme['desc']; ?></td>
|
||||
<td><?php echo $theme['release']; ?></td>
|
||||
<td><?php echo $theme['cost']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
||||
<?php endif;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<h2>'. __( 'Help', 'jobs' ) .'</h2>';
|
||||
echo '<p>'. __( 'Information could not be retrieved.', 'jobs' ) .'</p>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Content of the Donate tab
|
||||
* @since 1.0
|
||||
*/
|
||||
function tab_donate()
|
||||
{
|
||||
?>
|
||||
<h2><?php _e( 'Donate', 'bpxs' ); ?></h2>
|
||||
|
||||
<p><?php _e( 'We spend a lot of time and effort on implementing new features and on the maintenance of this plugin, so if you feel generous and have a few bucks to spare, then please consider to donate.', 'bpxs' ); ?></p>
|
||||
<p><?php _e( 'Click on the button below and you will be redirected to the PayPal site where you can make a safe donation', 'bpxs' ); ?></p>
|
||||
<p>
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" >
|
||||
<input type="hidden" name="cmd" value="_xclick"/><input type="hidden" name="business" value="mail@shabushabu-webbdesign.com"/>
|
||||
<input type="hidden" name="item_name" value="<?php _e('BP Xtra Signup @ http://shabushabu.eu','bpxs'); ?>"/>
|
||||
<input type="hidden" name="no_shipping" value="1"/><input type="hidden" name="return" value="http://shabushabu.eu/" />
|
||||
<input type="hidden" name="cancel_return" value="http://shabushabu.eu/"/>
|
||||
<input type="hidden" name="lc" value="US" />
|
||||
<input type="hidden" name="currency_code" value="USD"/>
|
||||
<input type="hidden" name="tax" value="0"/>
|
||||
<input type="hidden" name="bn" value="PP-DonationsBF"/>
|
||||
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" name="submit" alt="<?php _e( 'Make payments with PayPal - it\'s fast, free and secure!', 'bpxs' ); ?>" style="border: none;"/>
|
||||
</form>
|
||||
</p>
|
||||
<p><?php _e( 'Thank you and all the best!' ,'bpxs' ); ?><br />ShabuShabu Webdesign Team</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* alternate between anything
|
||||
* @since 1.0
|
||||
*/
|
||||
function alternate()
|
||||
{
|
||||
static $i = 0;
|
||||
$args = func_get_args();
|
||||
|
||||
return $args[$i++ % (func_num_args())];
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,6 @@
|
||||
.required{color:red;}
|
||||
#poststuff h3{cursor:pointer !important;}
|
||||
.long-text{width:99% !important;}
|
||||
#bpxs-last{margin-bottom:0 !important;}
|
||||
#slider h2{padding:0 15px 7px 45px !important;background:transparent url(../images/shabu-logo.png) no-repeat left top;}
|
||||
#show_all_label{margin:10px 0 20px;display:block;}
|
||||
160
wp-content/plugins/bp-xtra-signup/admin/css/jquery.ui.tabs.css
vendored
Normal file
160
wp-content/plugins/bp-xtra-signup/admin/css/jquery.ui.tabs.css
vendored
Normal file
@ -0,0 +1,160 @@
|
||||
/* Caution! Ensure accessibility in print and other media types... */
|
||||
@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
|
||||
.ui-tabs-hide {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide useless elements in print layouts... */
|
||||
@media print {
|
||||
.ui-tabs-nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Skin */
|
||||
#slider {
|
||||
border:1px solid #DFDFDF;
|
||||
margin:30px 15px 0pt 15px;
|
||||
clear:both;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
#tabs{
|
||||
display: block;
|
||||
background:transparent url(../images/admin-header-footer.png) repeat-x bottom;
|
||||
font-size:14px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.ui-tabs-nav {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 5px 0 0 5px;
|
||||
|
||||
}
|
||||
.ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
|
||||
display: block;
|
||||
clear: both;
|
||||
content: " ";
|
||||
}
|
||||
.ui-tabs-nav li {
|
||||
float: left;
|
||||
padding: 6px 10px;
|
||||
margin: 2px 2px 0px 1px !important;
|
||||
text-decoration: none;
|
||||
list-style: none;
|
||||
position:relative;
|
||||
top:1px;
|
||||
}
|
||||
.ui-tabs-nav a, .ui-tabs-nav a span {
|
||||
display: block;
|
||||
padding: 0 1px;
|
||||
}
|
||||
|
||||
.ui-tabs-nav a {
|
||||
margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
|
||||
padding-left: 0;
|
||||
color: #2583AD;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; /* required in IE 6 */
|
||||
outline: 0; /* prevent dotted border in Firefox */
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected{
|
||||
background: #fff;
|
||||
border: 1px solid #DFDFDF;
|
||||
color: #222;
|
||||
-moz-border-radius-topright: 6px;
|
||||
-khtml-border-top-right-radius: 6px;
|
||||
-webkit-border-top-right-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
-moz-border-radius-topleft: 6px;
|
||||
-khtml-border-top-left-radius: 6px;
|
||||
-webkit-border-top-left-radius: 6px;
|
||||
border-top-left-radius: 6px;
|
||||
}
|
||||
|
||||
.ui-tabs-selected a,
|
||||
.ui-tabs-selected a:hover {
|
||||
color:#222 !important;
|
||||
}
|
||||
|
||||
.ui-tabs-nav .ui-tabs-selected a,
|
||||
.ui-tabs-nav .ui-tabs-selected a:hover {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
z-index: 2;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.ui-tabs-nav li a:hover {
|
||||
color:#D54E21;
|
||||
}
|
||||
|
||||
.ui-tabs-nav a span {
|
||||
width: 64px; /* IE 6 treats width as min-width */
|
||||
min-width: 64px;
|
||||
height: 18px; /* IE 6 treats height as min-height */
|
||||
min-height: 18px;
|
||||
padding-top: 6px;
|
||||
padding-right: 0;
|
||||
}
|
||||
*>.ui-tabs-nav a span { /* hide from IE 6 */
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a span {
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a, .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active {
|
||||
background-position: 100% -150px;
|
||||
}
|
||||
.ui-tabs-nav a, .ui-tabs-nav .ui-tabs-disabled a:hover, .ui-tabs-nav .ui-tabs-disabled a:focus, .ui-tabs-nav .ui-tabs-disabled a:active {
|
||||
background-position: 100% -100px;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a span, .ui-tabs-nav a:hover span, .ui-tabs-nav a:focus span, .ui-tabs-nav a:active span {
|
||||
background-position: 0 -50px;
|
||||
}
|
||||
.ui-tabs-nav a span, .ui-tabs-nav .ui-tabs-disabled a:hover span, .ui-tabs-nav .ui-tabs-disabled a:focus span, .ui-tabs-nav .ui-tabs-disabled a:active span {
|
||||
background-position: 0 0;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
|
||||
cursor: text;
|
||||
}
|
||||
.ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active,
|
||||
.ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active { /* @ Opera, we need to be explicit again here now... */
|
||||
cursor: pointer;
|
||||
}
|
||||
.ui-tabs-disabled {
|
||||
opacity: .4;
|
||||
filter: alpha(opacity=40);
|
||||
}
|
||||
.ui-tabs-panel {
|
||||
border-top: 1px solid #97a5b0 !important;
|
||||
padding: 1em 8px;
|
||||
background: #fff; /* declare background color for container to avoid distorted fonts in IE while fading */
|
||||
|
||||
/* overwrite wp-admin */
|
||||
border:none !important;
|
||||
height:100% !important;
|
||||
margin:0pt 0pt 0pt 0px !important;
|
||||
overflow:visible !important;
|
||||
}
|
||||
|
||||
.ui-tabs-panel a {
|
||||
display:inline;
|
||||
}
|
||||
|
||||
|
||||
/* Additional IE specific bug fixes... */
|
||||
* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
|
||||
display: inline-block;
|
||||
}
|
||||
*:first-child+html .ui-tabs-nav { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 254 B |
BIN
wp-content/plugins/bp-xtra-signup/admin/images/shabu-logo.png
Normal file
BIN
wp-content/plugins/bp-xtra-signup/admin/images/shabu-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
250
wp-content/plugins/bp-xtra-signup/bp-xtra-signup.php
Normal file
250
wp-content/plugins/bp-xtra-signup/bp-xtra-signup.php
Normal file
@ -0,0 +1,250 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: BP Xtra Signup
|
||||
Plugin URI: http://shabushabu.eu/
|
||||
Description: This plugin lets you add a Terms of Service checkbox and, optionally, a Mailchimp signup checkbox to your BuddyPress registration page. Additionally, an ajax username availability check, a password strength meter, email check and date of birth check can be activated.
|
||||
Author: Boris Glumpler
|
||||
Version: 1.6
|
||||
Author URI: http://shabushabu.eu/
|
||||
Site Wide Only: true
|
||||
|
||||
Copyright 2010 by ShabuShabu Webdesign
|
||||
|
||||
****************************************************************************
|
||||
|
||||
This script is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
class BPXS_Loader
|
||||
{
|
||||
/**
|
||||
* The plugin version
|
||||
*/
|
||||
var $version = '1.6';
|
||||
|
||||
/**
|
||||
* Minimum required WP version
|
||||
*/
|
||||
var $min_wp = '3.0';
|
||||
|
||||
/**
|
||||
* Minimum required BP version
|
||||
*/
|
||||
var $min_bp = '1.2';
|
||||
|
||||
/**
|
||||
* Minimum required PHP version
|
||||
*/
|
||||
var $min_php = '5.0.0';
|
||||
|
||||
/**
|
||||
* Plugin creator link
|
||||
*/
|
||||
var $home_url = 'http://shabushabu.eu/';
|
||||
|
||||
/**
|
||||
* Name of the plugin folder
|
||||
*/
|
||||
var $plugin_name;
|
||||
|
||||
/**
|
||||
* Holds the admin page
|
||||
*/
|
||||
var $bpxs_admin;
|
||||
|
||||
/**
|
||||
* All our options
|
||||
*/
|
||||
var $options;
|
||||
|
||||
/**
|
||||
* PHP4 constructor
|
||||
* @since 1.0
|
||||
*/
|
||||
function bpxs_loader()
|
||||
{
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5 constructor
|
||||
* @since 1.0
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->constants();
|
||||
$this->translate();
|
||||
|
||||
// Stop the plugin if we missed the requirements
|
||||
if( ! $this->check_requirements() )
|
||||
return;
|
||||
|
||||
$this->plugin_name = plugin_basename( __FILE__ );
|
||||
$this->globals();
|
||||
$this->dependencies();
|
||||
|
||||
// activate and uninstall hooks
|
||||
register_activation_hook( $this->plugin_name, array( &$this, 'activate' ) );
|
||||
register_uninstall_hook( $this->plugin_name, array( &$this, 'uninstall' ) );
|
||||
|
||||
// load BP related files only if BP is present
|
||||
if( defined( 'BP_VERSION' ) )
|
||||
$this->start();
|
||||
else
|
||||
add_action( 'bp_init', array( &$this, 'start' ) );
|
||||
|
||||
add_filter( 'plugin_row_meta', array( &$this, 'add_links' ), 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all BP related files
|
||||
* @since 1.0
|
||||
*/
|
||||
function start()
|
||||
{
|
||||
// Stop the plugin if we don't have the correct BP version or the options haven't been set up yet
|
||||
if( ! $this->check_plugin() )
|
||||
return;
|
||||
|
||||
require_once( dirname( __FILE__ ) . '/_inc/bpxs-core.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for required wp version
|
||||
* @since 1.0
|
||||
*/
|
||||
function check_requirements()
|
||||
{
|
||||
global $wp_version;
|
||||
|
||||
if( version_compare( $wp_version, $this->min_wp, '>=' ) == false )
|
||||
{
|
||||
add_action( 'admin_notices', create_function( '', 'global $bpxs; printf(\'<div id="message" class="error"><p><strong>\' . __(\'BP Xtra Signup works only under WordPress %s or higher. <a href="%supdate-core.php">Upgrade now</a>!\', "bpxs" ) . \'</strong></p></div>\', $bpxs->min_wp, admin_url() );' ) );
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if( version_compare( PHP_VERSION, $this->min_php, '>=' ) == false )
|
||||
{
|
||||
add_action( 'admin_notices', create_function( '', 'global $bpxs; printf(\'<div id="message" class="error"><p><strong>\' . __(\'BP Xtra Signup works only under PHP %s or higher. Please ask your hosting company for support!\', "bpxs" ) . \'</strong></p></div>\', $bpxs->min_php );' ) );
|
||||
$error = true;
|
||||
}
|
||||
|
||||
return ( ! $error ) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for correct setup of options
|
||||
* @since 1.0
|
||||
*/
|
||||
function check_plugin()
|
||||
{
|
||||
if( version_compare( BP_VERSION, $this->min_bp, '>=' ) == false )
|
||||
{
|
||||
add_action( 'admin_notices', create_function( '', 'global $bpxs; printf(\'<div id="message" class="error"><p><strong>\' . __(\'BP Xtra Signup works only under BuddyPress %s or higher. <a href="%supdate-core.php">Upgrade now</a>!\', "bpxs" ) . \'</strong></p></div>\', $bpxs->min_bp, admin_url() );' ) );
|
||||
$error = true;
|
||||
}
|
||||
|
||||
return ( ! $error ) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the languages
|
||||
* @since 1.0
|
||||
*/
|
||||
function translate()
|
||||
{
|
||||
if( file_exists( BPXS_ABSPATH . 'languages/bpxs-' . get_locale() . '.mo' ) )
|
||||
load_textdomain( 'bpxs', BPXS_ABSPATH . 'languages/bpxs-' . get_locale() . '.mo' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Declare our options
|
||||
* @since 1.0
|
||||
*/
|
||||
function globals()
|
||||
{
|
||||
if( $options = get_option( 'bpxs_options' ) )
|
||||
{
|
||||
foreach( $options as $key => $var )
|
||||
$this->options->{$key} = $var;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Include all dependent files
|
||||
* @since 1.0
|
||||
*/
|
||||
function dependencies()
|
||||
{
|
||||
if( is_admin() )
|
||||
{
|
||||
require_once( dirname( __FILE__ ) . '/admin/bpxs-admin.php');
|
||||
$this->bpxs_admin = new BPXS_Admin_Loader();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Declare all constants
|
||||
* @since 1.0
|
||||
*/
|
||||
function constants()
|
||||
{
|
||||
define( 'BPXS_VERSION', $this->version );
|
||||
define( 'BPXS_FOLDER', plugin_basename( dirname( __FILE__ ) ) );
|
||||
define( 'BPXS_ABSPATH', trailingslashit( str_replace("\\","/", WP_PLUGIN_DIR . '/' . BPXS_FOLDER ) ) );
|
||||
define( 'BPXS_URLPATH', trailingslashit( WP_PLUGIN_URL . '/' . BPXS_FOLDER ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the plugin
|
||||
* @since 1.0
|
||||
*/
|
||||
function activate()
|
||||
{
|
||||
include_once( dirname( __FILE__ ) .'/admin/bpxs-install.php' );
|
||||
bpxs_install();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all options
|
||||
* @since 1.0
|
||||
*/
|
||||
function uninstall()
|
||||
{
|
||||
include_once( dirname( __FILE__ ) .'/admin/bpxs-install.php' );
|
||||
bpxs_uninstall();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add some links to plugin setup page
|
||||
* @since 1.0
|
||||
*/
|
||||
function add_links( $links, $file )
|
||||
{
|
||||
if( $file == $this->plugin_name )
|
||||
{
|
||||
$links[] = '<a href="'. $this->home_url .'forums/">' . __( 'Support Forums', 'bpxs' ) . '</a>';
|
||||
$links[] = '<a href="'. $this->home_url .'donation/">' . __( 'Donate', 'bpxs' ) . '</a>';
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
}
|
||||
// get the show on the road
|
||||
$bpxs = new BPXS_Loader();
|
||||
global $bpxs;
|
||||
?>
|
||||
33
wp-content/plugins/bp-xtra-signup/bpxs-config.php
Normal file
33
wp-content/plugins/bp-xtra-signup/bpxs-config.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage BuddyPress
|
||||
* @sub-subpackage Course Info
|
||||
* @author Boris Glumpler
|
||||
* @copyright 2010, ShabuShabu Webdesign
|
||||
* @link http://scubavagabonds.com
|
||||
* @license http://www.opensource.org/licenses/gpl-2.0.php GPL License
|
||||
*/
|
||||
|
||||
/** Define the server path to wp-config here, if you placed WP-CONTENT outside the classic file structure */
|
||||
|
||||
$path = ''; // It should end with a trailing slash
|
||||
|
||||
/** That's all, stop editing from here **/
|
||||
|
||||
if( ! defined( 'WP_LOAD_PATH' ) )
|
||||
{
|
||||
/** classic root path if wp-content and plugins are below wp-config.php */
|
||||
$classic_root = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) .'/' ;
|
||||
|
||||
if( file_exists( $classic_root .'wp-load.php' ) )
|
||||
define( 'WP_LOAD_PATH', $classic_root);
|
||||
else
|
||||
if( file_exists( $path .'wp-load.php' ) )
|
||||
define( 'WP_LOAD_PATH', $path );
|
||||
else
|
||||
exit( 'Could not find wp-load.php' );
|
||||
}
|
||||
|
||||
// let's load WordPress
|
||||
require_once( WP_LOAD_PATH .'wp-load.php' );
|
||||
61
wp-content/plugins/bp-xtra-signup/css/dev/style.css
Normal file
61
wp-content/plugins/bp-xtra-signup/css/dev/style.css
Normal file
@ -0,0 +1,61 @@
|
||||
#username_checker,#email_checker{
|
||||
position:relative;
|
||||
}
|
||||
#username_checker span.loading,#email_checker span.loading{
|
||||
background: url( images/ajax-loader.gif ) no-repeat 92% 50%;
|
||||
width:14px;
|
||||
height:14px;
|
||||
position:absolute;
|
||||
right:10px;
|
||||
top:7px;
|
||||
}
|
||||
#username_checker span.available,#username_checker span.error,#email_checker span.available,#email_checker span.error,#compare-info{
|
||||
display:none;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
margin: 10px 0;
|
||||
width: 86%;
|
||||
padding: 5px 15px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
}
|
||||
#username_checker span.available,#email_checker span.available{
|
||||
display:block;
|
||||
color:#555;
|
||||
background: #c3ff88;
|
||||
border-color:#8dff1c;
|
||||
}
|
||||
#username_checker span.error,#email_checker span.error,#compare-info{
|
||||
display:block;
|
||||
color: #555;
|
||||
background: #ffa0a0;
|
||||
border-color:#f04040;
|
||||
}
|
||||
#pass-strength-result {
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
background-color: #eee;
|
||||
border-width:1px;
|
||||
border-style:solid;
|
||||
padding:5px 10px;
|
||||
width:88%;
|
||||
border-color: #ddd !important;
|
||||
}
|
||||
#pass-strength-result.bad {
|
||||
background-color: #ffb78c;
|
||||
border-color: #ff853c !important;
|
||||
}
|
||||
#pass-strength-result.good {
|
||||
background-color: #ffec8b;
|
||||
border-color: #fc0 !important;
|
||||
}
|
||||
#pass-strength-result.short {
|
||||
background-color: #ffa0a0;
|
||||
border-color: #f04040 !important;
|
||||
}
|
||||
#pass-strength-result.strong {
|
||||
background-color: #c3ff88;
|
||||
border-color: #8dff1c !important;
|
||||
}
|
||||
BIN
wp-content/plugins/bp-xtra-signup/css/images/ajax-loader.gif
Normal file
BIN
wp-content/plugins/bp-xtra-signup/css/images/ajax-loader.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 457 B |
1
wp-content/plugins/bp-xtra-signup/css/style.css
Normal file
1
wp-content/plugins/bp-xtra-signup/css/style.css
Normal file
@ -0,0 +1 @@
|
||||
#username_checker,#email_checker{position:relative}#username_checker span.loading,#email_checker span.loading{background:url(images/ajax-loader.gif) no-repeat 92% 50%;width:14px;height:14px;position:absolute;right:10px;top:7px}#username_checker span.available,#username_checker span.error,#email_checker span.available,#email_checker span.error,#compare-info{display:none;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;margin:10px 0;width:86%;padding:5px 15px;border-style:solid;border-width:1px}#username_checker span.available,#email_checker span.available{display:block;color:#555;background:#c3ff88;border-color:#8dff1c}#username_checker span.error,#email_checker span.error,#compare-info{display:block;color:#555;background:#ffa0a0;border-color:#f04040}#pass-strength-result{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#eee;border-width:1px;border-style:solid;padding:5px 10px;width:88%;border-color:#ddd!important}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important}
|
||||
1
wp-content/plugins/bp-xtra-signup/js/availability.js
Normal file
1
wp-content/plugins/bp-xtra-signup/js/availability.js
Normal file
@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(){jQuery("input#signup_username").wrap("<div id='username_checker'></div> ");jQuery("#username_checker").append("<span class='loading' style='display:none'></span>");jQuery("#username_checker").append("<span id='name-info'></span> ");jQuery("input#signup_username").bind("blur",function(){jQuery("#username_checker #name-info").css({display:"none"});jQuery("#username_checker span.loading").css({display:"block"});var b=jQuery("input#signup_username").val();jQuery.post(ajaxurl,{action:"check_username",cookie:encodeURIComponent(document.cookie),user_name:b},function(c){var d=jQuery.parseJSON(c);if(d.code=="success"){a(d.message,0)}else{a(d.message,1)}})});function a(c,b){jQuery("#username_checker #name-info").removeClass().css({display:"block"});jQuery("#username_checker span.loading").css({display:"none"});jQuery("#username_checker #name-info").empty().html(c);if(b){jQuery("#username_checker #name-info").addClass("error")}else{jQuery("#username_checker #name-info").addClass("available")}}});
|
||||
37
wp-content/plugins/bp-xtra-signup/js/dev/availability.js
Normal file
37
wp-content/plugins/bp-xtra-signup/js/dev/availability.js
Normal file
@ -0,0 +1,37 @@
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("input#signup_username").wrap("<div id='username_checker'></div> ");
|
||||
jQuery("#username_checker").append("<span class='loading' style='display:none'></span>")
|
||||
jQuery("#username_checker").append("<span id='name-info'></span> ");
|
||||
|
||||
jQuery("input#signup_username").bind("blur",function(){
|
||||
jQuery("#username_checker #name-info").css({display:'none'});
|
||||
jQuery("#username_checker span.loading").css({display:'block'});
|
||||
|
||||
var user_name = jQuery("input#signup_username").val();
|
||||
|
||||
jQuery.post( ajaxurl, {
|
||||
action: 'check_username',
|
||||
'cookie': encodeURIComponent(document.cookie),
|
||||
'user_name':user_name
|
||||
},
|
||||
function(response){
|
||||
var resp = jQuery.parseJSON(response);
|
||||
|
||||
if(resp.code == 'success')
|
||||
show_message(resp.message,0);
|
||||
else
|
||||
show_message(resp.message,1);
|
||||
});
|
||||
});
|
||||
|
||||
function show_message(msg,is_error) {
|
||||
jQuery("#username_checker #name-info").removeClass().css({display:'block'});
|
||||
jQuery("#username_checker span.loading").css({display:'none'});
|
||||
jQuery("#username_checker #name-info").empty().html(msg);
|
||||
|
||||
if(is_error)
|
||||
jQuery("#username_checker #name-info").addClass("error");
|
||||
else
|
||||
jQuery("#username_checker #name-info").addClass("available");
|
||||
}
|
||||
});
|
||||
37
wp-content/plugins/bp-xtra-signup/js/dev/email-check.js
Normal file
37
wp-content/plugins/bp-xtra-signup/js/dev/email-check.js
Normal file
@ -0,0 +1,37 @@
|
||||
jQuery(document).ready(function(){
|
||||
jQuery(signup_mail_field).wrap("<div id='email_checker'></div> ");
|
||||
jQuery("#email_checker").append("<span class='loading' style='display:none'></span>")
|
||||
jQuery("#email_checker").append("<span id='email-info'></span> ");
|
||||
|
||||
jQuery(signup_mail_field).bind("blur",function(){
|
||||
jQuery("#email_checker #email-info").css({display:'none'});
|
||||
jQuery("#email_checker span.loading").css({display:'block'});
|
||||
|
||||
var email = jQuery(signup_mail_field).val();
|
||||
|
||||
jQuery.post( ajaxurl, {
|
||||
action: 'check_email',
|
||||
'cookie': encodeURIComponent(document.cookie),
|
||||
'email': email
|
||||
},
|
||||
function(response){
|
||||
var resp = jQuery.parseJSON(response);
|
||||
|
||||
if(resp.code == 'success')
|
||||
show_email_message(resp.message,0);
|
||||
else
|
||||
show_email_message(resp.message,1);
|
||||
});
|
||||
});
|
||||
|
||||
function show_email_message(msg,is_error) {
|
||||
jQuery("#email_checker #email-info").removeClass().css({display:'block'});
|
||||
jQuery("#email_checker span.loading").css({display:'none'});
|
||||
jQuery("#email_checker #email-info").empty().html(msg);
|
||||
|
||||
if(is_error)
|
||||
jQuery("#email_checker #email-info").addClass("error");
|
||||
else
|
||||
jQuery("#email_checker #email-info").addClass("available");
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,9 @@
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("input#signup_email").bind("blur",function(){
|
||||
var first_value = jQuery("input#signup_email_first").val();
|
||||
var second_value = jQuery("input#signup_email").val();
|
||||
|
||||
if( first_value != second_value )
|
||||
jQuery('input#signup_email').after( '<span id="compare-info" class="error">'+ compare_error +'</span>' );
|
||||
});
|
||||
});
|
||||
72
wp-content/plugins/bp-xtra-signup/js/dev/strengthmeter.js
Normal file
72
wp-content/plugins/bp-xtra-signup/js/dev/strengthmeter.js
Normal file
@ -0,0 +1,72 @@
|
||||
jQuery(document).ready(function(){
|
||||
// add the password strength meter
|
||||
jQuery("#signup_password_confirm").after('<div id="pass-strength-result">' + pwsL10n['title'] + '</div><p>' + pwsL10n['desc'] + '</p>');
|
||||
// do the deed
|
||||
jQuery('#signup_password').val('').keyup( check_pass_strength );
|
||||
jQuery('#signup_password_confirm').val('').keyup( check_pass_strength );
|
||||
|
||||
function check_pass_strength() {
|
||||
var pass1 = jQuery('#signup_password').val(), user = jQuery('#signup_username').val(), pass2 = jQuery('#signup_password_confirm').val(), strength;
|
||||
|
||||
jQuery('#pass-strength-result').removeClass('short bad good strong');
|
||||
if ( ! pass1 ) {
|
||||
jQuery('#pass-strength-result').html( pwsL10n.empty );
|
||||
return;
|
||||
}
|
||||
|
||||
strength = passwordStrength(pass1, user, pass2);
|
||||
|
||||
switch ( strength ) {
|
||||
case 2:
|
||||
jQuery('#pass-strength-result').addClass('bad').html( pwsL10n['bad'] );
|
||||
break;
|
||||
case 3:
|
||||
jQuery('#pass-strength-result').addClass('good').html( pwsL10n['good'] );
|
||||
break;
|
||||
case 4:
|
||||
jQuery('#pass-strength-result').addClass('strong').html( pwsL10n['strong'] );
|
||||
break;
|
||||
case 5:
|
||||
jQuery('#pass-strength-result').addClass('short').html( pwsL10n['mismatch'] );
|
||||
break;
|
||||
default:
|
||||
jQuery('#pass-strength-result').addClass('short').html( pwsL10n['short'] );
|
||||
}
|
||||
}
|
||||
|
||||
function passwordStrength(password1, username, password2) {
|
||||
var shortPass = 1, badPass = 2, goodPass = 3, strongPass = 4, mismatch = 5, symbolSize = 0, natLog, score;
|
||||
|
||||
// password 1 != password 2
|
||||
if ( (password1 != password2) && password2.length > 0)
|
||||
return mismatch
|
||||
|
||||
//password < 4
|
||||
if ( password1.length < 4 )
|
||||
return shortPass
|
||||
|
||||
//password1 == username
|
||||
if ( password1.toLowerCase() == username.toLowerCase() )
|
||||
return badPass;
|
||||
|
||||
if ( password1.match(/[0-9]/) )
|
||||
symbolSize +=10;
|
||||
if ( password1.match(/[a-z]/) )
|
||||
symbolSize +=26;
|
||||
if ( password1.match(/[A-Z]/) )
|
||||
symbolSize +=26;
|
||||
if ( password1.match(/[^a-zA-Z0-9]/) )
|
||||
symbolSize +=31;
|
||||
|
||||
natLog = Math.log( Math.pow(symbolSize, password1.length) );
|
||||
score = natLog / Math.LN2;
|
||||
|
||||
if (score < 40 )
|
||||
return badPass
|
||||
|
||||
if (score < 56 )
|
||||
return goodPass
|
||||
|
||||
return strongPass;
|
||||
}
|
||||
});
|
||||
1
wp-content/plugins/bp-xtra-signup/js/email-check.js
Normal file
1
wp-content/plugins/bp-xtra-signup/js/email-check.js
Normal file
@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(){jQuery(signup_mail_field).wrap("<div id='email_checker'></div> ");jQuery("#email_checker").append("<span class='loading' style='display:none'></span>");jQuery("#email_checker").append("<span id='email-info'></span> ");jQuery(signup_mail_field).bind("blur",function(){jQuery("#email_checker #email-info").css({display:"none"});jQuery("#email_checker span.loading").css({display:"block"});var b=jQuery(signup_mail_field).val();jQuery.post(ajaxurl,{action:"check_email",cookie:encodeURIComponent(document.cookie),email:b},function(c){var d=jQuery.parseJSON(c);if(d.code=="success"){a(d.message,0)}else{a(d.message,1)}})});function a(c,b){jQuery("#email_checker #email-info").removeClass().css({display:"block"});jQuery("#email_checker span.loading").css({display:"none"});jQuery("#email_checker #email-info").empty().html(c);if(b){jQuery("#email_checker #email-info").addClass("error")}else{jQuery("#email_checker #email-info").addClass("available")}}});
|
||||
1
wp-content/plugins/bp-xtra-signup/js/email-compare.js
Normal file
1
wp-content/plugins/bp-xtra-signup/js/email-compare.js
Normal file
@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(){jQuery("input#signup_email").bind("blur",function(){jQuery("#compare-info").remove();var b=jQuery("input#signup_email_first").val();var a=jQuery("input#signup_email").val();if(b!=a){jQuery("input#signup_email").after('<span id="compare-info" class="error">'+compare_error+"</span>")}})});
|
||||
39
wp-content/plugins/bp-xtra-signup/js/js.php
Normal file
39
wp-content/plugins/bp-xtra-signup/js/js.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage BuddyPress
|
||||
* @sub-subpackage BP Xtra Signup
|
||||
* @author Boris Glumpler
|
||||
* @copyright 2010, ShabuShabu Webdesign
|
||||
* @link http://shabushabu.eu/bp-xtra-signup
|
||||
* @license http://www.opensource.org/licenses/gpl-2.0.php GPL License
|
||||
*/
|
||||
|
||||
require_once( '../bpxs-config.php' );
|
||||
|
||||
global $bpxs;
|
||||
|
||||
if( $bpxs->options->u_availability == true )
|
||||
$load[] = 'availability.js';
|
||||
|
||||
if( $bpxs->options->psw_strength == true )
|
||||
$load[] = 'strengthmeter.js';
|
||||
|
||||
if( $bpxs->options->email_check == true )
|
||||
$load[] = 'email-check.js';
|
||||
|
||||
if( $bpxs->options->email_confirmation == true )
|
||||
$load[] = 'email-compare.js';
|
||||
|
||||
ob_start( "ob_gzhandler" );
|
||||
|
||||
header( 'Content-type: text/javascript' );
|
||||
header( "Cache-Control: public" );
|
||||
header( 'Expires: '. gmdate( 'D, d M Y H:i:s', time() + 86400 ) . 'GMT' );
|
||||
|
||||
foreach( (array)$load as $file )
|
||||
{
|
||||
include( dirname( __FILE__ ) .'/'. $file );
|
||||
echo "\t";
|
||||
}
|
||||
?>
|
||||
1
wp-content/plugins/bp-xtra-signup/js/strengthmeter.js
Normal file
1
wp-content/plugins/bp-xtra-signup/js/strengthmeter.js
Normal file
@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(){jQuery("#signup_password_confirm").after('<div id="pass-strength-result">'+pwsL10n.title+"</div><p>"+pwsL10n.desc+"</p>");jQuery("#signup_password").val("").keyup(b);jQuery("#signup_password_confirm").val("").keyup(b);function b(){var e=jQuery("#signup_password").val(),d=jQuery("#signup_username").val(),c=jQuery("#signup_password_confirm").val(),f;jQuery("#pass-strength-result").removeClass("short bad good strong");if(!e){jQuery("#pass-strength-result").html(pwsL10n.empty);return}f=a(e,d,c);switch(f){case 2:jQuery("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:jQuery("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:jQuery("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:jQuery("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:jQuery("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}function a(h,k,f){var m=1,j=2,d=3,c=4,e=5,i=0,l,g;if((h!=f)&&f.length>0){return e}if(h.length<4){return m}if(h.toLowerCase()==k.toLowerCase()){return j}if(h.match(/[0-9]/)){i+=10}if(h.match(/[a-z]/)){i+=26}if(h.match(/[A-Z]/)){i+=26}if(h.match(/[^a-zA-Z0-9]/)){i+=31}l=Math.log(Math.pow(i,h.length));g=l/Math.LN2;if(g<40){return j}if(g<56){return d}return c}});
|
||||
531
wp-content/plugins/bp-xtra-signup/languages/bpxs.po
Normal file
531
wp-content/plugins/bp-xtra-signup/languages/bpxs.po
Normal file
@ -0,0 +1,531 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: NextGEN ImageFlow\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-09-11 20:09+0100\n"
|
||||
"PO-Revision-Date: 2010-09-11 20:09+0100\n"
|
||||
"Last-Translator: Boris Glumpler <boris@shabushabu.eu>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Poedit-Basepath: .\n"
|
||||
"X-Poedit-KeywordsList: _e;__\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
|
||||
#: bp-xtra-signup.php:239
|
||||
#: admin/bpxs-admin.php:93
|
||||
msgid "Support Forums"
|
||||
msgstr ""
|
||||
|
||||
#: bp-xtra-signup.php:240
|
||||
#: admin/bpxs-admin.php:94
|
||||
#: admin/bpxs-settings.php:168
|
||||
#: admin/bpxs-settings.php:569
|
||||
msgid "Donate"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-admin.php:32
|
||||
msgid "BP Xtra Signup"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-admin.php:91
|
||||
msgid "Get help for BP Xtra Signup"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-install.php:32
|
||||
msgid "Don't forget"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-install.php:33
|
||||
msgid "Uncheck this box if you do not want to subscribe to our newsletter."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-install.php:34
|
||||
msgid "Please make sure to read our {url}Terms of Service{/url} and then check this box (required)."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-install.php:36
|
||||
msgid "You have to check our Terms Of Service to continue."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-install.php:38
|
||||
msgid "Unsuccessful newsletter signup"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-install.php:39
|
||||
msgid ""
|
||||
"Hello,\n"
|
||||
"\n"
|
||||
"there has been an error with a new subscriber to your newsletter! Check the error and send a message to the user if signup to the newsletter has been unsuccessful.\n"
|
||||
"\n"
|
||||
"Unable to load listSubscribe()!\n"
|
||||
"\n"
|
||||
"UserID: {USER_ID}\n"
|
||||
"Name: {USER_NAME}\n"
|
||||
"Email: {USER_EMAIL}\n"
|
||||
"\n"
|
||||
"Code: {ERROR_CODE}\n"
|
||||
"Msg: {ERROR_MESSAGE}"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:52
|
||||
msgid "You need to enter a Mailchimp List ID and an API Key."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:60
|
||||
msgid "You need to enter a valid email address."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:70
|
||||
msgid "You need to specify a date of birth profile field."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:76
|
||||
msgid "You need to specify an age."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:104
|
||||
msgid "Update Successfully"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:166
|
||||
#: admin/bpxs-settings.php:201
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:167
|
||||
#: admin/bpxs-settings.php:467
|
||||
#: admin/bpxs-settings.php:557
|
||||
msgid "Help"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:205
|
||||
msgid "Click to open all option boxes."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:211
|
||||
#: admin/bpxs-settings.php:256
|
||||
#: admin/bpxs-settings.php:315
|
||||
#: admin/bpxs-settings.php:332
|
||||
#: admin/bpxs-settings.php:349
|
||||
#: admin/bpxs-settings.php:366
|
||||
#: admin/bpxs-settings.php:383
|
||||
msgid "Click to toggle"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:212
|
||||
msgid "Terms of Service"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:216
|
||||
msgid "Activate TOS"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:219
|
||||
#: admin/bpxs-settings.php:264
|
||||
#: admin/bpxs-settings.php:323
|
||||
#: admin/bpxs-settings.php:340
|
||||
#: admin/bpxs-settings.php:357
|
||||
#: admin/bpxs-settings.php:374
|
||||
#: admin/bpxs-settings.php:391
|
||||
msgid "Yes"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:220
|
||||
#: admin/bpxs-settings.php:265
|
||||
#: admin/bpxs-settings.php:324
|
||||
#: admin/bpxs-settings.php:341
|
||||
#: admin/bpxs-settings.php:358
|
||||
#: admin/bpxs-settings.php:375
|
||||
#: admin/bpxs-settings.php:392
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:222
|
||||
msgid "Show the TOS checkbox on the registration screen?"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:225
|
||||
msgid "Signup Title"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:228
|
||||
msgid "The header title of the extra signup options."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:232
|
||||
msgid "Checkbox Text"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:235
|
||||
msgid "Will be displayed next to the checkbox a new user needs to check. These placeholders are allowed: {url},{/url}"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:239
|
||||
msgid "TOS Link"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:242
|
||||
msgid "The link to your Terms of Service page."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:246
|
||||
msgid "Error Text"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:249
|
||||
msgid "The text that appears when a user does not check the TOS checkbox."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:257
|
||||
msgid "Mailchimp Integration"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:261
|
||||
msgid "Activate Newsletter"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:267
|
||||
msgid "Only activate the newsletter if you have a Mailchimp account."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:270
|
||||
msgid "Newsletter Text"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:273
|
||||
msgid "The text next to the checkbox on the registration page."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:277
|
||||
msgid "API Key"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:280
|
||||
msgid "Your Mailchimp API key."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:284
|
||||
msgid "List ID"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:287
|
||||
msgid "The list ID you want new users to subscribe to."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:291
|
||||
msgid "Email Recipient"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:294
|
||||
msgid "Enter an email address you want newsletter signup errors sent to."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:298
|
||||
msgid "Email Subject"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:301
|
||||
msgid "The subject of the error message."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:305
|
||||
msgid "Email Message"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:308
|
||||
msgid "The body of the error message."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:316
|
||||
msgid "Email Confirmation"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:320
|
||||
msgid "Activate Email Confirmation"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:326
|
||||
msgid "Select yes if you want your users to confirm their email address."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:333
|
||||
msgid "Ajax Username Availability"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:337
|
||||
msgid "Activate Username Check"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:343
|
||||
msgid "Select yes if you want to activate the ajax username availability check."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:350
|
||||
msgid "Ajax Email Check"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:354
|
||||
msgid "Activate Email Check"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:360
|
||||
msgid "Select yes if you want to activate the ajax email check."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:367
|
||||
msgid "Password Strength Meter"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:371
|
||||
msgid "Activate Password Strength Meter"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:377
|
||||
msgid "Select yes if you want to activate the password strength meter."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:384
|
||||
msgid "Date of Birth Check"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:388
|
||||
msgid "Activate DOB Check"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:394
|
||||
msgid "Select yes if you want to activate the date of birth check."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:397
|
||||
msgid "DOB Field ID"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:404
|
||||
msgid "Select the profile field that represents the date of birth."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:408
|
||||
msgid "Pick your age"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:416
|
||||
msgid "Select the age you need your users to be above."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:423
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:469
|
||||
#, php-format
|
||||
msgid "To receive support for this plugin, please <a href=\"%s\">register</a> on <a href=\"%s\">ShabuShabu.eu</a>."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:470
|
||||
msgid "Registration is free. Support, however, will only be provided within the support group of this plugin, for which we charge a small monthly subscription fee."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:475
|
||||
#: admin/bpxs-settings.php:499
|
||||
#: admin/bpxs-settings.php:529
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:476
|
||||
#: admin/bpxs-settings.php:501
|
||||
#: admin/bpxs-settings.php:531
|
||||
msgid "Price"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:492
|
||||
msgid "Below you find a list of all our available and planned plugins and themes. Items that have a price tag attached come with 3 months free support."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:494
|
||||
msgid "Plugins"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:498
|
||||
#: admin/bpxs-settings.php:528
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:500
|
||||
#: admin/bpxs-settings.php:530
|
||||
msgid "Release Date"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:524
|
||||
msgid "Themes"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:558
|
||||
msgid "Information could not be retrieved."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:571
|
||||
msgid "We spend a lot of time and effort on implementing new features and on the maintenance of this plugin, so if you feel generous and have a few bucks to spare, then please consider to donate."
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:572
|
||||
msgid "Click on the button below and you will be redirected to the PayPal site where you can make a safe donation"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:576
|
||||
msgid "BP Xtra Signup @ http://shabushabu.eu"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:583
|
||||
msgid "Make payments with PayPal - it's fast, free and secure!"
|
||||
msgstr ""
|
||||
|
||||
#: admin/bpxs-settings.php:586
|
||||
msgid "Thank you and all the best!"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:54
|
||||
#, php-format
|
||||
msgid "You need to be at least %d years old to join this network."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:171
|
||||
msgid "Confirm Email (required)"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:201
|
||||
msgid "Please make sure you enter your email twice"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:204
|
||||
msgid "The emails you entered do not match."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:229
|
||||
#, php-format
|
||||
msgid "This usename is taken, please choose another one, e.g. %s"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:237
|
||||
msgid "This username is available."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:243
|
||||
msgid "You have to chose a username."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:317
|
||||
msgid "Only lowercase letters and numbers allowed."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:320
|
||||
msgid "This username is reserved. Please chose another one."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:323
|
||||
msgid "Username must be at least 4 characters."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:326
|
||||
msgid "Usernames must not contain the character \"_\"!"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:332
|
||||
msgid "Usernames must contain letters too!"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:353
|
||||
#: _inc/bpxs-core.php:359
|
||||
msgid "Strength indicator"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:354
|
||||
msgid "Very weak"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:355
|
||||
msgid "Weak"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:357
|
||||
msgid "Strong"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:358
|
||||
msgid "Mismatch"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:360
|
||||
msgid "Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! \" ? $ % ^ & )."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:374
|
||||
#: _inc/bpxs-core.php:388
|
||||
msgid "The emails don't match!"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:420
|
||||
msgid "January"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:421
|
||||
msgid "February"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:422
|
||||
msgid "March"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:423
|
||||
msgid "April"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:424
|
||||
msgid "May"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:425
|
||||
msgid "June"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:426
|
||||
msgid "July"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:427
|
||||
msgid "August"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:428
|
||||
msgid "September"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:429
|
||||
msgid "October"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:430
|
||||
msgid "November"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:431
|
||||
msgid "December"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:452
|
||||
msgid "Please enter a valid email address."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:455
|
||||
msgid "Sorry, that email address is already in use!"
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:458
|
||||
msgid "This email address is valid."
|
||||
msgstr ""
|
||||
|
||||
#: _inc/bpxs-core.php:461
|
||||
msgid "You have to enter an email address."
|
||||
msgstr ""
|
||||
|
||||
107
wp-content/plugins/bp-xtra-signup/readme.txt
Normal file
107
wp-content/plugins/bp-xtra-signup/readme.txt
Normal file
@ -0,0 +1,107 @@
|
||||
=== BP Xtra Signup ===
|
||||
Contributors: travel-junkie
|
||||
Donate link: http://shabushabu.eu/donation/
|
||||
Tags: buddypress, registration, eula, newsletter, tos, username, check, ajax, password, strength
|
||||
Requires at least: WP 3.0, BP 1.2.6
|
||||
Tested up to: WP 3.0.1, BP 1.3bleeding
|
||||
Stable tag: 1.6
|
||||
|
||||
Adds extra signup options to the registration page of a BuddyPress installation.
|
||||
|
||||
== Description ==
|
||||
|
||||
This plugin lets you add a Terms of Service checkbox and, optionally, a Mailchimp signup checkbox to your BuddyPress registration page.
|
||||
Additionally, an ajax username availability check, a password strength meter, email check and date of birth check can be activated.
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload the files to wp-content/plugins/bp-xtra-signup
|
||||
|
||||
2. Activate the plugin in your admin backend
|
||||
|
||||
4. Go to BuddyPress->BP Xtra Signup and change the options to your liking
|
||||
|
||||
That's it ... enjoy!
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= What about feature requests? =
|
||||
|
||||
You can register on our [support site](http://shabushabu.eu/membership-options/) and leave a comment in our support forums.
|
||||
|
||||
= But you charge for support, right? =
|
||||
|
||||
Yes, we do. It's not a lot, though, and you can obviously download the plugin for free.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Admin Panel
|
||||
2. Register Page
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= v1.0 =
|
||||
* initial release
|
||||
|
||||
= v1.1 =
|
||||
* Changed: TOS display is optional now
|
||||
* Added: slight code improvements
|
||||
|
||||
= v1.2 =
|
||||
* NEW: Optional email confirmation on registration (THX to Francesco Laffi)
|
||||
* Bugfix: Newsletter selection is repaired
|
||||
|
||||
= v1.3 =
|
||||
* NEW: Ajax username availability (THX to Brajesh Singh)
|
||||
* NEW: Password strength meter
|
||||
* Changed: Newsletter checkbox is unchecked by default due to legal issues in certain countries
|
||||
|
||||
= v1.3.1 =
|
||||
* NEW: Alternative username suggestion if desired username is taken already
|
||||
* Added: Support for WP MS when checking for usernames
|
||||
|
||||
= v1.4 =
|
||||
* NEW: Date of Birth check on registration
|
||||
* Added: Various filters and hooks
|
||||
* Added: Some admin UX enhancements
|
||||
|
||||
= v1.5 =
|
||||
* NEW: Ajax email check
|
||||
* NEW: Comparison of email values
|
||||
* NEW: JS files get concatinated
|
||||
* Added: Minified/dev js and css files
|
||||
|
||||
= v1.5.1 =
|
||||
* Bugfix: IE Compatibility by substituting JSON.parse with jQuery.parseJSON (THX James Smith)
|
||||
|
||||
= v1.5.2 =
|
||||
* Changed: TOS link and TOS text option have been combined
|
||||
|
||||
= v1.5.3 =
|
||||
* Bugfix: Admin help has been fixed
|
||||
|
||||
= v1.5.4 =
|
||||
* Bugfix: Fixed problems when translating the plugin
|
||||
|
||||
= v1.6 =
|
||||
* General housekeeping
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= v1.5.2 =
|
||||
Go to the plugin settings page and manually add the link to your TOS to the 'Checkbox Text' option
|
||||
|
||||
= v1.5 =
|
||||
Go to the plugin settings page to activate the ajax email check
|
||||
|
||||
= v1.4 =
|
||||
Go to the plugin settings page to activate the date of birth check
|
||||
|
||||
= v1.3 =
|
||||
Go to the plugin settings page and activate the password strength meter and ajax username availability if needed
|
||||
|
||||
= v1.2 =
|
||||
Visit the plugin admin page to activate email confirmation
|
||||
|
||||
= v1.0 =
|
||||
Slight code improvements over the beta version
|
||||
BIN
wp-content/plugins/bp-xtra-signup/screenshot-1.png
Normal file
BIN
wp-content/plugins/bp-xtra-signup/screenshot-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
BIN
wp-content/plugins/bp-xtra-signup/screenshot-2.png
Normal file
BIN
wp-content/plugins/bp-xtra-signup/screenshot-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@ -1072,7 +1072,8 @@ font-weight: bold;
|
||||
}
|
||||
.bp-wrapper .standard-form#signup_form div div.error {
|
||||
color: #8a1f11;
|
||||
margin: 10px 0 5px 0;
|
||||
margin: 0 0 10px 37%;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -628,4 +628,85 @@ function bp_fix_members_pagination_links( $pag_links ) {
|
||||
return $pag_links;
|
||||
}
|
||||
add_filter( 'bp_get_members_pagination_links', 'bp_fix_members_pagination_links' );
|
||||
|
||||
|
||||
|
||||
function bp_datebox_field ($html, $type, $day, $month, $year, $default_select ) {
|
||||
|
||||
// change your max year here
|
||||
$year_max = date('Y');
|
||||
|
||||
/* Check for updated posted values, but errors preventing them from being saved first time */
|
||||
if ( !empty( $_POST['field_' . $field->id . '_day'] ) ) {
|
||||
if ( $day != $_POST['field_' . $field->id . '_day'] )
|
||||
$day = $_POST['field_' . $field->id . '_day'];
|
||||
}
|
||||
|
||||
if ( !empty( $_POST['field_' . $field->id . '_month'] ) ) {
|
||||
if ( $month != $_POST['field_' . $field->id . '_month'] )
|
||||
$month = $_POST['field_' . $field->id . '_month'];
|
||||
}
|
||||
|
||||
if ( !empty( $_POST['field_' . $field->id . '_year'] ) ) {
|
||||
if ( $year != date( "j", $_POST['field_' . $field->id . '_year'] ) )
|
||||
$year = $_POST['field_' . $field->id . '_year'];
|
||||
}
|
||||
|
||||
$html = '';
|
||||
|
||||
switch ( $type ) {
|
||||
case 'day':
|
||||
$html .= '<option value=""' . esc_attr( $default_select ) . '>--</option>';
|
||||
|
||||
for ( $i = 1; $i < 32; $i++ ) {
|
||||
if ( $day == $i ) {
|
||||
$selected = ' selected = "selected"';
|
||||
} else {
|
||||
$selected = '';
|
||||
}
|
||||
$html .= '<option value="' . $i .'"' . $selected . '>' . $i . '</option>';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'month':
|
||||
$eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
|
||||
|
||||
$months = array( __( 'January', 'buddypress' ), __( 'February', 'buddypress' ), __( 'March', 'buddypress' ),
|
||||
__( 'April', 'buddypress' ), __( 'May', 'buddypress' ), __( 'June', 'buddypress' ),
|
||||
__( 'July', 'buddypress' ), __( 'August', 'buddypress' ), __( 'September', 'buddypress' ),
|
||||
__( 'October', 'buddypress' ), __( 'November', 'buddypress' ), __( 'December', 'buddypress' )
|
||||
);
|
||||
|
||||
$html .= '<option value=""' . esc_attr( $default_select ) . '>------</option>';
|
||||
|
||||
for ( $i = 0; $i < 12; $i++ ) {
|
||||
if ( $month == $eng_months[$i] ) {
|
||||
$selected = ' selected = "selected"';
|
||||
} else {
|
||||
$selected = '';
|
||||
}
|
||||
|
||||
$html .= '<option value="' . $eng_months[$i] . '"' . $selected . '>' . $months[$i] . '</option>';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'year':
|
||||
$html .= '<option value=""' . esc_attr( $default_select ) . '>----</option>';
|
||||
|
||||
for ( $i = $year_max; $i > 1899; $i-- ) {
|
||||
if ( $year == $i ) {
|
||||
$selected = ' selected = "selected"';
|
||||
} else {
|
||||
$selected = '';
|
||||
}
|
||||
|
||||
$html .= '<option value="' . $i .'"' . $selected . '>' . $i . '</option>';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
add_filter( 'bp_get_the_profile_field_datebox', 'bp_datebox_field', 10, 6 );
|
||||
|
||||
?>
|
||||
@ -34,21 +34,21 @@
|
||||
|
||||
<h4><?php _e( 'Account Details', 'buddypress' ) ?></h4>
|
||||
|
||||
<label for="signup_username"><?php _e( 'Username', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
|
||||
<?php do_action( 'bp_signup_username_errors' ) ?>
|
||||
<label for="signup_username"><?php _e( 'Username', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
|
||||
<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
|
||||
<?php do_action( 'bp_signup_username_errors' ) ?>
|
||||
|
||||
<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
|
||||
<?php do_action( 'bp_signup_email_errors' ) ?>
|
||||
<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
|
||||
<input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
|
||||
<?php do_action( 'bp_signup_email_errors' ) ?>
|
||||
|
||||
<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
|
||||
<?php do_action( 'bp_signup_password_errors' ) ?>
|
||||
<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
|
||||
<input type="password" name="signup_password" id="signup_password" value="" />
|
||||
<?php do_action( 'bp_signup_password_errors' ) ?>
|
||||
|
||||
<label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
|
||||
<?php do_action( 'bp_signup_password_confirm_errors' ) ?>
|
||||
<input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" />
|
||||
<?php do_action( 'bp_signup_password_confirm_errors' ) ?>
|
||||
|
||||
</div><!-- #basic-details-section -->
|
||||
|
||||
@ -74,36 +74,36 @@
|
||||
<?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
|
||||
|
||||
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
<input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="<?php bp_the_profile_field_edit_value() ?>" />
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
|
||||
|
||||
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_edit_value() ?></textarea>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>
|
||||
|
||||
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
|
||||
<?php bp_the_profile_field_options() ?>
|
||||
</select>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
|
||||
|
||||
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" multiple="multiple">
|
||||
<?php bp_the_profile_field_options() ?>
|
||||
</select>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
@ -112,12 +112,13 @@
|
||||
<div class="radio">
|
||||
<span class="label"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></span>
|
||||
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
<?php bp_the_profile_field_options() ?>
|
||||
|
||||
<?php if ( !bp_get_the_profile_field_is_required() ) : ?>
|
||||
<a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name() ?>' );"><?php _e( 'Clear', 'buddypress' ) ?></a>
|
||||
<?php endif; ?>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
@ -127,8 +128,8 @@
|
||||
<div class="checkbox">
|
||||
<span class="label"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></span>
|
||||
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
<?php bp_the_profile_field_options() ?>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
@ -137,7 +138,6 @@
|
||||
|
||||
<div class="datebox">
|
||||
<label for="<?php bp_the_profile_field_input_name() ?>_day"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
|
||||
<select name="<?php bp_the_profile_field_input_name() ?>_day" id="<?php bp_the_profile_field_input_name() ?>_day">
|
||||
<?php bp_the_profile_field_options( 'type=day' ) ?>
|
||||
@ -150,6 +150,7 @@
|
||||
<select name="<?php bp_the_profile_field_input_name() ?>_year" id="<?php bp_the_profile_field_input_name() ?>_year">
|
||||
<?php bp_the_profile_field_options( 'type=year' ) ?>
|
||||
</select>
|
||||
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user