function getArray($content, $startStr, $endStr, $startType, $endType) { $s = ""; $i = ""; $listStr = ""; for ($i = 0; $i <= 999; $i++) { //30为截取条件 //echo($content . "=" . instr($content, $startStr)); if (instr($content, $startStr) > 0 && instr($content, $endStr) > 0) { $s = mid($content, 1, instr($content, $endStr) + 1); //echo(" s=" . $s . "<br>"); $content = mid($content, instr($content, $endStr) + strlen($endStr), -1); $s = mid($s, instr($s, $startStr) + strlen($startStr), -1); //echo(" s2=" . $s . "<br>"); $s = substr($s, 0, strlen($s) - strlen($endStr)); if ($startType == true) { $s = $startStr . $s; } if ($endType == true) { $s = $s . $endStr; } if ($listStr != "") { $listStr = $listStr . '$Array$'; } $listStr = $listStr . $s; } else { break; } } $GetArray = $listStr; return @$GetArray; }
function extractColors($Hexa) { if (strlen($Hexa) != 6) { return array(0, 0, 0); } $R = hexdec(left($Hexa, 2)); $G = hexdec(mid($Hexa, 3, 2)); $B = hexdec(right($Hexa, 2)); return array($R, $G, $B); }
function getFormFieldList() { $s = ''; $c = ''; $splstr = ''; $fieldName = ''; $splstr = aspSplit(@$_POST, '&'); foreach ($splstr as $key => $s) { $fieldName = lCase(mid($s, 1, inStr($s, '=') - 1)); if ($c != '') { $c = $c . '|'; } $c = $c . $fieldName; } $getFormFieldList = $c; return @$getFormFieldList; }
function getWhereAnd($sql, $addSql) { $LCaseAddSql = ''; $AddType = ''; $s = ''; //追加SQl为空则退出 if (aspTrim($addSql) == '') { $getWhereAnd = $sql; return @$getWhereAnd; } if (inStr(lCase($sql), ' where ') > 0) { $AddType = ' And '; } else { $AddType = ' Where '; } if ($addSql != '') { $addSql = aspTrim($addSql); $LCaseAddSql = lCase($addSql); if (left($LCaseAddSql, 6) == 'order ' || left($LCaseAddSql, 6) == 'group ') { $getWhereAnd = $sql . ' ' . $addSql; return @$getWhereAnd; //改进必需加空格,因为前面已经删除了20160115 } else { if (left($LCaseAddSql, 6) == 'where ') { $addSql = mid($addSql, 7, -1); } else { if (left($LCaseAddSql, 4) == 'and ') { $addSql = mid($addSql, 5, -1); } } } //对where 改进 20160623 $s = lCase($addSql); if ($s != 'and' && $s != 'or' && $s != 'where') { $sql = $sql . $AddType . $addSql; } } $getWhereAnd = $sql; return @$getWhereAnd; }
function StrCut($Content, $StartStr, $EndStr, $CutType) { //On Error Resume Next $S1 = ''; $S1Str = ''; $S2 = ''; $S3 = ''; if (instr($Content, $StartStr) == false || instr($Content, $EndStr) == false) { $StrCut = ''; return @$StrCut; } switch ($CutType) { //完善于20150923 case 1: $S1 = instr($Content, $StartStr); $S1Str = mid($Content, $S1 + strlen($StartStr), -1); $S2 = $S1 + instr($S1Str, $EndStr) + strlen($StartStr) + strlen($EndStr) - 1; //为什么要减人 break; case 2: 0; ''; $S1 = instr($Content, $StartStr) + strlen($StartStr); $S1Str = mid($Content, $S1, -1); //S2 = InStr(S1, Content, EndStr) $S2 = $S1 + instr($S1Str, $EndStr) - 1; //call echo("s2",s2) } $S3 = $S2 - $S1; if ($S3 >= 0) { $StrCut = mid($Content, $S1, $S3); } else { $StrCut = ''; } return @$StrCut; }
function haveChina($content) { $i = ''; $j = ''; $haveChina = false; for ($i = 1; $i <= len($content); $i++) { $j = asc(mid($content, $i, 1)); //是汉字累加 if ($j < 0) { if (($j <= -22033 && $j >= -24158) == false) { $haveChina = true; return @$haveChina; } } } return @$haveChina; }
function handleSqlTop($sql) { $s = ""; $nLength = ""; $leftStr = ""; $rightStr = ""; $nRow = ""; $s = LCase($sql); $nLength = instr($s, " top "); $nSelect = instr(lcase($s), "select "); if ($nLength > 0 && $nSelect > 0) { //只允许查询有显示多少条的限制 20160408 $leftStr = mid($sql, 1, $nLength); $rightStr = mid($sql, $nLength + 5, -1); $rightStr = AspTrim($rightStr); $nRow = mid($rightStr, 1, instr($rightStr, " ")); $rightStr = mid($rightStr, instr($rightStr, " "), -1); //call echo("nRow",nRow) //call echo("leftStr",leftStr) //call echo("rightStr",rightStr) $sql = $leftStr . $rightStr . " limit " . $nRow; } $handleSqlTop = $sql; return @$handleSqlTop; }
function handleWithWebSiteList($httpurl, $urllist) { $website = ''; $splstr = ''; $url = ''; $c = ''; $urlWebsite = ''; $s = ''; $website = lCase(getWebSite($httpurl)); $splstr = aspSplit($urllist, vbCrlf()); foreach ($splstr as $key => $url) { if ($url != '') { if (right($url, 1) != '/' && inStr($url, '?') == false) { $s = mid($url, inStrRev($url, '/'), -1); //call echo("s",s) if ((inStr($s, '.') == false || inStr($s, '.com') > 0 || inStr($s, '.cn') > 0 || inStr($s, '.net') > 0) && inStr($s, '@') == false) { $url = $url . '/'; } //call echo("url",url) } $urlWebsite = lCase(getWebSite($url)); if ($website == $urlWebsite && inStr(vbCrlf() . $c . vbCrlf(), vbCrlf() . $url . vbCrlf()) == false) { if ($c != '') { $c = $c . vbCrlf(); } $c = $c . $url; } } } $handleWithWebSiteList = $c; return @$handleWithWebSiteList; }
function getHtmlValue($content, $sType) { $i = ''; $endStr = ''; $s = ''; $labelName = ''; $startLabel = ''; $endLabel = ''; $LCaseEndStr = ''; $paramName = ''; $startLabel = '<'; $endLabel = '>'; for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); $endStr = mid($content, $i, -1); if ($s == '<') { if (inStr($endStr, '>') > 0) { $s = mid($endStr, 1, inStr($endStr, '>')); $i = $i + len($s) - 1; $s = mid($s, 2, len($s) - 2); $s = PHPTrim($s); if (right($s, 1) == '/') { $s = PHPTrim(left($s, len($s) - 1)); } $endStr = right($endStr, len($endStr) - len($s) - 2); //最后字符减去当前标签 -2是因为它有<>二个字符 //注意之前放在labelName下面 $labelName = mid($s, 1, inStr($s . ' ', ' ') - 1); $labelName = lCase($labelName); if ($labelName == 'title' && $sType == 'webtitle') { $LCaseEndStr = lCase($endStr); if (inStr($LCaseEndStr, '</title>') > 0) { $s = mid($endStr, 1, inStr($LCaseEndStr, '</title>') - 1); } else { $s = ''; } $getHtmlValue = $s; return @$getHtmlValue; } else { if ($labelName == 'meta' && ($sType == 'webkeywords' || $sType == 'webdescription')) { $LCaseEndStr = lCase($endStr); $paramName = PHPTrim(lCase(getParamValue($s, 'name'))); if ('web' . $paramName == $sType) { $getHtmlValue = getParamValue($s, 'content'); return @$getHtmlValue; } } } } } } $getHtmlValue = ''; return @$getHtmlValue; }
$nCount = 0; foreach ($splStr as $s) { $tempS = $s; $s = AspTrim($s); if ($tempS != '' && substr(phptrim($s) . ' ', 0, 1) != '#') { $nCount = $nCount + 1; //总数 if (substr($tempS, 0, 4) == ' ') { } else { $parentid = '-1'; } if (trim(LCase($tempS)) == 'end') { break; } else { if (trim($s) != '') { $title = mid($s . ' ', 1, instr($s . ' ', ' ') - 1); $lableName = getStrCut($s, 'lablename=\'', '\'', 2); $url = getStrCut($s, 'url=\'', '\'', 2); $isdisplay = getStrCut($s, 'isdisplay=\'', '\'', 2); if ($isdisplay == '') { $isdisplay = 1; } //ASPEcho('lablename', $lableName) ; if ($title != '') { connExecute('insert into ' . $DB_PREFIX . 'ListMenu (title,parentid,sortrank,lablename,isdisplay,customaurl) values(\'' . $title . '\',' . $parentid . ',' . $nCount . ',\'' . $lableName . '\',' . $isdisplay . ',\'' . $url . '\')'); if ($parentid == '-1') { $rsObj = $GLOBALS['conn']->query('select * from ' . $DB_PREFIX . 'ListMenu where title=\'' . $title . '\''); $rs = mysql_fetch_array($rsObj); if (@mysql_num_rows($rsObj) != 0) { $parentid = $rs['id']; }
//$planet_angle[$sort_pos[$i]] = ($chart_idx * (3 * $deg_in_each_house) / (3 * $max_num_pl_in_each_house)) + ($deg_in_each_house / (2 * $max_num_pl_in_each_house)); // needed for aspect lines $planet_angle[$sort_pos[$i]] = $sort[$i]; $angle_to_use = $planet_angle[$sort_pos[$i]] - $Ascendant; // needed for placing info on chartwheel // denote that we have done at least one planet in this house (actually count the planets in this house that we have done) $planets_done++; // display the planet in the wheel $angle_to_use = deg2rad($angle_to_use); if ($flag == False) { display_planet_glyph($angle_to_use, $radius - $dist_from_diameter1, $xy); } else { display_planet_glyph($angle_to_use, $radius - $dist_from_diameter2, $xy); } imagettftext($im, 16, 0, $xy[0] + $center_pt, $xy[1] + $center_pt, $planet_color, FONTPATH . HAMBURG_TTF, chr($pl_glyph[$sort_pos[$i]])); // display degrees of longitude for each planet if (strtoupper(mid($retrograde, $sort_pos[$i] + 1, 1)) == "R") { $t = sprintf("%.1f", Reduce_below_30($sort[$i])) . " r"; } else { $t = sprintf("%.1f", Reduce_below_30($sort[$i])); } //draw line from planet to circumference if ($flag == False) { $x1 = (-$radius + $dist_from_diameter1a) * cos($angle_to_use); $y1 = ($radius - $dist_from_diameter1a) * sin($angle_to_use); $x2 = (-$radius + 6) * cos($angle_to_use); $y2 = ($radius - 6) * sin($angle_to_use); } else { $x1 = (-$radius + $dist_from_diameter2a) * cos($angle_to_use); $y1 = ($radius - $dist_from_diameter2a) * sin($angle_to_use); $x2 = (-$radius + 6) * cos($angle_to_use); $y2 = ($radius - 6) * sin($angle_to_use);
function PHPStr_Split($content, $Split_Length) { $i = ''; $s = ''; $c = ''; $n = ''; $ArrStr = aspArray(99); $nArray = ''; if ($Split_Length <= 0) { $Split_Length = 1; } $n = 0; $nArray = 0; for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); $c = $c . $s; $n = $n + 1; if ($n == $Split_Length) { $ArrStr[$nArray] = $c; $c = ''; $n = 0; $nArray = $nArray + 1; } } $PHPStr_Split = $ArrStr; return @$PHPStr_Split; }
function scanUrl($httpUrl, $toTitle, $codeset) { $splStr = ''; $i = ''; $s = ''; $content = ''; $PubAHrefList = ''; $PubATitleList = ''; $splUrl = ''; $spltitle = ''; $title = ''; $url = ''; $htmlDir = ''; $htmlFilePath = ''; $nOK = ''; $dataArray = ''; $webState = ''; $u = ''; $iniDir = ''; $iniFilePath = ''; $websize = ''; $nSetTime = ''; $startTime = ''; $openSpeed = ''; $isLocal = ''; $isThrough = ''; $htmlDir = '/../网站UrlScan/' . setFileName(getWebSite($httpUrl)); CreateDirFolder($htmlDir); $htmlFilePath = $htmlDir . '/' . setFileName($httpUrl) . '.html'; $iniDir = $htmlDir . '/conifg'; CreateFolder($iniDir); $iniFilePath = $iniDir . '/' . setFileName($httpUrl) . '.txt'; //httpurl="http://maiside.net/" $webState = 0; $nSetTime = 1; $openSpeed = 0; if (CheckFile($htmlFilePath) == false) { $startTime = now(); aspEcho('codeset', $codeset); $dataArray = handleXmlGet($httpUrl, $codeset); $content = $dataArray[0]; $content = toGB2312Char($content); //给PHP用,转成gb2312字符 $webState = $dataArray[1]; $openSpeed = dateDiff('s', $startTime, now()); //content=gethttpurl(httpurl,codeset) //call createfile(htmlFilePath,content) WriteToFile($htmlFilePath, $content, $codeset); createFile($iniFilePath, $webState . vbCrlf() . $openSpeed); $nSetTime = 3; $isLocal = 0; } else { //content=getftext(htmlFilePath) $content = reaFile($htmlFilePath, $codeset); $content = toGB2312Char($content); //给PHP用,转成gb2312字符 $splStr = aspSplit(getFText($iniFilePath), vbCrlf()); $webState = CInt($splStr[0]); $openSpeed = CInt($splStr[0]); $isLocal = 1; } $websize = getFSize($htmlFilePath); if ($websize == '') { $websize = 0; } aspEcho('isLocal', $isLocal); $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where httpurl=\'' . $httpUrl . '\''); if (@mysql_num_rows($rsObj) == 0) { $rs = mysql_fetch_array($rsObj); connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(httpurl,title,charset) values(\'' . $httpUrl . '\',\'' . $toTitle . '\',\'' . $codeset . '\')'); } connexecute('update ' . $GLOBALS['db_PREFIX'] . 'weburlscan set webstate=' . $webState . ',websize=' . $websize . ',openspeed=' . $openSpeed . ',charset=\'' . $codeset . '\' where httpurl=\'' . $httpUrl . '\''); //strLen(content) 不用这个,不精准 $s = getContentAHref('', $content, $PubAHrefList, $PubATitleList); $s = handleScanUrlList($httpUrl, $s); //call echo("httpurl",httpurl) //call echo("s",s) //call echo("PubATitleList",PubATitleList) $nOK = 0; $splUrl = aspSplit($PubAHrefList, vbCrlf()); $spltitle = aspSplit($PubATitleList, vbCrlf()); for ($i = 1; $i <= uBound($splUrl); $i++) { $title = $spltitle[$i]; $url = $splUrl[$i]; //去掉#号后台的字符20160506 if (inStr($url, '#') > 0) { $url = mid($url, 1, inStr($url, '#') - 1); } if ($url == '') { if ($title != '') { aspEcho('网址为空', $title); } } else { $url = handleScanUrlList($httpUrl, $url); $url = handleWithWebSiteList($httpUrl, $url); if ($url != '') { $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where httpurl=\'' . $url . '\''); if (@mysql_num_rows($rsObj) == 0) { $rs = mysql_fetch_array($rsObj); $u = lCase($url); if (inStr($u, 'tools/downfile.asp') > 0 || inStr($u, '/url.asp?') > 0 || inStr($u, '/aspweb.asp?') > 0 || inStr($u, '/phpweb.php?') > 0 || $u == 'http://www.maiside.net/qq/' || inStr($u, 'mailto:') > 0 || inStr($u, 'tel:') > 0 || inStr($u, '.html?replytocom') > 0) { //.html?replytocom 王通网站 $isThrough = 0; } else { $isThrough = 1; //不用true 因为写入数据会有问题 } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(tohttpurl,totitle,httpurl,title,isthrough,charset) values(\'' . $httpUrl . '\',\'' . $toTitle . '\',\'' . $url . '\',\'' . left($title, 255) . '\',' . $isThrough . ',\'' . $codeset . '\')'); $nOK = $nOK + 1; aspEcho($i, $url); } else { aspEcho($title, $url); } } } } $scanUrl = $nSetTime; return @$scanUrl; }
function handleTransferChinese_temp($content, $sType) { $zd = ''; $i = ''; $s = ''; $c = ''; $zd = '�I�����}���@���K���۰��a���\\�W�Ӊΰ��T�ڔ[�ܔ����C���k��O��Ͱ��^���r��������������U��݅��ؐ���^���N���䱹�v�����ʹP�Ϯ��Д��Ҏű��]��߅�ྎ���H��׃���q���p��˱��M���e��T���l���I���e���P����ܲ������K���g���a��ؔ�΅����Q�К��ёM�ґK�ӠN���n��œ�ւ}�ל�ގ����Ȳ�Բ�y��Ӳ�Ԍ��v�������s�������p���P���a���U��������L���L�������c���S�������n��܇���س��m��ꐳ��r�œγƷQ�͑ͳ��\\���G�հV���t���Y�ܐu���X����_���x�茙�뮠���P��I��I�������N���z���r���A�������|��̎�����������J�������N�����¾b���o���~���n�����[�ч�ӏĴԅ��՜����f�ܸZ���e���_�������J���ε������۵�đ�������Q���������������h��ʎ���n���v���u���\\�������I�Ɵ������Д��Ӝ���f������c��|��늵�឵��{��ՙ���B��ᔶ�픶��V��ӆ���G���|���Ӷ����������ٶ������x��ـ��僶�呶ϔ�о��҃���꠶Ԍ��և����D���g��Z�鉙���Z���~��Ӟ���I�����������D���E���l���y���m���\\���C����������L�ļ����w���u�ϏU���M���؉��܊^�ߑ���S���S������h���L�诂���T��p���S���P���w��ݗ���Ḩ�o���x����ؓ��Ӈ���D���`��ԓ���}���w�˗U���s�Ѷ����M�Ԍ��Մ���䓸پV�ڍ���怸�R�������w���t�������o�������m��얹�ؕ���^���Ϲ�ƈ������ُ������M��Є��Ғ���P���^���^�ߑT��؞��V��Ҏ��w�������|��܉��Ԏ���F��݁���L��偹������^���n���h��̖���u���Q���R��M���Z������t���ػ��o�����������W���A����������Ԓ���ѻ��Ļ��g���h��߀�������Q���������������o���S���e�ӓ]���x�ٚ����V��x�����Z��R���M���d���L��ȝ�뜆��@��؛�����������C���e�������E���I���u�����������O���������D�����E�����Ý���Ӌ��ӛ���H���^�ͼo�ЊA���v���a���Z��⛼ۃr���{�ߚ���O��Լ�{���g���D��}���O��z��A���|��������p���]�������b���`���v��Ҋ���I��Ş�������T���u���R�����������{���Y�����������v���u���z�������ɽ������q�óC�ăe���_����U�ʽg���I���^���A�ڹ�������Y���]��ý��o���\\���H��֔���M���x���a���M���ž��G���o���L���@�������i���o���R�������d�����������m�ǎ����f���x���e�ݓ���䏾�־無���N����X���Q���E���^���x��܊���E���_���P���w�ǚ����n�щ��ґ��ٓ�����ѝ��K��~�팒��V������r��̝���h���Q�����������U�����Ϟ���D���R������ه���{�������r���@���@���m�������������[�������|�à��ĞE�Ŭ��̓��̈́��ԝ��֘����D�݉������I��h�����x������Y���������������[���v���r���`���z����ɏ���B������z���i����������Ę������������������Z�����������v��Տ�Ư����|����ԫC���R�������[�݄C���U���g������`��X���I���s�����������@�������\\¢��¤�]¥��¦��§��¨�t«�J¬�R�B®�]¯�t°��±�u²̔³��¸�T»��¼�½�¿�H�������X�H�Ō��ƿ|�Ǒ]�˞V�̾G�͎n�Δ��ό\\�О��ҁy�Ւ���݆�ׂ����ٜS�ھ]��Փ���}���_��߉�����j��������j�苌�ꬔ��a��Λ���R���R�������I�������u���~���}���m���z���U���Má֙è؈ê�^í�Tó�Qû�]þ�V���T�Ɛ��ǂ����i�Ή��в[���i�֏���Ғ�݃���d�徒��R����������}���Q�����ևı�\\Ķ���Ņ����c�ɼ{���y�ӓ����X�Ր����[���H�ڃ���M��ā��f������B������������������������š�QŢ��ť�oŦ�~ŧēŨ��ũ�rű��ŵ�Zŷ�WŸ�tŹ��Ż�IŽ�a�̱P�����ג����r�燊���iƭ�_Ʈ�hƵ�lƶؚƻ�Oƾ�{���u�Ý����H�˓�����Ә����V�ܗ���Ě���R���T���M������������әǣ��ǥ�FǦ�UǨ�wǩ��ǫ�tǮ�Xǯ�QDZ��dz�\\Ǵ�lǵ�qǹ��Ǻ��ǽ��Ǿ�Nǿ���������@�Ř��dž��ȃS���N�ϸ[�Ը`�՚J���H�ތ����p�����A�����Ո��c����F��څ���^���|���ȣ�xȧ�EȨ��Ȱ��ȴ�sȵ�oȷ�_�������Ŕ_���@�ȟ����g���J�Ҽx�٘s�q��ܛ���J���c���������_���w��ِɡ��ɥ��ɧ�}ɨ��ɬ��ɱ��ɲ�xɴ��ɸ�Yɹ��ɾ�h���W�����٠�ɿ��ʉ��˂����p�՟��ܽB���d��z������O����������I���B�����Kʤ��ʦ��ʨ�{ʪ��ʫԊʱ�rʴ�gʵ��ʶ�Rʻ��Ƅ����m��������ҕ��ԇ�ى��ޫF������ݔ������H������g�������Q����˧��˫�p˭�l˰��˳�˵�f˶�T˸�q˿�z������ˑZ������A���b�Ӕ\\���K���V���C���m���S�罗��q��O��p��S���s�������i̡�H̢��̨�_̬�B̯��̰؝̱�c̲��̳��̷�T̸Մ̾�@�����̠C�Ν��н{��ӑ���v���`���R���}���w������l���N���F���d�� ���Nͭ�~ͳ�yͷ�^ͺ�dͼ�D�ňF���j��͑��Ó���r���W����֙E���m�䏝�垳���B���f���WΤ�fΥ�`Χ��Ϊ��Ϋ�Hά�SέȔΰ��α��γ��ν�^���l�����Ƽy�ȷ��ʆ��ͮY�Γ����Мu�ѸC���P�؆����u�ڞ����_�ޟo��ʏ�����]���F������`���a����Ϯ�uϰ��ϳ�Ϸ��ϸ��Ϻ�rϽݠϿ�{���b���M�ÏB�Ň����r���w���t������e���@���U�֬F�I�ؿh���W���w�ܑ��߾����������l��Ԕ��������ʒ�������N����Х�[Э�fЮ��Я�yв�{г�Cд��к�aл�xп�\\������d�׃��ڛ����P���C��̓��u������S�����w���m������ѡ�xѢ�_Ѥ�kѧ�Wѫ��ѯԃѰ��ѱ�ZѵӖѶӍѷ�dѹ��ѻ�fѼ���Ɔ��ǁ���Ӡ����̟����}�χ��Ҏr���������G�ᅒ�Ⳏ�叩���V������������P��������W���B��������ҡ�uҢ��ң�bҤ�Gҥ�{ҩˎү��ҳ�ҵ�IҶ�~ҽ�tҿ����U���z�ǃx��ρ��ˇ�ڃ|�䑛���x��Ԅ���h���x���g�쮐���[���a������y������[ӣ��Ӥ��ӥ��Ӧ��ӧ�tӨ��өΞӪ�Iӫ��ӬωӮ�Aӱ�fӴ��ӵ��Ӷ��Ӹ�bӻ�xӽԁ�Ń��Ǒn���]����̪q���T��ݛ���~��O������c��Z���Z���z���uԤ�AԦ�Sԧ�xԨ�Yԯ�@�@Ա�TԲ�AԵ��Զ�hԼ�sԾ�SԿ������Ð�������y�Ȅ����E���\\���N���j�Ε�������s�֞����d�ܔ��ݕ���ٝ���E���K����旗��؟�����t������\\��ٛ��܈ա�բ�lդ��թ�pի�Sծ��ձ��յ�Kն��շݚո��ջ��ս�����`�ŏ��ǝq�ʎ����~��Û���w���U���H���N���@��ؑ���������\\�����������������b����֡��֢�Y֣��֤�C֯��ְִ��ֽ��ֿ�����S�Ď����|�͜�����սK�ַN���[�ڱ����a���S�尙�畃���E���i���T���D��T�����������A���Tפ�vר��ש�uת�Dٍ��ׯ�fװ�bױ�y׳��״���F٘���YՁ�������ǝ���Ɲ���Y�՝n��ۙ�۾C�ܿ��ݿv���u���{��M���@ب��غ�G���d�Ć��Dž��Ʌ��ˏP���v���I�ЅQ�хT��ّ�لq�ۄ��܄�������t��������٭��ٯ�zٱ��ٲ��ٳ��ٶ�R�ǃf�̂��̓E���σ��Ѓ��݃L��e���Z������D������Ж���C���L���AڦӓڧӏڨӘک֎ڪ�nګ�Gڬ�bڭ�Xڮ�gگ�tڰ�xڱ�rڲ�Eڳ�CڴԟڵԑڶԜڷԖڸԍڹԏںՊڻ՟ڼԂڽ�Vھ�aڿ�N���O��Ռ��Վ��Ն����Ք���~���r���R���G���o���]���@���I���X���O���B���J��՛��փ��ו���q���u���k��ֆ���P���S���H��ח���d���ᎄ�������������w����ۣ�Pۦ��۩�i۪�Bۻ�cۼ�J۽���ώ��ш��ۉ��މ�����눺��N���s���P�������_ܳ�Hܼ�Gܿ�|��˞���{���O��ɐ���S���r���d���\\��L�䟦��ʁ��ɜ���w���C���j��������ݡ�nݣ�|ݥ�pݦȇݪ�Pݫ�nݰ�Wݲ�Wݵ�~ݺ�L�ӿM���r��ʉ���V������y���v��ʚ���`���Aޭ�I˒�\\���Y�ƊY�ό��ђ��ғ��ؓ��ⓝ�蓥�����d���tߢ�Xߣ�]ߥ�xߦ�{߱�sߴ�\\�`߽��߿���h�ÆJ�̇��Շ}�؇^�ن��܇������⇝�懁��O��Z������K����ඇD�࿇��ȇ����\\�Ӈ�������������������������ᫍ�sᰍ�ᴍ�ỎFὍ�῍����������ɎV���Ѝ��ێp�����E�������s����⤫M⨫J��h����q��������������A���G���Q���t���x���}���~�����ЏT���s�ޏ[����䑓��Y����ꐝ����������Q������������㢐�㥑a㫐�㳑C㴑|���V���Z������b���h���`���Y���������b������������]������������������H���D���I���R�㞖�휿��{��o���T����䤛�䥜�䫝�䯞g䰝G䱝�䵜Z䶝��^�ŝ��ɞc�˜O�ܞ��ޞ]�䝧��u��t�����|尞���q��߃��ޟ��ߊ��������������橊�櫋I欋�殌D洋z测�濋������ȋ��ɋ��͋������z���������|���A���w���~������������P���U���S���K������s���\\������t���~������������K���J���u���q���v���w���k硼�碼�磼�礽C祼�禼�秿U稽E穽I窽H笽W筽{箽�篽�簽�籾c精_糾p絾i綾E緾R績^繾J纾U绾l缾~罾|羾�翾����D�����¾��þ��ĿP�ž��ƿN�ǿb�ȿd�ɿc�ʿr�˿O�̿V���_�ο~�Ͽz�пw�ѿ��ҿ����i�Կ��տ����\\���`���R���Q���y��^��|��k�筇������t���q���I設a謭�趭���t��y��w还q�����Ǘ��Ș��ɗn�Ι��Й��ә��ٗd�ݙ��ߙf�◿�����E�瘁�����u���������������顙�餘�魙�鴙�鵙�鷙��ę��ƙ��ə{�֙��ڙ��ݙ_��{�䚑�暌�皚�隗�뚛��ܐ��ܗ���V���_���T���W���F���]���U���Y���e���b���`���m��݂���y��z��w�ݏ��A��O꧑�ꨑ�ꯑ�걮T꼕��ʕ��͕��ӕ����S���B���L���O��ٗ���D���W���B���c���l���g���y��َ��җ���J��Ҡ���]���D���M���P���U맚�몚�벚�뵚�빠��ʖV���F��Ä��Ē���T���t���e��Ĝ죚e��R��S��Z��`��j�ݞ��W쵔�쾟�쿟����������ǟ��ˠF��c��[�������U�������������X���µZ�õa�̳��ʹ��Ӵ��״~�������{���A������Ï���`��b������������������Q���A������{���O���S���������k���j���[������^������Z������`���������������X���f���g������p������C���B���G���������I���D������s���B������e���t���K������z������b���A���f������x��|����P��C��|��|��@������n����H������~��S��s��Z��u��|��H����Q����K���d������U���O������|���J���������}���D���U���I���������k������y���������\\���S���M���N������O���������C������h������|������j������Z���C���O���s���R�w��F��S��d��c��������R��z��|��������v��������[��P��Z���]���O�������Y���^���g���l���������������\\���F���_���Y���W���p���w�����������������������X�ܰX�ݰO�尒��A��B���D���������`�a�]�d�]���M���d��ў���c���@���h�䰗���e�������������@��R��M�}��W��h������D��������A��l�ϊ�͘�ϖ��Ϡ���|��͐���u��·��ϓ���X��ϔ���N����ƺV�ȹa�ֻe�ٺ`�ݹ~��j��D��X�캄�ﺍ�����f���[��Ŝ���A���U���u�̶i�ϼc�мg�ּR��{������ڎ���������z���O��ۄ���V���E��ۋ���]���Q���W���U���b��ۘ���X���k���g���x���z���n���Z���V���\\���Z���e���_���f���b���l���r���p���}���w���x�������h��ׇ������Y�����������|�շd���V���c���T���q���^���n���b���q���o���\\�������~�������������������������������a�������N���O���E���H���K���F���T�����������l���{���q���v���m���������������������������B���L�������Z���X���V���k���^���d���X���t���y���x���|���u����������W���N���t���o���B'; for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); if (inStr($zd, $s) > 0) { if ($sType == 1) { $s = mid($zd, inStr($zd, $s) - 1, 1); } else { $s = mid($zd, inStr($zd, $s) + 1, 1); } } $c = $c . $s; } $handleTransferChinese_temp = $c; return @$handleTransferChinese_temp; }
$first_colon = strpos($result, ":") + 1; $rise_hour = mid($result, $first_colon - 2, 2) + $timezone; if ($rise_hour >= 24) { $rise_hour = $rise_hour - 24; } $rise_minute = mid($result, $first_colon + 1, 2); $second_colon = strpos($result, ":", $first_colon + 1) + 1; $rise_seconds = mid($result, $second_colon + 1, 2); $third_colon = strpos($result, ":", $second_colon + 1) + 1; $set_hour = mid($result, $third_colon - 2, 2) + $timezone; if ($set_hour < 0) { $set_hour = $set_hour + 24; } $set_minute = mid($result, $third_colon + 1, 2); $fourth_colon = strpos($result, ":", $third_colon + 1) + 1; $set_seconds = mid($result, $fourth_colon + 1, 2); echo "<center>"; if ($timezone < 0) { $tz = $timezone; } else { $tz = "+" . $timezone; } echo '<font size="2"><b>For ' . strftime("%A, %B %d, %Y<br>JD used = {$starting_JD}<br>(time zone = GMT {$tz} hours)</b></font><br />\n", mktime($hour, $minute, 0, $month, $day, $year)); echo "<font size = '-1'><b>" . $long_deg . $ew_txt . $long_min . ", " . $lat_deg . $ns_txt . $lat_min . "</b></font><br /><br />"; echo "</center><br>"; $pl_name[0] = "Sun"; $pl_name[1] = "Moon"; $pl_name[2] = "Mars"; $pl_name[3] = "Mercury"; $pl_name[4] = "Jupiter"; $pl_name[5] = "Venus";
function batchImportColumnList($splField, $listStr, $nOK, $tableName) { $splstr = ''; $splxx = ''; $isColumn = ''; $columnName = ''; $s = ''; $c = ''; $nLen = ''; $id = ''; $parentIdArray = aspArray(99); $columntypeArray = aspArray(99); $flagsArray = aspArray(99); $nIndex = ''; $fieldStr = ''; $fieldName = ''; $valueStr = ''; $nCount = ''; $isColumn = false; $nCount = 0; $listStr = replace($listStr, vbTab(), ' '); $splstr = aspSplit($listStr, vbCrlf()); foreach ($splstr as $key => $s) { if ($s == '【#sub#】') { $isColumn = true; } else { if ($isColumn == true) { $columnName = $s; if (inStr($columnName, '【|】') > 0) { $columnName = mid($columnName, 1, inStr($columnName, '【|】') - 1); } $columnName = aspRTrim($columnName); $nLen = len($columnName); $columnName = aspLTrim($columnName); $nlen = $nLen - len($columnName); $nIndex = cint($nLen / 4); if ($columnName != '') { $parentIdArray[$nIndex] = $columnName; $c = $c . '【columnname】' . $columnName . vbCrlf(); foreach ($splField as $key => $fieldStr) { $splxx = aspSplit($fieldStr . '|', '|'); $fieldName = $splxx[0]; if ($fieldName != '' && $fieldName != 'columnname' && inStr($s, $fieldName . '=\'') > 0) { $valueStr = getStrCut($s, $fieldName . '=\'', '\'', 2); $c = $c . '【' . $fieldName . '】' . $valueStr . vbCrlf(); if ($fieldName == 'columntype') { $columntypeArray[$nIndex] = $valueStr; } else { if ($fieldName == 'flags') { $flagsArray[$nIndex] = $valueStr; } } } } if ($nIndex != 0) { $c = $c . '【parentid】' . $parentIdArray[$nIndex - 1] . vbCrlf(); $c = $c . '【columntype】' . $columntypeArray[$nIndex - 1] . vbCrlf(); $c = $c . '【flags】' . $flagsArray[$nIndex - 1] . vbCrlf(); } else { $c = $c . '【parentid】-1' . vbCrlf(); } $c = $c . '【sortrank】' . $nCount . vbCrlf(); $nCount = $nCount + 1; $c = $c . '-------------------------------' . vbCrlf(); } } } } //call die(createfile("1.txt",c)) //继续导入 if ($c != '') { importTXTData($c, $tableName, '添加'); } }
function getBrType($theInfo) { $strType = ''; $tmp1 = ''; $s = ''; $s = 'Other Unknown'; if ($theInfo == '') { $theInfo = uCase(serverVariables('HTTP_USER_AGENT')); } if (inStr($theInfo, uCase('mozilla')) > 0) { $s = 'Mozilla'; } if (inStr($theInfo, uCase('icab')) > 0) { $s = 'iCab'; } if (inStr($theInfo, uCase('lynx')) > 0) { $s = 'Lynx'; } if (inStr($theInfo, uCase('links')) > 0) { $s = 'Links'; } if (inStr($theInfo, uCase('elinks')) > 0) { $s = 'ELinks'; } if (inStr($theInfo, uCase('jbrowser')) > 0) { $s = 'JBrowser'; } if (inStr($theInfo, uCase('konqueror')) > 0) { $s = 'konqueror'; } if (inStr($theInfo, uCase('wget')) > 0) { $s = 'wget'; } if (inStr($theInfo, uCase('ask jeeves')) > 0 || inStr($theInfo, uCase('teoma')) > 0) { $s = 'Ask Jeeves/Teoma'; } if (inStr($theInfo, uCase('wget')) > 0) { $s = 'wget'; } if (inStr($theInfo, uCase('opera')) > 0) { $s = 'opera'; } if (inStr($theInfo, uCase('NOKIAN')) > 0) { $s = 'NOKIAN(诺基亚手机)'; } if (inStr($theInfo, uCase('SPV')) > 0) { $s = 'SPV(多普达手机)'; } if (inStr($theInfo, uCase('Jakarta Commons')) > 0) { $s = 'Jakarta Commons-HttpClient'; } if (inStr($theInfo, uCase('Gecko')) > 0) { $strType = '[Gecko] '; $s = 'Mozilla Series'; if (inStr($theInfo, uCase('aol')) > 0) { $s = 'AOL'; } if (inStr($theInfo, uCase('netscape')) > 0) { $s = 'Netscape'; } if (inStr($theInfo, uCase('firefox')) > 0) { $s = 'FireFox'; } if (inStr($theInfo, uCase('chimera')) > 0) { $s = 'Chimera'; } if (inStr($theInfo, uCase('camino')) > 0) { $s = 'Camino'; } if (inStr($theInfo, uCase('galeon')) > 0) { $s = 'Galeon'; } if (inStr($theInfo, uCase('k-meleon')) > 0) { $s = 'K-Meleon'; } $s = $strType . $s; } if (inStr($theInfo, uCase('bot')) > 0 || inStr($theInfo, uCase('crawl')) > 0) { $strType = '[Bot/Crawler]'; if (inStr($theInfo, uCase('grub')) > 0) { $s = 'Grub'; } if (inStr($theInfo, uCase('googlebot')) > 0) { $s = 'GoogleBot'; } if (inStr($theInfo, uCase('msnbot')) > 0) { $s = 'MSN Bot'; } if (inStr($theInfo, uCase('slurp')) > 0) { $s = 'Yahoo! Slurp'; } $s = $strType . $s; } if (inStr($theInfo, uCase('applewebkit')) > 0) { $strType = '[AppleWebKit]'; $s = ''; if (inStr($theInfo, uCase('omniweb')) > 0) { $s = 'OmniWeb'; } if (inStr($theInfo, uCase('safari')) > 0) { $s = 'Safari'; } $s = $strType . $s; } if (inStr($theInfo, uCase('msie')) > 0) { $strType = '[MSIE'; $tmp1 = mid($theInfo, inStr($theInfo, uCase('MSIE')) + 4, 6); $tmp1 = left($tmp1, inStr($tmp1, ';') - 1); $strType = $strType . $tmp1 . ']'; $s = 'Internet Explorer'; $s = $strType . $s; } if (inStr($theInfo, uCase('msn')) > 0) { $s = 'MSN'; } if (inStr($theInfo, uCase('aol')) > 0) { $s = 'AOL'; } if (inStr($theInfo, uCase('webtv')) > 0) { $s = 'WebTV'; } if (inStr($theInfo, uCase('myie2')) > 0) { $s = 'MyIE2'; } if (inStr($theInfo, uCase('maxthon')) > 0) { $s = 'Maxthon(傲游浏览器)'; } if (inStr($theInfo, uCase('gosurf')) > 0) { $s = 'GoSurf(冲浪高手浏览器)'; } if (inStr($theInfo, uCase('netcaptor')) > 0) { $s = 'NetCaptor'; } if (inStr($theInfo, uCase('sleipnir')) > 0) { $s = 'Sleipnir'; } if (inStr($theInfo, uCase('avant browser')) > 0) { $s = 'AvantBrowser'; } if (inStr($theInfo, uCase('greenbrowser')) > 0) { $s = 'GreenBrowser'; } if (inStr($theInfo, uCase('slimbrowser')) > 0) { $s = 'SlimBrowser'; } if (inStr($theInfo, uCase('360SE')) > 0) { $s = $s . '-360SE(360安全浏览器)'; } if (inStr($theInfo, uCase('QQDownload')) > 0) { $s = $s . '-QQDownload(QQ下载器)'; } if (inStr($theInfo, uCase('TheWorld')) > 0) { $s = $s . '-TheWorld(世界之窗浏览器)'; } if (inStr($theInfo, uCase('icafe8')) > 0) { $s = $s . '-icafe8(网维大师网吧管理插件)'; } if (inStr($theInfo, uCase('TencentTraveler')) > 0) { $s = $s . '-TencentTraveler(腾讯TT浏览器)'; } if (inStr($theInfo, uCase('baiduie8')) > 0) { $s = $s . '-baiduie8(百度IE8.0)'; } if (inStr($theInfo, uCase('iCafeMedia')) > 0) { $s = $s . '-iCafeMedia(网吧网媒趋势插件)'; } if (inStr($theInfo, uCase('DigExt')) > 0) { $s = $s . '-DigExt(IE5允许脱机阅读模式特殊标记)'; } if (inStr($theInfo, uCase('baiduds')) > 0) { $s = $s . '-baiduds(百度硬盘搜索)'; } if (inStr($theInfo, uCase('CNCDialer')) > 0) { $s = $s . '-CNCDialer(数控拨号)'; } if (inStr($theInfo, uCase('NOKIAN85')) > 0) { $s = $s . '-NOKIAN85(诺基亚手机)'; } if (inStr($theInfo, uCase('SPV_C600')) > 0) { $s = $s . '-SPV_C600(多普达C600)'; } if (inStr($theInfo, uCase('Smartphone')) > 0) { $s = $s . '-Smartphone(Windows Mobile for Smartphone Edition 操作系统的智能手机)'; } $getBrType = $s; return @$getBrType; }
function setHtmlParam($content, $ParamList) { $splStr = ''; $startStr = ''; $endStr = ''; $c = ''; $paramValue = ''; $ReplaceStartStr = ''; $endStr = '\''; $splStr = aspSplit($ParamList, '|'); foreach ($splStr as $key => $startStr) { $startStr = aspTrim($startStr); if ($startStr != '') { //替换开始字符 因为开始字符类型可变 不同 $ReplaceStartStr = $startStr; if (left($ReplaceStartStr, 3) == 'img') { $ReplaceStartStr = mid($ReplaceStartStr, 4, -1); } else { if (left($ReplaceStartStr, 1) == 'a') { $ReplaceStartStr = mid($ReplaceStartStr, 2, -1); } else { if (inStr('|ul|li|', '|' . left($ReplaceStartStr, 2) . '|') > 0) { $ReplaceStartStr = mid($ReplaceStartStr, 3, -1); } } } $ReplaceStartStr = ' ' . $ReplaceStartStr . '=\''; $startStr = ' ' . $startStr . '=\''; if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0) { $paramValue = StrCut($content, $startStr, $endStr, 2); $paramValue = HandleInModule($paramValue, 'end'); //处理内部模块 $c = $c . $ReplaceStartStr . $paramValue . $endStr; } } } $setHtmlParam = $c; return @$setHtmlParam; }
function page($page, $n, $pagesize) { $total = ceil($n / $pagesize); $total < 1 and $total = 1; return mid($page, 1, $total); }
function setCutTDStr($content, $TDWidth, $MoreColor) { $i = ''; $s = ''; $c = ''; $n = ''; $EndNumb = ''; $YesMore = ''; $content = cStr($content . ''); if ($content == '') { $setCutTDStr = $content; return @$setCutTDStr; } if ($TDWidth == '') { $setCutTDStr = $content; return @$setCutTDStr; } //TDWidth为空,则为自动 $n = 0; $YesMore = false; $EndNumb = int($TDWidth / 6.3); for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); if ($n >= $EndNumb) { $YesMore = true; break; } else { $c = $c . $s; } if (asc($s) < 0) { $n = $n + 2; } else { $n = $n + 1; } } if ($YesMore == true) { //需要处理Title标题的HTML $c = '<span Title="' . displayHtml($content) . '" style="background-color:' . $MoreColor . ';">' . $c . '</span>'; } $setCutTDStr = $c; return @$setCutTDStr; }
function formatting($content, $action) { $i = ''; $endStr = ''; $s = ''; $c = ''; $labelName = ''; $startLabel = ''; $endLabel = ''; $endLabelStr = ''; $nLevel = ''; $isYes = ''; $parentLableName = ''; $nextLableName = ''; //下一个标题名称 $isA = ''; //是否为A链接 $isTextarea = ''; //是否为多行输入文本框 $isScript = ''; //脚本语言 $isStyle = ''; //Css层叠样式表 $isPre = ''; //是否为pre $startLabel = '<'; $endLabel = '>'; $nLevel = 0; $action = '|' . $action . '|'; //层级 $isA = false; $isTextarea = false; $isScript = false; $isStyle = false; $isPre = false; $content = replace(replace($content, vbCrlf(), chr(10)), vbTab(), ' '); for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); $endStr = mid($content, $i, -1); if ($s == '<') { if (inStr($endStr, '>') > 0) { $s = mid($endStr, 1, inStr($endStr, '>')); $i = $i + len($s) - 1; $s = mid($s, 2, len($s) - 2); if (right($s, 1) == '/') { $s = PHPTrim(left($s, len($s) - 1)); } $endStr = right($endStr, len($endStr) - len($s) - 2); //最后字符减去当前标签 -2是因为它有<>二个字符 //注意之前放在labelName下面 $labelName = mid($s, 1, inStr($s . ' ', ' ') - 1); $labelName = lCase($labelName); //call echo("labelName",labelName) if ($labelName == 'a') { $isA = true; } else { if ($labelName == '/a') { $isA = false; } else { if ($labelName == 'textarea') { $isTextarea = true; } else { if ($labelName == '/textarea') { $isTextarea = false; } else { if ($labelName == 'script') { $isScript = true; } else { if ($labelName == '/script') { $isScript = false; } else { if ($labelName == 'style') { $isStyle = true; } else { if ($labelName == '/style') { $isStyle = false; } else { if ($labelName == 'pre') { $isPre = true; } else { if ($labelName == '/pre') { $isPre = false; } } } } } } } } } } $endLabelStr = $endLabel; $nextLableName = getHtmlLableName($endStr, 0); //不为压缩HTML if (inStr($action, '|ziphtml|') == false && $isPre == false) { if ($isA == false) { if (inStr('|a|strong|u|i|s|script|', '|' . $labelName . '|') == false && '/' . $labelName != $nextLableName && inStr('|/a|/strong|/u|/i|/s|/script|', '|' . $nextLableName . '|') == false) { $endLabelStr = $endLabelStr . chr(10); } } } //单标签最后加个 / 20160615 if (inStr('|br|hr|img|input|param|meta|link|', '|' . $labelName . '|') > 0) { $s = $s . ' /'; } $s = $startLabel . $s . $endLabelStr; //不为压缩HTML if (inStr($action, '|ziphtml|') == false && $isPre == false) { //处理这个 aaaaa</span> if ($isA == false && $isYes == false && left($labelName, 1) == '/' && $labelName != '/script' && $labelName != '/a') { //排除这种 <span>天天发团</span> 并且判断上一个字段不等于vbcrlf换行 if ('/' . $parentLableName != $labelName && right(aspTrim($c), 1) != chr(10)) { $s = chr(10) . $s; } } } $parentLableName = $labelName; $isYes = true; } } else { if ($s != '') { $isYes = false; //call echo("isPre",isPre) if ($isPre == false) { if ($s == chr(10)) { if ($isTextarea == false && $isScript == false && $isStyle == false) { $s = ''; } else { if ($isScript == true) { if (inStr($action, '|zipscripthtml|') > 0) { $s = ' '; } } else { if ($isStyle == true) { if (inStr($action, '|zipstylehtml|') > 0) { $s = ''; } } else { if ($isTextarea == true) { if (inStr($action, '|ziptextareahtml|') > 0) { $s = ''; } } else { $s = chr(10); } } } } // Right(Trim(c), 1) = ">") 为在压缩时用到 } else { if ((right(aspTrim($c), 1) == chr(10) || right(aspTrim($c), 1) == '>') && PHPTrim($s) == '' && $isTextarea == false && $isScript == false) { $s = ''; } } } } } $c = $c . $s; } $c = replace($c, chr(10), vbCrlf()); $formatting = $c; return @$formatting; }
function copyHtmlToWeb() { $webDir = ''; $toWebDir = ''; $toFilePath = ''; $filePath = ''; $fileName = ''; $fileList = ''; $splStr = ''; $content = ''; $s = ''; $s1 = ''; $c = ''; $webImages = ''; $webCss = ''; $webJs = ''; $splJs = ''; $webFolderName = ''; $jsFileList = ''; $setFileCode = ''; $nErrLevel = ''; $jsFilePath = ''; $url = ''; $setFileCode = @$_REQUEST['setcode']; //设置文件保存编码 handlePower('复制生成HTML页面'); //管理权限处理 writeSystemLog('', '复制生成HTML页面'); //系统日志 $webFolderName = $GLOBALS['cfg_webTemplate']; if (left($webFolderName, 1) == '/') { $webFolderName = mid($webFolderName, 2, -1); } if (right($webFolderName, 1) == '/') { $webFolderName = mid($webFolderName, 1, len($webFolderName) - 1); } if (inStr($webFolderName, '/') > 0) { $webFolderName = mid($webFolderName, inStr($webFolderName, '/') + 1, -1); } $webDir = '/htmladmin/' . $webFolderName . '/'; $toWebDir = '/htmlw' . 'eb/viewweb/'; CreateDirFolder($toWebDir); $toWebDir = $toWebDir . pinYin2($webFolderName) . '/'; deleteFolder($toWebDir); //删除 CreateFolder('/htmlweb/web'); //创建文件夹 防止web文件夹不存在20160504 deleteFolder($webDir); CreateDirFolder($webDir); $webImages = $webDir . 'Images/'; $webCss = $webDir . 'Css/'; $webJs = $webDir . 'Js/'; copyFolder($GLOBALS['cfg_webImages'], $webImages); copyFolder($GLOBALS['cfg_webCss'], $webCss); CreateFolder($webJs); //创建Js文件夹 //处理Js文件夹 $splJs = aspSplit(getDirJsList($webJs), vbCrlf()); foreach ($splJs as $key => $filePath) { if ($filePath != '') { $toFilePath = $webJs . getFileName($filePath); aspEcho('js', $filePath); moveFile($filePath, $toFilePath); } } //处理Css文件夹 $splStr = aspSplit(getDirCssList($webCss), vbCrlf()); foreach ($splStr as $key => $filePath) { if ($filePath != '') { $content = getFText($filePath); $content = replace($content, $GLOBALS['cfg_webImages'], '../images/'); $content = deleteCssNote($content); $content = PHPTrim($content); //设置为utf-8编码 20160527 if (lCase($setFileCode) == 'utf-8') { $content = replace($content, 'gb2312', 'utf-8'); } WriteToFile($filePath, $content, $setFileCode); aspEcho('css', $GLOBALS['cfg_webImages']); } } //复制栏目HTML $GLOBALS['isMakeHtml'] = true; $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn where isonhtml=true'); while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) { $GLOBALS['glb_filePath'] = replace(getColumnUrl($rss['columnname'], 'name'), $GLOBALS['cfg_webSiteUrl'] . '/', ''); if (right($GLOBALS['glb_filePath'], 1) == '/' || right($GLOBALS['glb_filePath'], 1) == '') { $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html'; } if (right($GLOBALS['glb_filePath'], 5) == '.html') { if (right($GLOBALS['glb_filePath'], 11) == '/index.html') { $fileList = $fileList . $GLOBALS['glb_filePath'] . vbCrlf(); } else { $fileList = $GLOBALS['glb_filePath'] . vbCrlf() . $fileList; } $fileName = replace($GLOBALS['glb_filePath'], '/', '_'); $toFilePath = $webDir . $fileName; copyFile($GLOBALS['glb_filePath'], $toFilePath); aspEcho('导航', $GLOBALS['glb_filePath']); } } //复制文章HTML $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where isonhtml=true'); while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) { $GLOBALS['glb_url'] = getHandleRsUrl($rss['filename'], $rss['customaurl'], '/detail/detail' . $rss['id']); $GLOBALS['glb_filePath'] = replace($GLOBALS['glb_url'], $GLOBALS['cfg_webSiteUrl'] . '/', ''); if (right($GLOBALS['glb_filePath'], 1) == '/' || right($GLOBALS['glb_filePath'], 1) == '') { $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html'; } if (right($GLOBALS['glb_filePath'], 5) == '.html') { if (right($GLOBALS['glb_filePath'], 11) == '/index.html') { $fileList = $fileList . $GLOBALS['glb_filePath'] . vbCrlf(); } else { $fileList = $GLOBALS['glb_filePath'] . vbCrlf() . $fileList; } $fileName = replace($GLOBALS['glb_filePath'], '/', '_'); $toFilePath = $webDir . $fileName; copyFile($GLOBALS['glb_filePath'], $toFilePath); aspEcho('文章' . $rss['title'], $GLOBALS['glb_filePath']); } } //复制单面HTML $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'onepage where isonhtml=true'); while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) { $GLOBALS['glb_url'] = getHandleRsUrl($rss['filename'], $rss['customaurl'], '/page/page' . $rss['id']); $GLOBALS['glb_filePath'] = replace($GLOBALS['glb_url'], $GLOBALS['cfg_webSiteUrl'] . '/', ''); if (right($GLOBALS['glb_filePath'], 1) == '/' || right($GLOBALS['glb_filePath'], 1) == '') { $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html'; } if (right($GLOBALS['glb_filePath'], 5) == '.html') { if (right($GLOBALS['glb_filePath'], 11) == '/index.html') { $fileList = $fileList . $GLOBALS['glb_filePath'] . vbCrlf(); } else { $fileList = $GLOBALS['glb_filePath'] . vbCrlf() . $fileList; } $fileName = replace($GLOBALS['glb_filePath'], '/', '_'); $toFilePath = $webDir . $fileName; copyFile($GLOBALS['glb_filePath'], $toFilePath); aspEcho('单页' . $rss['title'], $GLOBALS['glb_filePath']); } } //批量处理html文件列表 //call echo(cfg_webSiteUrl,cfg_webTemplate) //call rwend(fileList) $sourceUrl = ''; $replaceUrl = ''; $splStr = aspSplit($fileList, vbCrlf()); foreach ($splStr as $key => $filePath) { if ($filePath != '') { $filePath = $webDir . replace($filePath, '/', '_'); aspEcho('filePath', $filePath); $content = getFText($filePath); foreach ($splStr as $key => $s) { $s1 = $s; if (right($s1, 11) == '/index.html') { $s1 = left($s1, len($s1) - 11) . '/'; } $sourceUrl = $GLOBALS['cfg_webSiteUrl'] . $s1; $replaceUrl = $GLOBALS['cfg_webSiteUrl'] . replace($s, '/', '_'); //Call echo(sourceUrl, replaceUrl) '屏蔽 否则大量显示20160613 $content = replace($content, $sourceUrl, $replaceUrl); } $content = replace($content, $GLOBALS['cfg_webSiteUrl'], ''); //删除网址 $content = replace($content, $GLOBALS['cfg_webTemplate'] . '/', ''); //删除模板路径 记 //content=nullLinkAddDefaultName(content) foreach ($splJs as $key => $s) { if ($s != '') { $fileName = getFileName($s); $content = replace($content, 'Images/' . $fileName, 'js/' . $fileName); } } if (inStr($content, '/Jquery/Jquery.Min.js') > 0) { $content = replace($content, '/Jquery/Jquery.Min.js', 'js/Jquery.Min.js'); copyFile('/Jquery/Jquery.Min.js', $webJs . '/Jquery.Min.js'); } $content = replace($content, '<a href="" ', '<a href="index.html" '); //让首页加index.html createFileGBK($filePath, $content); } } //把复制网站夹下的images/文件夹下的js移到js/文件夹下 20160315 $htmlFileList = ''; $splHtmlFile = ''; $splJsFile = ''; $htmlFilePath = ''; $jsFileName = ''; $jsFileList = getDirJsNameList($webImages); $htmlFileList = getDirHtmlList($webDir); $splHtmlFile = aspSplit($htmlFileList, vbCrlf()); $splJsFile = aspSplit($jsFileList, vbCrlf()); foreach ($splHtmlFile as $key => $htmlFilePath) { $content = getFText($htmlFilePath); foreach ($splJsFile as $key => $jsFileName) { $content = regExp_Replace($content, 'Images/' . $jsFileName, 'js/' . $jsFileName); } $nErrLevel = 0; $content = handleHtmlFormatting($content, false, $nErrLevel, '|删除空行|'); //|删除空行| $content = handleCloseHtml($content, true, ''); //闭合标签 $nErrLevel = checkHtmlFormatting($content); if (checkHtmlFormatting($content) == false) { echoRed($htmlFilePath . '(格式化错误)', $nErrLevel); //注意 } //设置为utf-8编码 if (lCase($setFileCode) == 'utf-8') { $content = replace($content, '<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />', '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'); } $content = PHPTrim($content); WriteToFile($htmlFilePath, $content, $setFileCode); } //images下js移动到js下 foreach ($splJsFile as $key => $jsFileName) { $jsFilePath = $webImages . $jsFileName; $content = getFText($jsFilePath); $content = PHPTrim($content); WriteToFile($webJs . $jsFileName, $content, $setFileCode); DeleteFile($jsFilePath); } copyFolder($webDir, $toWebDir); //使htmlWeb文件夹用php压缩 if (@$_REQUEST['isMakeZip'] == '1') { makeHtmlWebToZip($webDir); } //使网站用xml打包20160612 if (@$_REQUEST['isMakeXml'] == '1') { makeHtmlWebToXmlZip('/htmladmin/', $webFolderName); } //浏览地址 $url = 'http://10.10.10.57/' . $toWebDir; aspEcho('浏览', '<a href=\'' . $url . '\' target=\'_blank\'>' . $url . '</a>'); }
function JsEncode__($s) { if (isNul($s)) { $JsEncode__ = ''; return @$JsEncode__; } $arr1 = ''; $arr2 = ''; $i = ''; $j = ''; $c = ''; $p = ''; $t = ''; $arr1 = array(chr(34), chr(92), chr(47), chr(8), chr(12), chr(10), chr(13), chr(9)); //34|",92|\,47|/,8|,12|,10| ,13| ,9| , $arr2 = array(chr(34), chr(92), chr(47), chr(98), chr(102), chr(110), chr(114)); //34|",92|\,47|/,98|b,102|f,110|n,114|r,1865|, for ($i = 1; $i <= len($s); $i++) { $p = true; $c = mid($s, $i, 1); for ($j = 0; $j <= uBound($arr1); $j++) { if ($c == $arr1[$j]) { $t = $t . '\\' . $arr2[$j]; $p = false; break; } } if ($p) { $t = $t . $c; } } $JsEncode__ = $t; return @$JsEncode__; }
function handleHtmlStyle($content) { $serchS = ''; $replaceS = ''; $nLength = ''; $serchS = $content; $nLength = inStr(lCase($serchS), '</style>') + 7; $serchS = mid($serchS, 1, $nLength); $nLength = inStrRev(lCase($serchS), '<style'); if ($nLength > 0) { $serchS = mid($serchS, $nLength, -1); } $replaceS = $serchS; $replaceS = cssCompression($replaceS, 0) . vbCrlf(); //格式化CSS $replaceS = removeBlankLines($replaceS); $content = replace($content, $serchS, $replaceS); $handleHtmlStyle = $content; return @$handleHtmlStyle; }
function getRParam($content, $lableStr) { $contentLCase = ''; $endS = ''; $i = ''; $s = ''; $c = ''; $isStart = ''; $startStr = ''; $isValue = ''; $content = ' ' . $content . ' '; //避免更精准获得值 $contentLCase = lCase($content); $lableStr = lCase($lableStr); $endS = mid($content, inStr($contentLCase, $lableStr) + len($lableStr), -1); //call echo("ends",ends) $isStart = false; //是否有开始类型值 $isValue = false; //是否有值 for ($i = 1; $i <= len($endS); $i++) { $s = mid($endS, $i, 1); if ($isStart == true) { if ($s != '') { if ($startStr == '') { $startStr = $s; } else { if ($startStr == '"' || $startStr == '\'') { if ($s == $startStr) { $isValue = true; break; } } else { if ($s == ' ' && $c == '') { } else { if ($s == ' ' || $s == '/' || $s == '>') { $isValue = true; break; } } } if ($s != ' ') { $c = $c . $s; } } } } if ($s == '=') { $isStart = true; } } if ($isValue == false) { $c = ''; } $getRParam = $c; //call echo("c",c) return @$getRParam; }
function getPostSql($id, $tableName, $fieldNameList) { $valueStr = ''; $editValueStr = ''; $sql = ''; $splStr = ''; $splxx = ''; $s = ''; $fieldList = ''; $fieldName = ''; $defaultFieldValue = ''; //字段名称 $fieldSetType = ''; //字段设置类型 $fieldValue = ''; //字段值 $systemFieldList = ''; //表字段列表 $systemFieldList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段配置列表'); $postFieldList = ''; //post字段列表 $splPost = ''; $fieldContent = ''; $fieldConfig = ''; $postFieldList = getFormFieldList(); //以后再把下面与上面这两种处理方法事成一种看看行不行 $splPost = aspSplit($postFieldList, '|'); foreach ($splPost as $key => $fieldName) { $fieldContent = @$_POST[$fieldName]; if (inStr($systemFieldList, ',' . $fieldName . '|') > 0 && inStr(',' . $fieldList . ',', ',' . $fieldName . ',') == false) { //为自定义的 if (inStr($fieldNameList, ',' . $fieldName . '|') > 0) { $fieldConfig = mid($fieldNameList, inStr($fieldNameList, ',' . $fieldName . '|') + 1, -1); } else { $fieldConfig = mid($systemFieldList, inStr($systemFieldList, ',' . $fieldName . '|') + 1, -1); } $fieldConfig = mid($fieldConfig, 1, inStr($fieldConfig, ',') - 1); //call echo("config",fieldConfig) //call echo(fieldName,fieldContent) //call echo("fieldConfig",fieldConfig) $splxx = aspSplit($fieldConfig . '|||', '|'); $fieldName = $splxx[0]; //字段名称 $fieldSetType = $splxx[1]; //字段设置类型 $defaultFieldValue = $splxx[2]; //默认字段值 $fieldValue = ADSqlRf($fieldName); //代替上面,因为它处理了'符号 //call echo("fieldValue",fieldValue) //排序密码不处理 if ($fieldValue != '#NO******NO#') { //md5加密 if ($fieldSetType == 'md5') { $fieldValue = myMD5($fieldValue); } if ($fieldSetType == 'yesno') { if ($fieldValue == '') { $fieldValue = $defaultFieldValue; } //不为数字类型加单引号 } else { if ($fieldSetType == 'numb') { if ($fieldValue == '') { $fieldValue = $defaultFieldValue; } } else { if ($fieldName == 'flags') { //PHP里用法 if (EDITORTYPE == 'php') { if ($fieldValue != '') { $fieldValue = '|' . arrayToString($fieldValue, '|'); } } else { $fieldValue = '|' . arrayToString(aspSplit($fieldValue, ', '), '|'); } $fieldValue = '\'' . $fieldValue . '\''; //为时间 } else { if ($fieldSetType == 'time' || $fieldSetType == 'now') { if ($fieldValue == '') { $fieldValue = now(); } $fieldValue = '\'' . $fieldValue . '\''; //为时期 } else { if ($fieldSetType == 'date') { if ($fieldValue == '') { $fieldValue = aspDate(); } $fieldValue = '\'' . $fieldValue . '\''; } else { $fieldValue = '\'' . $fieldValue . '\''; } } } } } $fieldValue = unescape($fieldValue); //解码20160418 if ($valueStr != '') { $valueStr = $valueStr . ','; $editValueStr = $editValueStr . ','; } $valueStr = $valueStr . $fieldValue; $editValueStr = $editValueStr . $fieldName . '=' . $fieldValue; } if ($fieldList != '') { $fieldList = $fieldList . ','; } $fieldList = $fieldList . $fieldName; } } //自定义字段是否需要写入默认值 有的 $splStr = aspSplit($fieldNameList, ','); foreach ($splStr as $key => $s) { if (inStr($s, '|') > 0) { $splxx = aspSplit($s . '|||', '|'); $fieldName = $splxx[0]; //字段名称 $fieldSetType = $splxx[1]; //字段设置类型 $fieldValue = $splxx[2]; //默认字段值 if (inStr($systemFieldList, ',' . $fieldName . '|') > 0 && inStr(',' . $fieldList . ',', ',' . $fieldName . ',') == false) { if ($fieldSetType == 'date' && $fieldValue == '') { $fieldValue = aspDate(); } else { if (($fieldSetType == 'time' || $fieldSetType == 'now') && $fieldValue == '') { $fieldValue = now(); } } if ($fieldSetType != 'yesno' && $fieldSetType != 'numb') { $fieldValue = '\'' . $fieldValue . '\''; } if ($fieldList != '') { $fieldList = $fieldList . ','; $valueStr = $valueStr . ','; $editValueStr = $editValueStr . ','; } $fieldList = $fieldList . $fieldName; $valueStr = $valueStr . $fieldValue; $editValueStr = $editValueStr . $fieldName . '=' . $fieldValue; //call echo(fieldName,fieldSetType) } } } if ($id == '') { $sql = 'insert into ' . $GLOBALS['db_PREFIX'] . '' . $tableName . ' (' . $fieldList . ',updatetime) values(' . $valueStr . ',\'' . now() . '\')'; } else { $sql = 'update ' . $GLOBALS['db_PREFIX'] . '' . $tableName . ' set ' . $editValueStr . ',updatetime=\'' . now() . '\' where id=' . $id; } $getPostSql = $sql; return @$getPostSql; }
function cutFunctionvValue($content, $startStr, $endStr) { $ku1 = ''; $ku2 = ''; $i = ''; $s = ''; $c = ''; $ku1 = 1; $ku2 = 0; for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); $c = $c . $s; if ($s == $startStr) { $ku1 = $ku1 + 1; } else { if ($s == $endStr) { $ku2 = $ku2 + 1; if ($ku1 == $ku2) { break; } } } } $cutFunctionvValue = $c; return @$cutFunctionvValue; }
$input_banip_on = form_radio_yes_no('banip_on', $conf['banip_on']); empty($baniplist) and $baniplist = array(array('banid' => 1, 'ip0' => 0, 'ip1' => 0, 'ip2' => 0, 'ip3' => 0, 'create_date_fmt' => '', 'expiry_fmt' => '')); include "./admin/view/banip.htm"; } elseif ($action == 'update') { $method != 'POST' and message(-1, 'Method error'); $banid = param(2, 0); $ip0 = param('ip0', 0); $ip1 = param('ip1', 0); $ip2 = param('ip2', 0); $ip3 = param('ip3', 0); $expiry = param('expiry'); $expiry = strtotime($expiry); $ip0 = mid($ip0, 0, 255); $ip1 = mid($ip1, 0, 255); $ip2 = mid($ip2, 0, 255); $ip3 = mid($ip3, 0, 255); $banip = banip_read($banid); if (empty($banip)) { $r = banip_create(array('banid' => $banid, 'ip0' => $ip0, 'ip1' => $ip1, 'ip2' => $ip2, 'ip3' => $ip3, 'expiry' => $expiry)); $r !== FALSE ? message(0, '创建成功') : message(-1, '创建失败'); } $r = banip_update($banid, array('ip0' => $ip0, 'ip1' => $ip1, 'ip2' => $ip2, 'ip3' => $ip3, 'expiry' => $expiry)); $r !== FALSE ? message(0, '更新成功') : message(-1, '更新失败'); } elseif ($action == 'enable') { $method != 'POST' and message(-1, 'Method error'); $banip_on = param('banip_on', 0); $r = conf_set('banip_on', $banip_on); $r !== FALSE ? message(0, '更新成功') : message(-1, '更新失败,请检查 conf/conf.php 是否可写!'); } elseif ($action == 'delete') { $method != 'POST' and message(-1, 'Method error'); $banid = param(2, 0);
function delTemplate() { $templateDir = ''; $toTemplateDir = ''; $url = ''; $templateDir = replace(@$_REQUEST['templateDir'], '\\', '/'); handlePower('删除模板'); //管理权限处理 $toTemplateDir = mid($templateDir, 1, inStrRev($templateDir, '/')) . '#' . mid($templateDir, inStrRev($templateDir, '/') + 1, -1) . '_' . Format_Time(now(), 11); //call die(toTemplateDir) moveFolder($templateDir, $toTemplateDir); $url = '?act=displayLayout&templateFile=layout_manageTemplates.html&lableTitle=模板'; Rw(getMsg1('删除模板完成,正在进入模板界面...', $url)); }
function formatNumber($content, $n) { $dianLeft = ""; $dianRight = ""; $i = ""; $c = ""; $s = ""; $content = cstr($content); if (inStr($content, ".") > 0) { $dianLeft = mid($content, 1, inStr($content, ".") - 1); $dianRight = mid($content, inStr($content, ".") + 1, -1); } else { $dianLeft = $content; } $dianRight = $dianRight . "0000000000"; for ($i = 1; $i <= $n; $i++) { $s = mid($dianRight, $i, 1); $c = $c . $s; } if ($n > 0) { $dianLeft = $dianLeft . "."; } $test = $dianLeft . $c; return @$formatNumber; }