ZIPcode-verification.zip 3.44KB

huayula

资源文件列表:

code-verification.zip 大约有4个文件
  1. 双击获取更多.url 110B
  2. code-verification.php 4.52KB
  3. script.js 1.3KB
  4. style.css 1.33KB

资源介绍:

WordPress原创插件:Code-verification 微信或QQ二维码验证引导关注
<?php /* Plugin Name: Code Verification Plugin URI: https://www.qqmu.com Description: 隐藏文章部分内容,需要验证才能查看。 Version: 1.0 Author: QQ沐编程 Author URI: https://www.qqmu.com */ if (!defined('ABSPATH')) { exit; // 如果直接访问此文件,则退出。 } // 注册并包含CSS function content_protect_enqueue_styles() { wp_register_style('content-protect-style', plugins_url('code-verification/style.css')); wp_enqueue_style('content-protect-style'); } add_action('wp_enqueue_scripts', 'content_protect_enqueue_styles'); // 注册并包含JS function content_protect_enqueue_scripts() { wp_register_script('content-protect-script', plugins_url('code-verification/script.js'), array('jquery'), null, true); wp_enqueue_script('content-protect-script'); } add_action('wp_enqueue_scripts', 'content_protect_enqueue_scripts'); function content_protect_menu() { add_options_page('Content Protect Settings', '二维码设置', 'manage_options', 'content-protect', 'content_protect_options_page'); } add_action('admin_menu', 'content_protect_menu'); function content_protect_options_page() { ?> <div class="wrap"> <h1>二维码设置</h1> <p style="text-align: left; font-size: 14px; color: #999;">注意事项:换行符号是&lt;br&gt;,如:请扫码关注微信二维码&lt;br&gt发送“验证码”获取密码。 <br>短代码引入文章示例:[protected] 这是隐藏的内容,只有验证密码后才能看到。 [/protected] </p> <form method="post" action="options.php"> <?php settings_fields('content_protect_settings'); ?> <?php do_settings_sections('content-protect'); ?> <table class="form-table"> <tr valign="top"> <th scope="row">设定密码</th> <td><input style="width:200px;" type="text" name="content_protect_password" value="<?php echo esc_attr(get_option('content_protect_password')); ?>" /></td> </tr> <tr valign="top"> <th scope="row">提示内容</th> <td><textarea cols="100" style="height: 100px;" name="content_protect_prompt"><?php echo esc_textarea(get_option('content_protect_prompt')); ?></textarea></td> </tr> <tr valign="top"> <th scope="row">二维码图片</th> <td><input style="width:500px;" type="text" name="content_protect_image" value="<?php echo esc_url(get_option('content_protect_image')); ?>" ></td> </tr> </table> <?php submit_button(); ?> </form> <p style="text-align: center; font-size: 14px; color: #999;">本插件由<a href="https://ds17.cn" target="_blank">大神博客ds17.cn</a>原创,务必保留所有权利,删除必究。</p> </div> <?php } function content_protect_register_settings() { register_setting('content_protect_settings', 'content_protect_password'); register_setting('content_protect_settings', 'content_protect_prompt'); register_setting('content_protect_settings', 'content_protect_image'); } add_action('admin_init', 'content_protect_register_settings'); function content_protect_shortcode($atts,$content = null) { $atts = shortcode_atts( array( 'password' => get_option('content_protect_password'), ), $atts ); if (isset($_POST['content_protect_password']) &&$_POST['content_protect_password'] == $atts['password']) { setcookie('content_protect_verified', true, time() + 3600, COOKIEPATH, COOKIE_DOMAIN); } if (isset($_COOKIE['content_protect_verified']) &&$_COOKIE['content_protect_verified']) { return do_shortcode($content); } else { $prompt = get_option('content_protect_prompt', '请输入密码查看内容。'); $image = get_option('content_protect_image'); $output = '<div class="content-protect">'; if ($image) { $output .= '<img src="' . esc_url($image) . '" alt="验证图片" />'; } $output .= '<p>' .$prompt . '</p>'; $output .= '<form method="post">'; $output .= '<input type="password" name="content_protect_password" />'; $output .= '<input type="submit" value="验证" />'; $output .= '</form>'; $output .= '</div>'; return $output; } } add_shortcode('protected', 'content_protect_shortcode');
100+评论
captcha
    类型标题大小时间
    ZIPmongodb-linux-x86-64-rhel70-4.0.9.tgz99.72MB8月前
    ZIP2024年全国省市区县街道SQL数据脚本11.52MB8月前
    ZIP表格行内编辑增删改查以及拖拽式分割面板组件封装5.54KB8月前
    ZIPGB/T 28181-2022 公共安全视频监控联网系统:信息传输、交换、控制技术要求pdf协议文档,GB/T 28181-2035MB8月前
    ZIPJAVA基于J2ME的手机游戏开发(论文+源代码).zip161.54KB8月前
    ZIPjava基于BS结构下的OA流程可视化的研究与实现(源代码+论文).zip238.8KB8月前
    ZIP图片自动下载器-单线程增量式爬虫18.38MB8月前
    ZIP井字棋小游戏,内含mitsuko.h mitsuko.lib两个文件11.87KB8月前