本文整理汇总了PHP中cptch_display_captcha_custom函数的典型用法代码示例。如果您正苦于以下问题:PHP cptch_display_captcha_custom函数的具体用法?PHP cptch_display_captcha_custom怎么用?PHP cptch_display_captcha_custom使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cptch_display_captcha_custom函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_visible_fields
/**
* @param string $element_id
* @param array $attributes
* @param string $response_html
* @return string
*/
public function get_visible_fields($element_id, array $attributes = array(), $response_html = '')
{
$replacements = array('{n}' => $element_id, '{response}' => $response_html);
$visible_fields = MC4WP_Tools::replace_variables($this->content, $replacements, array_values($this->settings['lists']));
// insert captcha
if (function_exists('cptch_display_captcha_custom')) {
$captcha_fields = '<input type="hidden" name="_mc4wp_has_captcha" value="1" /><input type="hidden" name="cntctfrm_contact_action" value="true" />' . cptch_display_captcha_custom();
$visible_fields = str_ireplace(array('{captcha}', '[captcha]'), $captcha_fields, $visible_fields);
}
/**
* @filter mc4wp_form_content
* @param int $form_id The ID of the form that is being shown
* @expects string
*
* Can be used to customize the content of the form mark-up, eg adding additional fields.
*/
$visible_fields = (string) apply_filters('mc4wp_form_content', $visible_fields, $this->ID);
return $visible_fields;
}
示例2: wpmtst_add_captcha
function wpmtst_add_captcha($captcha)
{
$html = '';
switch ($captcha) {
case 'akismet':
break;
// Captcha by BestWebSoft
// Captcha by BestWebSoft
case 'bwsmath':
if (function_exists('cptch_display_captcha_custom')) {
$html .= '<input type="hidden" name="cntctfrm_contact_action" value="true">';
$html .= cptch_display_captcha_custom();
}
break;
// Really Simple Captcha by Takayuki Miyoshi
// Really Simple Captcha by Takayuki Miyoshi
case 'miyoshi':
if (class_exists('ReallySimpleCaptcha')) {
$captcha_instance = new ReallySimpleCaptcha();
$word = $captcha_instance->generate_random_word();
$prefix = mt_rand();
$image = $captcha_instance->generate_image($prefix, $word);
$html .= '<span>' . _x('Input this code:', 'Captcha', 'strong-testimonials') . ' <input type="hidden" name="captchac" value="' . $prefix . '"><img class="captcha" src="' . plugins_url('really-simple-captcha/tmp/') . $image . '"></span>';
$html .= '<input type="text" class="captcha" name="captchar" maxlength="4" size="5">';
}
break;
// Advanced noCaptcha reCaptcha by Shamim Hasan
// Advanced noCaptcha reCaptcha by Shamim Hasan
case 'advnore':
if (function_exists('anr_captcha_form_field')) {
$html .= anr_captcha_form_field(false);
}
break;
default:
// no captcha
}
return $html;
}
示例3: wppb_captcha_add_form_recover_password
function wppb_captcha_add_form_recover_password($output, $username_email = '')
{
$cptch_options = get_option('cptch_options');
if (1 == $cptch_options['cptch_lost_password_form']) {
$output = str_replace('</ul>', '<li>' . cptch_display_captcha_custom() . '</li>' . '</ul>', $output);
}
return $output;
}
示例4: form
/**
* Returns the MailChimp for WP form mark-up
*
* @param array $atts
* @param string $content
*
* @return string
*/
public function form($atts, $content = null)
{
$opts = mc4wp_get_options('form');
if (!function_exists('mc4wp_replace_variables')) {
include_once MC4WP_LITE_PLUGIN_DIR . 'includes/functions/template.php';
}
// allow developers to add css classes
$css_classes = $this->get_css_classes();
$form_action = apply_filters('mc4wp_form_action', mc4wp_get_current_url());
$content = "\n<!-- Form by MailChimp for WordPress plugin v" . MC4WP_LITE_VERSION . " - http://dannyvankooten.com/mailchimp-for-wordpress/ -->\n";
$content .= '<form method="post" action="' . $form_action . '" id="mc4wp-form-' . $this->form_instance_number . '" class="' . $css_classes . '">';
// maybe hide the form
if (!($this->success && $opts['hide_after_success'])) {
$form_markup = __($opts['markup']);
// replace special values
$form_markup = str_ireplace(array('%N%', '{n}'), $this->form_instance_number, $form_markup);
$form_markup = mc4wp_replace_variables($form_markup, array_values($opts['lists']));
// insert captcha
if (function_exists('cptch_display_captcha_custom')) {
$captcha_fields = '<input type="hidden" name="_mc4wp_has_captcha" value="1" /><input type="hidden" name="cntctfrm_contact_action" value="true" />' . cptch_display_captcha_custom();
$form_markup = str_ireplace('[captcha]', $captcha_fields, $form_markup);
}
// allow plugins to add form fieldsq
do_action('mc4wp_before_form_fields', 0);
// allow plugins to alter form content
$content .= apply_filters('mc4wp_form_content', $form_markup);
// allow plugins to add form fields
do_action('mc4wp_after_form_fields', 0);
// hidden fields
$content .= '<textarea name="_mc4wp_required_but_not_really" style="display: none !important;"></textarea>';
$content .= '<input type="hidden" name="_mc4wp_form_submit" value="1" />';
$content .= '<input type="hidden" name="_mc4wp_form_instance" value="' . $this->form_instance_number . '" />';
$content .= '<input type="hidden" name="_mc4wp_form_nonce" value="' . wp_create_nonce('_mc4wp_form_nonce') . '" />';
}
if ($this->form_instance_number === $this->submitted_form_instance) {
if ($this->success) {
$content .= '<div class="mc4wp-alert mc4wp-success">' . __($opts['text_success']) . '</div>';
} elseif ($this->error !== '') {
$api = mc4wp_get_api();
$e = $this->error;
$error_type = $e === 'already_subscribed' ? 'notice' : 'error';
$error_message = isset($opts['text_' . $e]) ? $opts['text_' . $e] : $opts['text_error'];
// allow developers to customize error message
$error_message = apply_filters('mc4wp_form_error_message', $error_message, $e);
$content .= '<div class="mc4wp-alert mc4wp-' . $error_type . '">' . __($error_message, 'mailchimp-for-wp') . '</div>';
// show the eror returned by MailChimp?
if ($api->has_error() && current_user_can('manage_options')) {
$content .= '<div class="mc4wp-alert mc4wp-error"><strong>Admin notice:</strong> ' . $api->get_error_message() . '</div>';
}
}
// endif
}
if (current_user_can('manage_options') && empty($opts['lists'])) {
$content .= '<div class="mc4wp-alert mc4wp-error"><strong>Admin notice:</strong> you have not selected a MailChimp list for this sign-up form to subscribe to yet. <a href="' . admin_url('admin.php?page=mc4wp-lite-form-settings') . '">Edit your form settings</a> and select at least 1 list.</div>';
}
$content .= "</form>";
$content .= "\n<!-- / MailChimp for WP Plugin -->\n";
// increase form instance number in case there is more than one form on a page
$this->form_instance_number++;
// make sure scripts are enqueued later
global $is_IE;
if (isset($is_IE) && $is_IE) {
wp_enqueue_script('mc4wp-placeholders');
}
return $content;
}
示例5: get_visible_form_fields
/**
* @param $form
* @param $opts
*
* @return string
*/
private function get_visible_form_fields($form, $opts)
{
// replace special values
$visible_fields = __($form->post_content, 'mailchimp-for-wp');
$visible_fields = str_ireplace(array('%N%', '{n}'), $this->form_instance_number, $visible_fields);
$visible_fields = mc4wp_replace_variables($visible_fields, array_values($opts['lists']));
// insert captcha
if (function_exists('cptch_display_captcha_custom')) {
$captcha_fields = '<input type="hidden" name="_mc4wp_has_captcha" value="1" /><input type="hidden" name="cntctfrm_contact_action" value="true" />' . cptch_display_captcha_custom();
$visible_fields = str_ireplace(array('{captcha}', '[captcha]'), $captcha_fields, $visible_fields);
}
/**
* @filter mc4wp_form_content
* @param int $form_id The ID of the form that is being shown
* @expects string
*
* Can be used to customize the content of the form mark-up, eg adding additional fields.
*/
$visible_fields = apply_filters('mc4wp_form_content', $visible_fields, $form->ID);
return (string) $visible_fields;
}
示例6: contactForm
public static function contactForm($field_callback, $before_callback = null, $after_callback = null, $return = false)
{
$_this = self::getInstance();
if (!isset($_this->features['contact-form'])) {
return;
}
$options = $_this->theme_options->child(array($_this->features['contact-form']['group'], $_this->features['contact-form']['name']));
$labels = array('name' => __('Name', $_this->domain), 'email' => __('E-mail', $_this->domain), 'website' => __('Website', $_this->domain), 'phone' => __('Phone number', $_this->domain), 'subject' => __('Subject', $_this->domain), 'message' => __('Message', $_this->domain), 'captcha' => __('Captcha', $_this->domain));
$requires = array('name' => true, 'email' => true, 'website' => false, 'phone' => false, 'subject' => false, 'message' => true, 'captcha' => true);
$output = HTML::form()->action(admin_url(self::WP_AJAX_URI))->method('post')->add(HTML::makeInput('hidden', 'action', $_this->features['contact-form']['action']));
if ($_this->features['contact-form']['form_id']) {
$output->id($_this->features['contact-form']['form_id']);
}
if ($_this->features['contact-form']['form_class']) {
$output->class($_this->features['contact-form']['form_class']);
}
if ($before_callback !== null) {
$output->add(is_callable($before_callback) ? call_user_func($before_callback) : (string) $before_callback);
}
if (is_callable($field_callback)) {
foreach ($options->value('fields') as $field) {
$html = call_user_func($field_callback, $field, $requires[$field], $labels[$field]);
if ($field == 'captcha' && function_exists('cptch_display_captcha_custom')) {
$captcha = HTML::makeInput('hidden', 'cntctfrm_contact_action', 'true')->html() . preg_replace('/ style="[^"]*"/i', '', cptch_display_captcha_custom());
$html = strpos($html, '%s') !== false ? sprintf($html, $captcha) : $captcha;
}
$output->add($html);
}
}
if ($after_callback !== null) {
$output->add(is_callable($after_callback) ? call_user_func($after_callback) : (string) $after_callback);
}
if ($return) {
return $output->html();
} else {
echo $output->html();
}
}
示例7: cptch_custom_form
function cptch_custom_form($error_message, $content = "")
{
$cptch_options = get_option('cptch_options');
/* captcha html - login form */
$content .= '<p class="cptch_block" style="text-align:left;">';
if ("" != $cptch_options['cptch_label_form']) {
$content .= '<span class="cptch_title">' . $cptch_options['cptch_label_form'] . '<span class="required"> ' . $cptch_options['cptch_required_symbol'] . '</span></span>';
}
if (isset($error_message['error_captcha'])) {
$content .= "<span class='cptch_error' style='color:red'>" . $error_message['error_captcha'] . "</span><br />";
}
$content .= cptch_display_captcha_custom();
$content .= '</p>';
return $content;
}
示例8: load_captchabestwebsoft
private function load_captchabestwebsoft()
{
if (function_exists('cptch_register_form')) {
ob_start();
if (function_exists('cptch_display_captcha_custom')) {
echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />";
echo cptch_display_captcha_custom();
}
if (function_exists('cptchpr_display_captcha_custom')) {
echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />";
echo cptchpr_display_captcha_custom();
}
$display = ob_get_clean();
return $display;
} else {
return '';
}
}
示例9: cptch_display_captcha_custom
</label>
<input type="password" class="text required" placeholder="Enter Email Address" name="pwd" id="login_password" value="" />
</div>
<div class="captchadiv">
<p class="captcha_login" style="text-align:center">
<?php
if (function_exists('cptch_check_custom_form') && cptch_check_custom_form() !== true || function_exists('cptchpr_check_custom_form') && cptchpr_check_custom_form() !== true) {
echo "Please complete the CAPTCHA.";
}
?>
</p>
<p class="captcha_login" style="text-align:center">
<?php
if (function_exists('cptch_display_captcha_custom')) {
echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />";
echo cptch_display_captcha_custom();
}
if (function_exists('cptchpr_display_captcha_custom')) {
echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />";
echo cptchpr_display_captcha_custom();
}
?>
</p>
</div>
<div class="submit login_input">
<input type="submit" class="btn_login" name="login" id="login" value="LOGIN" />
<?php
echo APP_Login::redirect_field();
?>
<input type="hidden" name="testcookie" value="1" />
</div>
示例10: cptch_display_captcha_custom
}
} else {
echo $msg;
echo $forms1;
if (function_exists('cptch_display_captcha_custom')) {
echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />";
echo "<p><label>Antispam : </label>" . cptch_display_captcha_custom() . "</label>";
}
echo $forms2;
}
} else {
if (isset($_SESSION['qcs-isconnect'])) {
// echo $available_services;
} else {
echo $forms1;
if (function_exists('cptch_display_captcha_custom')) {
echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />";
echo "<p><label>Antispam : </label>" . cptch_display_captcha_custom() . "</label>";
}
echo $forms2;
}
}
?>
</div><!-- #content -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();
示例11: cptch_custom_form
function cptch_custom_form($error_message)
{
$cptch_options = get_option('cptch_options');
$content = "";
// captcha html - login form
$content .= '<p style="text-align:left;">';
if ("" != $cptch_options['cptch_label_form']) {
$content .= '<label>' . $cptch_options['cptch_label_form'] . '</label><br />';
} else {
$content .= '<br />';
}
if (isset($error_message['error_captcha'])) {
$content .= "<span style='color:red'>" . $error_message['error_captcha'] . "</span><br />";
}
$content .= cptch_display_captcha_custom();
$content .= '</p>';
return $content;
}
示例12: form
/**
* Returns the MailChimp for WP form mark-up
*
* @param array $atts
* @param string $content
*
* @return string
*/
public function form( $atts = array(), $content = '' ) {
$opts = mc4wp_get_options('form');
// was this form submitted?
$was_submitted = ( is_object( $this->form_request ) && $this->form_request->get_form_instance_number() === $this->form_instance_number );
// enqueue scripts (in footer) if form was submitted
if( $was_submitted ) {
wp_enqueue_script( 'mc4wp-form-request' );
wp_localize_script( 'mc4wp-form-request', 'mc4wpFormRequestData', array(
'success' => ( $this->form_request->is_successful() ) ? 1 : 0,
'submittedFormId' => $this->form_request->get_form_instance_number(),
'postData' => stripslashes_deep( $_POST )
)
);
}
if ( ! function_exists( 'mc4wp_replace_variables' ) ) {
include_once MC4WP_LITE_PLUGIN_DIR . 'includes/functions/template.php';
}
/**
* @filter mc4wp_form_action
* @expects string
*
* Sets the `action` attribute of the form element. Defaults to the current URL.
*/
$form_action = apply_filters( 'mc4wp_form_action', mc4wp_get_current_url() );
/**
* @filter mc4wp_form_message_position
* @expects string before|after
*
* Can be used to change the position of the form success & error messages.
* Valid options are 'before' or 'after'
*/
$message_position = apply_filters( 'mc4wp_form_message_position', 'after' );
// Start building content string
$content = "\n<!-- Form by MailChimp for WordPress plugin v". MC4WP_LITE_VERSION ." - https://dannyvankooten.com/mailchimp-for-wordpress/ -->\n";
$content .= '<form method="post" action="'. $form_action .'" id="mc4wp-form-'.$this->form_instance_number.'" class="'. $this->get_css_classes() .'">';
// show message if form was submitted and message position is before
if( $was_submitted && $message_position === 'before' ) {
$content .= $this->get_form_message_html();
}
// do not add form fields if form was submitted and hide_after_success is enabled
if( ! ( $opts['hide_after_success'] && $was_submitted && $this->form_request->is_successful() ) ) {
// add form fields from settings
$form_markup = __( $opts['markup'] );
// replace special values
$form_markup = str_ireplace( array( '%N%', '{n}' ), $this->form_instance_number, $form_markup );
$form_markup = mc4wp_replace_variables( $form_markup, array_values( $opts['lists'] ) );
// insert captcha
if( function_exists( 'cptch_display_captcha_custom' ) ) {
$captcha_fields = '<input type="hidden" name="_mc4wp_has_captcha" value="1" /><input type="hidden" name="cntctfrm_contact_action" value="true" />' . cptch_display_captcha_custom();
$form_markup = str_ireplace( '[captcha]', $captcha_fields, $form_markup );
}
// allow plugins to add form fieldsq
do_action( 'mc4wp_before_form_fields', 0 );
/**
* @filter mc4wp_form_content
* @param int $form_id The ID of the form that is being shown
* @expects string
*
* Can be used to customize the content of the form mark-up, eg adding additional fields.
*/
$content .= apply_filters( 'mc4wp_form_content', $form_markup );
// allow plugins to add form fields
do_action( 'mc4wp_after_form_fields', 0 );
// hidden fields
$content .= '<textarea name="_mc4wp_required_but_not_really" style="display: none !important;"></textarea>';
$content .= '<input type="hidden" name="_mc4wp_form_submit" value="1" />';
$content .= '<input type="hidden" name="_mc4wp_form_instance" value="'. $this->form_instance_number .'" />';
$content .= '<input type="hidden" name="_mc4wp_form_nonce" value="'. wp_create_nonce( '_mc4wp_form_nonce' ) .'" />';
}
// show message if form was submitted and message position is after
if( $was_submitted && $message_position === 'after' ) {
$content .= $this->get_form_message_html();
}
$content .= "</form>";
//.........这里部分代码省略.........
示例13: form
/**
* Returns the MailChimp for WP form mark-up
*
* @param array $atts
* @param string $content
*
* @return string
*/
public function form($atts = array(), $content = '')
{
// make sure template functions are loaded
if (!function_exists('mc4wp_replace_variables')) {
include_once MC4WP_LITE_PLUGIN_DIR . 'includes/functions/template.php';
}
// Get form options
$opts = mc4wp_get_options('form');
// was this form submitted?
$was_submitted = is_object($this->form_request) && $this->form_request->get_form_instance_number() === $this->form_instance_number;
/**
* @filter mc4wp_form_action
* @expects string
*
* Sets the `action` attribute of the form element. Defaults to the current URL.
*/
$form_action = apply_filters('mc4wp_form_action', mc4wp_get_current_url());
// Generate opening HTML
$opening_html = "<!-- Form by MailChimp for WordPress plugin v" . MC4WP_LITE_VERSION . " - https://mc4wp.com/ -->";
$opening_html .= '<form method="post" action="' . $form_action . '" id="mc4wp-form-' . $this->form_instance_number . '" class="' . $this->get_css_classes() . '">';
// Generate before & after fields HTML
$before_fields = apply_filters('mc4wp_form_before_fields', '');
$after_fields = apply_filters('mc4wp_form_after_fields', '');
// Process fields, if not submitted or not successfull or hide_after_success disabled
if (!$was_submitted || !$opts['hide_after_success'] || !$this->form_request->is_successful()) {
// add form fields from settings
$visible_fields = __($opts['markup'], 'mailchimp-for-wp');
// replace special values
$visible_fields = str_ireplace(array('%N%', '{n}'), $this->form_instance_number, $visible_fields);
$visible_fields = mc4wp_replace_variables($visible_fields, array_values($opts['lists']));
// insert captcha
if (function_exists('cptch_display_captcha_custom')) {
$captcha_fields = '<input type="hidden" name="_mc4wp_has_captcha" value="1" /><input type="hidden" name="cntctfrm_contact_action" value="true" />' . cptch_display_captcha_custom();
$visible_fields = str_ireplace(array('{captcha}', '[captcha]'), $captcha_fields, $visible_fields);
}
/**
* @filter mc4wp_form_content
* @param int $form_id The ID of the form that is being shown
* @expects string
*
* Can be used to customize the content of the form mark-up, eg adding additional fields.
*/
$visible_fields = apply_filters('mc4wp_form_content', $visible_fields);
// hidden fields
$hidden_fields = '<textarea name="_mc4wp_required_but_not_really" style="display: none !important;"></textarea>';
$hidden_fields .= '<input type="hidden" name="_mc4wp_form_submit" value="1" />';
$hidden_fields .= '<input type="hidden" name="_mc4wp_form_instance" value="' . $this->form_instance_number . '" />';
$hidden_fields .= '<input type="hidden" name="_mc4wp_form_nonce" value="' . wp_create_nonce('_mc4wp_form_nonce') . '" />';
} else {
$visible_fields = '';
$hidden_fields = '';
}
// empty string for response
$response_html = '';
if ($was_submitted) {
// Enqueue script (only after submit)
wp_enqueue_script('mc4wp-form-request');
wp_localize_script('mc4wp-form-request', 'mc4wpFormRequestData', array('success' => $this->form_request->is_successful() ? 1 : 0, 'submittedFormId' => $this->form_request->get_form_instance_number(), 'postData' => $this->form_request->get_data()));
// get actual response html
$response_html = $this->form_request->get_response_html();
// add form response after or before fields if no {response} tag
if (stristr($visible_fields, '{response}') === false || $opts['hide_after_success']) {
/**
* @filter mc4wp_form_message_position
* @expects string before|after
*
* Can be used to change the position of the form success & error messages.
* Valid options are 'before' or 'after'
*/
$message_position = apply_filters('mc4wp_form_message_position', 'after');
switch ($message_position) {
case 'before':
$before_fields = $before_fields . $response_html;
break;
case 'after':
$after_fields = $response_html . $after_fields;
break;
}
}
}
// Always replace {response} tag, either with empty string or actual response
$visible_fields = str_ireplace('{response}', $response_html, $visible_fields);
// Generate closing HTML
$closing_html = "</form>";
$closing_html .= "<!-- / MailChimp for WP Plugin -->";
// increase form instance number in case there is more than one form on a page
$this->form_instance_number++;
// make sure scripts are enqueued later
global $is_IE;
if (isset($is_IE) && $is_IE) {
wp_enqueue_script('mc4wp-placeholders');
}
//.........这里部分代码省略.........
示例14: cptch_custom_form
function cptch_custom_form($error_message)
{
$cptch_options = get_option('cptch_options');
$content = "";
// captcha html - login form
$content .= '<p class="cptch_block" style="text-align:left;">';
if ("" != $cptch_options['cptch_label_form']) {
$content .= '<label for="cptch_input">' . stripslashes($cptch_options['cptch_label_form']) . '<span class="required"> ' . $cptch_options['cptch_required_symbol'] . '</span></label><br />';
} else {
$content .= '<br />';
}
if (isset($error_message['error_captcha'])) {
$content .= "<span class='cptch_error' style='color:red'>" . $error_message['error_captcha'] . "</span><br />";
}
$content .= cptch_display_captcha_custom();
$content .= '</p>';
return $content;
}