function makeHtmlWebToZip($webDir) { $content = ''; $splStr = ''; $filePath = ''; $c = ''; $fileArray = ''; $fileName = ''; $fileType = ''; $isTrue = ''; $webFolderName = ''; $cleanFileList = ''; $splStr = aspSplit($webDir, '/'); $webFolderName = $splStr[2]; //call eerr(webFolderName,webDir) $content = getFileFolderList($webDir, true, '全部', '', '全部文件夹', '', ''); $splStr = aspSplit($content, vbCrlf()); foreach ($splStr as $key => $filePath) { if (CheckFolder($filePath) == false) { $fileArray = handleFilePathArray($filePath); $fileName = lCase($fileArray[2]); $fileType = lCase($fileArray[4]); $fileName = remoteNumber($fileName); $isTrue = true; if (inStr('|' . $cleanFileList . '|', '|' . $fileName . '|') > 0 && $fileType == 'html') { $isTrue = false; } if ($isTrue == true) { //call echo(fileType,fileName) if ($c != '') { $c = $c . '|'; } $c = $c . replace($filePath, HandlePath('/'), ''); $cleanFileList = $cleanFileList . $fileName . '|'; } } } Rw($c); $c = $c . '|||||'; createFileGBK('htmlweb/1.txt', $c); aspEcho('<hr>cccccccccccc', $c); //先判断这个文件存在20160309 if (CheckFile('/myZIP.php') == true) { aspEcho('', XMLPost(getHost() . '/myZIP.php?webFolderName=' . $webFolderName, 'content=' . escape($c))); } }
function handleLink($httpUrl, $content, $sType, $SetStr, $UrlOrContent, &$PubAHrefList, &$PubATitleList) { $splStr = ''; $i = ''; $s = ''; $c = ''; $TempContent = ''; $FindUrl = ''; $HandleUrl = ''; $startStr = ''; $endStr = ''; $s1 = ''; $s2 = ''; $tempHttpUrl = ''; $tempHttpUrl = $httpUrl; $UrlOrContent = lCase($UrlOrContent); $content = replace(replace($content, '= ', '='), '= ', '='); $content = replace(replace($content, ' =', '='), ' =', '='); $TempContent = lCase($content); //没有链接退出 if (inStr($TempContent, ' href=') == 0 && inStr($TempContent, ' src=') == 0 && $sType != 'style') { $handleLink = ''; return @$handleLink; } else { if (inStr($TempContent, ' href=\\"') > 0) { $content = replace($content, '\\"', '"'); $TempContent = lCase($content); } } $startStr = $sType . '="'; $endStr = '"'; if (inStr($TempContent, $startStr) > 0 && inStr($TempContent, $endStr) > 0) { //call echo("提示","1") $FindUrl = StrCut($content, $startStr, $endStr, 2); if ($SetStr != '') { $HandleUrl = $SetStr; } else { $HandleUrl = fullHttpUrl($httpUrl, $FindUrl); //替换目录 if ($UrlOrContent == 'replacedir') { $HandleUrl = $tempHttpUrl . handleFilePathArray($HandleUrl)[2]; } $PubAHrefList = $PubAHrefList . hanldeStyleBackgroundUrl($HandleUrl, '', '') . vbCrlf(); //链接标题 $s1 = inStr($content, '>'); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, 1, inStrRev($s2, '</') - 1); $s2 = replace($s2, vbCrlf(), '【换行】'); $PubATitleList = $PubATitleList . $s2 . vbCrlf(); } if ($FindUrl != $HandleUrl) { //强强强旱替换 $s1 = inStr($content, $startStr) - 1 + len($startStr); //这里面用TempContent而不用Content因为有大小写在里面20140726 $s2 = right($content, len($content) - $s1); $s2 = mid($s2, inStr($s2, $endStr), -1); $s1 = left($content, $s1); $content = $s1 . $HandleUrl . $s2; } if ($UrlOrContent == 'url') { $handleLink = $HandleUrl; } else { $handleLink = $content; } return @$handleLink; } $startStr = $sType . '=\''; $endStr = '\''; if (inStr($TempContent, $startStr) > 0 && inStr($TempContent, $endStr) > 0) { //call echo("提示","2") $FindUrl = StrCut($TempContent, $startStr, $endStr, 2); if ($SetStr != '') { $HandleUrl = $SetStr; } else { $HandleUrl = fullHttpUrl($httpUrl, $FindUrl); //替换目录 if ($UrlOrContent == 'replacedir') { $HandleUrl = $tempHttpUrl . handleFilePathArray($HandleUrl)[2]; } $PubAHrefList = $PubAHrefList . hanldeStyleBackgroundUrl($HandleUrl, '', '') . vbCrlf(); //链接标题 $s1 = inStr($content, '>'); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, 1, inStrRev($s2, '</') - 1); $s2 = replace($s2, vbCrlf(), '【换行】'); $PubATitleList = $PubATitleList . $s2 . vbCrlf(); } if ($FindUrl != $HandleUrl) { //强强强旱替换 $s1 = inStr($content, $startStr) - 1 + len($startStr); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, inStr($s2, $endStr), -1); $s1 = left($content, $s1); $content = $s1 . $HandleUrl . $s2; } if ($UrlOrContent == 'url') { $handleLink = $HandleUrl; } else { $handleLink = $content; } return @$handleLink; } $startStr = $sType . '='; $endStr = '>'; //这里面把之家的 空格换成> if (inStr($TempContent, $startStr) > 0 && inStr($TempContent, $endStr) > 0) { $FindUrl = StrCut($TempContent, $startStr, $endStr, 2); if ($SetStr != '') { $HandleUrl = $SetStr; } else { $HandleUrl = fullHttpUrl($httpUrl, $FindUrl); //替换目录 if ($UrlOrContent == 'replacedir') { $HandleUrl = $tempHttpUrl . handleFilePathArray($HandleUrl)[2]; } $PubAHrefList = $PubAHrefList . hanldeStyleBackgroundUrl(handleHttpUrl($HandleUrl), '', '') . vbCrlf(); //链接标题 $s1 = inStr($content, '>'); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, 1, inStrRev($s2, '</') - 1); $s2 = replace($s2, vbCrlf(), '【换行】'); $PubATitleList = $PubATitleList . $s2 . vbCrlf(); } if ($FindUrl != $HandleUrl) { //强强强旱替换 $s1 = inStr($content, $startStr) - 1 + len($startStr); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, inStr($s2, $endStr), -1); $s1 = left($content, $s1); $content = $s1 . $HandleUrl . $s2; } if ($UrlOrContent == 'url') { $handleLink = $HandleUrl; } else { $handleLink = $content; } return @$handleLink; } if ($UrlOrContent != 'url') { $handleLink = $content; } CreateAddFile('出错内容列表.txt', $httpUrl . vbCrlf() . $content . vbCrlf() . $sType . vbCrlf() . $SetStr . vbCrlf() . $UrlOrContent . vbCrlf() . '----------------------' . vbCrlf()); return @$handleLink; }
function getFileAttr($filePath, $sType) { $sType = strval($sType); $arrayData = handleFilePathArray($filePath); if ($sType == '0') { $getFileAttr = $arrayData[0]; } else { if ($sType == '1') { $getFileAttr = $arrayData[1]; } else { if ($sType == '2' || $sType == 'name') { $getFileAttr = $arrayData[2]; } else { if ($sType == '3') { $getFileAttr = $arrayData[3]; } else { if ($sType == '4') { $getFileAttr = $arrayData[4]; } } } } } return @$getFileAttr; }