function webStat($folderPath) { $dateTime = ''; $content = ''; $splStr = ''; $thisUrl = ''; $goToUrl = ''; $caiShu = ''; $c = ''; $fileName = ''; $co = ''; $ie = ''; $xp = ''; $goToUrl = serverVariables('HTTP_REFERER'); $thisUrl = 'http://' . serverVariables('HTTP_HOST') . serverVariables('SCRIPT_NAME'); $caiShu = serverVariables('QUERY_STRING'); if ($caiShu != '') { $thisUrl = $thisUrl . '?' . $caiShu; } $goToUrl = @$_REQUEST['GoToUrl']; $thisUrl = @$_REQUEST['ThisUrl']; $co = @$_GET['co']; $dateTime = now(); $content = serverVariables('HTTP_USER_AGENT'); $content = replace($content, 'MSIE', 'Internet Explorer'); $content = replace($content, 'NT 5.0', '2000'); $content = replace($content, 'NT 5.1', 'XP'); $content = replace($content, 'NT 5.2', '2003'); $splStr = aspSplit($content . ';;;;', ';'); $ie = $splStr[1]; $xp = aspTrim($splStr[2]); if (right($xp, 1) == ')') { $xp = mid($xp, 1, len($xp) - 1); } $c = '来访' . $goToUrl . vbCrlf(); $c = $c . '当前:' . $thisUrl . vbCrlf(); $c = $c . '时间:' . $dateTime . vbCrlf(); $c = $c . 'IP:' . getIP() . vbCrlf(); $c = $c . 'IE:' . getBrType('') . vbCrlf(); $c = $c . 'Cookies=' . $co . vbCrlf(); $c = $c . 'XP=' . $xp . vbCrlf(); $c = $c . 'Screen=' . @$_REQUEST['screen'] . vbCrlf(); //屏幕分辨率 $c = $c . '用户信息=' . serverVariables('HTTP_USER_AGENT') . vbCrlf(); //用户信息 $c = $c . '-------------------------------------------------' . vbCrlf(); //c=c & "CaiShu=" & CaiShu & vbcrlf $fileName = $folderPath . Format_Time(now(), 2) . '.txt'; CreateAddFile($fileName, $c); $c = $c . vbCrlf() . $fileName; $c = replace($c, vbCrlf(), '\\n'); $c = replace($c, '"', '\\"'); //Response.Write("eval(""var MyWebStat=\""" & C & "\"""")") $splxx = ''; $nIP = ''; $nPV = ''; $ipList = ''; $s = ''; $ip = ''; //判断是否显示回显记录 if (@$_REQUEST['stype'] == 'display') { $content = getFText($fileName); $splxx = aspSplit($content, vbCrlf() . '-------------------------------------------------' . vbCrlf()); $nIP = 0; $nPV = 0; $ipList = ''; foreach ($splxx as $key => $s) { if (inStr($s, '当前:') > 0) { $s = vbCrlf() . $s . vbCrlf(); $ip = ADSql(getStrCut($s, vbCrlf() . 'IP:', vbCrlf(), 0)); $nPV = $nPV + 1; if (inStr(vbCrlf() . $ipList . vbCrlf(), vbCrlf() . $ip . vbCrlf()) == false) { $ipList = $ipList . $ip . vbCrlf(); $nIP = $nIP + 1; } } } Rw('document.write(\'网长统计 | 今日IP[' . $nIP . '] | 今日PV[' . $nPV . '] \')'); } $webStat = $c; return @$webStat; }
function websiteDetail() { $content = ''; $splxx = ''; $filePath = ''; $s = ''; $ip = ''; $ipList = ''; $nIP = ''; $nPV = ''; $i = ''; $timeStr = ''; $c = ''; handlePower('网站统计详细'); //管理权限处理 for ($i = 1; $i <= 30; $i++) { $timeStr = getHandleDate(($i - 1) * -1); //format_Time(Now() - i + 1, 2) $filePath = $GLOBALS['adminDir'] . '/data/stat/' . $timeStr . '.txt'; $content = getFText($filePath); $splxx = aspSplit($content, vbCrlf() . '-------------------------------------------------' . vbCrlf()); $nIP = 0; $nPV = 0; $ipList = ''; foreach ($splxx as $key => $s) { if (inStr($s, '当前:') > 0) { $s = vbCrlf() . $s . vbCrlf(); $ip = ADSql(getStrCut($s, vbCrlf() . 'IP:', vbCrlf(), 0)); $nPV = $nPV + 1; if (inStr(vbCrlf() . $ipList . vbCrlf(), vbCrlf() . $ip . vbCrlf()) == false) { $ipList = $ipList . $ip . vbCrlf(); $nIP = $nIP + 1; } } } aspEcho($timeStr, 'IP(' . $nIP . ') PV(' . $nPV . ')'); if ($i < 4) { $c = $c . $timeStr . ' IP(' . $nIP . ') PV(' . $nPV . ')' . '<br>'; } } setConfigFileBlock($GLOBALS['WEB_CACHEFile'], $c, '#访客信息#'); writeSystemLog('', '详细网站统计'); //系统日志 }
function XY_handleGetTableBody($action, $tableName, $fieldParamName, $defaultFileName, $adminUrl) { $url = ''; $content = ''; $id = ''; $sql = ''; $addSql = ''; $fieldName = ''; $fieldParamValue = ''; $fieldNameList = ''; $nLen = ''; $delHtmlYes = ''; $trimYes = ''; $defaultStr = ''; $noisonhtml = ''; $intoFieldStr = ''; $valuesStr = ''; $nonull = ''; $fieldName = RParam($action, 'fieldname'); //字段名称 $noisonhtml = RParam($action, 'noisonhtml'); //不生成html $nonull = RParam($action, 'noisonhtml'); //内容不能为空20160716 home if ($noisonhtml == 'true') { $intoFieldStr = ',isonhtml'; $valuesStr = ',0'; } $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表'); //字段名称不为空,并且要在表字段里 if ($fieldName == '' || inStr($fieldNameList, ',' . $fieldName . ',') == false) { $fieldName = $defaultFileName; } $fieldName = lCase($fieldName); //转为小写,因为在PHP里是全小写的 $fieldParamValue = RParam($action, $fieldParamName); //截取字段内容 $id = handleNumber(RParam($action, 'id')); //获得ID $addSql = ' where ' . $fieldParamName . '=\'' . $fieldParamValue . '\''; if ($id != '') { $addSql = ' where id=' . $id; } $content = getDefaultValue($action); $defaultStr = $content; //获得默认内容 $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . $tableName . $addSql; $rsObj = $GLOBALS['conn']->query($sql); if (@mysql_num_rows($rsObj) == 0) { $rs = mysql_fetch_array($rsObj); //自动添加 20160113 if (RParam($action, 'autoadd') == 'true') { connexecute('insert into ' . $GLOBALS['db_PREFIX'] . $tableName . ' (' . $fieldParamName . ',' . $fieldName . $intoFieldStr . ') values(\'' . $fieldParamValue . '\',\'' . ADSql($content) . '\'' . $valuesStr . ')'); } } else { $id = $rs['id']; $content = $rs[$fieldName]; if (len($content) <= 0) { $content = $defaultStr; connexecute('update ' . $GLOBALS['db_PREFIX'] . $tableName . ' set ' . $fieldName . '=\'' . $content . '\' where id=' . $rs['id']); } } //删除Html $delHtmlYes = RParam($action, 'delHtml'); //是否删除Html if ($delHtmlYes == 'true') { $content = replace(delHtml($content), '<', '<'); } //HTML处理 //删除两边空格 $trimYes = RParam($action, 'trim'); //是否删除两边空格 if ($trimYes == 'true') { $content = TrimVbCrlf($content); } //截取字符处理 $nLen = RParam($action, 'len'); //字符长度值 $nLen = handleNumber($nLen); //If nLen<>"" Then ReplaceStr = CutStr(ReplaceStr,nLen,"null")' Left(ReplaceStr,nLen) if ($nLen != '') { $content = CutStr($content, $nLen, '...'); } //Left(ReplaceStr,nLen) if ($id == '') { $id = XY_AP_GetFieldValue('', $sql, 'id'); } $url = $adminUrl . '&id=' . $id . '&n=' . getRnd(11); if (@$_REQUEST['gl'] == 'edit') { $content = '<span>' . $content . '</span>'; } //call echo(sql,url) $content = handleDisplayOnlineEditDialog($url, $content, '', 'span'); $XY_handleGetTableBody = $content; return @$XY_handleGetTableBody; }
function scanDomainHomePageSize() { $url = ''; $nSetTime = ''; $isdomain = ''; $htmlDir = ''; $txtFilePath = ''; $homePageList = ''; $nThis = ''; $nCount = ''; $splstr = ''; $s = ''; $c = ''; $website = ''; $nState = ''; $websize = ''; $content = ''; $startTime = ''; $webtitle = ''; $webkeywords = ''; $webdescription = ''; $nThis = @$_REQUEST['nThis']; if ($nThis == '') { $nThis = 0; } else { $nThis = cint($nThis); } $nSetTime = 3; $GLOBALS['conn='] = OpenConn(); $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webdomain where website<>\'\' and websize=0 and isdomain=true'); $nCount = @$_REQUEST['nCount']; if ($nCount == '') { $nCount = @mysql_num_rows($rsObj); } while ($rs = $GLOBALS['conn']->fetch_array($rsObj)) { $nThis = $nThis + 1; aspEcho($nThis . '/' . $nCount, $rs['website']); doEvents(); $htmlDir = '/../网站UrlScan/域名首页大小/'; CreateDirFolder($htmlDir); $txtFilePath = $htmlDir . '/' . setFileName($rs['website']) . '.txt'; if (CheckFile($txtFilePath) == true) { aspEcho('类型', '本地'); $nSetTime = 1; } else { $website = getWebSite($rs['website']); if ($website == '') { Eerr('域名为空', $GLOBALS['httpurl']); } $content = getHttpPage($website, $rs['charset']); $content = toGB2312Char($content); //给PHP用,转成gb2312字符 if ($content == '') { $content = ' '; } createFile($txtFilePath, $content); aspEcho('类型', '网络'); } $content = getFText($txtFilePath); $webtitle = getHtmlValue($content, 'webtitle'); $webkeywords = getHtmlValue($content, 'webkeywords'); $webdescription = getHtmlValue($content, 'webdescription'); $websize = getFSize($txtFilePath); aspEcho('webtitle', $webtitle); //这样写是给转PHP时方便 connexecute('update ' . $GLOBALS['db_PREFIX'] . 'webdomain set webtitle=\'' . ADSql($webtitle) . '\',webkeywords=\'' . $webkeywords . '\',webdescription=\'' . $webdescription . '\',websize=' . $websize . ',isthrough=false,updatetime=\'' . now() . '\' where id=' . $rs['id'] . ''); $startTime = @$_REQUEST['startTime']; if ($startTime == '') { $startTime = now(); } Rw(VBRunTimer($startTime) . '<hr>'); $url = getUrlAddToParam(getThisUrl(), '?nThis=' . $nThis . '&nCount=' . $nCount . '&startTime=' . $startTime . '&N=' . getRnd(11), 'replace'); Rw(jsTiming($url, $nSetTime)); die; } aspEcho('操作完成', '<a href=\'?act=dispalyManageHandle&actionType=WebDomain&addsql=order by id desc&lableTitle=网站域名\'>OK,共(' . $nThis . ')条</a>'); }