function simplr_profile_page() { global $current_user, $errors; if (!class_exists('Form')) { include_once dirname(__FILE__) . '/form.class.php'; } if (!is_user_logged_in()) { ini_set('display_errors', 1); error_reporting(E_ALL); $output = ''; ob_start(); wp_login_form(); $output = ob_get_contents(); ob_end_clean(); return $output; } else { $error_header = ''; if (is_array($errors)) { foreach ($errors as $error) { $error_header .= '<div id="simplr-message" class="error">' . @$error . "</div>\n"; } } elseif (@$_REQUEST['updated'] == 'true') { $error_header = '<div id="simplr-message" class="success">' . apply_filters('simplr_profile_updated_message', __('Your profile was saved', 'simplr-registration-form')) . '</div>'; } $fields = get_transient('simplr_profile_transient'); delete_transient('simplr_profile_transient'); ob_start(); echo '<h3>' . __('User Login', 'simplr-registration-form') . ': ' . $current_user->user_login . ' / ' . __('Registered', 'simplr-registration-form') . ': ' . date_i18n(get_option('date_format'), strtotime($current_user->user_registered)) . '</h3>'; echo '<form id="simplr-form" method="post" action="" >'; SREG_Form::text(array('name' => 'user_nicename', 'label' => __('Nickname', 'simplr-registration-form'), 'required' => false), $current_user->user_nicename, 'wide'); SREG_Form::text(array('name' => 'user_email', 'label' => __('Email', 'simplr-registration-form'), 'required' => true), $current_user->user_email, 'wide'); if (!empty($fields)) { foreach ($fields as $field) { $key_val = get_user_meta($current_user->ID, $field['key'], true); $args = array('name' => $field['key'], 'label' => $field['label'], 'required' => $field['required']); //setup specific field values for date and callback if ($field['type'] == 'callback') { $field['options_array'][1] = array($key_val); } if ($field['type'] != '') { SREG_Form::$field['type']($args, @$key_val, '', $field['options_array']); } } //endforeach } SREG_Form::hidden(array('name' => 'user_id'), $current_user->ID, '', ''); if (!get_user_meta($current_user->ID, 'fbuser_id', true)) { simplr_change_password(); } wp_nonce_field('simplr-profile', '_simplr_nonce'); SREG_Form::submit(array('name' => 'simplr-profile')); echo '</form>'; $output = ob_get_contents(); ob_end_clean(); return $error_header . $output; } }
'post_type'=>'page'), $simplr_reg->login_redirect, 'wide' );*/ SREG_Form::related_select(array('name' => 'profile_redirect', 'label' => __('Redirect default profile page', 'simplr-registration-form'), 'required' => false, 'post_type' => 'page', 'comment' => __('Use this option to force users to access only their "front" end profile page ... i.e. the page with the [profile_page] shortcode', 'simplr-registration-form')), @$simplr_reg->profile_redirect, 'wide chzn'); SREG_Form::related_select(array('name' => 'thank_you', 'label' => __('Custom Thank You Page', 'simplr-registration-form'), 'required' => false, 'post_type' => 'page', 'comment' => __('You can leave this field blank. The default behavior outputs a confirmation on the page with the registration shortcode after registering. Use this only if you want to redirect the user elsewhere after registration.', 'simplr-registration-form')), @$simplr_reg->thank_you, 'wide chzn', ''); if (is_object($simplr_reg) && isset($simplr_reg->default_email)) { $default_email = $simplr_reg->default_email; } else { $default_email = get_option('admin_email'); } SREG_Form::text(array('name' => 'default_email', 'label' => __('Default FROM Email', 'simplr-registration-form'), 'required' => false), $default_email, 'wide'); SREG_Form::radio(array('name' => 'styles', 'label' => __('Disable Plugin Styles', 'simplr-registration-form'), 'required' => 'no', 'default' => 'no'), @$simplr_reg->styles, '', array('yes' => __('Yes', 'simplr-registration-form'), 'no' => __('No', 'simplr-registration-form'))); if (isset($simplr_reg->styles) && $simplr_reg->styles != 'yes') { SREG_Form::select(array('name' => 'style_skin', 'label' => __('Select a style', 'simplr-registration-form'), 'required' => 'no', 'default' => 'default.css', 'helper' => 'skins'), @$simplr_reg->style_skin, '', ''); SREG_Form::text(array('name' => 'stylesheet', 'label' => __('Override Default Stylesheet', 'simplr-registration-form'), 'required' => false, 'comment' => __('Specify a custom stylesheet. Will not apply if "Plugin Styles" are disabled', 'simplr-registration-form')), @$simplr_reg->stylesheet, 'wide'); } /*Deprecated: All registration forms now have custom messages. SREG_Form::textarea(array( 'name'=>'email_message', 'label'=>'Email Message', 'required'=>false ), @$simplr_reg->email_message, 'wide', array('95%','200px') );*/ ?> <?php echo wp_nonce_field(-1, "reg-main"); ?> <p class="submit">
style="display:none;"<?php } ?> > <?php SREG_Form::text(array('name' => 'fb_app_id', 'label' => __('Facebook App ID', 'simplr-registration-form'), 'required' => false), $simplr_reg->fb_app_id, 'wide'); /*SREG_Form::text(array( 'name'=>'fb_app_key', 'label'=>'Facebook Application Key', 'required'=>false ), $simplr_reg->fb_app_key, 'wide' );*/ SREG_Form::text(array('name' => 'fb_app_secret', 'label' => __('Facebook Application Secret', 'simplr-registration-form'), 'required' => false), $simplr_reg->fb_app_secret, 'wide'); SREG_Form::checkbox_group(array('name' => 'fb_request_perms', 'label' => __('Permissions to Request', 'simplr-registration-form'), 'required' => true, 'helper' => 'perms'), $simplr_reg->fb_request_perms, 'checkgroup', ''); SREG_Form::select(array('name' => 'fb_login_allow', 'label' => __('Allow users to login using their Facebook account?', 'simplr-registration-form'), 'required' => false, 'default' => 'no', 'comment' => ''), $simplr_reg->fb_login_allow, 'wide', array('yes' => 'Yes', 'no' => 'No')); SREG_Form::text(array('name' => 'fb_login_redirect', 'label' => __('Facebook Login Redirect', 'simplr-registration-form'), 'required' => false, 'comment' => __('Where should the user be redirected after logging in with Facebook.', 'simplr-registration-form')), esc_attr($simplr_reg->fb_login_redirect), 'wide'); SREG_Form::checkbox(array('name' => 'fb_auto_register', 'label' => __("Auto-Register", 'simplr-registration-form'), 'required' => false, 'comment' => __("Enabling this option will automatically register and login the user after agreeing to connect your application to his/her profile.", 'simplr-registration-form')), $simplr_reg->fb_auto_register, 'checkbox'); ?> </div> <?php echo wp_nonce_field(-1, "fb-api"); ?> <p class="submit"> <input type="submit" class="button-primary" name="fb-submit" value="<?php _e('Save Changes', 'simplr-registration-form'); ?> " /> </p> </form>
<?php SREG_Form::radio(array('name' => 'show_in_profile', 'label' => __('Show this field in user profile?', 'simplr-registration-form'), 'default' => 'yes'), esc_attr(@$field->show_in_profile), 'wide', array('yes' => __('Yes', 'simplr-registration-form'), 'no' => __('No', 'simplr-registration-form'))); ?> <?php SREG_Form::select(array('name' => 'type', 'label' => __('Type', 'simplr-registration-form'), 'default' => 'text'), esc_attr($field->type ? $field->type : 'text'), 'wide', array('text' => __('Text Field', 'simplr-registration-form'), 'textarea' => __('Textarea', 'simplr-registration-form'), 'select' => __('Multiple Choice: Select Box', 'simplr-registration-form'), 'radio' => __('Multiple Choice: Radio Buttons', 'simplr-registration-form'), 'date' => __('Date Field', 'simplr-registration-form'), 'checkbox' => __('Checkbox', 'simplr-registration-form'), 'hidden' => __('Hidden Field', 'simplr-registration-form'), 'callback' => __('Callback Function', 'simplr-registration-form')), 'type-select'); ?> <div id="choices"> <?php $comment = __('<strong>Checkbox: </strong> Option not used.', 'simplr-registration-form') . '<br />' . __('<strong>Text Field:</strong> Option is not used.', 'simplr-registration-form') . '<br />' . __('<strong>Multiple Choice:</strong> Separate multiple options with a comma (i.e. yes,no).', 'simplr-registration-form') . '<br />' . __('<strong>Date:</strong> Option is used to determine range of available dates. Enter two years separated by commas. i.e. 2000,2015.', 'simplr-registration-form') . '<br />' . __('<strong>Textarea:</strong> Option is used to determine height and width of text box. Enter dimensions width them height, separated by a comma (i.e. <em>300px,100px</em> would generate a box that is 300 pixels wide and 100 pixels tall).', 'simplr-registration-form') . '<br />' . __('<strong>Hidden Field:</strong> Option determines the value that will be passed to the hidden field.', 'simplr-registration-form'); ?> <?php $values = isset($field->options_array) ? implode(',', @$field->options_array) : null; ?> <?php SREG_Form::text(array('name' => 'options_array', 'label' => __('Options', 'simplr-registration-form'), 'comment' => $comment), $values, ''); ?> <br class="clear" /> </div> <?php echo wp_nonce_field(-1, "reg-field"); ?> <p> <?php $submit_value = $_GET['action'] == 'edit' ? __('Save Changes', 'simplr-registration-form') : __('Add Field', 'simplr-registration-form'); ?> <input type="submit" name="submit-field" value="<?php echo $submit_value; ?>
?> <?php SREG_Form::text(array('name' => 'mod_email_subj', 'label' => __('Email Subject Line', 'simplr-registration-form'), 'required' => false, 'default' => __("Welcome to %%blogname%%", 'simplr-registration-form')), $simplr_reg->mod_email_subj, 'text input'); ?> <?php SREG_Form::textarea(array('name' => 'mod_email', 'label' => __('Moderation Email', 'simplr-registration-form'), 'required' => false, 'comment' => __("You can use user submitted values in this field by wrapping them in %%. For instance to use the value of the field 'first_name' you would type 'Welcome, %%first_name%% '. Use %%link%% for the activation link. ", 'simplr-registration-form'), 'default' => __("hello", 'simplr-registration-form')), $simplr_reg->mod_email, 'textarea wide', array('500px', '150px')); ?> <?php $roles = new WP_Roles(); ?> <?php SREG_Form::select(array('name' => 'mod_roles[]', 'label' => __('Roles', 'simplr-registration-form'), 'multiple' => true, 'comment' => __("Which user roles can moderate new users.", 'simplr-registration-form'), 'required' => true), $simplr_reg->mod_roles, 'wide chzn alignleft', $roles->get_names()); ?> <?php SREG_Form::text(array('name' => 'mod_email_activated_subj', 'label' => __('Account Activated Email Subject Line', 'simplr-registration-form'), 'required' => false), $simplr_reg->mod_email_activated_subj, 'text input'); ?> <?php SREG_Form::textarea(array('name' => 'mod_email_activated', 'label' => __('Account Activated Email', 'simplr-registration-form'), 'required' => false, 'comment' => __("This email is sent to alert the user their account was activated.", 'simplr-registration-form')), $simplr_reg->mod_email_activated, 'textarea wide', array('500px', '150px')); ?> </div> <p class="submit"> <?php wp_nonce_field('reg-mod', -1); ?> <input type="submit" name="mod-submit" class="button button-primary" value="<?php _e('Submit', 'simplr-registration-form'); ?> " /> </p>