Plugin Directory

Changeset 2428041


Ignore:
Timestamp:
11/29/2020 09:18:28 AM (5 years ago)
Author:
cnfang
Message:

2.7.9

Location:
wxsync/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wxsync/trunk/readme.txt

    r2276243 r2428041  
    55Requires at least: 3.3
    66Tested up to: 5.2.2
    7 Stable tag:2.7.8
     7Stable tag:2.7.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • wxsync/trunk/setting.php

    r2274759 r2428041  
    188188
    189189                <tr>
     190                    <th>去除所有HTML标签</th>
     191                    <td>
     192                        <select name="article_remotetag">
     193                            <option value="0" <?php if(!empty($_COOKIE['article_remotetag']) && 0==$_COOKIE['article_remotetag']){echo 'selected';} ?>>保留</option>
     194                            <option value="1" <?php if(!empty($_COOKIE['article_remotetag']) && 1==$_COOKIE['article_remotetag']){echo 'selected';} ?>>去除</option>
     195                        </select>
     196                    </td>
     197                </tr>
     198
     199                <tr>
     200                    <th>移除文中的链接</th>
     201                    <td>
     202                        <select name="article_remote_a_href">
     203                            <option value="0" <?php if(!empty($_COOKIE['article_remote_a_href']) && 0==$_COOKIE['article_remote_a_href']){echo 'selected';} ?>>保留</option>
     204                            <option value="1" <?php if(!empty($_COOKIE['article_remote_a_href']) && 1==$_COOKIE['article_remote_a_href']){echo 'selected';} ?>>移除链接,保留内容</option>
     205                            <option value="2" <?php if(!empty($_COOKIE['article_remote_a_href']) && 2==$_COOKIE['article_remote_a_href']){echo 'selected';} ?>>移除链接和内容</option>
     206                        </select>
     207                    </td>
     208                </tr>
     209
     210                <tr>
    190211                    <th>移除【开头】图片序号(#分隔)</th>
    191212                    <td>
     
    241262
    242263                        </div>
     264                        <textarea id="debugresult_html" style="border-top: 1px solid #000;width: 100%;height: 300px;display: none;">
     265                            </textarea>
    243266                    </td>
    244267                </tr>
     
    438461        }
    439462        var article_imgurl = jQuery('select[name=article_imgurl]').val();
     463        var article_remotetag = jQuery('select[name=article_remotetag]').val();
     464        var article_remote_a_href = jQuery('select[name=article_remote_a_href]').val();
    440465
    441466        reqIndex = 0;
     
    470495                        wxsync_setsourcetxt:wxsync_setsourcetxt,
    471496                        wxsync_replace_words:wxsync_replace_words,
    472                         article_imgurl:article_imgurl
     497                        article_imgurl:article_imgurl,
     498                        article_remotetag:article_remotetag,
     499                        article_remote_a_href:article_remote_a_href
    473500                    },
    474501                    success: function(res) {
     
    481508                        reqfunc(reqIndex);
    482509                    },
    483                     error: function() {
     510                    error: function(XMLHttpRequest) {
    484511                        jQuery('#suburl').html('请求失败,位置:'+reqIndex);
     512                        //err1
     513                        var str = XMLHttpRequest.responseText;
     514                        jQuery('#debugresult_html').text(str);
     515                        jQuery('#debugresult_html').css('display','block');
    485516                    }
    486517
  • wxsync/trunk/wxsync.php

    r2276243 r2428041  
    44Plugin URI: http://std.cloud
    55Description: 标准云微信公众号文章免费采集、<strong>任意公众号自动采集5元/月</strong>、<strong>历史文章导出20元/公众号</strong>
    6 Version: 2.7.8
     6Version: 2.7.9
    77Author: 标准云(std.cloud)
    88Author URI: http://std.cloud
     
    2424$GLOBALS['wxsync_tab'] = '';
    2525$GLOBALS['wxsync_error'] = array();
    26 $GLOBALS['wxsync_ver'] = '2.7.8';
     26$GLOBALS['wxsync_ver'] = '2.7.9';
    2727$GLOBALS['wxsync_code'] = 0;
    2828
     
    5757            ,'urls','override','article_time','article_status','article_cate','article_source','article_style','wxsync_setsourcetxt','article_type','article_checkrepeat'
    5858            ,'wxsync_rmheadimg','wxsync_rmtailimg','wxsync_replace_words','article_imgurl','article_href','article_debug','article_raw'
    59             ,'host','port','username','password');
     59            ,'host','port','username','password','article_remotetag','article_remote_a_href');
    6060    foreach ($keys as $one){
    6161        if(isset($_REQUEST[$one])){
     
    524524
    525525        }
     526
    526527
    527528        $html = str_replace($replace_v1, $replace_v2, $html);
     
    620621        }
    621622
     623
     624        //去除所有HTML标签
     625        if(isset($req['article_remotetag']) && 1 == isset($req['article_remotetag'])){
     626            $content = str_replace('</p>', '<br>', $content);
     627            $content = strip_tags($content, '<br><img><video><iframe><code><a><audio><canvas><input>');
     628        }
     629        if(isset($req['article_remote_a_href'])){
     630            if(1 == $req['article_remote_a_href']){
     631                $content = preg_replace('/<a[^>]*>(.*?)<\/a>/i', '$1', $content);
     632            }
     633            if(2 == $req['article_remote_a_href']){
     634                $content = preg_replace('/<a[^>]*>(.*?)<\/a>/i', '', $content);
     635            }
     636        }
     637
    622638        if('keep' == $article_checkrepeat){
    623639            if (!$override && post_exists($articleTitle)) {
Note: See TracChangeset for help on using the changeset viewer.