Example #1
0
        $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);
                }
            } else {
                $tmpFilterFids['filter_multi'] = intval($newArray['filter_list']['filter']['filter_multi']);
                $tmpFilterFids['filter_enter'] = intval($newArray['filter_list']['filter']['filter_enter']);
                $tmpFilterFids['filter_rule'] = addslashes(encodestring($newArray['filter_list']['filter']['filter_area']));
                $tmpFilterFids['filter_name'] = addslashes($newArray['filter_list']['filter']['filter_name']);
                $tmpFilterFids['rule_id'] = $ruleID;
                $sql = $NBS->add($tmpFilterFids);
                $db->query($sql);
            }
        }
        showloading('?module=listRules', '导入采集器配置', '采集器: ' . $_POST['ruleName'] . ' 导入成功,现在返回采集器列表.');
        $tpShowBody = false;
    }
}
Example #2
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;
                        }
                    }
                }
            }
        }
    }
}
Example #3
0
}
if (!is_numeric($_GET['ID'])) {
    error('采集器编号只能是数字!');
}
$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);
if (!$rs->next_record()) {
    error('找不到编号为' . $_GET['ID'] . '的采集器规则!');
}
$NBS = new NEATBulidSql(TB_RULES);
$rulesFids['id'] = $_GET['ID'];
$sql = $NBS->del($rulesFids);
$db->query($sql);
$NBS->setTable(TB_FILTER);
$filterFids['rule_id'] = $_GET['ID'];
$sql = $NBS->del($filterFids);
$db->query($sql);
$NBS->setTable(TB_LINKS);
$linksFids['rules'] = $_GET['ID'];
$sql = $NBS->del($linksFids);
$db->query($sql);
$NBS->setTable(TB_DATA);
$dataFids['rules'] = $_GET['ID'];
$sql = $NBS->del($dataFids);
$db->query($sql);
$db->disconnect();
showloading('?module=listRules', '删除成功', '编号为 ' . $_GET['ID'] . ' 的采集器删除成功,现在返回采集器列表.');
$tpShowBody = false;
Example #4
0
                if (!$_POST['configName']) {
                    error('请输入数据库配置的名称');
                }
                $contents = base64_decode($_SESSION['content']);
                $NX = new NEAT_XML();
                $NX->parse_document($contents);
                $newArray = $NX->xml_array['nc_dbexport_config'];
                $time = strtotime(date('Y-m-d H:i:s'));
                $NBS = new NEATBulidSql(TB_DB2DB);
                $configFids['name'] = $_POST['configName'];
                $configFids['db_type'] = addslashes(trim($newArray['access']['access_type']));
                $configFids['rules'] = @implode(',', $_POST['rulesID']);
                $configFids['host'] = addslashes($_SESSION['TARGET_DB_HOST']);
                $configFids['user'] = addslashes($_SESSION['TARGET_DB_USER']);
                $configFids['password'] = addslashes($_SESSION['TARGET_DB_PASS']);
                $configFids['db_name'] = addslashes($_SESSION['TARGET_DB_NAME']);
                $configFids['article_table'] = addslashes(trim($newArray['otherdb']['otherdb_table']));
                $configFids['field_list'] = addslashes(trim($newArray['otherdb']['otherdb_fields']));
                $configFids['value_list'] = addslashes(trim($newArray['otherdb']['otherdb_rules']));
                $configFids['date'] = $time;
                $sql = $NBS->add($configFids);
                $db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
                $db->query($sql);
                $db->disconnect();
                session_destroy();
                showloading('index.php?module=listDB', '导入成功', '导入配置: ' . $_POST['configName'] . ' 导入成功,现在返回配置列表.');
                $tpShowBody = false;
            }
        }
    }
}
Example #5
0
<?php

if (!$_GET['ID']) {
    error('导入配置编号不能为空!');
}
if (!is_numeric($_GET['ID'])) {
    error('导入配置编号只能是数字!');
}
$sql = 'DELETE ';
$sql .= 'FROM ' . TB_DB2DB . ' ';
$sql .= 'WHERE id = ' . $_GET['ID'];
$db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
$rs = $db->update($sql);
$db->disconnect();
showloading('?module=listDB', '删除成功...', '编号为' . $_GET['ID'] . '的导入规则已经被成功删除,现在返回导入规则列表');
$tpShowBody = false;
Example #6
0
            $nextStart = $start + $eachTimes;
            $geted = $nextStart - 1;
            $leaveTotal = $total - $geted;
            if ($leaveTotal < $eachTimes) {
                $eachTimes = $leaveTotal;
            }
            if ($total < $nextStart) {
                if ($_GET['mark'] and $_GET['marktype'] == 'image') {
                    @unlink($markImage);
                }
                $url = '?module=listRules';
                showloading($url, '文章图片采集任务完成...', '文章图片已经全部采集到本地目录');
                $tpShowBody = false;
            } else {
                $url = '?module=bodyImgCollection&action=processing&total=' . $total . '&rulesID=' . $rulesID . '&eachTimes=' . $eachTimes . '&savePath=' . $savePath . '&start=' . $nextStart . '&maxsize=' . $maxSize . '&minsize=' . $minSize;
                if ($_GET['mark']) {
                    if ($_GET['marktype'] == 'text') {
                        $url .= '&mark=1&marktype=text&mark_text_text=' . $_GET['mark_text_text'] . '&mark_text_tran=' . $_GET['mark_text_tran'] . '&mark_text_fontsize=' . $_GET['mark_text_fontsize'];
                    } else {
                        if ($_GET['marktype'] == 'image') {
                            $url .= '&mark=1&marktype=image&mark_image_image=' . $_GET['mark_image_image'] . '&mark_image_tran=' . $_GET['mark_image_tran'];
                        }
                    }
                }
                $message = '当前已经采集 : ' . $geted . ' 条,还有 ' . $leaveTotal . ' 条在任务队列中. (一共 ' . $total . ' 条)';
                showloading($url, '文章图片采集任务进行中...', $message, 1);
                $tpShowBody = false;
            }
        }
    }
}
Example #7
0
            break;
        case '1week':
            $savetime = 604800;
            break;
        case '1year':
            $savetime = 31536000;
            break;
        default:
            $savetime = 0;
    }
    $cookieSaveTime = !$savetime ? 0 : $savetime + time();
    if ($_POST['username'] == NEAT_USERNAME and $_POST['password'] == NEAT_PASSWORD) {
        setcookie(COOKIE_PREFIX . 'neatusername', $_POST['username'], $cookieSaveTime, COOKIE_PATH, COOKIE_DOMAIN);
        setcookie(COOKIE_PREFIX . 'neatpassword', md5($_POST['password']), $cookieSaveTime, COOKIE_PATH, COOKIE_DOMAIN);
        showloading('index.php', '登陆成功', '登陆成功,现在返回首页');
        $tpShowBody = false;
    } else {
        error('用户或密码错误,请返回重试!');
    }
} else {
    if ($_GET['logout']) {
        setcookie(COOKIE_PREFIX . 'neatusername', time() - 31536000, $cookieSaveTime, COOKIE_PATH, COOKIE_DOMAIN);
        setcookie(COOKIE_PREFIX . 'neatpassword', time() - 31536000, $cookieSaveTime, COOKIE_PATH, COOKIE_DOMAIN);
        showloading('index.php', '退出成功', '退出成功,现在返回首页');
        $tpShowBody = false;
    } else {
        $tpShowBody = false;
        $tp->set_templatefile('templates/login.html');
        $tp->output();
    }
}
Example #8
0
<?php

if (!$_GET['ID']) {
    error('采集器编号不能为空!');
}
if (!is_numeric($_GET['ID'])) {
    error('采集器编号只能是数字!');
}
if (!$_GET['action']) {
    showloading('?module=testBody&action=get&ID=' . $_GET['ID'] . '&url=' . rawurlencode($_GET['url']), '测试采集内容中...');
    $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);
        $filterSql = 'SELECT * ';
        $filterSql .= 'FROM ' . TB_FILTER . ' ';
        $filterSql .= 'WHERE rule_id = ' . $_GET['ID'];
        $rsFilter = $db->query($filterSql);
        $i = 0;
        while ($rsFilter->next_record()) {
            $filter[$i] = $rsFilter->get('filter_rule');
            ++$i;
        }
        $db->disconnect();
        if (!$rs->next_record()) {
            error('找不到编号为' . $_GET['ID'] . '的采集器规则!');
        }
Example #9
0
            $nextStart = $start + $eachTimes;
            $geted = $nextStart - 1;
            $leaveTotal = $total - $geted;
            if ($leaveTotal < $eachTimes) {
                $eachTimes = $leaveTotal;
            }
            if ($total < $nextStart) {
                $countSql = 'SELECT COUNT(*) AS total ';
                $countSql .= 'FROM ' . TB_DATA . ' ';
                $countSql .= 'WHERE rules = ' . $_GET['rulesID'];
                $rs = $db->query($countSql);
                $rs->next_record();
                $importTotal = $rs->get('total');
                $NBS = new NEATBulidSql(TB_RULES);
                $conditionFids['id'] = $_GET['rulesID'];
                $rulesFids['import_num'] = $importTotal;
                $sql = $NBS->update($rulesFids, $conditionFids);
                $db->update($sql);
                $url = $_GET['rulesID'] ? '?module=updateRulesCount&ID=' . $_GET['rulesID'] : 'index.php';
                showloading($url, '数据入库任务完成...', '文章已经全部采集到本地数据库');
                $tpShowBody = false;
            } else {
                $url = '?module=import&action=processing&total=' . $total . '&rulesID=' . $rulesID . '&eachTimes=' . $eachTimes . '&start=' . $nextStart;
                $message = '当前已经入库 : ' . $geted . ' 条,还有 ' . $leaveTotal . ' 条在任务队列中. (一共 ' . $total . ' 条)';
                showloading($url, '数据入库任务进行中...', $message, 1);
                $tpShowBody = false;
            }
        }
    }
}
$db->disconnect();
Example #10
0
<?php

if (!$_GET['ID']) {
    error('采集器编号不能为空!');
}
if (!is_numeric($_GET['ID'])) {
    error('采集器编号只能是数字!');
}
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');
Example #11
0
                            $time = strtotime(date('Y-m-d H:i:s'));
                            $NBS = new NEATBulidSql(TB_DB2DB);
                            $configFids['name'] = $name;
                            $configFids['db_type'] = trim($_GET['type']);
                            $configFids['rules'] = @implode(',', $_POST['rulesID']);
                            $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;
                            $configCondition['id'] = intval($_GET['ID']);
                            $sql = $NBS->update($configFids, $configCondition);
                            $db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
                            $db->query($sql);
                            $db->disconnect();
                            session_destroy();
                            showloading('index.php?module=listDB', '修改成功', '导入配置: ' . $name . ' 修改成功,现在返回配置列表.');
                            $tpShowBody = false;
                        }
                    }
                }
            }
        }
    }
}
Example #12
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();
Example #13
0
$sql .= 'WHERE id ';
$sql .= 'IN (' . $sqlIDList . ')';
$rs = $db->query($sql);
$count = array();
while ($rs->next_record()) {
    $rulesID = $rs->get('rules');
    ++$count[$rulesID];
}
$NBS = new NEATBulidSql(TB_RULES);
foreach ($count as $k => $v) {
    $updateFids['import_num'] = 'num';
    $conditionFids['id'] = $k;
    $config['import_num']['method'] = '-';
    $config['import_num']['num'] = $v;
    $sql = $NBS->update($updateFids, $conditionFids, $config);
    $db->update($sql);
}
$sql = 'DELETE ';
$sql .= 'FROM ' . TB_DATA . ' ';
$sql .= 'WHERE link_id ';
$sql .= 'IN (' . $sqlIDList . ')';
$db->update($sql);
$sql = 'UPDATE ' . TB_LINKS . ' ';
$sql .= 'SET import = 0 ';
$sql .= 'WHERE id ';
$sql .= 'IN (' . $sqlIDList . ')';
$db->update($sql);
$db->disconnect();
$_SERVER['HTTP_REFERER'] ? $url = $_SERVER['HTTP_REFERER'] : ($url = '?module=listImport');
showloading($url, '数据删除成功', '有 ' . $idNum . ' 条数据被成功删除.现在返回数据列表');
$tpShowBody = false;
Example #14
0
<?php

if (!$_GET['ID']) {
    error('采集器编号不能为空!');
}
if (!is_numeric($_GET['ID'])) {
    error('采集器编号只能是数字!');
}
$db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
$countSql = 'SELECT COUNT(*) AS total ';
$countSql .= 'FROM ' . TB_LINKS . ' ';
$countSql .= 'WHERE rules = ' . $_GET['ID'];
$rs = $db->query($countSql);
$rs->next_record();
$linkTotal = $rs->get('total');
$countSql = 'SELECT COUNT(*) AS total ';
$countSql .= 'FROM ' . TB_DATA . ' ';
$countSql .= 'WHERE rules = ' . $_GET['ID'];
$rs = $db->query($countSql);
$rs->next_record();
$importTotal = $rs->get('total');
$NBS = new NEATBulidSql(TB_RULES);
$conditionFids['id'] = $_GET['ID'];
$rulesFids['link_num'] = $linkTotal;
$rulesFids['import_num'] = $importTotal;
$sql = $NBS->update($rulesFids, $conditionFids);
$db->update($sql);
$db->disconnect();
showloading('?module=listRules', '更新计数成功', '编号为 ' . $_GET['ID'] . ' 的采集器更新计数,现在返回采集器列表.');
$tpShowBody = false;
Example #15
0
                 $alertTitle = $finishAlertTitle;
                 $alertMessage = $finishAlertMessage;
             }
         } else {
             if ($_GET['start'] < $pageTotal) {
                 $alertTitle = $nextAlertTitle;
                 $alertMessage = '当前任务:第' . $_GET['start'] . '页,一共' . $pageTotal . '页在任务队列中.' . $nextAlertMessage;
                 $gotoURL = $baseURL . '3&start=' . ++$_GET['start'] . '&dataCount=' . $dataCount . '&existsCount=' . $existsCount;
             } else {
                 $gotoURL = $finishBaseURL . '&dataCount=' . $dataCount . '&existsCount=' . $existsCount;
                 $alertTitle = $finishAlertTitle;
                 $alertMessage = $finishAlertMessage;
             }
         }
     }
     showloading($gotoURL, $alertTitle, $alertMessage, 1);
     $tpShowBody = false;
 } else {
     if ($_GET['action'] == 'finish') {
         if (0 < $_GET['dataCount']) {
             $NBS = new NEATBulidSql(TB_RULES);
             $updateFids['link_num'] = 'link_num';
             $conditionFids['id'] = $_GET['ID'];
             $config['link_num']['method'] = '+';
             $config['link_num']['num'] = $_GET['dataCount'];
             $sql = $NBS->update($updateFids, $conditionFids, $config);
             $db->update($sql);
         }
         $tp->set_templatefile('templates/link_collection_result.html');
         $tp->assign('existsCount', $_GET['existsCount']);
         $tp->assign('dataCount', $_GET['dataCount']);
Example #16
0
        }
    }
    $updateSql = 'UPDATE ' . TB_LINKS . ' SET ';
    $updateSql .= $adoptSql;
    $updateSql .= '	WHERE id IN (' . $sqlIDList . ')';
    $db->update($updateSql);
    $sql = 'DELETE ';
    $sql .= 'FROM ' . TB_DATA . ' ';
    $sql .= 'WHERE link_id ';
    $sql .= 'IN (' . $sqlIDList . ')';
    $db->update($sql);
} else {
    $totalSql = 'SELECT COUNT(*) AS total FROM ' . TB_LINKS . ' ';
    $totalSql .= ' WHERE rules = ' . $_GET['rules'] . ' ';
    $totalrs = $db->query($totalSql);
    $totalrs->next_record();
    $idNum = $totalrs->get('total');
    $updateSql = 'UPDATE ' . TB_LINKS . ' SET ';
    $updateSql .= $adoptSql;
    $updateSql .= '	WHERE rules = ' . $_GET['rules'] . ' ';
    $db->update($updateSql);
    $sql = 'DELETE ';
    $sql .= 'FROM ' . TB_DATA . ' ';
    $sql .= 'WHERE rules ';
    $sql .= '= ' . $_GET['rules'] . ' ';
    $db->update($sql);
}
$db->disconnect();
$_SERVER['HTTP_REFERER'] ? $url = $_SERVER['HTTP_REFERER'] : ($url = '?module=listLink');
showloading($url, '编辑成功', '有 ' . $idNum . ' 条连接更新为 ' . $message[$_GET['adopt']] . ' ,现在返回连接列表.', 1);
$tpShowBody = false;
Example #17
0
    while ($rsFilter->next_record()) {
        $filterSource[] = $rsFilter->getarray();
    }
    if (is_array($filterSource)) {
        foreach ($filterSource as $val) {
            $insertSql = '';
            $sqlFids = '';
            $sqlValue = '';
            $sign = '';
            foreach ($val as $k => $v) {
                if ($k == 'id' or $k == 'rule_id') {
                    continue;
                } else {
                    $sqlFids .= $sign . $k;
                    $sqlValue .= $sign . '\'' . addslashes($v) . '\'';
                    $sign = ', ';
                    continue;
                }
            }
            $sqlFids .= ', rule_id';
            $sqlValue .= ' , \'' . $ruleID . '\'';
            $insertSql = 'INSERT INTO ' . TB_FILTER . ' ';
            $insertSql .= '(' . $sqlFids . ') ';
            $insertSql .= 'VALUES (' . $sqlValue . ') ';
            $db->query($insertSql);
        }
    }
    showloading('?module=listRules', '复制采集器成功', '新的采集器: ' . $newRuleName . ' 复制成功,现在采集器列表.');
    $tpShowBody = false;
    $db->disconnect();
}
Example #18
0
                if ($NEAT_SWF->saved['remotePath']) {
                    foreach ($NEAT_SWF->saved['remotePath'] as $key => $val) {
                        $newPathReplace = $newPath . $val;
                        $bodyContent = str_replace($key, $newPathReplace, $bodyContent);
                    }
                }
                $conditionFids['id'] = $rs->get('id');
                $datasFids['body'] = addslashes($bodyContent);
                $datasFids['swf_geted'] = 1;
                $sql = $NBS->update($datasFids, $conditionFids);
                $db->query($sql);
            }
            $nextStart = $start + $eachTimes;
            $geted = $nextStart - 1;
            $leaveTotal = $total - $geted;
            if ($leaveTotal < $eachTimes) {
                $eachTimes = $leaveTotal;
            }
            if ($total < $nextStart) {
                $url = '?module=listRules';
                showloading($url, '文章FLASH采集任务完成...', '文章FLASH已经全部采集到本地目录');
                $tpShowBody = false;
            } else {
                $url = '?module=bodySwfCollection&action=processing&total=' . $total . '&rulesID=' . $rulesID . '&eachTimes=' . $eachTimes . '&savePath=' . $savePath . '&start=' . $nextStart . '&maxsize=' . $maxSize . '&minsize=' . $minSize;
                $message = '当前已经采集 : ' . $geted . ' 条,还有 ' . $leaveTotal . ' 条在任务队列中. (一共 ' . $total . ' 条)';
                showloading($url, '文章FLASH采集任务进行中...', $message, 10);
                $tpShowBody = false;
            }
        }
    }
}
Example #19
0
';
            continue;
        } else {
            $item .= 'item' . $val['pid'] . '.add(item' . $val['id'] . ');
';
            continue;
        }
    }
    $tp->set_templatefile('templates/category_add.html');
    $tp->assign('tree', $tree);
    $tp->assign('root', $root);
    $tp->assign('item', $item);
    $tp->assign('option', $option);
    $moduleTemplate = $tp->result();
    $moduleTitle = '添加采集器分类';
} else {
    if (!$_POST['title']) {
        error('分类名称不能为空!');
    }
    !$_POST['orderid'] ? $maxOrderID = $NC->getNodeMaxOrderID($_POST['pid']) : ($maxOrderID = $_POST['orderid']);
    $data['id'] = '';
    $data['pid'] = $_POST['pid'];
    $data['title'] = $_POST['title'];
    $data['orderid'] = $maxOrderID;
    $NC->addCategory($data);
    $catearray = $NC->getCategory();
    $getarray = $NC->getTree($catearray, 0, 0, 'category');
    $NC->doCategoryCache($getarray);
    showloading('?module=listCategory', '分类添加', '分类添加完毕,现在返回分类列表', 1);
    $tpShowBody = false;
}
Example #20
0
' . 'define(\'COOKIE_DOMAIN\', \'' . COOKIE_DOMAIN . '\');
' . 'define(\'COOKIE_PATH\', \'' . COOKIE_PATH . '\');

' . '// num of onepage

' . 'define(\'NUM_RULES_ONEPAGE\', ' . $_POST['page_rules'] . ');
' . 'define(\'NUM_LINK_ONEPAGE\', ' . $_POST['page_link'] . ');
' . 'define(\'NUM_IMPORT_ONEPAGE\', ' . $_POST['page_import'] . ');

' . '// registration information

' . 'define(\'REG_NAME\', \'' . $_POST['reg_name'] . '\');
' . 'define(\'REG_TYPE\', ' . $_POST['reg_type'] . ');
' . 'define(\'REG_SERVER_SN\', \'' . $_POST['reg_server_sn'] . '\');
' . 'define(\'REG_LOCAL_SN\', \'' . $_POST['reg_local_sn'] . '\');

' . '// username password

' . 'define(\'NEAT_USERNAME\', \'' . $_POST['username'] . '\');
' . 'define(\'NEAT_PASSWORD\', \'' . $_POST['password'] . '\');

' . '$configIgnoreExt = array(' . $ignoreExtArray . ');

' . '?>';
    $fp = fopen('includes/config.inc.php', 'w+');
    fwrite($fp, $configContents);
    fclose($fp);
    $url = '?module=sysConfig';
    showloading($url, '配置参数编辑成功', '配置文件已经更新,现在返回配置参数页.', 1);
    $tpShowBody = false;
}
Example #21
0
    $tp->assign('id', $rs->get('id'));
    $tp->assign('cfgname', $rs->get('name'));
    $moduleTemplate = $tp->result();
    $moduleTitle = '复制导入配置';
    $db->disconnect();
} else {
    $configName = trim($_POST['configname']);
    if (!$_POST['configname']) {
        error('请输入配置名称');
    }
    $sourceArray = $rs->getarray();
    foreach ($sourceArray as $key => $val) {
        if ($key == 'name' or $key == 'id') {
            continue;
        } else {
            $sqlFids .= $sign . $key;
            $sqlValue .= $sign . '\'' . addslashes($val) . '\'';
            $sign = ', ';
            continue;
        }
    }
    $sqlFids .= ', name';
    $sqlValue .= ' , \'' . addslashes($configName) . '\'';
    $insertSql = 'INSERT INTO ' . TB_DB2DB . ' ';
    $insertSql .= '(' . $sqlFids . ') ';
    $insertSql .= 'VALUES (' . $sqlValue . ') ';
    $db->query($insertSql);
    showloading('?module=listDB', '复制导入配置成功', '新的导入配置: ' . $configName . ' 复制成功,现在导入配置列表.');
    $tpShowBody = false;
    $db->disconnect();
}
Example #22
0
$sql .= 'WHERE id ';
$sql .= 'IN (' . $sqlIDList . ')';
$rs = $db->query($sql);
$count = array();
while ($rs->next_record()) {
    $rulesID = $rs->get('rules');
    ++$count[$rulesID];
}
$NBS = new NEATBulidSql(TB_RULES);
foreach ($count as $k => $v) {
    $updateFids['link_num'] = 'num';
    $conditionFids['id'] = $k;
    $config['link_num']['method'] = '-';
    $config['link_num']['num'] = $v;
    $sql = $NBS->update($updateFids, $conditionFids, $config);
    $db->update($sql);
}
$sql = 'DELETE ';
$sql .= 'FROM ' . TB_DATA . ' ';
$sql .= 'WHERE link_id ';
$sql .= 'IN (' . $sqlIDList . ')';
$db->update($sql);
$sql = 'DELETE ';
$sql .= 'FROM ' . TB_LINKS . ' ';
$sql .= 'WHERE id ';
$sql .= 'IN (' . $sqlIDList . ')';
$db->update($sql);
$db->disconnect();
$_SERVER['HTTP_REFERER'] ? $url = $_SERVER['HTTP_REFERER'] : ($url = '?module=listLink');
showloading($url, '连接删除成功', '有 ' . $idNum . ' 条连接被成功删除.现在返回连接列表');
$tpShowBody = false;