Plugin Directory

Changeset 2999917


Ignore:
Timestamp:
11/22/2023 07:20:45 AM (2 years ago)
Author:
sosel
Message:

updata v1.1

Location:
part-content-encryption
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • part-content-encryption/index.php

    r2754345 r2999917  
    22/**
    33 * @package article_PW
    4  * @version 1.0
     4 * @version 1.1
    55 */
    66/*
     
    99Description: WP自带的文章或页面加密码,只能是整编文章或页面,此插件可以部分内容加密;写文章或页面时,只需加短代码标签[pw key="密码"]需要加密的内容[/pw]
    1010Author: MailBerry
    11 Version: 1.0
     11Version: 1.1
    1212Author URI: https://mailberry.com.cn
    1313*/
     14
    1415function e_encryption_enqueue_style()
    1516{
    16     wp_enqueue_style('encryption-style',plugins_url('/style.css',__FILE__),array(),'1.0.0','all');
     17    wp_enqueue_style('encryption-style', plugins_url('/style.css', __FILE__), array(), '1.0.0', 'all');
    1718}
    18 add_action('wp_enqueue_scripts','e_encryption_enqueue_style');
    19 function e_encryption($atts, $content=null){
    20     extract(shortcode_atts(array('key'=>null), $atts));
    21     if(isset($_POST['e_encryption_key']) && $_POST['e_encryption_key']==$key){
    22     return '
    23     <div class="e-encryption">'.$content.'</div>
    24     ';
    25     }
    26     else{
    27     return '
    28     <form class="e-encryption" action="'.get_permalink().'" method="post" name="e-encryption"><label>输入密码查看加密内容:</label><input type="password" name="e_encryption_key" class="encry-i" maxlength="50"><input type="submit" class="encry-s" value="确定">
    29     <div class="euc-clear"></div>
    30     </form>
    31     ';
    32     }
    33     }
    34    
    35     add_shortcode('pw','e_encryption');
     19add_action('wp_enqueue_scripts', 'e_encryption_enqueue_style');
     20
     21function e_encryption($atts, $content = null) {
     22    extract(shortcode_atts(array('key' => null), $atts));
     23    $e_encryption_key = isset($_POST['e_encryption_key']) ? sanitize_text_field($_POST['e_encryption_key']) : null;
     24    if (!is_null($e_encryption_key) && $e_encryption_key == $key) {
     25        return '<div class="e-encryption">' . $content . '</div>';
     26    } else {
     27        return '
     28        <form class="e-encryption" action="' . get_permalink() . '" method="post" name="e-encryption">
     29            <label>输入密码查看加密内容:</label>
     30            <input type="password" name="e_encryption_key" class="encry-i" maxlength="50">
     31            <input type="submit" class="encry-s" value="确定">
     32            <div class="euc-clear"></div>
     33        </form>
     34        ';
     35    }
     36}
     37
     38add_shortcode('pw', 'e_encryption');
  • part-content-encryption/readme.txt

    r2754356 r2999917  
    33Tags: part content encryption
    44Donate link: 捐款链接地址
    5 Requires at least: 4.2
    6 Tested up to: 6.0
     5Requires at least: 6.4.1
     6Tested up to: 6.4
    77Requires PHP: 5.6
    8 Stable tag: 1.0
     8Stable tag: 1.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    31313,QQ群、TG群组
    32324,公众号“XX”回复,验证码
    33 5,1+1+2=?
    3433等等多种方式,主要是配合私域流量转换
    3534
    3635== Screenshots ==
    37361. screenshot-1.png
    38 2. screenshot-4.png
     372. screenshot-3.png
     383. screenshot-4.png
    3939
    4040
    4141== Changelog ==
    42 === 1.0.1 ===
    43 更正插件名,添加一个截图
     42=== 1.1 ===
     43修改样式,增加响应样式,修正兼容最新6.4以上版本
     44=== 1.0.1===
     45更正插件名,添加两个截图
    4446=== 1.0 ===
    4547这是初始版本
  • part-content-encryption/style.css

    r2964304 r2999917  
    1 /* 部分内容加密码表样CSS */
    2 /*e-encryption*/
     1/* 部分内容加密插件样式 */
     2
     3/* e-encryption 容器样式 */
    34.e-encryption {
    4     margin: 20px 0;
    5     padding: 60px;
    6     background: #f8f8f8;
    7     }
    8     .e-encryption input.encry-i[type="password"] {
    9     float: left;
    10     background: #fff;
    11     width: 100%;
    12     line-height: 36px;
    13     margin-top: 5px;
    14     border-radius: 3px;
    15     }
    16     .e-encryption input.encry-s[type="submit"] {
    17     float: right;
    18     margin-top: -47px;
    19     width: 30%;
    20     margin-right: 1px;
    21     border-radius: 0 3px 3px 0;
    22     }
    23     input.encry-s[type="submit"]{ background-color:var(--accent-color); color:#fff; font-size:21px; box-shadow:none; -webkit-transition: .4s; -moz-transition: .4s; -o-transition: .4s; transition:.4s; -webkit-backface-visibility:hidden; position:relative; cursor:pointer; padding: 13px 20px; text-align: center; border-radius: 30px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; border: 0; height: auto; outline: medium; line-height: 20px; margin: 10; -webkit-border-radius: 30px; -moz-border-radius: 30px; -ms-border-radius: 30px; -o-border-radius: 30px; }
    24     input.encry-s[type="submit"]:hover{background-color:var(--accent-color);}
    25     input.encry-i[type="text"],input.encry-i[type="password"]{border:1px solid #F2EFEF;color:#777;display:block;background: #FCFCFC;font-size:18px;transition:all .5s ease 0;outline:0;box-sizing:border-box;-webkit-border-radius:25px;-moz-border-radius:25px;border-radius:25px;padding:5px 16px; margin: 0;height: auto;line-height: 30px;}
    26     input.encry-i[type="text"]:hover,input.encry-i[type="password"]:hover{border:1px solid #f4898c;box-shadow:0 0 4px #f4898c;}
     5    margin: 20px 0;
     6    padding: 30px;
     7    background: #f8f8f8;
     8    border-radius: 10px;
     9    border: 1px solid #ddd; /* 添加外边框 */
     10    text-align: center; /* 为了使按钮居中 */
     11}
     12
     13/* 输入框样式 */
     14.e-encryption input.encry-i[type="text"],
     15.e-encryption input.encry-i[type="password"] {
     16    width: 100%;
     17    line-height: 36px;
     18    margin-top: 5px;
     19    border: 1px solid #F2EFEF;
     20    border-radius: 25px;
     21    font-size: 16px;
     22    padding: 5px 16px;
     23    transition: all .5s ease 0;
     24    outline: 0;
     25    box-sizing: border-box;
     26    display: block; /* 使输入框占满整行 */
     27}
     28
     29.e-encryption input.encry-i[type="text"]:hover,
     30.e-encryption input.encry-i[type="password"]:hover {
     31    border: 1px solid #f4898c;
     32    box-shadow: 0 0 4px #f4898c;
     33}
     34
     35/* 提交按钮样式 */
     36.e-encryption input.encry-s[type="submit"] {
     37    width: auto;
     38    background-color: var(--accent-color, #f4898c);
     39    color: #fff;
     40    font-size: 21px;
     41    padding: 13px 20px;
     42    border-radius: 25px;
     43    border: 0;
     44    height: auto;
     45    outline: none;
     46    line-height: 20px;
     47    cursor: pointer;
     48    transition: .4s;
     49    display: block; /* 使按钮占满整行 */
     50    margin: 20px auto 0; /* 顶部边距和自动水平边距 */
     51}
     52
     53input.encry-s[type="submit"]:hover {
     54    background-color: var(--accent-color-hover, #e4756f);
     55}
     56
     57/* 响应式设计 */
     58@media (max-width: 768px) {
     59    .e-encryption {
     60        padding: 15px;
     61    }
     62    .e-encryption input.encry-i[type="password"],
     63    .e-encryption input.encry-s[type="submit"] {
     64        width: 100%;
     65        margin-top: 10px;
     66    }
     67}
Note: See TracChangeset for help on using the changeset viewer.