diff --git a/src/dede/co_add.php b/src/dede/co_add.php deleted file mode 100755 index 4371caaf..00000000 --- a/src/dede/co_add.php +++ /dev/null @@ -1,162 +0,0 @@ -LoadListConfig($tmplistconfig); - $listurl = ''; - $links = $dc->Testlists($listurl); - $errmsg = $dc->errString; - } else { - $demopage = '没有匹配到适合的列表页!'; - } - } - require_once(DEDEADMIN . "/templets/co_add_step1_test.htm"); - exit(); - } - - //从预览并提示进入下一步 - else { - $row = $dsql->GetOne("SELECT nid,channelid FROM `#@__co_note` WHERE isok=0 AND notename LIKE '$notename' "); - if (!is_array($row)) { - $uptime = time(); - $listconfig = urldecode($listconfig); - $inquery = " INSERT INTO `#@__co_note`(`channelid`,`notename`,`sourcelang`,`uptime`,`cotime`,`pnum`,`isok`,`usemore`,`listconfig`,`itemconfig`) - VALUES ('$channelid','$notename','$sourcelang','$uptime','0','0','0','$usemore','$listconfig',''); "; - $rs = $dsql->ExecuteNoneQuery($inquery); - if (!$rs) { - ShowMsg("保存信息时出现错误!" . $dsql->GetError(), "-1"); - exit(); - } - $nid = $dsql->GetLastID(); - } else { - $channelid = $row['channelid']; - $uptime = time(); - if (empty($freq)) $freq = 1; - if (empty($extypeid)) $extypeid = 0; - if (empty($islisten)) $islisten = 0; - $usemore = (!isset($usemore) ? 0 : 1); - - $query = " UPDATE `#@__co_note` SET - `channelid`='$channelid', - `notename`='$notename', - `sourcelang`='$sourcelang', - `uptime`='$uptime', - `isok`='1', - `usemore`='$usemore', - `listconfig`='$listconfig' WHERE nid='$nid'; "; - $dsql->ExecuteNoneQuery($query); - $nid = $row['nid']; - } - if (!isset($previewurl)) $previewurl = ''; - require_once(DEDEINC . '/dedetag.class.php'); - require_once(DEDEADMIN . "/templets/co_add_step2.htm"); - exit(); - } -} - -//保存文章规则 -/*---------------------- -function Save_Art(){ } -----------------------*/ else if ($step == 5) { - /* - [previewurl] => '' - */ - $itemconfig = "{dede:sppage sptype=\\'$sptype\\' sptype=\\'$sptype\\' srul=\\'$srul\\' erul=\\'$erul\\'}$sppage{/dede:sppage}\r\n"; - $itemconfig .= "{dede:previewurl}$previewurl{/dede:previewurl}\r\n"; - $itemconfig .= "{dede:keywordtrim}$keywordtrim{/dede:keywordtrim}\r\n"; - $itemconfig .= "{dede:descriptiontrim}$descriptiontrim{/dede:descriptiontrim}\r\n"; - $fs = explode(',', 'value,match,isunit,isdown,trim,function'); - foreach ($fields as $field) { - foreach ($fs as $f) { - $GLOBALS[$f . '_' . $field] = (!isset($GLOBALS[$f . '_' . $field]) ? '' : $GLOBALS[$f . '_' . $field]); - } - $matchstr = $GLOBALS["match_" . $field]; - $trimstr = $GLOBALS["trim_" . $field]; - $trimstr = trim(str_replace(' ', '#n#', $trimstr)); - $matchstr = trim(str_replace(' ', '#n#', $matchstr)); - if ($trimstr != '' && !preg_match("#{dede:trim#i", $trimstr)) { - $trimstr = " {dede:trim}$trimstr{/dede:trim}\r\n"; - } - $itemconfig .= "{dede:item field=\\'" . $field . "\\' value=\\'" . $GLOBALS["value_" . $field] . "\\' isunit=\\'" . $GLOBALS["isunit_" . $field] . "\\' isdown=\\'" . $GLOBALS["isdown_" . $field] . "\\'} - {dede:match}" . $matchstr . "{/dede:match} - $trimstr - {dede:function}" . $GLOBALS["function_" . $field] . "{/dede:function} -{/dede:item}\r\n"; - } - $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET itemconfig='$itemconfig' WHERE nid='$nid' "); - //echo $dsql->GetError(); - require_once(DEDEINC . '/dedecollection.class.php'); - require_once(DEDEADMIN . "/templets/co_add_step2_test.htm"); - exit(); -} else if ($step == 6) { - $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET isok='1' WHERE nid='$nid' "); - ShowMsg("成功设置一个规则!", "co_main.php"); - exit(); -} else if ($step == 7) { - $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET isok='1' WHERE nid='$nid' "); - ShowMsg("成功设置一个规则,现在转向采集页面!", "co_gather_start.php?nid=$nid"); - exit(); -} diff --git a/src/dede/co_do.php b/src/dede/co_do.php deleted file mode 100755 index 46f71a35..00000000 --- a/src/dede/co_do.php +++ /dev/null @@ -1,242 +0,0 @@ -ExecuteNoneQuery("DELETE FROM `#@__co_htmls` WHERE nid='$nid'"); - $dsql->ExecuteNoneQuery("DELETE FROM `#@__co_note` WHERE nid='$nid'"); - $dsql->ExecuteNoneQuery("DELETE FROM `#@__co_urls` WHERE nid='$nid'"); - ShowMsg("成功删除一个节点!", "co_main.php"); - exit(); -} - -//清空采集内容 -//清空采集内容时仍会保留旧的网址索引,在监控模式下始终采集新的内容 -/* -function url_clear() -*/ else if ($dopost == "clear") { - CheckPurview('co_Del'); - if (!isset($ids)) $ids = ''; - if (empty($ids)) { - if (!empty($nid)) { - $nid = intval($nid); - $dsql->ExecuteNoneQuery("DELETE FROM `#@__co_htmls` WHERE nid='$nid'"); - } - ShowMsg("成功清空一个节点采集的内容!", "co_main.php"); - exit(); - } else { - if (!empty($clshash)) { - $dsql->SetQuery("SELECT nid,url FROM `#@__co_htmls` WHERE aid IN($ids) "); - $dsql->Execute(); - while ($arr = $dsql->GetArray()) { - $nhash = md5($arr['url']); - $nid = $row['nid']; - $dsql->ExecuteNoneQuery("DELETE FROM `#@__co_urls ` WHERE nid='$nid' AND hash='$nhash' "); - } - } - $dsql->ExecuteNoneQuery("DELETE FROM `#@__co_htmls` WHERE aid IN($ids) "); - ShowMsg("成功删除指定的网址内容!", $ENV_GOBACK_URL); - exit(); - } -} else if ($dopost == "clearct") { - CheckPurview('co_Del'); - if (!empty($ids)) { - $dsql->ExecuteNoneQuery("UPDATE `#@__co_htmls` SET isdown=0,result='' WHERE aid IN($ids) "); - } - ShowMsg("成功清除所有内容!", $ENV_GOBACK_URL); - exit(); -} -/* -function url_clearall() -*/ else if ($dopost == "clearall") { - CheckPurview('co_Del'); - $dsql->ExecuteNoneQuery("DELETE FROM `#@__co_htmls` "); - ShowMsg("成功清空所有采集的临时内容!", "co_main.php"); - exit(); -} -//内容替换 -/* -function co_replace() { } -*/ else if ($dopost == "replace") { - //if() - //$nid $aid $regtype $fdstring $rpstring - $rpstring = trim($rpstring); - if ($regtype == 'string') { - $dsql->ExecuteNoneQuery("UPDATE `#@__co_htmls` SET `result`=REPLACE(`result`,'$fdstring','$rpstring') WHERE nid='$nid' "); - } else { - //返回一条测试结果,并要求用户确认操作 - if (empty($rpok)) { - $fdstring = stripslashes($fdstring); - $rpstring = stripslashes($rpstring); - $hiddenrpvalue = "\r\n\r\n"; - $fdstring = str_replace("\\/", "#ASZZ#", $fdstring); - $fdstring = str_replace('/', "\\/", $fdstring); - $fdstring = str_replace('#ASZZ#', "\\/", $fdstring); - $result = $rs = stripslashes($rs); - if ($fdstring != '') { - $result = trim(preg_replace("/$fdstring/isU", $rpstring, $rs)); - } - $wintitle = "采集管理-内容替换"; - $wecome_info = "采集管理::内容替换"; - $win = new OxWindow(); - $win->Init("co_do.php", "js/blank.js", "POST"); - $win->AddHidden('dopost', $dopost); - $win->AddHidden('nid', $nid); - $win->AddHidden('regtype', 'regex'); - $win->AddHidden('aid', $aid); - $win->AddHidden('rpok', 'ok'); - $win->AddTitle("内容替换操作确认:如果下面结果正确,点击确认,系统将替换当前节点所有内容!{$hiddenrpvalue}"); - $win->AddItem("原来的内容:", "\r\n"); - $win->AddItem("按规则替换后的内容:", "\r\n"); - $winform = $win->GetWindow("ok"); - $win->Display(); - exit(); - } else { - if ($fdstring != '') { - $dsql->SetQuery("SELECT `aid`,`result` FROM `#@__co_htmls` WHERE nid='$nid' "); - $dsql->Execute(); - while ($row = $dsql->GetArray()) { - $fdstring = stripslashes($fdstring); - $rpstring = stripslashes($rpstring); - $fdstring = str_replace("\\/", "#ASZZ#", $fdstring); - $fdstring = str_replace('/', "\\/", $fdstring); - $fdstring = str_replace('#ASZZ#', "\\/", $fdstring); - $result = trim(preg_replace("/$fdstring/isU", $rpstring, $row['result'])); - $result = addslashes($result); - $dsql->ExecuteNoneQuery("UPDATE `#@__co_htmls` SET `result`='$result' WHERE aid='{$row['aid']}' "); - } - } - } - } - ShowMsg("成功替换当前节点所有数据!", "co_view.php?aid=$aid"); - exit(); -} -//复制节点 -/* -function co_copy() -*/ else if ($dopost == "copy") { - CheckPurview('co_AddNote'); - if (empty($mynotename)) { - $wintitle = "采集管理-复制节点"; - $wecome_info = "采集管理::复制节点"; - $win = new OxWindow(); - $win->Init("co_do.php", "js/blank.js", "POST"); - $win->AddHidden("dopost", $dopost); - $win->AddHidden("nid", $nid); - $win->AddTitle("请输入新节点名称:"); - $win->AddItem("新节点名称:", ""); - $winform = $win->GetWindow("ok"); - $win->Display(); - exit(); - } - $row = $dsql->GetOne("SELECT * FROM `#@__co_note` WHERE nid='$nid'"); - foreach ($row as $k => $v) { - if (!isset($$k)) { - $$k = addslashes($v); - } - } - $usemore = (empty($usemore) ? '0' : $usemore); - $inQuery = " INSERT INTO `#@__co_note`(`channelid`,`notename`,`sourcelang`,`uptime`,`cotime`,`pnum`,`isok`,`listconfig`,`itemconfig`,`usemore`) - VALUES ('$channelid','$mynotename','$sourcelang','" . time() . "','0','0','0','$listconfig','$itemconfig','$usemore'); "; - $dsql->ExecuteNoneQuery($inQuery); - ShowMsg("成功复制一个节点!", $ENV_GOBACK_URL); - exit(); -} -//测试Rss源是否正确 -/*----------------------- -function co_testrss() --------------------------*/ else if ($dopost == "testrss") { - CheckPurview('co_AddNote'); - $msg = ''; - if ($rssurl == '') { - $msg = '你没有指定RSS地址!'; - } else { - include(DEDEINC . "/dedecollection.func.php"); - $arr = GetRssLinks($rssurl); - $msg = "从 {$rssurl} 发现的网址:
"; - $i = 1; - if (is_array($arr)) { - foreach ($arr as $ar) { - $msg .= "
\r\n"; - $msg .= "link: {$ar['link']}
title: {$ar['title']}
image: {$ar['image']}\r\n"; - $i++; - } - } - } - $wintitle = "采集管理-测试"; - $wecome_info = "采集管理::RSS地址测试"; - $win = new OxWindow(); - $win->AddMsgItem($msg); - $winform = $win->GetWindow("hand"); - $win->Display(); - exit(); -} -//测试批量网址是否正确 -/*----------------------- -function co_testregx() --------------------------*/ else if ($dopost == "testregx") { - CheckPurview('co_AddNote'); - $msg = ''; - if ($regxurl == '') { - $msg = '你没有指定匹配的网址!'; - } else { - include(DEDEINC . "/dedecollection.func.php"); - $msg = "匹配的网址:
"; - $lists = GetUrlFromListRule($regxurl, '', $startid, $endid, $addv); - foreach ($lists as $surl) { - $msg .= $surl[0] . "
\r\n"; - } - } - $wintitle = "采集管理-测试匹配规则"; - $wecome_info = "采集管理::测试匹配列表网址规则"; - $win = new OxWindow(); - $win->AddMsgItem($msg); - $winform = $win->GetWindow("hand"); - $win->Display(); - exit(); -} - -//采集未下载内容 -/*-------------------- -function co_all() ----------------------*/ else if ($dopost == "coall") { - CheckPurview('co_PlayNote'); - $mrow = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__co_htmls` "); - $totalnum = $mrow['dd']; - if ($totalnum == 0) { - ShowMsg("没发现可下载的内容!", "-1"); - exit(); - } - $wintitle = "采集管理-采集未下载内容"; - $wecome_info = "采集管理::采集未下载内容"; - $win = new OxWindow(); - $win->Init("co_gather_start_action.php", "js/blank.js", "GET"); - $win->AddHidden('startdd', '0'); - $win->AddHidden('pagesize', '5'); - $win->AddHidden('sptime', '0'); - $win->AddHidden('nid', '0'); - $win->AddHidden('totalnum', $totalnum); - $win->AddMsgItem("本操作会检测并下载‘临时内容’中所有未下载的内容,是否继续?"); - $winform = $win->GetWindow("ok"); - $win->Display(); - exit(); -} diff --git a/src/dede/co_edit.php b/src/dede/co_edit.php deleted file mode 100755 index 456521e6..00000000 --- a/src/dede/co_edit.php +++ /dev/null @@ -1,144 +0,0 @@ -ExecuteNoneQuery($query); - echo $dsql->GetError(); - if ($donext == 'save') { - ShowMsg("成功保存配置!", "co_main.php"); - } else { - require_once(dirname(__FILE__) . "/co_test_rule.php"); - } - exit(); -} -$arr = $dsql->GetOne("SELECT * FROM `#@__co_note` WHERE nid='$nid'"); - -//如果内容规则未设置,转到设置内容规则的表单 -if (trim($arr['itemconfig']) == '') { - $channelid = $arr['channelid']; - $nid = $arr['nid']; - if (!isset($previewurl)) $previewurl = ''; - - require_once(DEDEINC . '/dedetag.class.php'); - require_once(DEDEADMIN . "/templets/co_add_step2.htm"); - exit(); -} -$usemore = $arr['usemore']; -$notename = $arr['notename']; -$notes = array(); -$dsql->FreeResult(); -$dtp = new DedeTagParse(); -$dtp2 = new DedeTagParse(); -$dtp->LoadString($arr['listconfig'] . $arr['itemconfig']); -$channelid = $arr['channelid']; -$notes['keywordtrim'] = ''; -$notes['descriptiontrim'] = ''; -foreach ($dtp->CTags as $tid => $ctag) { - if ($ctag->GetName() == 'item') { - $f = $ctag->GetAtt('field'); - $notes[$f]['item'] = $ctag; - $dtp2->LoadString($ctag->GetInnerText()); - $notes[$f]['trim'] = ''; - foreach ($dtp2->CTags as $ctag2) { - if ($ctag2->GetName() == 'trim') { - $notes[$f]['trim'] .= "{dede:trim replace=\"" . $ctag2->GetAtt('replace') . "\"}" . $ctag2->GetInnerText() . "{/dede:trim}\r\n"; - } else if ($ctag2->GetName() == 'match') { - $notes[$f]['match'] = $ctag2->GetInnerText() . "\r\n"; - } else if ($ctag2->GetName() == 'function') { - $notes[$f]['function'] = $ctag2->GetInnerText() . "\r\n"; - } - } - } else if ($ctag->GetName() == 'keywordtrim') { - $notes['keywordtrim'] = $ctag->GetInnerText(); - } else if ($ctag->GetName() == 'descriptiontrim') { - $notes['descriptiontrim'] = $ctag->GetInnerText(); - } else if ($ctag->GetName() == 'noteinfo') { - $noteinfo = $ctag; - } else if ($ctag->GetName() == 'listrule') { - $listrule = $ctag; - $dtp2->LoadString($ctag->GetInnerText()); - $addurls = $dtp2->GetTagByName('addurls'); - $regxrule = $dtp2->GetTagByName('regxrule'); - $areastart = $dtp2->GetTagByName('areastart'); - $areaend = $dtp2->GetTagByName('areaend'); - $batchrule = $dtp2->GetTagByName('batchrule'); - } else if ($ctag->GetName() == 'sppage') { - $sppage = $ctag; - } else if ($ctag->GetName() == 'previewurl') { - $previewurl = trim($ctag->GetInnerText()); - } -} -if (!isset($previewurl)) $previewurl = ''; -require_once(DEDEADMIN . '/templets/co_edit.htm'); diff --git a/src/dede/co_edit_text.php b/src/dede/co_edit_text.php deleted file mode 100755 index a745b65b..00000000 --- a/src/dede/co_edit_text.php +++ /dev/null @@ -1,38 +0,0 @@ -采集点管理::更改采集规则 - 专家更改模式"; - $win = new OxWindow(); - $win->Init("co_edit_text.php", "js/blank.js", "POST"); - $win->AddHidden("job", "yes"); - $win->AddHidden("nid", $nid); - $row = $dsql->GetOne("SELECT * FROM `#@__co_note` WHERE nid='$nid' "); - $win->AddTitle("索引与基本信息配置:"); - $win->AddMsgItem(""); - $win->AddTitle("字段配置:"); - $win->AddMsgItem(""); - $winform = $win->GetWindow("ok"); - $win->Display(); - exit(); -} else { - CheckPurview('co_EditNote'); - $query = "UPDATE `#@__co_note` SET listconfig='$listconfig',itemconfig='$itemconfig' WHERE nid='$nid' "; - $rs = $dsql->ExecuteNoneQuery($query); - ShowMsg("成功修改一个规则!", "co_main.php"); - exit(); -} diff --git a/src/dede/co_export.php b/src/dede/co_export.php deleted file mode 100755 index b8533ed6..00000000 --- a/src/dede/co_export.php +++ /dev/null @@ -1,248 +0,0 @@ -GetOne("SELECT COUNT(*) AS dd FROM `#@__co_htmls` WHERE nid='$nid' AND isdown='1' "); - $totalcc = $mrow['dd']; - $rrow = $dsql->GetOne("SELECT channelid,usemore FROM `#@__co_note` WHERE nid='$nid' "); - $channelid = $rrow['channelid']; - $usemore = $rrow['usemore']; - } else { - $mrow = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__co_htmls` WHERE isdown='1' "); - $totalcc = $mrow['dd']; - } - include DedeInclude("templets/co_export.htm"); - exit(); -} else { - require_once(DEDEINC . '/dedecollection.class.php'); - $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 0; - $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0; - $pageno = isset($pageno) && is_numeric($pageno) ? $pageno : 1; - $startid = isset($startid) && is_numeric($startid) ? $startid : 0; - $endid = isset($endid) && is_numeric($endid) ? $endid : 0; - - if (!isset($makehtml)) $makehtml = 0; - if (!isset($onlytitle)) $onlytitle = 0; - if (!isset($usetitle)) $usetitle = 0; - if (!isset($autotype)) $autotype = 0; - - $co = new DedeCollection(); - $co->LoadNote($nid); - $orderway = (($co->noteInfos['cosort'] == 'desc' || $co->noteInfos['cosort'] == 'asc') ? $co->noteInfos['cosort'] : 'desc'); - if ($channelid == 0 && $typeid == 0) { - ShowMsg('请指定默认导出栏目或频道ID!', 'javascript:;'); - exit(); - } - if ($channelid == 0) { - $row = $dsql->GetOne("SELECT ch.* FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$typeid'; "); - } else { - $row = $dsql->GetOne("SELECT * FROM `#@__channeltype` WHERE id='$channelid'; "); - } - if (!is_array($row)) { - echo "找不到频道内容模型信息,无法完成操作!"; - exit(); - } - - //分析规则,并生成临时的SQL语句 - $channelid = $row['id']; - $maintable = $row['maintable']; - $addtable = $row['addtable']; - if (empty($maintable)) $maintable = '#@__archives'; - if (empty($addtable)) { - echo "找不主表配置信息,无法完成操作!"; - exit(); - } - $adminid = $cuserLogin->getUserID(); - - //微索引表 - $indexSqlTemplate = "INSERT INTO `#@__arctiny`(`arcrank`,`typeid`,`channel`,`senddate`,`sortrank`) VALUES ('$arcrank','@typeid@' ,'$channelid','@senddate@', '@sortrank@'); "; - - //基本信息主表 - $mainSqlTemplate = "INSERT INTO `$maintable`(id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,description,keywords) - VALUES ('@aid@','@typeid@','@sortrank@','@flag@','0','$channelid','$arcrank','0','0','@title@','','','@writer@','@source@','@litpic@','@pubdate@','@senddate@','$adminid','@description@','@keywords@'); "; - - //生成附加表插入的SQL语句 - $inadd_f = $inadd_v = ''; - $dtp = new DedeTagParse(); - $dtp->SetNameSpace('field', '<', '>'); - $dtp->LoadString($row['fieldset']); - foreach ($dtp->CTags as $ctag) { - $tname = $ctag->GetTagName(); - $inadd_f .= ",`$tname`"; - $notsend = $ctag->GetAtt('notsend'); - $fieldtype = $ctag->GetAtt('type'); - if ($notsend == 1) { - //对不同类型设置默认值 - if ($ctag->GetAtt('default') != '') { - $dfvalue = $ctag->GetAtt('default'); - } else if ($fieldtype == 'int' || $fieldtype == 'float' || $fieldtype == 'number') { - $dfvalue = '0'; - } else if ($fieldtype == 'dtime') { - $dfvalue = time(); - } else { - $dfvalue = ''; - } - $inadd_v .= ",'$dfvalue'"; - } else { - $inadd_v .= ",'@$tname@'"; - } - } - $addSqlTemplate = "INSERT INTO `{$addtable}`(`aid`,`typeid`{$inadd_f}) Values('@aid@','@typeid@'{$inadd_v})"; - - //导出数据的SQL操作 - $dtp = new DedeTagParse(); - $totalpage = $totalcc / $pagesize; - $startdd = ($pageno - 1) * $pagesize; - if (!empty($nid)) { - $dsql->SetQuery("SELECT * FROM `#@__co_htmls` WHERE nid='$nid' AND isdown='1' ORDER BY aid $orderway LIMIT $startdd,$pagesize"); - } else { - $dsql->SetQuery("SELECT * FROM `#@__co_htmls` WHERE isdown='1' ORDER BY aid $orderway LIMIT $startdd,$pagesize"); - } - $dsql->Execute(); - while ($row = $dsql->GetObject()) { - if (trim($row->result == '')) continue; - - //$addSqlTemplate,$mainSqlTemplate,$indexSqlTemplate - $ntypeid = ($autotype == 1 && $row->typeid != 0) ? $row->typeid : $typeid; - $indexSql = str_replace('@typeid@', $ntypeid, $indexSqlTemplate); - $mainSql = str_replace('@typeid@', $ntypeid, $mainSqlTemplate); - $addSql = str_replace('@typeid@', $ntypeid, $addSqlTemplate); - $dtp->LoadString($row->result); - $exid = $row->aid; - if (!is_array($dtp->CTags)) continue; - - //获取时间和标题 - $pubdate = $sortrank = time(); - $title = $row->title; - $litpic = ''; - foreach ($dtp->CTags as $ctag) { - $itemName = $ctag->GetAtt('name'); - if ($itemName == 'title' && $usetitle == 0) { - $title = trim($ctag->GetInnerText()); - if ($title == '') { - $title = $row->title; - } - } else if ($itemName == 'pubdate') { - $pubdate = trim($ctag->GetInnerText()); - if (preg_match("#[^0-9]#", $pubdate)) { - $pubdate = $sortrank = GetMkTime($pubdate); - } else { - $pubdate = $sortrank = time(); - } - } else if ($itemName == 'litpic') { - $litpic = trim($ctag->GetInnerText()); - } - } - - //检测重复标题 - $title = addslashes($title); - if ($onlytitle) { - $testrow = $dsql->GetOne("SELECT COUNT(ID) AS dd FROM `$maintable` WHERE title LIKE '$title'"); - if ($testrow['dd'] > 0) { - echo "数据库已存在标题为: {$title} 的文档,程序阻止了此本条内容导入
\r\n"; - continue; - } - } - - //替换固定的项目 - $senddate = time(); - $flag = ''; - if ($litpic != '') $flag = 'p'; - - //随机推荐 - if ($randcc > 0) { - $rflag = mt_rand(1, $randcc); - if ($rflag == $randcc) { - $flag = ($flag == '' ? 'c' : $flag . ',c'); - } - } - $indexSql = str_replace('@senddate@', $senddate, $indexSql); - $indexSql = str_replace('@sortrank@', $sortrank, $indexSql); - $mainSql = str_replace('@flag@', $flag, $mainSql); - $mainSql = str_replace('@sortrank@', $sortrank, $mainSql); - $mainSql = str_replace('@pubdate@', $pubdate, $mainSql); - $mainSql = str_replace('@senddate@', $senddate, $mainSql); - $mainSql = str_replace('@title@', cn_substr($title, $cfg_title_maxlen), $mainSql); - //$mainSql = str_replace('@title@', cn_substr($title, 60), $mainSql); 原来的语句,采集的文章导出到栏目后标题不全 - $addSql = str_replace('@sortrank@', $sortrank, $addSql); - $addSql = str_replace('@senddate@', $senddate, $addSql); - - //替换模型里的其它字段 - foreach ($dtp->CTags as $ctag) { - if ($ctag->GetName() != 'field') { - continue; - } - $itemname = $ctag->GetAtt('name'); - $itemvalue = addslashes(trim($ctag->GetInnerText())); - $mainSql = str_replace("@$itemname@", $itemvalue, $mainSql); - $addSql = str_replace("@$itemname@", $itemvalue, $addSql); - } - - //插入数据库 - $rs = $dsql->ExecuteNoneQuery($indexSql); - if ($rs) { - $aid = $dsql->GetLastID(); - $mainSql = str_replace('@aid@', $aid, $mainSql); - $addSql = str_replace('@aid@', $aid, $addSql); - $mainSql = preg_replace("#@([a-z0-9]{1,})@#", '', $mainSql); - $addSql = preg_replace("#@([a-z0-9]{1,})@#", '', $addSql); - $rs = $dsql->ExecuteNoneQuery($mainSql); - if (!$rs) { - echo "导入 '$title' 时错误:" . $dsql->GetError() . "
"; - $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$aid' "); - } else { - $rs = $dsql->ExecuteNoneQuery($addSql); - if (!$rs) { - echo "导入 '$title' 时错误:" . $dsql->GetError() . "
"; - $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$aid' "); - $dsql->ExecuteNoneQuery("DELETE FROM `$maintable` WHERE id='$aid' "); - } - } - } - $dsql->ExecuteNoneQuery("UPDATE `#@__co_htmls` SET isexport=1 WHERE aid='$exid' "); - } - - //检测是否完成或后续操作 - if ($totalpage <= $pageno) { - if ($channelid > 0 && $makehtml == 1) { - if ($autotype == 0 && !empty($nid)) { - $mhtml = "makehtml_archives_action.php?typeid=$typeid&startid=$startid&endid=$endid&pagesize=20"; - ShowMsg("完成数据导入,准备生成文档HTML...", $mhtml); - exit(); - } else { - ShowMsg("完成所有数据导入,请手工更新HTML!", "javascript:;"); - exit(); - } - } else { - ShowMsg("完成所有数据导入!", "javascript:;"); - exit(); - } - } else { - if ($totalpage > 0) { - $rs = substr(($pageno / $totalpage * 100), 0, 2); - } else { - $rs = 100; - } - $pageno++; - $gourl = "co_export.php?dopost=done&nid=$nid&totalcc=$totalcc&channelid=$channelid&pageno=$pageno"; - $gourl .= "&nid=$nid&typeid=$typeid&autotype=$autotype&arcrank=$arcrank&pagesize=$pagesize&randcc=$randcc"; - $gourl .= "&startid=$startid&endid=$endid&onlytitle=$onlytitle&usetitle=$usetitle&makehtml=$makehtml"; - ShowMsg("完成 {$rs}% 导入,继续执行操作...", $gourl, '', 500); - exit(); - } -} diff --git a/src/dede/co_export_corule.php b/src/dede/co_export_corule.php deleted file mode 100755 index 610de853..00000000 --- a/src/dede/co_export_corule.php +++ /dev/null @@ -1,34 +0,0 @@ -GetOne("Select * From `#@__co_note` where nid='$nid'"); -$noteconfig = "{dede:listconfig}\r\n".$row['listconfig']."\r\n{/dede:listconfig}\r\n\r\n"; -$noteconfig .= "{dede:itemconfig}\r\n".$row['itemconfig']."\r\n{/dede:itemconfig}"; -if(empty($extype) || $extype=='base64') -{ - $noteconfig = "BASE64:".base64_encode($noteconfig).":END"; - $exmsg = "   【导出为普通格式】 "; -} -else -{ - $exmsg = "   【导出为Base64格式】 "; -} -$wintitle = "导出采集规则"; -$wecome_info = "采集节点管理::导出采集规则 $exmsg"; -$win = new OxWindow(); -$win->Init(); -$win->AddTitle("以下为规则 [{$row['notename']}] 的文本配置,你可以共享给你的朋友:"); -$winform = $win->GetWindow("hand",""); -$win->Display(); diff --git a/src/dede/co_gather_start.php b/src/dede/co_gather_start.php deleted file mode 100755 index 195da17f..00000000 --- a/src/dede/co_gather_start.php +++ /dev/null @@ -1,31 +0,0 @@ -LoadNote($nid); - $row = $dsql->GetOne("SELECT COUNT(aid) AS dd FROM `#@__co_htmls` WHERE nid='$nid'; "); - if ($row['dd'] == 0) { - $unum = "没有记录或从来没有采集过这个节点!"; - } else { - $unum = "共有 {$row['dd']} 个历史种子网址![更新种子网址,并采集]"; - } -} else { - $nid = ""; - $row['dd'] = ""; - $ntitle = '监控式采集:'; - $unum = "没指定采集节点,将使用检测新内容采集模式!"; -} -include DedeInclude('templets/co_gather_start.htm'); diff --git a/src/dede/co_gather_start_action.php b/src/dede/co_gather_start_action.php deleted file mode 100755 index f2adb999..00000000 --- a/src/dede/co_gather_start_action.php +++ /dev/null @@ -1,71 +0,0 @@ - $startdd + $pagesize) $limitSql = " LIMIT $startdd,$pagesize "; -else $limitSql = " LIMIT $startdd," . ($totalnum - $startdd); - -if ($totalnum - $startdd < 1) { - if (empty($nid)) { - $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET cotime='" . time() . "'; "); - } else { - $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET cotime='" . time() . "' WHERE nid='$nid'; "); - } - ShowMsg('完成当前下载任务!', 'javascript:;'); - exit(); -} - -$co = new DedeCollection(); -if (!empty($nid)) $co->LoadNote($nid); - -//没指定采集ID时下载所有内容 -if (!empty($nid)) { - $dsql->SetQuery("SELECT aid,nid,url,isdown,litpic FROM `#@__co_htmls` WHERE nid=$nid $limitSql "); -} else { - $dsql->SetQuery("SELECT aid,nid,url,isdown,litpic FROM `#@__co_htmls` $limitSql "); -} -$dsql->Execute(99); -$tjnum = $startdd; -while ($row = $dsql->GetObject(99)) { - if ($row->isdown == 0) { - if (empty($nid)) $co->LoadNote($row->nid); - $co->DownUrl($row->aid, $row->url, $row->litpic); - } - $tjnum++; - if ($sptime > 0) sleep($sptime); -} -if ($totalnum - $oldstart != 0) { - $tjlen = ceil((($tjnum - $oldstart) / ($totalnum - $oldstart)) * 100); - $dvlen = $tjlen * 2; - $tjsta = "
"; - $tjsta .= "
完成当前任务的:$tjlen %,继续执行任务..."; -} -if ($tjnum < $totalnum) { - ShowMsg($tjsta, "co_gather_start_action.php?notckpic=$notckpic&sptime=$sptime&nid=$nid&oldstart=$oldstart&totalnum=$totalnum&startdd=" . ($startdd + $pagesize) . "&pagesize=$pagesize", "", 0); - exit(); -} else { - if (empty($nid)) { - $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET cotime='" . time() . "'; "); - } else { - $dsql->ExecuteNoneQuery("UPDATE `#@__co_note` SET cotime='" . time() . "' WHERE nid='$nid'; "); - } - ShowMsg("完成当前下载任务!", "javascript:;"); - exit(); -} diff --git a/src/dede/co_get_corule.php b/src/dede/co_get_corule.php deleted file mode 100755 index 540748a6..00000000 --- a/src/dede/co_get_corule.php +++ /dev/null @@ -1,99 +0,0 @@ -采集点管理::导入采集规则"; - $win = new OxWindow(); - $win->Init("co_get_corule.php","js/blank.js","POST"); - $win->AddHidden("job","yes"); - $win->AddTitle("请在下面输入你要导入的文本配置:(建议用base64编码[支持不编码的规则,但不兼容旧版规则])"); - $win->AddMsgItem(""); - $winform = $win->GetWindow("ok"); - $win->Display(); - exit(); -} -else -{ - CheckPurview('co_AddNote'); - require_once(DEDEINC."/dedetag.class.php"); - $notes = trim($notes); - - //对Base64格式的规则进行解码 - if(ereg('^BASE64:',$notes)) - { - if(!ereg(':END$',$notes)) - { - ShowMsg('该规则不合法,Base64格式的采集规则为:BASE64:base64编码后的配置:END !','-1'); - exit(); - } - $notess = explode(':',$notes); - $notes = $notess[1]; - $notes = base64_decode(ereg_replace("[\r\n\t ]",'',$notes)) OR die('配置字符串有错误!'); - } - else - { - $notes = stripslashes($notes); - } - $dtp = new DedeTagParse(); - $dtp->LoadString($notes); - if(!is_array($dtp->CTags)) - { - ShowMsg('该规则不合法,无法导入!','-1'); - exit(); - } - $ctag1 = $dtp->GetTagByName('listconfig'); - $ctag2 = $dtp->GetTagByName('itemconfig'); - $listconfig = $ctag1->GetInnerText(); - $itemconfig = addslashes($ctag2->GetInnerText()); - $dtp->LoadString($listconfig); - $listconfig = addslashes($listconfig); - $noteinfo = $dtp->GetTagByName('noteinfo'); - if(!is_object($noteinfo)) - { - ShowMsg("该规则不合法,无法导入!","-1"); - exit(); - } - foreach($noteinfo->CAttribute->Items as $k=>$v) - { - $$k = addslashes($v); - } - $uptime = time(); - if(empty($freq)) - { - $freq = 1; - } - if(empty($extypeid)) - { - $extypeid = 0; - } - if(empty($islisten)) - { - $islisten = 0; - } - $inquery = " INSERT INTO `#@__co_note`(`channelid`,`notename`,`sourcelang`,`uptime`,`cotime`,`pnum`,`isok`,`usemore`,`listconfig`,`itemconfig`) - VALUES ('$channelid','$notename','$sourcelang','$uptime','0','0','0','$usemore','$listconfig','$itemconfig'); "; - $rs = $dsql->ExecuteNoneQuery($inquery); - if(!$rs) - { - ShowMsg("保存信息时出现错误!".$dsql->GetError(),"-1"); - exit(); - } - ShowMsg("成功导入一个规则!","co_main.php"); - exit(); -} diff --git a/src/dede/co_getsource_url_action.php b/src/dede/co_getsource_url_action.php deleted file mode 100755 index a182f36c..00000000 --- a/src/dede/co_getsource_url_action.php +++ /dev/null @@ -1,98 +0,0 @@ -GetOne("SELECT COUNT(*) AS dd FROM `#@__co_htmls` WHERE nid='$nid' "); - $totalnum = $mrow['dd']; - $gurl = "co_gather_start_action.php?notckpic=$notckpic&islisten=$islisten&nid=$nid&startdd=$startdd&pagesize=$pagesize&sptime=$sptime"; - if ($totalnum <= 0) { - ShowMsg("你指定的模式为:[下载种子网址中未下载内容]
使用这个模式节点必须已经有种子网址,否则请使用其它模式!", "javascript:;"); - exit(); - } else { - ShowMsg("检测节点正常,现转向网页采集...", $gurl . "&totalnum=$totalnum"); - exit(); - } -} - -//监控式采集(检测新内容) -/*----------------------------- -function Download_new() { } -------------------------------*/ else if ($islisten == 1) { - $gurl = "co_gather_start_action.php?notckpic=$notckpic&islisten=1&nid=$nid&startdd=$startdd&pagesize=$pagesize&sptime=$sptime"; - $gurlList = "co_getsource_url_action.php?islisten=1&nid=0&pagesize=$pagesize&sptime=$sptime"; - //针对专门节点 - if (!empty($nid)) { - $co = new DedeCollection(); - $co->LoadNote($nid); - $limitList = $co->GetSourceUrl(1, 0, 100); - $row = $co->dsql->GetOne("SELECT COUNT(aid) AS dd FROM `#@__co_htmls` WHERE nid='$nid' "); - $totalnum = $row['dd']; - if ($totalnum == 0) { - ShowMsg("在这节点中没发现有新内容....", "javascript:;"); - exit(); - } else { - ShowMsg("已获得所有种子网址,转向网页采集...", $gurl . "&totalnum=$totalnum"); - exit(); - } - } - //针对所有节点 - else { - $curpos = (isset($curpos) ? intval($curpos) : 0); - $row = $dsql->GetOne("SELECT nid FROM `#@__co_note` ORDER BY nid ASC LIMIT $curpos,1"); - $nnid = $row['nid']; - if (!is_array($row)) { - ShowMsg("完成所有节点检测....", "co_gather_start_action.php?notckpic=0&sptime=0&nid=0&startdd=0&pagesize=5&totalnum=" . $totalnum); - exit(); - } else { - $co = new DedeCollection(); - $co->LoadNote($nnid); - $limitList = $co->GetSourceUrl(1, 0, 100); - $curpos++; - ShowMsg("已检测节点( {$nnid} ),继续下一个节点...", $gurlList . "&curpos=$curpos"); - exit(); - } - } -} -//重新下载所有内容模式 -/*----------------------------- -function Download_all() { } -------------------------------*/ else { - $gurl = "co_gather_start_action.php?notckpic=$notckpic&islisten=$islisten&nid=$nid&startdd=$startdd&pagesize=$pagesize&sptime=$sptime"; - $gurlList = "co_getsource_url_action.php?islisten=$islisten&nid=$nid&startdd=$startdd&pagesize=$pagesize&sptime=$sptime"; - $co = new DedeCollection(); - $co->LoadNote($nid); - $limitList = $co->GetSourceUrl($islisten, $glstart, $pagesize); - if ($limitList == 0) { - $row = $co->dsql->GetOne("SELECT COUNT(aid) AS dd FROM `#@__co_htmls` WHERE nid='$nid'"); - $totalnum = $row['dd']; - ShowMsg("已获得所有种子网址,转向网页采集...", $gurl . "&totalnum=$totalnum"); - exit(); - } - if ($limitList > 0) { - ShowMsg("采集列表剩余:{$limitList} 个页面,继续采集...", $gurlList . "&glstart=" . ($glstart + $pagesize), 0, 100); - exit(); - } -} diff --git a/src/dede/co_main.php b/src/dede/co_main.php deleted file mode 100755 index b3240b3b..00000000 --- a/src/dede/co_main.php +++ /dev/null @@ -1,32 +0,0 @@ -SetTemplet(DEDEADMIN . "/templets/co_main.htm"); -$dlist->SetSource($sql); -$dlist->display(); - -function GetDatePage($mktime) -{ - return $mktime == '0' ? '从未采集过' : MyDate('Y-m-d', $mktime); -} - -function TjUrlNum($nid) -{ - global $dsql; - $row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__co_htmls` WHERE nid='$nid' "); - return $row['dd']; -} diff --git a/src/dede/co_test_rule.php b/src/dede/co_test_rule.php deleted file mode 100755 index ea4bee0f..00000000 --- a/src/dede/co_test_rule.php +++ /dev/null @@ -1,18 +0,0 @@ -LoadNote($nid); -include DedeInclude('templets/co_test_rule.htm'); -exit(); diff --git a/src/dede/co_url.php b/src/dede/co_url.php deleted file mode 100755 index 6f382c56..00000000 --- a/src/dede/co_url.php +++ /dev/null @@ -1,57 +0,0 @@ - - - "; -} else { - $exportbt = ""; -} - -$sql = "SELECT cu.aid,cu.nid,cu.isexport AS isex,cu.title,cu.url,cu.dtime,cu.isdown,cn.notename,tp.typename FROM `#@__co_htmls` cu -LEFT JOIN `#@__co_note` cn ON cn.nid=cu.nid -LEFT JOIN `#@__arctype` tp ON tp.id=cu.typeid -$where ORDER BY cu.aid DESC"; -$dlist = new DataListCP(); -$dlist->SetParameter("nid", $nid); -$dlist->SetParameter("small", $small); -if ($small == 0) { - $dlist->SetTemplate(DEDEADMIN . "/templets/co_url.htm"); -} else { - $dlist->SetTemplate(DEDEADMIN . "/templets/co_url_2.htm"); -} -$dlist->SetSource($sql); -$dlist->display(); - -function IsDownLoad($isd) -{ - if ($isd == "0") return "未下载"; - else return "已下载"; -} - -function IsExData($isex) -{ - if ($isex == 0) return "未导出"; - else return "已导出"; -} diff --git a/src/dede/co_view.php b/src/dede/co_view.php deleted file mode 100755 index 4c989000..00000000 --- a/src/dede/co_view.php +++ /dev/null @@ -1,56 +0,0 @@ -ExecuteNoneQuery("UPDATE `#@__co_htmls` SET result='$result' WHERE aid='$aid'; "); - ShowMsg("成功保存一条记录!", $backurl); - exit(); -} -$dsql->SetSql("SELECT * FROM `#@__co_htmls` WHERE aid='$aid'"); -$dsql->Execute(); -$row = $dsql->GetObject(); -$isdown = $row->isdown; -$nid = $row->nid; -$url = $row->url; -$dtime = $row->dtime; -$body = $row->result; -$litpic = $row->litpic; -$fields = array(); -if ($isdown == 0) { - $co = new DedeCollection(); - $co->LoadNote($nid); - $co->DownUrl($aid, $url, $litpic); - $co->dsql->SetSql("SELECT * FROM `#@__co_htmls` WHERE aid='$aid'"); - $co->dsql->Execute(); - $row = $co->dsql->GetObject(); - $isdown = $row->isdown; - $nid = $row->nid; - $url = $row->url; - $dtime = $row->dtime; - $body = $row->result; - $litpic = $row->litpic; -} -$dtp = new DedeTagParse(); -$dtp->SetNameSpace("dede", "{", "}"); -$dtp->LoadString($body); -include DedeInclude('templets/co_view.htm'); diff --git a/src/dede/inc/grouplist.txt b/src/dede/inc/grouplist.txt index afaa9bc4..ff861aa1 100755 --- a/src/dede/inc/grouplist.txt +++ b/src/dede/inc/grouplist.txt @@ -42,19 +42,6 @@ >a_MyCheck>审核我发布的文档 >a_Recycling>管理回收站 ->>采集管理 - ->co_NewRule>管理数据规则模型 ->co_Switch>导入外部数据 ->co_AddNote>增加采集节点 ->co_EditNote>修改采集节点 ->co_PlayNote>采集数据 ->co_ListNote>列出采集节点 ->co_ViewNote>管理已下载内容 ->co_Export>采集内容入库 ->co_Del>删除采集节点 ->co_GetOut>导入离线数据 - >>模板管理 >temp_All>管理所有模板 diff --git a/src/dede/inc/inc_action_info.php b/src/dede/inc/inc_action_info.php index abc90b86..f9128638 100755 --- a/src/dede/inc/inc_action_info.php +++ b/src/dede/inc/inc_action_info.php @@ -461,46 +461,3 @@ $actionSearch[10] = array( ), ) ); -$actionSearch[11] = array( - 'toptitle' => '采集', - 'title' => '采集管理', - 'description' => '内容采集管理操作', - 'soniterm' => array( - 0 => array( - 'title' => '采集节点管理 ', - 'description' => '单个采集节点的管理页面,可以添加采集,导入,导出采集节点等', - 'purview' => 'co_ListNote', - 'linkurl' => 'co_main.php' - ), - 1 => array( - 'title' => '临时内容管理 ', - 'description' => '采集的临时内容存放处', - 'purview' => 'co_ViewNote', - 'linkurl' => 'co_url.php' - ), - 2 => array( - 'title' => '导入采集规则', - 'description' => '导入采集的规则', - 'purview' => 'co_GetOut', - 'linkurl' => 'co_get_corule.php' - ), - 3 => array( - 'title' => '智能标记向导', - 'description' => '可以根据需要生成相应的调用标签', - 'purview' => 'temp_Other', - 'linkurl' => 'mytag_tag_guide.php' - ), - 4 => array( - 'title' => '监控采集模式 ', - 'description' => '监控采集模式', - 'purview' => 'co_GetOut', - 'linkurl' => 'co_gather_start.php' - ), - 5 => array( - 'title' => '采集未下载内容 ', - 'description' => '采集没有下载完成的内容', - 'purview' => 'co_GetOut', - 'linkurl' => 'co_do.php?dopost=coall' - ), - ) -); diff --git a/src/dede/inc/inc_menu.php b/src/dede/inc/inc_menu.php index 59b0449e..0a97eb07 100755 --- a/src/dede/inc/inc_menu.php +++ b/src/dede/inc/inc_menu.php @@ -108,14 +108,6 @@ $menusMain = " $adminMenu1 - - - - - - - - diff --git a/src/dede/inc/inc_menu_map.php b/src/dede/inc/inc_menu_map.php index 97676a88..b4a9d770 100755 --- a/src/dede/inc/inc_menu_map.php +++ b/src/dede/inc/inc_menu_map.php @@ -60,14 +60,6 @@ $menusMain = " - - - - - - - - diff --git a/src/dede/templets/co_add_step0.htm b/src/dede/templets/co_add_step0.htm deleted file mode 100755 index e232a64b..00000000 --- a/src/dede/templets/co_add_step0.htm +++ /dev/null @@ -1,38 +0,0 @@ - - - - -选择内容模型 - - - - - - - - - - - - - - - - -
选择内容模型 -
- -
- -
- - diff --git a/src/dede/templets/co_add_step1.htm b/src/dede/templets/co_add_step1.htm deleted file mode 100755 index 2711211f..00000000 --- a/src/dede/templets/co_add_step1.htm +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - 新增采集节点 - - - - - - -
-
-
新增采集节点:第一步设置基本信息及网址索引页规则
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
节点基本信息
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
节点名称:目标页面编码: - - GB2312 - - UTF8 - - BIG5 -
区域匹配模式: - - 正则表达式 - - 字符串 - 内容导入顺序: - - 与目标站一致 - - 与目标站相反 -
以下选项仅在开启防盗链模式才需设定,如果目标网站没有防盗链功能请不要开启,否则会降低采集速度。
防盗链模式: - - 不开启 - - 开启 - 资源下载超时时间: - 秒 -
引用网址: - - (一般为目标网站其中一个文章页的网址) -
-
- - - - - -
列表网址获取规则
-
- - - - - - - - - - - - - - - - - - - - - -
来源属性: - - 批量生成列表网址 - - 手工指定列表网址 - - 从RSS中获取 -
批量生成地址设置: - - - - - - - - - - -
- 匹配网址: - - -
- (如:http://wwws.dedebiz.com/html/test/list_(*).html,如果不能匹配所有网址,可以在手工指定网址的地方输入要追加的网址) -
- (*)从 - - 到 - - (页码或规律数字)  - 每页递增: - - - 启用多栏目通配(#) -
-
手工指定网址:
- 在指定了通配规则后有些不能匹配的网址也可以在这里指定。
-
-
- - - - - -
文章网址匹配规则
-
- - - - - - - - - - - - - - - - -
内容网址匹配模式: - - 指定包含有文章网址的区域(可以获取区域的网址、标题、图片等信息) - - 指定网址正则表达式(仅能获得网址信息)
包含有文章网址的区域设置: - - - - - - - - - - - - - - - - - - - - -
区域开始的HTML: - -
区域结束的HTML: - -
如果链接中含有图片: - - 不处理 - - 采集为缩略图 -
对区域网址进行再次筛选:
- (使用正则表达式)
必须包含: - - (优先级高于后者)
不能包含: -
-
-
  -
-
- - - \ No newline at end of file diff --git a/src/dede/templets/co_add_step1_test.htm b/src/dede/templets/co_add_step1_test.htm deleted file mode 100755 index b51a8381..00000000 --- a/src/dede/templets/co_add_step1_test.htm +++ /dev/null @@ -1,77 +0,0 @@ - - - - -采集节点测试 - - - - - -
-
-
新增采集节点:测试基本信息及网址索引页规则设置
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
网址获取规则测试:
- 测试的列表网址: -
- 获得的文章网址(只显示前十条):
- \r\n"; - if($arr['image'] != '') $arr['image'] = "\r\n"; - echo "
"; - echo "网址: {$arr['link']}
\r\n标题: {$arr['title']}
\r\n图片: {$arr['image']}\r\n"; - $i++; - if($i>10) break; - } - } - else - { - echo $errmsg; - } - ?> -
- -   - -
-
- - diff --git a/src/dede/templets/co_add_step2.htm b/src/dede/templets/co_add_step2.htm deleted file mode 100755 index 42bdbf74..00000000 --- a/src/dede/templets/co_add_step2.htm +++ /dev/null @@ -1,341 +0,0 @@ - - - - - -新增采集节点 - - - - -
-
-
新增采集节点:第二步设置内容字段获取规则
-
-
- - - - - - - - - - - - - -
- - - - - -
网页内容获取规则
-
- - - - - - - - - - - - - - - - - - - - -
预览网址: 
内容分页导航所在的区域匹配规则:
- - 全部列出的分页列表
- - 上下页形式或不完整的分页列表 -
- - 分页列表规则 开始: - - 结束: - -
如果设定分页列表规则.可采用地址规则(正则),其中{p}是递增变量,从1开始每次增加1,例如:{path}{file}_{p}{ext}
- 规则说明:{path}地址+目录 {file}文件 {ext}文件扩展名{p}分页列表数
-  以下为固定的采集项目:(项目点击可展开/隐藏,内容摘要、关键字、缩略图系统会用正则进行自动匹配) -
- - - - - - - - - - - - - - -
- - - - -
- - - - - -
关键字过滤内容: - -
-
- - - - -
- - - - - -
摘要过滤内容: - -
-
- - - - - - - -
 文章标题
- - - - - - - - - - - -
匹配规则: - -
过滤规则:
-
- - - - - - - -
 文章作者
- - - - - - - - - - - -
匹配规则: -
过滤规则: - -
-
- - - - - - - -
 文章来源
- - - - - - - - - - - -
匹配规则: -
过滤规则: - -
-
-
- - - - - - - -
 发布时间
- - - - - - - - - - - -
匹配规则: -
过滤规则: - -
- -
-
- - - - - -
-  以下是针对模型设置的采集项目: -
- GetOne("Select * From `#@__channeltype` where id='$channelid' "); - $dtp = new DedeTagParse(); - $dtp->SetNameSpace('field','<','>'); - $dtp->LoadString($row['fieldset']); - foreach($dtp->CTags as $ctag) - { - //采集禁用的字段 - $notsend = $ctag->GetAtt('notsend'); - if($notsend==1) continue; - - $fieldtype = $ctag->GetAtt('type'); - $tname = $ctag->GetTagName(); - $iname = $ctag->GetAtt('itemname'); - - //设置转换函数 - if($fieldtype=='img') $functions = "@me=TurnImageTag(@me);"; - else if($fieldtype=='softlinks'||$fieldtype=='addon') $functions = "@me=TurnLinkTag(@me);"; - else if($fieldtype=='dtime') $functions = "@me=GetMkTime(@me);"; - else $functions = ''; - - //对不同类型设置默认值 - if($ctag->GetAtt('default')!='') { - $dfvalue = $ctag->GetAtt('default'); - } - else if($fieldtype=='int'||$fieldtype=='float'||$fieldtype=='number') { - $dfvalue = '0'; - } - else if($fieldtype=='dtime') { - $dfvalue = time(); - } - else { - $dfvalue = ''; - } - ?> - - - - - - - - - - - -
-   -  字段默认值: - -
- - - - - - - - - - - - - - - - -
匹配规则: - - - - - 分页内容字段(规则中只允许单一的该类型字段)
- - 下载字段里的多媒体资源 - -
过滤规则: - - - -
自定义处理接口: - - - 函数或程序的变量
- @body 表示原始网页 @litpic 缩略图
- @me 表示当前标记值和最终结果 -
-
- -
- -
-
- - diff --git a/src/dede/templets/co_add_step2_test.htm b/src/dede/templets/co_add_step2_test.htm deleted file mode 100755 index 938ba487..00000000 --- a/src/dede/templets/co_add_step2_test.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - -采集节点测试 - - - - - -
-
-
新增采集节点:测试内容字段设置
-
- -
-
- - - - - - - - - - - - - -
网址获取规则测试:(测试时不会下载远程图片)
- 测试的网址: -
- LoadNote($nid); - echo ""; - } - ?> -
- -   - -   - -
- - - diff --git a/src/dede/templets/co_config.htm b/src/dede/templets/co_config.htm deleted file mode 100755 index 71bea449..00000000 --- a/src/dede/templets/co_config.htm +++ /dev/null @@ -1,20 +0,0 @@ - - - - -~templets~ \ No newline at end of file diff --git a/src/dede/templets/co_edit.htm b/src/dede/templets/co_edit.htm deleted file mode 100755 index dcf2d11f..00000000 --- a/src/dede/templets/co_edit.htm +++ /dev/null @@ -1,712 +0,0 @@ - - - - - - 修改采集节点 - - - - - - - - -
-
-
修改采集节点
-
- - -
-
-
- - - - - - - - -
- - - - - -
网址索引内容配置
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
节点基本信息
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
节点名称: - - 目标页面编码: - GetAtt('sourcelang')=='gb2312') echo " checked='1'"; ?> /> - GB2312 - GetAtt('sourcelang')=='utf-8') echo " checked='1'"; ?> /> - UTF8 - GetAtt('sourcelang')=='big5') echo " checked='1'"; ?> /> - BIG5 -
区域匹配模式: - GetAtt('macthtype')=='regex') echo " checked='1'"; ?> /> - 正则表达式 - GetAtt('macthtype')=='string') echo " checked='1'"; ?> /> - 字符串 - 内容导入顺序: - GetAtt('cosort')=='asc') echo " checked='1'"; ?> /> - 与目标站一致 - GetAtt('cosort')=='desc') echo " checked='1'"; ?> /> - 与目标站相反 -
以下选项仅在开启防盗链模式才需设定,如果目标网站没有防盗链功能请不要开启,否则会降低采集速度。
防盗链模式: - GetAtt('isref')=='no') echo " checked='1'"; ?> /> - 不开启 - GetAtt('isref')=='yes') echo " checked='1'"; ?> /> - 开启 - 资源下载超时时间: - 秒 -
引用网址: - - (一般为目标网站其中一个文章页的网址) -
-
- - - - - -
列表网址获取规则
-
- - - - - - - - - - - - - - '> - - - - '> - - - -
来源属性: - GetAtt('sourcetype')=='batch') echo " checked='checked'"; ?> /> - 批量生成列表网址 - GetAtt('sourcetype')=='hand') echo " checked='checked'"; ?> /> - 手工指定列表网址 - GetAtt('sourcetype')=='rss') echo " checked='checked'"; ?> /> - 从RSS中获取 -
批量生成地址设置: - - - - - - - - - - -
- 匹配网址: - - -
- (如:https://www.dedebiz.com/html/test/list_(*).html,如果不能匹配所有网址,可以在手工指定网址的地方输入要追加的网址) -
- (*)从 - - 到 - - (填写页码或规律递增数字)  - 每页递增: - - /> - 启用多栏目通配(#) -
-
手工指定网址:
- 在指定了通配规则后有些不能匹配的网址也可以在这里指定。
- -
多栏目通配规则:
- - 如果目标网站使用单一模板,可以在匹配网址中用"(#)"表示近似网址的差异,然后在通配规则中设定集合,并且可以指定导出栏目。 - -
-
- -
示例格式:[(#)=>labs/list_3; (*)=>1-25; typeid=>7] - 匹配网址:http://www.aaa.com/(#)_(*).html -
-
- - - - - -
文章网址匹配规则
-
- - - - - - - - - - - - - - - - - -
内容网址匹配模式: - GetAtt('urlrule')=='area') echo " checked='1'"; ?> /> - 指定包含有文章网址的区域(可以获取区域的网址、标题、图片等信息) - GetAtt('urlrule')=='regx') echo " checked='1'"; ?> /> - 指定网址正则表达式(仅能获得网址信息) -
包含有文章网址的区域设置: - - - - - - - - - - - - - - - - - - - - -
区域开始的HTML: - -
区域结束的HTML: - -
如果链接中含有图片: - GetAtt('listpic')=='0') echo " checked='1'"; ?> /> - 不处理 - GetAtt('listpic')=='1') echo " checked='1'"; ?> /> - 采集为缩略图 -
对区域网址进行再次筛选:
- (使用正则表达式)
必须包含: - - (优先级高于后者) -
不能包含: - -
-
-
  - -   - -
- - - - - - - - - - - - - -
- - - \ No newline at end of file diff --git a/src/dede/templets/co_export.htm b/src/dede/templets/co_export.htm deleted file mode 100755 index efdc489a..00000000 --- a/src/dede/templets/co_export.htm +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -采集内容导出 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
采集管理 - > 采集内容导出:
- 共有[]条可导出数据: - 你当进行的操作是--导出所有采集内容,需注意下面问题:
\r\n"; - echo "1 、如果你采集的内容包含多个内容模型的信息,本操作将会出错!
\r\n"; - echo "2 、这种模式'完成后自动生成导入内容HTML'功能无效。\r\n"; - echo "
"; - } - ?> -
默认导出栏目: - getUserChannel(),$channelid); - echo ""; - ?> - (请选择白色的栏目) -
- 批量采集选项: - - /> - 使用采集规则中指定的栏目ID(如果目标的栏目ID为0,则用上面选择的栏目) -
发布选项: - - 普通文档 - - 保存为草稿 -
每批导入: - 条 -
附带选项: - - 排除重复标题 - - 完成后自动生成导入内容HTML - - 使用列表索引的标题 -
随机推荐: - - (0 表示不推荐,具体数值表示大约多少篇文档出现一篇推荐[随机]) -
 
- -   - -
- - - - - -
进行状态:
-
- -
-

 

- - diff --git a/src/dede/templets/co_gather_start.htm b/src/dede/templets/co_gather_start.htm deleted file mode 100755 index 56d47c47..00000000 --- a/src/dede/templets/co_gather_start.htm +++ /dev/null @@ -1,129 +0,0 @@ - - - - -采集节点 - - - - - - - - - - - - - - - - - - - ' /> - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
- - - - - -
节点名称: - noteInfos['notename']; - else echo "所有节点"; - ?> -
种子网址数: - -
每页采集: - - 条, - 间隔时间: - - 秒(防刷新的站点需设置) -
特殊选项: - - 不检测重复图片 -
附加选项: - /> - 监控采集模式(检测当前或所有节点是否有新内容) - -
- - 重新下载全部内容 -
- - 下载种子网址的未下载内容 -
- -
-   - -
- - - - - -
节点的种子网址: - - [增大] [缩小] -
-
- -
- -
- - diff --git a/src/dede/templets/co_main.htm b/src/dede/templets/co_main.htm deleted file mode 100755 index d24e9aa6..00000000 --- a/src/dede/templets/co_main.htm +++ /dev/null @@ -1,198 +0,0 @@ -{dede:config.pagesize value="20"/} - - - - - - 采集节点管理 - - - - - - - - - - - - - - - - - - - - - - - - - - {dede:datalist} - - - - - - - - - - {/dede:datalist} - - - - - - - -
- - - - - -
采集节点管理: - -
-
选择节点名称针对规则最后采集日期加入日期编码网址数
{dede:field.notename /}{dede:field.typename /}{dede:field.cotime function='GetDatePage(@me)' /}{dede:field.uptime function='GetDatePage(@me)' /}{dede:field.sourcelang /}{dede:field.nid function='TjUrlNum(@me)' /}
- - - - -
-   - 增加新节点 - 导入配置 - 导出配置 - | - 采集 - 导出数据 - | - 更改 - 更改配置 - 测试 - | - 查看已下载 - | - 复制 - 清空 - | - 删除 -
-
- {dede:pagelist size='5' /} -
- - - \ No newline at end of file diff --git a/src/dede/templets/co_test_rule.htm b/src/dede/templets/co_test_rule.htm deleted file mode 100755 index 1bdad804..00000000 --- a/src/dede/templets/co_test_rule.htm +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - 测试节点 - - - - - - - - - - - - - - - - - -
- - - - - -
测试节点: - - -
-
- - - - - - - - - - - - - - - - - - - -
节点名称: noteInfos['notename']); ?>
列表测试信息: 
- -
网页规则测试:(DedeCMSV6里时间日期字段一般是整数类型,如果您看到pubdate、senddate是整数,那种属正常的情况)
- 单个网页测试网址: -
- -
-
- -   - -
 
- - - \ No newline at end of file diff --git a/src/dede/templets/co_trimrule.html b/src/dede/templets/co_trimrule.html deleted file mode 100755 index 3f3c74f3..00000000 --- a/src/dede/templets/co_trimrule.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - -规则选择框 - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 超链接 - Object
- javascript脚本 - embed
- <!--()--> - iframe
- table - param
- style - <div([^.]*)>
-img -</div>
- -
-
- - diff --git a/src/dede/templets/co_url.htm b/src/dede/templets/co_url.htm deleted file mode 100755 index 05f265c6..00000000 --- a/src/dede/templets/co_url.htm +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - 采集内容管理 - - - - - - - - - - - - - - - - - - - - - - - {dede:datalist} - - - - - - - - - - - {/dede:datalist} - - - - - - - -
- - - - - -
临时内容管理: - - - -
-
选择内容标题所属节点获取日期下载导出预设栏目来源网页
{dede:field.title/}{dede:field.notename/}{dede:field.dtime function="GetDateMk(@me)" /}{dede:field.isdown function="IsDownLoad(@me)" /}{dede:field.isex function="IsExData(@me)" /}{dede:field.typename /}[源网址]
  -   - - - -
- {dede:pagelist listsize=5/} -
- - - \ No newline at end of file diff --git a/src/dede/templets/co_url_2.htm b/src/dede/templets/co_url_2.htm deleted file mode 100755 index 8b3b60b7..00000000 --- a/src/dede/templets/co_url_2.htm +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 采集内容管理 - - - - - - - - - - - - - - - - - - {dede:datalist} - - - - - - - - - {/dede:datalist} - - - - - - - -
选择内容标题所属节点获取日期是否下载来源
{dede:field.title/}{dede:field.notename/}{dede:field.dtime function="GetDateMk(@me)" /}{dede:field.isdown function="IsDownLoad(@me)" /}[源网址]
  -      -   -
- {dede:pagelist listsize=5/} -
- - - \ No newline at end of file diff --git a/src/dede/templets/co_view.htm b/src/dede/templets/co_view.htm deleted file mode 100755 index c3568ff1..00000000 --- a/src/dede/templets/co_view.htm +++ /dev/null @@ -1,113 +0,0 @@ - - - - -采集内容预览 - - - -
- - - - - - - - - - - - - - - Count;$i++) -{ - $ctag = $dtp->CTags[$i]; - if($ctag->GetName()=="field") - { - $fname = $ctag->GetAtt("name"); - $fvalue = $ctag->GetInnerText(); - ?> - - - - -Clear(); -?> - - - - -
- 采集内容管理 > 采集内容预览:(系统会自动下载并处理未下载过的内容) -
如果发布时间(pubdate)为空,系统将采用导入时的实际时间,‘#p#副标题#e#’字样是系统分页符号,请不要替换。
字段名称内 容
- - - - $fvalue"; - else echo ""; - ?> -
- -   - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 内容替换: -
进行替换时会把当前节点的所有结果在原始内容中进行替换,使用正则表达式模式时,会要求再次确实,请注意使用风险。
匹配模式: - 完全匹配 - 正则表达式 -
当前记录
原始内容参考:
- -
- 要替换的字符串
- 或正则表达式: -
- - 替换为: - -
- -   - -
-
- - - \ No newline at end of file diff --git a/src/dede/templets/index_menu2.htm b/src/dede/templets/index_menu2.htm index 327ee2fd..bdcff04c 100755 --- a/src/dede/templets/index_menu2.htm +++ b/src/dede/templets/index_menu2.htm @@ -153,8 +153,6 @@ echo "\r\n"
模块
生成
-
-
采集
会员