Example #1
0
function getThisIdPage($tableName, $id, $nPageSize)
{
    if ($id == '') {
        return 1;
    }
    $nCount = '';
    if ($nPageSize == '') {
        $nPageSize = 10;
    }
    $nCount = connexecute('select count(*) from ' . $tableName . ' where id<=' . $id)[0];
    $getThisIdPage = GetCountPage(cint($nCount), $nPageSize);
    //call echo("tableName=" & tableName & "id=" & id &",ncount=" & ncount,npagesize & "               ," & getThisIdPage)
    return @$getThisIdPage;
}
Example #2
0
function updateTodayWebStat()
{
    $content = '';
    $url = '';
    $dateStr = '';
    $dateMsg = '';
    if (@$_REQUEST['date'] != '') {
        $dateStr = now() + cint(@$_REQUEST['date']);
        $dateMsg = '昨天';
    } else {
        $dateStr = now();
        $dateMsg = '今天';
    }
    handlePower('更新' . $dateMsg . '统计');
    //管理权限处理
    //call echo("datestr",datestr)
    connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'websitestat where dateclass=\'' . Format_Time($dateStr, 2) . '\'');
    $content = getFText($GLOBALS['adminDir'] . '/data/stat/' . Format_Time($dateStr, 2) . '.txt');
    whiteWebStat($content);
    $url = getUrlAddToParam(getThisUrl(), '?act=dispalyManageHandle', 'replace');
    Rw(getMsg1('更新' . $dateMsg . '统计成功,正在进入' . @$_REQUEST['lableTitle'] . '列表...', $url));
    writeSystemLog('', '更新网站统计');
    //系统日志
}
Example #3
0
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, '添加');
    }
}
Example #4
0
 function even_or_odd($number)
 {
     $int_number = cint($number);
     $return_val = '';
     if ($int_number < 0) {
         // normalize negative numbers.
         $int_number = $int_number * -1;
     }
     if ($int_number = 0) {
         $return_val = false;
     } elseif ($int_number = 1) {
         $return_val = 'odd';
     } elseif ($int_number > 1) {
         if ($int_number % 2) {
             $return_val = 'odd';
         } else {
             $return_val = 'even';
         }
     } else {
         return 'even_odd error';
     }
     return $return_val;
 }
Example #5
0
function runScanWebUrl()
{
    $nSetTime = '';
    $setCharSet = '';
    $httpUrl = '';
    $url = '';
    $selectWeb = '';
    $nThis = '';
    $nCount = '';
    $startTime = '';
    $setCharSet = 'gb2312';
    //gb2312
    //http://www.dfz9.com/
    //http://www.maiside.net/
    //http://sharembweb.com/
    //http://www.ufoer.com/
    $httpUrl = 'http://sharembweb.com/';
    //selectWeb="ufoer"
    if ($selectWeb == 'ufoer') {
        $httpUrl = 'http://www.ufoer.com/';
        $setCharSet = 'utf-8';
    }
    $nThis = @$_REQUEST['nThis'];
    if ($nThis == '') {
        $nThis = 0;
    } else {
        $nThis = cint($nThis);
    }
    $GLOBALS['conn='] = OpenConn();
    $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan');
    $nCount = @$_REQUEST['nCount'];
    if ($nCount == '') {
        $nCount = @mysql_num_rows($rsObj);
    }
    if (@mysql_num_rows($rsObj) == 0) {
        connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(httpurl,title,isthrough,charset) values(\'' . $httpUrl . '\',\'home\',true,\'' . $setCharSet . '\')');
    }
    //循环
    $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where isThrough=true');
    if (@mysql_num_rows($rsxObj) != 0) {
        $rsx = mysql_fetch_array($rsxObj);
        $nThis = $nThis + 1;
        aspEcho($nThis, $rsx['httpurl']);
        doEvents();
        $nSetTime = scanUrl($rsx['httpurl'], $rsx['title'], $rsx['charset']);
        //这样写是给转PHP时方便
        connexecute('update ' . $GLOBALS['db_PREFIX'] . 'weburlscan  set isthrough=false  where id=' . $rsx['id'] . '');
        $startTime = @$_REQUEST['startTime'];
        if ($startTime == '') {
            $startTime = now();
        }
        VBRunTimer($startTime);
        $url = getUrlAddToParam(getThisUrl(), '?nThis=' . $nThis . '&nCount=' . $nCount . '&startTime=' . $startTime . '&N=' . getRnd(11), 'replace');
        Rw(jsTiming($url, $nSetTime));
        die;
    }
    aspEcho('操作完成', '<a href=\'?act=dispalyManageHandle&actionType=WebUrlScan&addsql=order by id desc&lableTitle=网址扫描\'>OK,共(' . $nThis . ')条</a>');
    //输入报告
    $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where webstate=404');
    while ($rs = $GLOBALS['conn']->fetch_array($rsObj)) {
        aspEcho('<a href=\'' . $rs['httpurl'] . '\' target=\'_blank\'>' . $rs['httpurl'] . '</a>', '<a href=\'' . $rs['tohttpurl'] . '\' target=\'_blank\'>' . $rs['tohttpurl'] . '</a>');
    }
}