本文整理汇总了PHP中wpmem_create_formfield函数的典型用法代码示例。如果您正苦于以下问题:PHP wpmem_create_formfield函数的具体用法?PHP wpmem_create_formfield怎么用?PHP wpmem_create_formfield使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpmem_create_formfield函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wpmem_user_profile
/**
* add WP-Members fields to the WP user profile screen.
*
* @since 2.6.5
*
* @global int $user_id
*/
function wpmem_user_profile()
{
global $wpmem, $user_id;
/**
* Filter the heading for the user profile additional fields.
*
* @since 2.9.1
*
* @param string The default heading.
*/
?>
<h3><?php
echo apply_filters('wpmem_user_profile_heading', __('Additional Information', 'wp-members'));
?>
</h3>
<table class="form-table">
<?php
// Get fields.
$wpmem_fields = $wpmem->fields;
//get_option( 'wpmembers_fields' );
// Get excluded meta.
$exclude = wpmem_get_excluded_meta('user-profile');
foreach ($wpmem_fields as $meta) {
$val = get_user_meta($user_id, $meta[2], true);
$valtochk = '';
$chk_tos = true;
if ($meta[2] == 'tos' && $val == 'agree') {
$chk_tos = false;
echo wpmem_create_formfield($meta[2], 'hidden', $val);
}
// Do we exclude the row?
$chk_pass = in_array($meta[2], $exclude) ? false : true;
if ($meta[4] == "y" && $meta[6] == "n" && $chk_tos && $chk_pass) {
// If there are any required fields.
$req = $meta[5] == 'y' ? ' <span class="description">' . __('(required)') . '</span>' : '';
$show_field = '
<tr>
<th><label>' . __($meta[1], 'wp-members') . $req . '</label></th>
<td>';
$val = get_user_meta($user_id, $meta[2], true);
if ($meta[3] == 'checkbox' || $meta[3] == 'select') {
$valtochk = $val;
$val = $meta[7];
}
$show_field .= wpmem_create_formfield($meta[2], $meta[3], $val, $valtochk) . '
</td>
</tr>';
/**
* Filter the field for user profile additional fields.
*
* @since 2.9.1
*
* @parma string $show_field The HTML string of the additional field.
*/
echo apply_filters('wpmem_user_profile_field', $show_field);
}
}
?>
</table><?php
}
开发者ID:nospor,项目名称:wp-members,代码行数:67,代码来源:users.php
示例2: wpmem_inc_registration
/**
* Registration Form Dialog.
*
* Outputs the form for new user registration and existing user edits.
*
* @since 2.5.1
*
* @param string $toggle (optional) Toggles between new registration ('new') and user profile edit ('edit').
* @param string $heading (optional) The heading text for the form, null (default) for new registration.
* @global string $wpmem_regchk Used to determine if the form is in an error state.
* @global array $userdata Used to get the user's registration data if they are logged in (user profile edit).
* @return string $form The HTML for the entire form as a string.
*/
function wpmem_inc_registration($toggle = 'new', $heading = '', $redirect_to = null)
{
global $wpmem, $wpmem_regchk, $userdata;
// Set up default wrappers.
$defaults = array('heading_before' => '<legend>', 'heading_after' => '</legend>', 'fieldset_before' => '<fieldset>', 'fieldset_after' => '</fieldset>', 'main_div_before' => '<div id="wpmem_reg">', 'main_div_after' => '</div>', 'txt_before' => '[wpmem_txt]', 'txt_after' => '[/wpmem_txt]', 'row_before' => '', 'row_after' => '', 'buttons_before' => '<div class="button_div">', 'buttons_after' => '</div>', 'form_id' => '', 'form_class' => 'form', 'button_id' => '', 'button_class' => 'buttons', 'req_mark' => '<span class="req">*</span>', 'req_label' => '<span class="req">*</span>' . __('Required field', 'wp-members'), 'req_label_before' => '<div class="req-text">', 'req_label_after' => '</div>', 'show_clear_form' => false, 'clear_form' => __('Reset Form', 'wp-members'), 'submit_register' => __('Register'), 'submit_update' => __('Update Profile', 'wp-members'), 'strip_breaks' => true, 'use_nonce' => false, 'wrap_inputs' => true, 'n' => "\n", 't' => "\t");
/**
* Filter the default form arguments.
*
* This filter accepts an array of various elements to replace the form defaults. This
* includes default tags, labels, text, and small items including various booleans.
*
* @since 2.9.0
*
* @param array An array of arguments to merge with defaults. Default null.
* @param string $toggle Toggle new registration or profile update. new|edit.
*/
$args = apply_filters('wpmem_register_form_args', '', $toggle);
// Merge $args with defaults.
$args = wp_parse_args($args, $defaults);
// Username is editable if new reg, otherwise user profile is not.
if ($toggle == 'edit') {
// This is the User Profile edit - username is not editable.
$val = $userdata->user_login;
$label = '<label for="username" class="text">' . __('Username') . '</label>';
$input = '<p class="noinput">' . $val . '</p>';
$field_before = $args['wrap_inputs'] ? '<div class="div_text">' : '';
$field_after = $args['wrap_inputs'] ? '</div>' : '';
} else {
// This is a new registration.
$val = isset($_POST['log']) ? stripslashes($_POST['log']) : '';
$label = '<label for="username" class="text">' . __('Choose a Username', 'wp-members') . $args['req_mark'] . '</label>';
$input = wpmem_create_formfield('log', 'text', $val, '', 'username');
}
$field_before = $args['wrap_inputs'] ? '<div class="div_text">' : '';
$field_after = $args['wrap_inputs'] ? '</div>' : '';
// Add the username row to the array.
$rows['username'] = array('order' => 0, 'meta' => 'username', 'type' => 'text', 'value' => $val, 'row_before' => $args['row_before'], 'label' => $label, 'field_before' => $field_before, 'field' => $input, 'field_after' => $field_after, 'row_after' => $args['row_after']);
/**
* Filter the array of form fields.
*
* The form fields are stored in the WP options table as wpmembers_fields. This
* filter can filter that array after the option is retreived before the fields
* are parsed. This allows you to change the fields that may be used in the form
* on the fly.
*
* @since 2.9.0
*
* @param array The array of form fields.
* @param string $toggle Toggle new registration or profile update. new|edit.
*/
$wpmem_fields = apply_filters('wpmem_register_fields_arr', $wpmem->fields, $toggle);
// Loop through the remaining fields.
foreach ($wpmem_fields as $field) {
// Start with a clean row.
$val = '';
$label = '';
$input = '';
$field_before = '';
$field_after = '';
// Skips user selected passwords for profile update.
$pass_arr = array('password', 'confirm_password', 'password_confirm');
$do_row = $toggle == 'edit' && in_array($field[2], $pass_arr) ? false : true;
// Skips tos, makes tos field hidden on user edit page, unless they haven't got a value for tos.
if ($field[2] == 'tos' && $toggle == 'edit' && get_user_meta($userdata->ID, 'tos', true)) {
$do_row = false;
$hidden_tos = wpmem_create_formfield($field[2], 'hidden', get_user_meta($userdata->ID, 'tos', true));
}
// If the field is set to display and we aren't skipping, construct the row.
if ($field[4] == 'y' && $do_row == true) {
// Label for all but TOS.
if ($field[2] != 'tos') {
$class = $field[3] == 'password' ? 'text' : $field[3];
$label = '<label for="' . $field[2] . '" class="' . $class . '">' . __($field[1], 'wp-members');
$label = $field[5] == 'y' ? $label . $args['req_mark'] : $label;
$label = $label . '</label>';
}
// Gets the field value for both edit profile and submitted reg w/ error.
if ($toggle == 'edit' && $wpmem_regchk != 'updaterr') {
switch ($field[2]) {
case 'description':
$val = htmlspecialchars(get_user_meta($userdata->ID, 'description', 'true'));
break;
case 'user_email':
case 'confirm_email':
$val = sanitize_email($userdata->user_email);
break;
case 'user_url':
//.........这里部分代码省略.........
开发者ID:scottnkerr,项目名称:eeco,代码行数:101,代码来源:forms.php
示例3: wpmem_do_wp_newuser_form
/**
* Appends WP-Members registration fields to Users > Add New User screen.
*
* @since 2.9.0
*/
function wpmem_do_wp_newuser_form()
{
global $wpmem;
echo '<table class="form-table"><tbody>';
$wpmem_fields = $wpmem->fields;
//get_option( 'wpmembers_fields' );
$exclude = wpmem_get_excluded_meta('register');
foreach ($wpmem_fields as $field) {
if ($field[6] == 'n' && !in_array($field[2], $exclude)) {
$req = $field[5] == 'y' ? ' <span class="description">' . __('(required)') . '</span>' : '';
echo '<tr>
<th scope="row">
<label for="' . $field[2] . '">' . __($field[1], 'wp-members') . $req . '</label>
</th>
<td>';
// determine the field type and generate accordingly.
switch ($field[3]) {
case 'select':
$val = isset($_POST[$field[2]]) ? $_POST[$field[2]] : '';
echo wpmem_create_formfield($field[2], $field[3], $field[7], $val);
break;
case 'textarea':
echo '<textarea name="' . $field[2] . '" id="' . $field[2] . '" class="textarea">';
echo isset($_POST[$field[2]]) ? esc_textarea($_POST[$field[2]]) : '';
echo '</textarea>';
break;
case 'checkbox':
$val = isset($_POST[$field[2]]) ? $_POST[$field[2]] : '';
$val = !$_POST && $field[8] == 'y' ? $field[7] : $val;
echo wpmem_create_formfield($field[2], $field[3], $field[7], $val);
break;
default:
echo '<input type="' . $field[3] . '" name="' . $field[2] . '" id="' . $field[2] . '" class="input" value="';
echo isset($_POST[$field[2]]) ? esc_attr($_POST[$field[2]]) : '';
echo '" size="25" />';
break;
}
echo '</td>
</tr>';
}
}
echo '</tbody></table>';
}
开发者ID:scottnkerr,项目名称:eeco,代码行数:48,代码来源:wp-registration.php
示例4: wpmem_admin_fields
/**
* Add WP-Members fields to the WP user profile screen.
*
* @since 2.1
*
* @global array $current_screen The WordPress screen object
* @global int $user_ID The user ID
*/
function wpmem_admin_fields()
{
global $current_screen, $user_ID, $wpmem;
$user_id = $current_screen->id == 'profile' ? $user_ID : $_REQUEST['user_id'];
?>
<h3><?php
/**
* Filter the heading for additional profile fields.
*
* @since 2.8.2
*
* @param string The default additional fields heading.
*/
echo apply_filters('wpmem_admin_profile_heading', __('WP-Members Additional Fields', 'wp-members'));
?>
</h3>
<table class="form-table">
<?php
// Get fields.
$wpmem_fields = $wpmem->fields;
// get_option( 'wpmembers_fields' );
// Get excluded meta.
$exclude = wpmem_get_excluded_meta('admin-profile');
/**
* Fires at the beginning of generating the WP-Members fields in the user profile.
*
* @since 2.9.3
*
* @param int $user_id The user's ID.
* @param array $wpmem_fields The WP-Members fields.
*/
do_action('wpmem_admin_before_profile', $user_id, $wpmem_fields);
foreach ($wpmem_fields as $meta) {
$valtochk = '';
// Determine which fields to show in the additional fields area.
$show = $meta[6] == 'n' && !in_array($meta[2], $exclude) ? true : false;
$show = $meta[1] == 'TOS' && $meta[4] != 'y' ? null : $show;
if ($show) {
// Is the field required?
$req = $meta[5] == 'y' ? ' <span class="description">' . __('(required)') . '</span>' : '';
$show_field = '
<tr>
<th><label>' . __($meta[1], 'wp-members') . $req . '</label></th>
<td>';
$val = htmlspecialchars(get_user_meta($user_id, $meta[2], true));
if ($meta[3] == 'checkbox' || $meta[3] == 'select') {
$valtochk = $val;
$val = $meta[7];
}
$show_field .= wpmem_create_formfield($meta[2], $meta[3], $val, $valtochk) . '
</td>
</tr>';
/**
* Filter the profile field.
*
* @since 2.8.2
*
* @param string $show_field The HTML string for the additional profile field.
*/
echo apply_filters('wpmem_admin_profile_field', $show_field);
}
}
// See if reg is moderated, and if the user has been activated.
if ($wpmem->mod_reg == 1) {
$user_active_flag = get_user_meta($user_id, 'active', true);
switch ($user_active_flag) {
case '':
$label = __('Activate this user?', 'wp-members');
$action = 1;
break;
case 0:
$label = __('Reactivate this user?', 'wp-members');
$action = 1;
break;
case 1:
$label = __('Deactivate this user?', 'wp-members');
$action = 0;
break;
}
?>
<tr>
<th><label><?php
echo $label;
?>
</label></th>
<td><input id="activate_user" type="checkbox" class="input" name="activate_user" value="<?php
echo $action;
?>
" /></td>
</tr>
//.........这里部分代码省略.........
开发者ID:Geragamer,项目名称:hatalmas-project,代码行数:101,代码来源:user-profile.php
示例5: wpmem_a_build_captcha_options
//.........这里部分代码省略.........
<tr valign="top">
<th scope="row"><?php
_e('reCAPTCHA Keys', 'wp-members');
?>
</th>
<td>
<?php
printf(__('reCAPTCHA requires an API key, consisting of a "public" and a "private" key. You can sign up for a %s free reCAPTCHA key%s', 'wp-members'), "<a href=\"https://www.google.com/recaptcha/admin#whyrecaptcha\" target=\"_blank\">", '</a>');
?>
.<br />
<?php
_e('Public Key', 'wp-members');
?>
: <input type="text" name="wpmem_captcha_publickey" size="50" value="<?php
echo $public_key;
?>
" /><br />
<?php
_e('Private Key', 'wp-members');
?>
: <input type="text" name="wpmem_captcha_privatekey" size="50" value="<?php
echo $private_key;
?>
" />
</td>
</tr>
<tr valign="top">
<th scope="row"><?php
_e('Choose Theme', 'wp-members');
?>
</th>
<td>
<select name="wpmem_captcha_theme"><?php
echo wpmem_create_formfield(__('Red', 'wp-members'), 'option', 'red', $captcha_theme);
echo wpmem_create_formfield(__('White', 'wp-members'), 'option', 'white', $captcha_theme);
echo wpmem_create_formfield(__('Black Glass', 'wp-members'), 'option', 'blackglass', $captcha_theme);
echo wpmem_create_formfield(__('Clean', 'wp-members'), 'option', 'clean', $captcha_theme);
?>
</select>
</td>
</tr>
<?php
// if reCAPTCHA v2 is enabled...
} elseif ($wpmem->captcha == 3) {
$show_update_button = true;
$private_key = isset($wpmem_captcha['recaptcha']) ? $wpmem_captcha['recaptcha']['private'] : '';
$public_key = isset($wpmem_captcha['recaptcha']) ? $wpmem_captcha['recaptcha']['public'] : '';
?>
<tr valign="top">
<th scope="row"><?php
_e('reCAPTCHA Keys', 'wp-members');
?>
</th>
<td>
<?php
printf(__('reCAPTCHA requires an API key, consisting of a "site" and a "secret" key. You can sign up for a %s free reCAPTCHA key%s', 'wp-members'), "<a href=\"https://www.google.com/recaptcha/admin#whyrecaptcha\" target=\"_blank\">", '</a>');
?>
.<br />
<?php
_e('Site Key', 'wp-members');
?>
: <input type="text" name="wpmem_captcha_publickey" size="50" value="<?php
echo $public_key;
?>
" /><br />
<?php
开发者ID:rushyendra1,项目名称:cportalWP,代码行数:67,代码来源:tab-captcha.php
示例6: wpmem_admin_fields
/**
* Add WP-Members fields to the WP user profile screen.
*
* @since 2.1
*
* @global array $current_screen The WordPress screen object
* @global int $user_ID The user ID
*/
function wpmem_admin_fields()
{
global $current_screen, $user_ID, $wpmem;
$user_id = $current_screen->id == 'profile' ? $user_ID : $_REQUEST['user_id'];
?>
<h3><?php
/**
* Filter the heading for additional profile fields.
*
* @since 2.8.2
*
* @param string The default additional fields heading.
*/
echo apply_filters('wpmem_admin_profile_heading', __('WP-Members Additional Fields', 'wp-members'));
?>
</h3>
<table class="form-table">
<?php
// Get fields.
$wpmem_fields = $wpmem->fields;
// get_option( 'wpmembers_fields' );
// Get excluded meta.
$exclude = wpmem_get_excluded_meta('admin-profile');
/**
* Fires at the beginning of generating the WP-Members fields in the user profile.
*
* @since 2.9.3
*
* @param int $user_id The user's ID.
* @param array $wpmem_fields The WP-Members fields.
*/
do_action('wpmem_admin_before_profile', $user_id, $wpmem_fields);
// Assemble form rows array.
$rows = array();
foreach ($wpmem_fields as $meta) {
$valtochk = '';
$values = '';
// Determine which fields to show in the additional fields area.
$show = $meta[6] == 'n' && !in_array($meta[2], $exclude) ? true : false;
$show = $meta[1] == 'TOS' && $meta[4] != 'y' ? null : $show;
if ($show) {
$val = get_user_meta($user_id, $meta[2], true);
$val = $meta[3] == 'multiselect' || $meta[3] == 'multicheckbox' ? $val : htmlspecialchars($val);
if ($meta[3] == 'checkbox') {
$valtochk = $val;
$val = $meta[7];
}
if ('multicheckbox' == $meta[3] || 'select' == $meta[3] || 'multiselect' == $meta[3] || 'radio' == $meta[3]) {
$values = $meta[7];
$valtochk = $val;
}
// Is this an image or a file?
if ('file' == $meta[3] || 'image' == $meta[3]) {
$attachment_url = wp_get_attachment_url($val);
$empty_file = '<span class="description">' . __('None') . '</span>';
if ('file' == $meta[3]) {
$input = $attachment_url ? '<a href="' . $attachment_url . '">' . $attachment_url . '</a>' : $empty_file;
} else {
$input = $attachment_url ? '<img src="' . $attachment_url . '">' : $empty_file;
}
// @todo - come up with a way to handle file updates - user profile form does not support multitype
//$show_field.= ' <span class="description">' . __( 'Update this file:' ) . '</span><br />';
//$show_field.= wpmem_create_formfield( $meta[2] . '_update_file', $meta[3], $val, $valtochk );
} else {
if ('select' == $meta[3] || 'radio' == $meta[3]) {
$input = wpmem_create_formfield($meta[2], $meta[3], $values, $valtochk);
} elseif ('multicheckbox' == $meta[3] || 'multiselect' == $meta[3]) {
$delimiter = isset($meta[8]) ? $meta[8] : '|';
$input = $wpmem->forms->create_form_field(array('name' => $meta[2], 'type' => $meta[3], 'value' => $values, 'compare' => $valtochk, 'delimiter' => $delimiter));
} else {
$meta[3] = 'hidden' == $meta[3] ? 'text' : $meta[3];
$input = wpmem_create_formfield($meta[2], $meta[3], $val, $valtochk);
}
}
// Is the field required?
$req = $meta[5] == 'y' ? ' <span class="description">' . __('(required)') . '</span>' : '';
$label = '<label>' . __($meta[1], 'wp-members') . $req . '</label>';
// Build the form rows for filtering.
$rows[$meta[2]] = array('order' => $meta[0], 'meta' => $meta[2], 'type' => $meta[3], 'value' => $val, 'values' => $values, 'label_text' => __($meta[1], 'wp-members'), 'row_before' => '', 'label' => $label, 'field_before' => '', 'field' => $input, 'field_after' => '', 'row_after' => '');
}
}
/**
* Filter for rows
*
* @since 3.1.0
*
* @param array $rows
* @param string $toggle
*/
$rows = apply_filters('wpmem_register_form_rows_admin', $rows, 'adminprofile');
// Handle form rows display from array.
//.........这里部分代码省略.........
开发者ID:pab44,项目名称:pab44,代码行数:101,代码来源:user-profile.php
示例7: wpmem_a_build_captcha_options
/**
* builds the captcha options
*
* @since 2.4.0
*/
function wpmem_a_build_captcha_options()
{
$wpmem_captcha = get_option('wpmembers_captcha');
$url = home_url();
?>
<div class="metabox-holder has-right-sidebar">
<div class="inner-sidebar">
<?php
wpmem_a_meta_box();
?>
<div class="postbox">
<h3><span><?php
_e('Need help?', 'wp-members');
?>
</span></h3>
<div class="inside">
<strong><i>See the <a href="http://rocketgeek.com/plugins/wp-members/users-guide/registration/using-captcha/" target="_blank">Users Guide on reCAPTCHA</a>.</i></strong>
</div>
</div>
</div> <!-- .inner-sidebar -->
<div id="post-body">
<div id="post-body-content">
<div class="postbox">
<h3><?php
_e('Manage reCAPTCHA Options', 'wp-members');
?>
</h3>
<div class="inside">
<form name="updatecaptchaform" id="updatecaptchaform" method="post" action="<?php
echo $_SERVER['REQUEST_URI'];
?>
">
<?php
wp_nonce_field('wpmem-update-captcha');
?>
<table class="form-table">
<tr>
<td colspan="2">
<p><?php
_e('reCAPTCHA is a free, accessible CAPTCHA service that helps to digitize books while blocking spam on your blog.', 'wp-members');
?>
</p>
<p><?php
printf(__('reCAPTCHA asks commenters to retype two words scanned from a book to prove that they are a human. This verifies that they are not a spambot while also correcting the automatic scans of old books. So you get less spam, and the world gets accurately digitized books. Everybody wins! For details, visit the %s reCAPTCHA website%s', 'wp-members'), '<a href="http://recaptcha.net/" target="_blank">', '</a>');
?>
.</p>
<p>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php
_e('reCAPTCHA Keys', 'wp-members');
?>
</th>
<td>
<?php
printf(__('reCAPTCHA requires an API key, consisting of a "public" and a "private" key. You can sign up for a %s free reCAPTCHA key%s', 'wp-members'), "<a href=\"http://recaptcha.net/api/getkey?domain={$url}&app=wordpress\" target=\"_blank\">", '</a>');
?>
.<br />
<?php
_e('Public Key', 'wp-members');
?>
: <input type="text" name="wpmem_captcha_publickey" size="50" value="<?php
echo $wpmem_captcha[0];
?>
" /><br />
<?php
_e('Private Key', 'wp-members');
?>
: <input type="text" name="wpmem_captcha_privatekey" size="50" value="<?php
echo $wpmem_captcha[1];
?>
" />
</td>
</tr>
<tr valign="top">
<th scope="row"><?php
_e('Choose Theme', 'wp-members');
?>
</th>
<td>
<select name="wpmem_captcha_theme">
<!--<?php
echo wpmem_create_formfield(__('WP-Members', 'wp-members'), 'option', 'custom', $wpmem_captcha[2]);
?>
--><?php
echo wpmem_create_formfield(__('Red', 'wp-members'), 'option', 'red', $wpmem_captcha[2]);
echo wpmem_create_formfield(__('White', 'wp-members'), 'option', 'white', $wpmem_captcha[2]);
echo wpmem_create_formfield(__('Black Glass', 'wp-members'), 'option', 'blackglass', $wpmem_captcha[2]);
echo wpmem_create_formfield(__('Clean', 'wp-members'), 'option', 'clean', $wpmem_captcha[2]);
?>
<!--<?php
//.........这里部分代码省略.........
开发者ID:googlecode-mirror,项目名称:wpmu-demo,代码行数:101,代码来源:tab-captcha.php
示例8: 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();
}*/
$redirect_to = isset($_REQUEST['redirect_to']) ? esc_url($_REQUEST['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]<div id="wpmem_login">
<a name="login"></a>
<form action="' . get_permalink() . '" method="POST" class="form">
<fieldset>
<legend>' . $arr[0] . '</legend>
<label for="username">' . $arr[1] . '</label>
<div class="div_text">
' . wpmem_create_formfield($arr[3], $arr[2], '', '', $arr[9]) . '
</div>
<label for="password">' . $arr[4] . '</label>
<div class="div_text">
' . wpmem_create_formfield($arr[6], $arr[5], '', '', $arr[10]) . '
</div>
<input type="hidden" name="redirect_to" value="' . $redirect_to . '" />';
if ($arr[7] != 'login') {
$form = $form . wpmem_create_formfield('formsubmit', 'hidden', '1');
}
$form = $form . wpmem_create_formfield('a', 'hidden', $arr[7]);
$form = $form . '<div class="button_div">';
if ($arr[7] == 'login') {
$form = $form . '<input name="rememberme" type="checkbox" id="rememberme" value="forever" /> ' . __('Remember me', 'wp-members') . ' <input type="submit" name="Submit" value="' . $arr[8] . '" class="buttons" />';
} else {
$form = $form . '<input type="submit" name="Submit" value="' . $arr[8] . '" class="buttons" />';
}
$form = $form . '</div>
<div class="clear"></div>
<div align="right">';
if ((WPMEM_MSURL != null || $page == 'members') && $arr[7] == 'login') {
$link = apply_filters('wpmem_forgot_link', wpmem_chk_qstr(WPMEM_MSURL) . 'a=pwdreset');
$form = $form . __('Forgot password?', 'wp-members') . ' <a href="' . $link . '">' . __('Click here to reset', 'wp-members') . '</a>';
}
$form = $form . '</div>
<div align="right">';
if (WPMEM_REGURL != null && $arr[7] == 'login') {
$link = apply_filters('wpmem_reg_link', WPMEM_REGURL);
$form = $form . __('New User?', 'wp-members') . ' <a href="' . $link . '">' . __('Click here to register', 'wp-members') . '</a>';
}
$form = $form . '</div>
<div class="clear"></div>
</fieldset></form>
</div>[/wpmem_txt]';
$form = apply_filters('wpmem_login_form', $form);
return $form;
}
开发者ID:googlecode-mirror,项目名称:wpmu-demo,代码行数:79,代码来源:wp-members-dialogs.php
示例9: wpmem_a_build_options
/**
* Builds the settings panel.
*
* @since 2.2.2
*/
function wpmem_a_build_options()
{
global $wpmem;
/** This filter is documented in wp-members/inc/email.php */
$admin_email = apply_filters('wpmem_notify_addr', get_option('admin_email'));
$chg_email = __(sprintf('%sChange%s or %sFilter%s this address', '<a href="' . site_url('wp-admin/options-general.php', 'admin') . '">', '</a>', '<a href="http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_notify_addr/">', '</a>'), 'wp-members');
$help_link = __(sprintf('See the %sUsers Guide on plugin options%s.', '<a href="http://rocketgeek.com/plugins/wp-members/users-guide/plugin-settings/options/" target="_blank">', '</a>'), 'wp-members');
// Build an array of post types
$post_types = get_post_types(array('public' => true, '_builtin' => false), 'names', 'and');
$post_arr = array('post' => 'Posts', 'page' => 'Pages');
if ($post_types) {
foreach ($post_types as $post_type) {
$cpt_obj = get_post_type_object($post_type);
$post_arr[$cpt_obj->name] = $cpt_obj->labels->name;
}
}
?>
<div class="metabox-holder has-right-sidebar">
<div class="inner-sidebar">
<?php
wpmem_a_meta_box();
?>
<div class="postbox">
<h3><span><?php
_e('Need help?', 'wp-members');
?>
</span></h3>
<div class="inside">
<strong><i><?php
echo $help_link;
?>
</i></strong>
</div>
</div>
<?php
wpmem_a_rss_box();
?>
</div> <!-- .inner-sidebar -->
<div id="post-body">
<div id="post-body-content">
<div class="postbox">
<h3><span><?php
_e('Manage Options', 'wp-members');
?>
</span></h3>
<div class="inside">
<form name="updatesettings" id="updatesettings" method="post" action="<?php
echo $_SERVER['REQUEST_URI'];
?>
">
<?php
wp_nonce_field('wpmem-update-settings');
?>
<h3><?php
_e('Content', 'wp-members');
?>
</h3>
<ul>
<?php
// Content Blocking option group.
$i = 0;
$len = count($post_arr);
foreach ($post_arr as $key => $val) {
if ($key == 'post' || $key == 'page' || isset($wpmem->post_types) && array_key_exists($key, $wpmem->post_types)) {
?>
<li<?php
echo $i == $len - 1 ? ' style="border-bottom:1px solid #eee;"' : '';
?>
>
<label><?php
echo $i == 0 ? 'Content Blocking' : ' ';
?>
</label>
<?php
$block = isset($wpmem->block[$key]) ? $wpmem->block[$key] : '';
$values = array(__('Do not block', 'wp-members') . '|0', __('Block', 'wp-members') . '|1');
echo wpmem_create_formfield('wpmem_block_' . $key, 'select', $values, $block);
?>
<span><?php
echo $val;
?>
</span>
</li>
<?php
$i++;
}
}
// Show Excerpts, Login Form, and Registration Form option groups.
$option_group_array = array('show_excerpt' => __('Show Excerpts', 'wp-members'), 'show_login' => __('Show Login Form', 'wp-members'), 'show_reg' => __('Show Registration Form', 'wp-members'), 'autoex' => __('Auto Excerpt:', 'wp-members'));
foreach ($option_group_array as $item_key => $item_val) {
$i = 0;
$len = count($post_arr);
//.........这里部分代码省略.........
开发者ID:pab44,项目名称:pab44,代码行数:101,代码来源:tab-options.php
示例10: wpmem_a_field_table
//.........这里部分代码省略.........
">
<td width="10%"><?php
$can_delete = $wpmem_fields[$row][2] == 'user_nicename' || $wpmem_fields[$row][2] == 'display_name' || $wpmem_fields[$row][2] == 'nickname' ? 'y' : 'n';
if ($can_delete == 'y' || $wpmem_fields[$row][6] != 'y') {
?>
<input type="checkbox" name="<?php
echo "del_" . $wpmem_fields[$row][2];
?>
" value="delete" /> <?php
_e('Delete', 'wp-members');
}
?>
</td>
<td width="15%"><?php
_e($wpmem_fields[$row][1], 'wp-members');
if ($wpmem_fields[$row][5] == 'y') {
?>
<font color="red">*</font><?php
}
?>
</td>
<td width="15%"><?php
echo $wpmem_fields[$row][2];
?>
</td>
<td width="10%"><?php
echo $wpmem_fields[$row][3];
?>
</td>
<?php
if ($wpmem_fields[$row][2] != 'user_email') {
?>
<td width="10%"><?php
echo wpmem_create_formfield($wpmem_fields[$row][2] . "_display", 'checkbox', 'y', $wpmem_fields[$row][4]);
?>
</td>
<td width="10%"><?php
echo wpmem_create_formfield($wpmem_fields[$row][2] . "_required", 'checkbox', 'y', $wpmem_fields[$row][5]);
?>
</td>
<?php
} else {
?>
<td colspan="2" width="20%"><small><i><?php
_e('(Email cannot be removed)', 'wp-members');
?>
</i></small></td>
<?php
}
?>
<td align="center" width="10%"><?php
if ($wpmem_fields[$row][3] == 'checkbox') {
echo wpmem_create_formfield($wpmem_fields[$row][2] . "_checked", 'checkbox', 'y', $wpmem_fields[$row][8]);
}
?>
</td>
<td width="10%"><?php
echo $wpmem_fields[$row][6] == 'y' ? 'native' : wpmem_fields_edit_link($wpmem_fields[$row][2]);
?>
</td>
<td align="center" width="10%">
<?php
$wpmem_ut_fields_skip = array('user_email', 'confirm_email', 'password', 'confirm_password');
if (!in_array($wpmem_fields[$row][2], $wpmem_ut_fields_skip)) {
?>
开发者ID:artsmorgan,项目名称:roiWP,代码行数:67,代码来源:tab-fields.php
示例11: wpmem_login_form_OLD
/**
* Login Form Dialog (Legacy)
*
* Builds the table-based form used for
* login, change password, and reset password.
*
* @param string $page
* @param array $arr
* @return string $form
*/
function wpmem_login_form_OLD($page, $arr)
{
$form = '<div class="wpmem_login">
<a name="login"></a>
<form name="form" method="post" action="' . get_permalink() . '">
<table width="400" border="0" cellspacing="0" cellpadding="4">
<tr align="left">
<td colspan="2"><h2>' . $arr[0] . '</h2></td>
</tr>
<tr>
<td width="118" align="right">' . $arr[1] . '</td>
<td width="166">' . wpmem_create_formfield($arr[3], $arr[2], '') . '</td>
</tr>
<tr>
<td width="118" align="right">' . $arr[4] . '</td>
<td width="166">' . wpmem_create_formfield($arr[6], $arr[5], '') . '</td>
</tr>';
if ($arr[7] == 'login') {
$form = $form . '<tr>
<td width="118"> </td>
<td width="166"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> ' . __('Remember me', 'wp-members') . '</td>
</tr>';
}
$form = $form . '<tr>
<td width="118"> </td>
<td width="166">
<input type="hidden" name="redirect_to" value="' . get_permalink() . '" />';
if ($arr[7] != 'login') {
$form = $form . wpmem_create_formfield('formsubmit', 'hidden', '1');
}
$form = $form . wpmem_create_formfield('a', 'hidden', $arr[7]) . '
<input type="submit" name="Submit" value="' . $arr[8] . '" />
</td>
</tr>';
if ((WPMEM_MSURL != null || $page == 'members') && $arr[7] == 'login') {
$link = wpmem_chk_qstr(WPMEM_MSURL);
$form = $form . '<tr>
<td colspan="2">' . __('Forgot password?', 'wp-members') . ' <a href="' . $link . 'a=pwdreset">' . __('Click here to reset', 'wp-members') . '</a></td>
</tr>';
}
if (WPMEM_REGURL != null && $arr[7] == 'login') {
$form = $form . '<tr>
<td colspan="2">' . __('New User?', 'wp-members') . ' <a href="' . WPMEM_REGURL . '">' . __('Click here to register', 'wp-members') . '</a></td>
</tr>';
}
$form = $form . '</table>
</form>
</div>';
return $form;
}
开发者ID:googlecode-mirror,项目名称:wpmu-demo,代码行数:60,代码来源:wp-members-deprecated.php
示例12: wpmem_admin_fields
/**
* add WP-Members fields to the WP user profile screen
*
* @since 2.1
*
* @uses apply_filters Calls wpmem_admin_profile_field
& @uses apply_filters Calls wpmem_admin_profile_heading
*
* @global array $current_screen The WordPress screen object
* @global int $user_ID The user ID
*/
function wpmem_admin_fields()
{
global $current_screen, $user_ID;
$user_id = $current_screen->id == 'profile' ? $user_ID : $_REQUEST['user_id'];
?>
<h3><?php
echo apply_filters('wpmem_admin_profile_heading', __('WP-Members Additional Fields', 'wp-members'));
?>
</h3>
<table class="form-table">
<?php
$wpmem_fields = get_option('wpmembers_fields');
$valtochk = '';
for ($row = 0; $row < count($wpmem_fields); $row++) {
/** determine which fields to show in the additional fields area */
$show = $wpmem_fields[$row][6] == 'n' && $wpmem_fields[$row][2] != 'password' ? true : false;
$show = $wpmem_fields[$row][1] == 'TOS' && $wpmem_fields[$row][4] != 'y' ? null : $show;
if ($show) {
$show_field = '
<tr>
<th><label>' . $wpmem_fields[$row][1] . '</label></th>
<td>';
$val = htmlspecialchars(get_user_meta($user_id, $wpmem_fields[$row][2], 'true'));
if ($wpmem_fields[$row][3] == 'checkbox' || $wpmem_fields[$row][3] == 'select') {
$valtochk = $val;
$val = $wpmem_fields[$row][7];
}
$show_field .= wpmem_create_formfield($wpmem_fields[$row][2], $wpmem_fields[$row][3], $val, $valtochk) . '
</td>
</tr>';
$valtochk = '';
// empty for the next field in the loop
echo apply_filters('wpmem_admin_profile_field', $show_field);
}
}
// see if reg is moderated, and if the user has been activated
if (WPMEM_MOD_REG == 1) {
$user_active_flag = get_user_meta($user_id, 'active', 'true');
switch ($user_active_flag) {
case '':
$label = __('Activate this user?', 'wp-members');
$action = 1;
break;
case 0:
$label = __('Reactivate this user?', 'wp-members');
$action = 1;
break;
case 1:
$label = __('Deactivate this user?', 'wp-members');
$action = 0;
break;
}
?>
<tr>
<th><label><?php
echo $label;
?>
</label></th>
<td><input id="activate_user" type="checkbox" class="input" name="activate_user" value="<?php
echo $action;
?>
" /></td>
</tr>
<?php
}
// if using subscription model, show expiration
// if registration is moderated, this doesn't show if user is not active yet.
if (WPMEM_USE_EXP == 1) {
if (WPMEM_MOD_REG == 1 && get_user_meta($user_id, 'active', 'true') == 1 || WPMEM_MOD_REG != 1) {
wpmem_a_extenduser($user_id);
}
}
?>
<tr>
<th><label><?php
_e('IP @ registration', 'wp-members');
?>
</label></th>
<td><?php
echo get_user_meta($user_id, 'wpmem_reg_ip', 'true');
?>
</td>
</tr>
</table><?php
}
开发者ID:googlecode-mirror,项目名称:wpmu-demo,代码行数:99,代码来源:user-profile.php
示例13: wpmem_user_profile
/**
* add WP-Members fields to the WP user profile screen
*
* @since 2.6.5
*
* @global int $user_id
*/
function wpmem_user_profile()
{
global $user_id;
?>
<h3><?php
_e('Additional Info', 'wp-members');
?>
</h3>
<table class="form-table">
<?php
$wpmem_fields = get_option('wpmembers_fields');
for ($row = 0; $row < count($wpmem_fields); $row++) {
$val = get_user_meta($user_id, $wpmem_fields[$row][2], 'true');
$chk_tos = true;
if ($wpmem_fields[$row][2] == 'tos' && $val == 'agree') {
$chk_tos = false;
echo wpmem_create_formfield($wpmem_fields[$row][2], 'hidden', $val);
}
$chk_pass = true;
if ($wpmem_fields[$row][2] == 'password') {
$chk_pass = false;
}
if ($wpmem_fields[$row][4] == "y" && $wpmem_fields[$row][6] == "n" && $chk_tos && $chk_pass) {
// if there are any required fields, set a toggle to show indicator in last line
if ($wpmem_fields[$row][5] == 'y') {
$has_req = true;
}
?>
<tr>
<th><label><?php
echo $wpmem_fields[$row][1];
?>
</label></th>
<td><?php
$val = get_user_meta($user_id, $wpmem_fields[$row][2], 'true');
if ($wpmem_fields[$row
|
请发表评论