function updateWebsiteStat() { $content = ''; $splStr = ''; $splxx = ''; $filePath = ''; $fileName = ''; $url = ''; $s = ''; $nCount = ''; handlePower('更新网站统计'); //管理权限处理 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'websitestat'); //删除全部统计记录 $content = getDirTxtList($GLOBALS['adminDir'] . '/data/stat/'); $splStr = aspSplit($content, vbCrlf()); $nCount = 1; foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && left($fileName, 1) != '#') { $nCount = $nCount + 1; aspEcho($nCount . '、filePath', $filePath); doEvents(); $content = getFText($filePath); $content = replace($content, chr(0), ''); whiteWebStat($content); } } $url = getUrlAddToParam(getThisUrl(), '?act=dispalyManageHandle', 'replace'); Rw(getMsg1('更新全部统计成功,正在进入' . @$_REQUEST['lableTitle'] . '列表...', $url)); writeSystemLog('', '更新网站统计'); //系统日志 }
function resetAccessData_temp() { handlePower('恢复模板数据'); //管理权限处理 $GLOBALS['conn='] = OpenConn(); $splStr = ''; $i = ''; $s = ''; $columnname = ''; $title = ''; $nCount = ''; $webdataDir = ''; $webdataDir = @$_REQUEST['webdataDir']; if ($webdataDir != '') { if (checkFolder($webdataDir) == false) { eerr('网站数据目录不存在,恢复默认数据未成功', $webdataDir); } } else { $webdataDir = '/Data/WebData/'; } aspEcho('提示', '恢复数据完成'); rw('<hr><a href=\'../index.php\' target=\'_blank\'>进入首页</a> | <a href="?" target=\'_blank\'>进入后台</a>'); $content = ''; $filePath = ''; $parentid = ''; $author = ''; $adddatetime = ''; $fileName = ''; $bodycontent = ''; $webtitle = ''; $webkeywords = ''; $webdescription = ''; $sortrank = ''; $labletitle = ''; $target = ''; $websitebottom = ''; $webTemplate = ''; $webimages = ''; $webcss = ''; $webjs = ''; $flags = ''; $websiteurl = ''; $splxx = ''; $columntype = ''; $relatedtags = ''; $npagesize = ''; $customaurl = ''; $nofollow = ''; $templatepath = ''; $isthrough = ''; $titlecolor = ''; $showreason = ''; $ncomputersearch = ''; $nmobliesearch = ''; $ncountsearch = ''; $ndegree = ''; //竞价表 $displaytitle = ''; $aboutcontent = ''; $isonhtml = ''; //单页表 $columnenname = ''; //导航表 $smallimage = ''; $bigImage = ''; $bannerimage = ''; //文章表 $httpurl = ''; $price = ''; $morepageurl = ''; $charset = ''; $thispage = ''; $countpage = ''; $bigClassName = ''; $startStr = ''; $endStr = ''; $startaddstr = ''; $endaddstr = ''; $sType = ''; $saction = ''; $fieldName = ''; $fieldcheck = ''; //网站配置 $content = GetFText($webdataDir . '/website.txt'); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } if ($content != '') { $webtitle = newGetStrCut($content, 'webtitle'); $webkeywords = newGetStrCut($content, 'webkeywords'); $webdescription = newGetStrCut($content, 'webdescription'); $websitebottom = newGetStrCut($content, 'websitebottom'); $webTemplate = newGetStrCut($content, 'webtemplate'); $webimages = newGetStrCut($content, 'webimages'); $webcss = newGetStrCut($content, 'webcss'); $webjs = newGetStrCut($content, 'webjs'); $flags = newGetStrCut($content, 'flags'); $websiteurl = newGetStrCut($content, 'websiteurl'); if (getRecordCount($GLOBALS['db_PREFIX'] . 'website', '') == 0) { connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'website(webtitle) values(\'测试\')'); } connexecute('update ' . $GLOBALS['db_PREFIX'] . 'website set webtitle=\'' . $webtitle . '\',webkeywords=\'' . $webkeywords . '\',webdescription=\'' . $webdescription . '\',websitebottom=\'' . $websitebottom . '\',webtemplate=\'' . $webTemplate . '\',webimages=\'' . $webimages . '\',webcss=\'' . $webcss . '\',webjs=\'' . $webjs . '\',flags=\'' . $flags . '\',websiteurl=\'' . $websiteurl . '\''); } //导航 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'webcolumn'); $content = getDirTxtList($webdataDir . '/webcolumn/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('导航', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webtitle】') > 0) { $s = $s . vbCrlf(); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $customaurl = newGetStrCut($s, 'customaurl'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $fileName = newGetStrCut($s, 'filename'); $columnname = newGetStrCut($s, 'columnname'); $columnenname = newGetStrCut($s, 'columnenname'); $columntype = newGetStrCut($s, 'columntype'); $flags = newGetStrCut($s, 'flags'); $parentid = newGetStrCut($s, 'parentid'); $parentid = phpTrim(getColumnId($parentid)); //可根据栏目名称找到对应ID 不存在为-1 //call echo("parentid",parentid) $labletitle = newGetStrCut($s, 'labletitle'); //每页显示条数 $npagesize = newGetStrCut($s, 'npagesize'); if ($npagesize == '') { $npagesize = 10; } //默认分页数为10条 $target = newGetStrCut($s, 'target'); $smallimage = newGetStrCut($s, 'smallimage'); $bigImage = newGetStrCut($s, 'bigImage'); $bannerimage = newGetStrCut($s, 'bannerimage'); $templatepath = newGetStrCut($s, 'templatepath'); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //call echo(columnname,nofollow) $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'webcolumn (webtitle,webkeywords,webdescription,columnname,columnenname,columntype,sortrank,filename,customaurl,flags,parentid,labletitle,aboutcontent,bodycontent,npagesize,isonhtml,nofollow,target,smallimage,bigImage,bannerimage,templatepath) values(\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $columnname . '\',\'' . $columnenname . '\',\'' . $columntype . '\',' . $sortrank . ',\'' . $fileName . '\',\'' . $customaurl . '\',\'' . $flags . '\',' . $parentid . ',\'' . $labletitle . '\',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',' . $npagesize . ',' . $isonhtml . ',' . $nofollow . ',\'' . $target . '\',\'' . $smallimage . '\',\'' . $bigImage . '\',\'' . $bannerimage . '\',\'' . $templatepath . '\')'); } } } } //文章 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'articledetail'); $content = getDirAllFileList($webdataDir . '/articledetail/', 'txt'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('文章', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $parentid = newGetStrCut($s, 'parentid'); $parentid = getColumnId($parentid); $title = newGetStrCut($s, 'title'); $titlecolor = newGetStrCut($s, 'titlecolor'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $author = newGetStrCut($s, 'author'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $adddatetime = newGetStrCut($s, 'adddatetime'); $fileName = newGetStrCut($s, 'filename'); $templatepath = newGetStrCut($s, 'templatepath'); $flags = newGetStrCut($s, 'flags'); $relatedtags = newGetStrCut($s, 'relatedtags'); $customaurl = newGetStrCut($s, 'customaurl'); $target = newGetStrCut($s, 'target'); $smallimage = newGetStrCut($s, 'smallimage'); $bigImage = newGetStrCut($s, 'bigImage'); $bannerimage = newGetStrCut($s, 'bannerimage'); $labletitle = newGetStrCut($s, 'labletitle'); $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //价格 $price = getDianNumb(newGetStrCut($s, 'price')); if ($price == '') { $price = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'articledetail (parentid,title,titlecolor,webtitle,webkeywords,webdescription,author,sortrank,adddatetime,filename,flags,relatedtags,aboutcontent,bodycontent,updatetime,isonhtml,customaurl,nofollow,target,smallimage,bigImage,bannerimage,templatepath,labletitle,price) values(' . $parentid . ',\'' . $title . '\',\'' . $titlecolor . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $author . '\',' . $sortrank . ',\'' . $adddatetime . '\',\'' . $fileName . '\',\'' . $flags . '\',\'' . $relatedtags . '\',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',\'' . now() . '\',' . $isonhtml . ',\'' . $customaurl . '\',' . $nofollow . ',\'' . $target . '\',\'' . $smallimage . '\',\'' . $bigImage . '\',\'' . $bannerimage . '\',\'' . $templatepath . '\',\'' . $labletitle . '\',' . $price . ')'); } } } } //单页 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'OnePage'); $content = getDirTxtList($webdataDir . '/OnePage/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('单页', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webkeywords】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $displaytitle = newGetStrCut($s, 'displaytitle'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $adddatetime = newGetStrCut($s, 'adddatetime'); $fileName = newGetStrCut($s, 'filename'); $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $target = newGetStrCut($s, 'target'); $templatepath = newGetStrCut($s, 'templatepath'); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'onepage (title,displaytitle,webtitle,webkeywords,webdescription,adddatetime,filename,isonhtml,aboutcontent,bodycontent,nofollow,target,templatepath) values(\'' . $title . '\',\'' . $displaytitle . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $adddatetime . '\',\'' . $fileName . '\',' . $isonhtml . ',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',' . $nofollow . ',\'' . $target . '\',\'' . $templatepath . '\')'); } } } } //竞价 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'Bidding'); $content = getDirTxtList($webdataDir . '/Bidding/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('竞价', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webkeywords】') > 0) { $s = $s . vbCrlf(); $webkeywords = newGetStrCut($s, 'webkeywords'); $showreason = newGetStrCut($s, 'showreason'); $ncomputersearch = newGetStrCut($s, 'ncomputersearch'); $nmobliesearch = newGetStrCut($s, 'nmobliesearch'); $ncountsearch = newGetStrCut($s, 'ncountsearch'); $ndegree = newGetStrCut($s, 'ndegree'); $ndegree = getNumber($ndegree); if ($ndegree == '') { $ndegree = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'Bidding (webkeywords,showreason,ncomputersearch,nmobliesearch,ndegree) values(\'' . $webkeywords . '\',\'' . $showreason . '\',' . $ncomputersearch . ',' . $nmobliesearch . ',' . $ndegree . ')'); } } } } //搜索统计 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'SearchStat'); $content = getDirTxtList($webdataDir . '/SearchStat/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('搜索统计', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $customaurl = newGetStrCut($s, 'customaurl'); $target = newGetStrCut($s, 'target'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'SearchStat (title,webtitle,webkeywords,webdescription,customaurl,target,isthrough,sortrank,isonhtml,nofollow) values(\'' . $title . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $customaurl . '\',\'' . $target . '\',' . $isthrough . ',' . $sortrank . ',' . $isonhtml . ',' . $nofollow . ')'); } } } } $itemid = ''; $userName = ''; $ip = ''; $reply = ''; $tableName = ''; //评论 //评论 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'TableComment'); $content = getDirTxtList($webdataDir . '/TableComment/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('评论', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $tableName = newGetStrCut($s, 'tablename'); $title = newGetStrCut($s, 'title'); $itemid = getArticleId(newGetStrCut($s, 'itemid')); if ($itemid == '') { $itemid = 0; } //call echo("itemID",itemID) $adddatetime = newGetStrCut($s, 'adddatetime'); $userName = newGetStrCut($s, 'username'); $ip = newGetStrCut($s, 'ip'); $bodycontent = newGetStrCut($s, 'bodycontent'); $reply = newGetStrCut($s, 'reply'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'TableComment (tablename,title,itemid,adddatetime,username,ip,bodycontent,reply,isthrough) values(\'' . $tableName . '\',\'' . $title . '\',' . $itemid . ',\'' . $adddatetime . '\',\'' . $userName . '\',\'' . $ip . '\',\'' . $bodycontent . '\',\'' . $reply . '\',' . $isthrough . ')'); } } } } //友情链接 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'FriendLink'); $content = getDirTxtList($webdataDir . '/FriendLink/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('评论', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $httpurl = newGetStrCut($s, 'httpurl'); $smallimage = newGetStrCut($s, 'smallimage'); $flags = newGetStrCut($s, 'flags'); $target = newGetStrCut($s, 'target'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '0' || lCase($sortrank) == 'false') { $sortrank = 0; } else { $sortrank = 1; } $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'FriendLink (title,httpurl,smallimage,flags,sortrank,isthrough,target) values(\'' . $title . '\',\'' . $httpurl . '\',\'' . $smallimage . '\',\'' . $flags . '\',' . $sortrank . ',' . $isthrough . ',\'' . $target . '\')'); } } } } //留言 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'GuestBook'); $content = getDirTxtList($webdataDir . '/GuestBook/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('留言', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【adddatetime】') > 0) { $s = $s . vbCrlf(); $adddatetime = newGetStrCut($s, 'adddatetime'); $bodycontent = newGetStrCut($s, 'bodycontent'); $reply = newGetStrCut($s, 'reply'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'GuestBook (adddatetime,bodycontent,reply,isthrough) values(\'' . $adddatetime . '\',\'' . $bodycontent . '\',\'' . $reply . '\',' . $isthrough . ')'); } } } } //采集网站 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'CaiWeb'); $content = getDirTxtList($webdataDir . '/CaiWeb/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('采集网站', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【bigclassname】') > 0) { $s = $s . vbCrlf(); $bigClassName = newGetStrCut($s, 'bigclassname'); $httpurl = newGetStrCut($s, 'httpurl'); $morepageurl = newGetStrCut($s, 'morepageurl'); $charset = newGetStrCut($s, 'charset'); $adddatetime = newGetStrCut($s, 'adddatetime'); $bodycontent = newGetStrCut($s, 'bodycontent'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $thispage = newGetStrCut($s, 'thispage'); if ($thispage == '') { $thispage = 0; } $countpage = newGetStrCut($s, 'countpage'); if ($countpage == '') { $thispage = 0; } $columnname = newGetStrCut($s, 'columnname'); connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'CaiWeb (adddatetime,bodycontent,httpurl,morepageurl,charset,sortrank,thispage,countpage,bigclassname,columnname) values(\'' . $adddatetime . '\',\'' . $bodycontent . '\',\'' . $httpurl . '\',\'' . $morepageurl . '\',\'' . $charset . '\',' . $sortrank . ',' . $thispage . ',' . $countpage . ',\'' . $bigClassName . '\',\'' . $columnname . '\')'); } } } } //采集配置 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'CaiConfig'); $content = getDirTxtList($webdataDir . '/CaiConfig/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('采集配置', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【bigclassname】') > 0) { $s = $s . vbCrlf(); $bigClassName = newGetStrCut($s, 'bigclassname'); $sType = newGetStrCut($s, 'stype'); $startStr = newGetStrCut($s, 'startstr'); $endStr = newGetStrCut($s, 'endstr'); $startaddstr = newGetStrCut($s, 'startaddstr'); $endaddstr = newGetStrCut($s, 'endaddstr'); $adddatetime = newGetStrCut($s, 'adddatetime'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $saction = newGetStrCut($s, 'saction'); $isthrough = newGetStrCut($s, 'isthrough'); $isthrough = IIF($isthrough == '0' || lCase($isthrough) == 'false', 0, 1); $fieldName = newGetStrCut($s, 'fieldname'); $fieldcheck = newGetStrCut($s, 'fieldcheck'); if ($fieldcheck == '') { $fieldcheck = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'CaiConfig (adddatetime,sortrank,bigclassname,stype,startstr,endstr,startaddstr,endaddstr,saction,isthrough,fieldname,fieldcheck) values(\'' . $adddatetime . '\',' . $sortrank . ',\'' . $bigClassName . '\',\'' . $sType . '\',\'' . $startStr . '\',\'' . $endStr . '\',\'' . $startaddstr . '\',\'' . $endaddstr . '\',\'' . $saction . '\',' . $isthrough . ',\'' . $fieldName . '\',' . $fieldcheck . ')'); } } } } writeSystemLog('', '恢复默认数据' . $GLOBALS['db_PREFIX']); //系统日志 }