case 1: $url = 1; break; case 2: $url = '2&start=1'; break; case 3: $url = '3&start=1'; } $url = $baseURL . $url . '&dataCount=0&existsCount=0'; showloading($url); $tpShowBody = false; } else { if ($_GET['action'] == 'get') { $NC = new NEAT_COLLECTOR(); $NIA = new NEAT_IMPORT_ARTICLE($NC); switch ($_GET['type']) { case 1: $method = 'GET'; $param['cookie'] = $rs->get('cookies'); $referer = $rs->get('referer'); $useragent = $rs->get('useragent'); $replaceRNT = $rs->get('replaceRNT'); $url = $rs->get('url'); break; case 2: $method = 'GET'; $param['cookie'] = $rs->get('cookies'); $referer = $rs->get('referer'); $useragent = $rs->get('useragent'); $replaceRNT = $rs->get('replaceRNT');
$rs->get('multi_intro') == 2 ? $areaMulti['intro'] = 1 : ($areaMulti['intro'] = 2); $rs->get('enter_title') == 0 ? $areaFormat['title'] = 1 : ($areaFormat['title'] = 2); $rs->get('enter_body') == 0 ? $areaFormat['body'] = 1 : ($areaFormat['body'] = 2); $rs->get('enter_body_page') == 0 ? $areaFormat['body_page'] = 1 : ($areaFormat['body_page'] = 2); $rs->get('enter_body_page_link') == 0 ? $areaFormat['body_page_link'] = 1 : ($areaFormat['body_page_link'] = 2); $rs->get('enter_author') == 0 ? $areaFormat['author'] = 1 : ($areaFormat['author'] = 2); $rs->get('enter_from') == 0 ? $areaFormat['from'] = 1 : ($areaFormat['from'] = 2); $rs->get('enter_intro') == 0 ? $areaFormat['intro'] = 1 : ($areaFormat['intro'] = 2); $bodyPageType = $rs->get('body_page_type'); $method = 'GET'; $param['cookie'] = $rs->get('cookies'); // $referer = $rs->get('referer'); $useragent = $rs->get('useragent'); $replaceRNT = $rs->get('replaceRNT'); $NC = new NEAT_COLLECTOR(); $NIA = new NEAT_IMPORT_ARTICLE($NC); $articleData = $NIA->getArticle($fullURL, $tag, $area, $areaMulti, $areaFormat, $method, $param, $bodyPageType, $referer, $useragent, $replaceRNT); $tp->set_templatefile('templates/import_view.html'); $tp->assign('title', deletehtml($articleData['title'])); $tp->assign('date', date('Y年m月d日')); $tp->assign('body', $articleData['body']); $tp->assign('author', $articleData['author']); $tp->assign('from', $articleData['from']); $tp->assign('intro', $articleData['intro']); $tp->assign('url', $shortURL); $tp->assign('fullURL', $fullURL); $moduleTemplate = $tp->result(); $moduleTitle = $articleData['title']; } }
$rs_rules->get('multi_author') == 1 ? $rules[$thisRulesID]['multi']['author'] = 1 : ($rules[$thisRulesID]['multi']['author'] = 2); $rs_rules->get('multi_from') == 1 ? $rules[$thisRulesID]['multi']['from'] = 1 : ($rules[$thisRulesID]['multi']['from'] = 2); $rs_rules->get('multi_intro') == 2 ? $rules[$thisRulesID]['multi']['intro'] = 1 : ($rules[$thisRulesID]['multi']['intro'] = 2); $rs_rules->get('enter_title') == 0 ? $rules[$thisRulesID]['format']['title'] = 1 : ($rules[$thisRulesID]['format']['title'] = 2); $rs_rules->get('enter_body') == 0 ? $rules[$thisRulesID]['format']['body'] = 1 : ($rules[$thisRulesID]['format']['body'] = 2); $rs_rules->get('enter_body_page') == 0 ? $rules[$thisRulesID]['format']['body_page'] = 1 : ($rules[$thisRulesID]['format']['body_page'] = 2); $rs_rules->get('enter_body_page_link') == 0 ? $rules[$thisRulesID]['format']['body_page_link'] = 1 : ($rules[$thisRulesID]['format']['body_page_link'] = 2); $rs_rules->get('enter_author') == 0 ? $rules[$thisRulesID]['format']['author'] = 1 : ($rules[$thisRulesID]['format']['author'] = 2); $rs_rules->get('enter_from') == 0 ? $rules[$thisRulesID]['format']['from'] = 1 : ($rules[$thisRulesID]['format']['from'] = 2); $rs_rules->get('enter_intro') == 0 ? $rules[$thisRulesID]['format']['intro'] = 1 : ($rules[$thisRulesID]['format']['intro'] = 2); $rules[$thisRulesID]['bodyPageType'] = $rs_rules->get('body_page_type'); $rules[$thisRulesID]['method'] = 'GET'; $rules[$thisRulesID]['param']['cookie'] = $rs_rules->get('cookies'); } $NC = new NEAT_COLLECTOR(); $NIA = new NEAT_IMPORT_ARTICLE($NC); $articleData = $NIA->getArticle($rs->get('url'), $rules[$thisRulesID]['tag'], $rules[$thisRulesID]['area'], $rules[$thisRulesID]['multi'], $rules[$thisRulesID]['format'], $rules[$thisRulesID]['method'], $rules[$thisRulesID]['param'], $rules[$thisRulesID]['bodyPageType'], $rs_rules->get('referer'), $rs_rules->get('useragent'), $rs_rules->get('replaceRNT')); if (!$articleData) { $badLinkID[] = $rs->get('id'); continue; } else { $importTitle =& $articleData['title']; $importBody =& $articleData['body']; $importAuthor =& $articleData['author']; $importFrom =& $articleData['from']; $importIntro =& $articleData['intro']; $importDate = strtotime(date('Y-m-d H:i:s')); // if ((trim ($importTitle) AND trim ($importBody))) //@todo if (trim($importTitle)) { $NBS = new NEATBulidSql(TB_DATA);
if (!$_GET['action']) { showloading('?module=testLink&action=get&ID=' . $_GET['ID'], '测试采集连接中...', '这会根据您的网络速度以及目标站的网络速度来决定消耗时间.请耐心等待! ', 1); $tpShowBody = false; } else { if ($_GET['action'] == 'get') { $sql = 'SELECT * '; $sql .= 'FROM ' . TB_RULES . ' '; $sql .= 'WHERE id = ' . $_GET['ID']; $db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE); $rs = $db->query($sql); $db->disconnect(); if (!$rs->next_record()) { error('找不到编号为' . $_GET['ID'] . '的采集器规则!'); } $NC = new NEAT_COLLECTOR(); $NIA = new NEAT_IMPORT_ARTICLE($NC); switch ($rs->get('index_type')) { case 1: $method = 'GET'; $param['cookie'] = $rs->get('cookies'); $referer = $rs->get('referer'); $useragent = $rs->get('useragent'); $replaceRNT = $rs->get('replaceRNT'); $url = $rs->get('url'); break; case 2: $method = 'GET'; $param['cookie'] = $rs->get('cookies'); $referer = $rs->get('referer'); $useragent = $rs->get('useragent'); $replaceRNT = $rs->get('replaceRNT');