' . stripslashes($arr[0]) . '
'; // filter blocked content message $str = apply_filters( 'wpmem_restricted_msg', $str ); } } $arr = array( __( 'Existing Users Login', 'wp-members' ), __( 'Username', 'wp-members' ), 'text', 'log', __( 'Password', 'wp-members' ), 'password', 'pwd', 'login', __( 'Login', 'wp-members' ), 'username', 'password' ); $str = $str . wpmem_login_form( $page, $arr ); return $str; } endif; if ( ! function_exists( 'wpmem_inc_changepassword' ) ): /** * Change Password Dialog * * Loads the form for changing password. * * @since 2.0 * * @uses wpmem_login_form() * * @return string $str the generated html for the change password form */ function wpmem_inc_changepassword() { $arr = array(__('Change Password', 'wp-members'), __('New Password', 'wp-members'), 'password', 'pass1', __('Repeat Password', 'wp-members'), 'password', 'pass2', 'pwdchange', __('Update Password', 'wp-members'), 'password', 'password'); $str = wpmem_login_form( 'page', $arr ); return $str; } endif; if ( ! function_exists( 'wpmem_inc_resetpassword' ) ): /** * Reset Password Dialog * * Loads the form for resetting password. * * @since 2.1 * * @uses wpmem_login_form() * * @return string $str the generated html fo the reset password form */ function wpmem_inc_resetpassword() { $arr = array(__('Reset Forgotten Password', 'wp-members'), __('Username', 'wp-members'), 'text', 'user', __('Email', 'wp-members'), 'text', 'email', 'pwdreset', __('Reset Password', 'wp-members'), 'username', 'textbox'); $str = wpmem_login_form( 'page', $arr ); return $str; } endif; if ( ! function_exists( 'wpmem_inc_loginfailed' ) ): /** * Login Failed Dialog * * Returns the login failed error message. * * @since 1.8 * * @uses apply_filters Calls wpmem_login_failed which filters the failed login dialog * * @return string $str the generated html for the login failed message */ function wpmem_inc_loginfailed() { $str = '' . __('You entered an invalid username or password.', 'wp-members') . '
' . sprintf( __( 'You are logged in as %s', 'wp-members' ), $user_login ) . '
' . sprintf( __( 'You are logged in as %s', 'wp-members' ), $user_login ) . '
' . __( 'click here to logout', 'wp-members' ) . '
' . sprintf( __( 'You are logged in as %s', 'wp-members' ), $user_login ) . ' | ' . __( 'click here to logout', 'wp-members' ) . '
'; break; } return $str; } endif; if ( ! function_exists( 'wpmem_inc_regmessage' ) ): /** * Message Dialog * * Returns various dialogs and error messages. * * @since 1.8 * * @uses apply_filters Calls the wpmem_msg_dialog filter to filter the message dialog * * @param string $toggle error message toggle to look for specific error messages * @param string $msg a message that has no toggle that is passed directly to the function * @return string $str */ function wpmem_inc_regmessage( $toggle, $msg='' ) { $wpmem_dialogs = get_option('wpmembers_dialogs'); $arr = array( 'user', 'email', 'success', 'editsuccess', 'pwdchangerr', 'pwdchangesuccess', 'pwdreseterr', 'pwdresetsuccess' ); $str = '
'; for( $r = 0; $r < count( $arr ); $r++ ) { if( $toggle == $arr[$r] ) { $str = $str . stripslashes( $wpmem_dialogs[$r+1] ) . '
'; $str = apply_filters( 'wpmem_msg_dialog', $str ); return $str; } endif; if ( ! function_exists( 'wpmem_inc_registration' ) ): /** * Registration Form Include * * Calls the appropriate set of forms and passes back string containing the form * * @since 2.5.1 * * @uses wpmem_inc_registration_NEW() * @uses wpmem_inc_registration_OLD() * * @param var $toggle * @param string $heading * @return string */ function wpmem_inc_registration( $toggle = 'new', $heading = '' ) { if ( WPMEM_OLD_FORMS != 1 ) { $str = wpmem_inc_registration_NEW( $toggle, $heading ); } else { include_once( 'wp-members-deprecated.php' ); $str = wpmem_inc_registration_OLD( $toggle, $heading ); } return $str; } endif; if ( ! function_exists( 'wpmem_login_form' ) ): /** * Login Form Include * * Calls the appropriate set of forms. * * @since 2.5.1 * * @uses wpmem_login_form_NEW() * @uses wpmem_login_form_OLD() * * @param string $page * @param array $arr array of the login form pieces * @var string the html of the form * @return string the html of the form in $str */ function wpmem_login_form( $page, $arr ) { if ( WPMEM_OLD_FORMS != 1 ) { $str = wpmem_login_form_NEW( $page, $arr ); } else { include_once( 'wp-members-deprecated.php' ); $str = wpmem_login_form_OLD( $page, $arr ); } return $str; } endif; if( ! function_exists( 'wpmem_inc_registration_NEW' ) ): /** * Registration Form Dialog * * Outputs the table-less form for new user * registration and existing user edits. * * @since 2.5.1 * * @uses apply_filters Calls 'wpmem_register_form_before' * @uses apply_filters Calls 'wpmem_register_form' * @uses apply_filters Calls 'wpmem_register_heading' * @uses apply_filters Calls 'wpmem_tos_link_txt' * * @param string $toggle * @param string $heading * @return string $form */ function wpmem_inc_registration_NEW( $toggle = 'new', $heading = '' ) { // fix the wptexturize remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_content', 'wptexturize' ); add_filter( 'the_content', 'wpmem_texturize', 99 ); global $userdata, $wpmem_regchk, $username, $wpmem_fieldval_arr; if( !$heading ) { $heading = apply_filters( 'wpmem_register_heading', __( 'New Users Registration', 'wp-members' ) ); } $form = apply_filters( 'wpmem_register_form_before', '' ); $form.= '[wpmem_txt]'; } } if( $toggle == 'edit' ) { $form = $form . ''; } else { $form = $form . ''; } $form = $form . ' '; // @todo find a better place to put this $form = $form . ''; $form = $form . wpmem_inc_attribution(); $form = $form . '[/wpmem_txt]'; $form = apply_filters( 'wpmem_register_form', $form ); return $form; } endif; if ( ! function_exists( 'wpmem_login_form_NEW' ) ): /** * Login Form Dialog * * Builds the table-less form used for * login, change password, and reset password. * * @since 2.5.1 * * @uses apply_filters Calls 'wpmem_login_form_before' * @uses apply_filters Calls 'wpmem_forgot_link' * @uses apply_filters Calls 'wpmem_reg_link' * @uses apply_filters Calls 'wpmem_login_form' * * @param string $page * @param array $arr * @return string $form */ function wpmem_login_form_NEW( $page, $arr ) { // are we redirecting somewhere? if( isset( $_REQUEST['redirect_to'] ) ) { $redirect_to = $_REQUEST['redirect_to']; } else { $redirect_to = get_permalink(); } // fix the wptexturize remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_content', 'wptexturize' ); add_filter('the_content', 'wpmem_texturize', 99); $form = apply_filters( 'wpmem_login_form_before', '' ); $form.= '[wpmem_txt][/wpmem_txt]'; $form = apply_filters( 'wpmem_login_form', $form ); return $form; } endif; if ( ! function_exists( 'wpmem_inc_recaptcha' ) ): /** * Create reCAPTCHA form * * @since 2.6.0 * * @uses apply_filters Calls wpmem_recaptcha * * @param string $key * @param string $theme * @return string $str */ function wpmem_inc_recaptcha( $key, $theme ) { $str = ' '; $str = apply_filters( 'wpmem_recaptcha', $str ); return $str; } endif; /** * Create an attribution link in the form * * @since 2.6.0 * @return $str string */ function wpmem_inc_attribution() { /* Taking this out? That's ok. But please consider making a donation to support the further development of this plugin. Many hours of work have gone into its development and ongoing support. If you are a developer using this for a client site, you see value in not having to do this from scratch. Please consider a larger amount. If you are a donor, I thank you for your support! */ $show_attribution = true; if( defined( 'WPMEM_REMOVE_ATTR' ) ) { $show_attribution = false; } if( WPMEM_OLD_FORMS != 1 && $show_attribution == true ) { // NEW FORMS $str = '