Plugin Directory

Changeset 2214756


Ignore:
Timestamp:
12/19/2019 02:15:40 AM (6 years ago)
Author:
zhengdon
Message:

update image download and test up to 5.3.2

Location:
keydatas/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • keydatas/trunk/keydatas.php

    r2182730 r2214756  
    44Plugin URI: http://www.keydatas.com/caiji/wordpress-cms-caiji
    55Description: 简数(keydatas.com)是一个通用、简单、智能、在线的网页数据采集和发布平台,功能强大,操作简单。支持定时采集+自动发布,定时发布,站群发布;集成强大的数据处理和SEO优化工具;支持微信公众号文章(包括采集公众号历史文章)、今日头条、淘宝客商品一键采集;集成翻译和同义词替换等服务;图片下载支持存储到阿里云OSS、七牛对象存储、腾讯云对象存储,并支持压缩和水印;免费自动接入多家IP代理商。同时支持LightSNS主题;即将推出知乎、简书采集。
    6 Version: 2.3.19
     6Version: 2.4.1
    77Author: keydatas
    88Author URI: http://www.keydatas.com
     
    142142                $post = $wpdb->get_row($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title='%s' and post_status!='trash' and post_status!='inherit' ",stripslashes($my_post['post_title'])));
    143143                if(!empty($post)){
     144                    //这里可以补充图片
     145                    kds_downloadImages($_REQ);
    144146                    //返回访问路径
    145                     keydatas_successRsp(array("url" => get_home_url() . "/?p={$post->ID}"));
     147                    keydatas_successRsp(array("url" => get_home_url() . "?p={$post->ID}"."#相同标题文章已存在"));
    146148                    //keydatas_failRsp(2000,'title exist' '相同标题文章已存在:'.get_home_url() . "/?p={$post->ID}");
    147149                }
     
    296298            }
    297299            /////图片http下载
    298             $downloadFlag = $_REQ["__kds_download_imgs_flag"];
    299             if (!empty($downloadFlag) && $downloadFlag== "true") {
    300                 $docImgsStr = $_REQ["__kds_docImgs"];
    301                 if (!empty($docImgsStr)) {
    302                     $docImgs = explode(',',$docImgsStr);
    303                     if (is_array($docImgs)) {
    304                         $upload_dir = wp_upload_dir();
    305                         foreach ($docImgs as $imgUrl) {
    306                             $urlItemArr = explode('/',$imgUrl);
    307                             $itemLen=count($urlItemArr);
    308                             if($itemLen>=3){
    309                                 //最后的相对路径,如  2018/06
    310                                 $fileRelaPath=$urlItemArr[$itemLen-3].'/'.$urlItemArr[$itemLen-2];
    311                                 $imgName=$urlItemArr[$itemLen-1];
    312                                 $finalPath=$upload_dir['basedir'] . '/'.$fileRelaPath;
    313                                 if (wp_mkdir_p($finalPath)) {
    314                                     $file = $finalPath . '/' . $imgName;
    315                                     if(!file_exists($file)){
    316                                         $doc_image_data = file_get_contents($imgUrl);
    317                                         file_put_contents($file, $doc_image_data);
    318                                     }
    319                                 }
    320                             }
    321                         }//.for
    322                     }//..is_array
    323                 }               
    324             }
     300            kds_downloadImages($_REQ);
    325301           
    326302           
     
    369345    }
    370346}
     347
     348/**
     349/////图片http下载
     350*/
     351function  kds_downloadImages($_REQ){
     352 try{
     353    $downloadFlag = $_REQ["__kds_download_imgs_flag"];
     354    if (!empty($downloadFlag) && $downloadFlag== "true") {
     355        $docImgsStr = $_REQ["__kds_docImgs"];
     356        if (!empty($docImgsStr)) {
     357            $docImgs = explode(',',$docImgsStr);
     358            if (is_array($docImgs)) {
     359                $upload_dir = wp_upload_dir();
     360                foreach ($docImgs as $imgUrl) {
     361                    $urlItemArr = explode('/',$imgUrl);
     362                    $itemLen=count($urlItemArr);
     363                    if($itemLen>=3){
     364                        //最后的相对路径,如  2018/06
     365                        $fileRelaPath=$urlItemArr[$itemLen-3].'/'.$urlItemArr[$itemLen-2];
     366                        $imgName=$urlItemArr[$itemLen-1];
     367                        $finalPath=$upload_dir['basedir'] . '/'.$fileRelaPath;
     368                        if (wp_mkdir_p($finalPath)) {
     369                            $file = $finalPath . '/' . $imgName;
     370                            if(!file_exists($file)){
     371                                $doc_image_data = file_get_contents($imgUrl);
     372                                file_put_contents($file, $doc_image_data);
     373                            }
     374                        }
     375                    }
     376                }//.for
     377            }//..is_array
     378        }               
     379    }
     380 } catch (Exception $ex) {
     381    //error_log('image download error:'. $e->getMessage(), 3, '/var/log/ecms_test.log');
     382 }     
     383}
    371384?>
  • keydatas/trunk/readme.txt

    r2182730 r2214756  
    55Author URI: http://www.keydatas.com
    66Plugin URI: http://www.keydatas.com/wordpress-plugin
    7 Stable tag: 2.3.19
     7Stable tag: 2.4.1
    88Requires at least: 4.1
    9 Tested up to: 5.2.4
     9Tested up to: 5.3.2
    1010Requires PHP: 5.2.4
    1111License: GPLv2 or later
     
    313112.SEO Plugin,huochetou,google XML sitemap,WP Baidu Map,baiduxzh,Sitemap,baidu-submit-link,AutoTags,Github<br>
    3232autospider,fanyi,Translate,LightSNS,collect.
    33 13.wordpress插件推荐:百度熊掌号,WordPress HTTPS (SSL),wp encrypt,really simple ssl,wp-super-cache,WP Rocket,All-in-One SEO Pack,login LockDown,Comments Link Redirect,Add Post URL,BackWPup,DX-auto-publish,Link Manager,No Category Parents,Platinum SEO Pack,WP Keyword Link,Yet Another Related Posts Plugin,Fix image width,Role Manager,Search & Replace,WordPress Database Backup,WP-PostViews,WP PHP widget,Baidu Sitemap Generator,DB Cache Reloaded Fix + Hyper Cache,SEO Friendly Images,BackWPup,Simple URLs,Redirection.
     3313.wordpress插件推荐:百度熊掌号,百度推送,WordPress HTTPS (SSL),wp encrypt,really simple ssl,wp-super-cache,WP Rocket,All-in-One SEO Pack,login LockDown,Comments Link Redirect,Add Post URL,BackWPup,DX-auto-publish,Link Manager,No Category Parents,Platinum SEO Pack,WP Keyword Link,Yet Another Related Posts Plugin,Fix image width,Role Manager,Search & Replace,WordPress Database Backup,WP-PostViews,WP PHP widget,Baidu Sitemap Generator,DB Cache Reloaded Fix + Hyper Cache,SEO Friendly Images,BackWPup,Simple URLs,Redirection,5118,ai伪原创.
    3434
    3535== Installation ==
     
    4949
    5050== Changelog ==
     51= 2.4.1 =
     52* 标题已存在的,支持补充图片。
    5153= 2.3.4 =
    5254* 修改使用随机用户在一些环境异常问题。
Note: See TracChangeset for help on using the changeset viewer.