Plugin Directory

Changeset 3393329


Ignore:
Timestamp:
11/11/2025 02:52:14 AM (5 months ago)
Author:
infility
Message:

V2.14.26 (20251110) Ben: 抓取网页数据公共化

Location:
infility-global/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • infility-global/trunk/infility_global.php

    r3393324 r3393329  
    44Plugin URI: https://www.infility.cn/
    55Description: Infility公共插件
    6 Version: 2.14.25
     6Version: 2.14.26
    77Author: Infility
    88Author URI: https://www.infility.cn/
     
    135135    function __construct()
    136136    {
    137         define( 'INFILITY_GLOBAL_VERSION', '2.14.25' );
     137        define( 'INFILITY_GLOBAL_VERSION', '2.14.26' );
    138138        define( 'INFILITY_GLOBAL_PATH', plugin_dir_path( __FILE__ ) ); // fullpath/wp-content/plugins/infility-global/ // 有斜杠
    139139        define( 'INFILITY_GLOBAL_URL', plugins_url( '/', __FILE__ ) ); // https://the_domain/wp-content/plugins/infility-global/ // 斜杠是自己加的
  • infility-global/trunk/widgets/infility-import-data/include/infility-import-site.php

    r3393324 r3393329  
    10981098        $page_tag = $this->getHtmlTag($html,$page_format_target['format'],$page_format_target['type'],['href']);
    10991099
    1100         if(empty($page_tag)){$this->error='分页数据出错';return false;}
    1101 
    1102 
    11031100        $sql = "SELECT url FROM $url_table WHERE list_id=$list_id AND `type`='category'";
    11041101        $check_repeat = $wpdb->get_col($sql);
     
    11141111                $pages[] = $v['link'];
    11151112            }
    1116         }
    1117 
    1118         $last_page_num = $this->getLastPageFromHrefs($pages,$url);
    1119         foreach($pages as $k=>$v){
    1120             $page_num = $k+1;
    1121 
     1113
     1114            $last_page_num = $this->getLastPageFromHrefs($pages,$url);
     1115            foreach($pages as $k=>$v){
     1116                $page_num = $k+1;
     1117
     1118                $insert = [
     1119                    'list_id' => $list_id,
     1120                    'type' => 'category',
     1121                    'url' => $v,
     1122                    'status' => 0,
     1123                    'page' => $page_num,
     1124                    'total_page'=> $last_page_num,
     1125                    'add_time' => time(),
     1126                ];
     1127
     1128                $wpdb->insert($url_table,$insert);
     1129            }
     1130        }else{
    11221131            $insert = [
    11231132                'list_id' => $list_id,
    11241133                'type' => 'category',
    1125                 'url' => $v,
     1134                'url' => $url,
    11261135                'status' => 0,
    1127                 'page' => $page_num,
    1128                 'total_page'=> $last_page_num,
     1136                'page' => 1,
     1137                'total_page'=> 1,
    11291138                'add_time' => time(),
    11301139            ];
Note: See TracChangeset for help on using the changeset viewer.