Beispiel #1
0
         continue;
     } else {
         $link =& $v;
         $sqlSearch = 'SELECT id ';
         $sqlSearch .= 'FROM ' . TB_LINKS . ' ';
         $sqlSearch .= 'WHERE url = \'' . $link . '\' ';
         $sqlSearch .= 'Limit 1';
         $rs = $db->query($sqlSearch);
         if (!$rs->next_record()) {
             ++$dataCount;
             $dataFids['id'] = '';
             $dataFids['title'] = deletehtml(addslashes($linksList['title'][$k]));
             $dataFids['url'] = addslashes(str_replace('&', '&', $link));
             $dataFids['rules'] = $_GET['ID'];
             $dataFids['date'] = strtotime(date('Y-m-d H:i:s'));
             $sql = $NBS->add($dataFids);
             $db->update($sql);
             continue;
         } else {
             ++$existsCount;
             continue;
         }
         continue;
     }
 }
 $finishBaseURL = '?module=collectionLink&action=finish&ID=' . $_GET['ID'];
 $nextAlertTitle = '继续采集...';
 $nextAlertMessage = '继续采集下一页索引的连接.请不要关闭本页.';
 $finishAlertTitle = '采集完成...';
 $finishAlertMessage = '连接采集完成,现在开始统计结果.';
 if ($_GET['type'] == 1) {
Beispiel #2
0
 $rulesFids['multi_author'] = intval($newArray['multi']['multi_author']);
 $rulesFids['multi_from'] = intval($newArray['multi']['multi_from']);
 $rulesFids['multi_intro'] = intval($newArray['multi']['multi_intro']);
 $rulesFids['enter_link'] = intval($newArray['enter']['enter_link']);
 $rulesFids['enter_title'] = intval($newArray['enter']['enter_title']);
 $rulesFids['enter_body'] = intval($newArray['enter']['enter_body']);
 $rulesFids['enter_body_page'] = intval($newArray['page']['page_enter_page']);
 $rulesFids['enter_body_page_link'] = intval($newArray['page']['page_enter_next']);
 $rulesFids['enter_author'] = intval($newArray['enter']['enter_author']);
 $rulesFids['enter_from'] = intval($newArray['enter']['enter_from']);
 $rulesFids['enter_intro'] = intval($newArray['enter']['enter_intro']);
 $rulesFids['link_num'] = 0;
 $rulesFids['import_num'] = 0;
 $rulesFids['date'] = strtotime(date('Y-m-d'));
 $rulesFids['body_page_type'] = intval($newArray['page']['page_type']);
 $sql = $NBS->add($rulesFids);
 $db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
 $db->query($sql);
 $NBS->setTable(TB_FILTER);
 $ruleID = $db->lastid();
 if ($newArray['filter_list']['filter']) {
     if ($newArray['filter_list']['filter'][0]) {
         foreach ($newArray['filter_list']['filter'] as $val) {
             $tmpFilterFids['filter_multi'] = intval($val['filter_multi']);
             $tmpFilterFids['filter_enter'] = intval($val['filter_enter']);
             $tmpFilterFids['filter_rule'] = addslashes(encodestring($val['filter_area']));
             $tmpFilterFids['filter_name'] = addslashes($val['filter_name']);
             $tmpFilterFids['rule_id'] = $ruleID;
             $sql = $NBS->add($tmpFilterFids);
             $db->query($sql);
         }
Beispiel #3
0
     ++$i;
 }
 if ($checkSqlCondition) {
     $checkSqlCondition = 'WHERE ' . $checkSqlCondition;
 }
 $checkSql .= $checkSqlCondition;
 if ($tableKey == 0 and $filtrate) {
     $rs_check = $TDB->Execute($checkSql);
     if ($rs_check) {
         $rsNum = $rs_check->RecordCount();
         $rs_check->Close();
     }
 }
 if ($rsNum == 0) {
     $NBS->setTable($tableName);
     $sql = $NBS->add($importData);
     $TDB->Execute($sql);
     if ($dbAllList['handle'][$tableName]['get']) {
         $rsNewRow = array();
         $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
         $rsNew = $TDB->Execute($checkSql);
         if ($rsNew) {
             $rsNewRow = $rsNew->fields;
             $rsNew->Close();
         }
         foreach ($dbAllList['handle'][$tableName]['get'] as $getValue) {
             $putArray[$getValue['targetTable']][$getValue['targetField']] = $rsNewRow[$getValue['field']];
         }
         continue;
     }
     continue;
Beispiel #4
0
                            $time = strtotime(date('Y-m-d H:i:s'));
                            $NBS = new NEATBulidSql(TB_DB2DB);
                            $configFids['id'] = '';
                            $configFids['db_type'] = trim($_GET['type']);
                            $configFids['rules'] = @implode(',', $_POST['rulesID']);
                            $configFids['name'] = $name;
                            $configFids['host'] = $_SESSION['TARGET_DB_HOST'];
                            $configFids['user'] = $_SESSION['TARGET_DB_USER'];
                            $configFids['password'] = $_SESSION['TARGET_DB_PASS'];
                            $configFids['db_name'] = $_SESSION['TARGET_DB_NAME'];
                            $configFids['article_table'] = $tableList;
                            $configFids['field_list'] = $fieldList;
                            $configFids['value_list'] = $dataList;
                            $configFids['recount_fields_list'] = $countFieldsList;
                            $configFids['recount_fields_value_list'] = $countFieldsValueList;
                            $configFids['recount_rules_list'] = $countRulesList;
                            $configFids['recount_rules_value_list'] = $countRulesValueList;
                            $configFids['date'] = $time;
                            $sql = $NBS->add($configFids);
                            $db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
                            $db->query($sql);
                            $db->disconnect();
                            showloading('index.php?module=listDB', '添加成功', '导入配置: ' . $name . ' 添加成功,现在返回采集器列表.');
                            $tpShowBody = false;
                        }
                    }
                }
            }
        }
    }
}
Beispiel #5
0
                $tmpFilterFids['filter_rule'] = $_POST['filter_rule'][$key];
                $tmpFilterFids['filter_name'] = $_POST['filter_name'][$key];
                $sql = $NBS->update($tmpFilterFids, $tmpConditionFids);
                $db->query($sql);
                continue;
            } else {
                $tmpDelFids['id'] = $key;
                $sql = $NBS->del($tmpDelFids);
                $db->query($sql);
                continue;
            }
        }
    }
    if ($_POST['add_filter_rule']) {
        foreach ($_POST['add_filter_rule'] as $k => $v) {
            if ($v) {
                $tmpFilterFids['filter_multi'] = $_POST['add_filter_multi'][$k];
                $tmpFilterFids['filter_enter'] = $_POST['add_filter_enter'][$k];
                $tmpFilterFids['filter_rule'] = $_POST['add_filter_rule'][$k];
                $tmpFilterFids['filter_name'] = $_POST['add_filter_name'][$k];
                $tmpFilterFids['rule_id'] = $_GET['ID'];
                $sql = $NBS->add($tmpFilterFids);
                $db->query($sql);
                continue;
            }
        }
    }
    showloading('?module=listRules', '编辑成功', '采集器: ' . $_POST['name'] . ' 编辑成功,现在返回采集器列表.');
    $tpShowBody = false;
}
$db->disconnect();