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('', '更新网站统计'); //系统日志 }
function getDetailList($action, $content, $actionName, $lableTitle, $fieldNameList, $nPageSize, $nPage, $addSql) { $GLOBALS['conn='] = OpenConn(); $defaultStr = ''; $i = ''; $s = ''; $c = ''; $tableName = ''; $j = ''; $splxx = ''; $sql = ''; $x = ''; $url = ''; $nCount = ''; $pageInfo = ''; $modI = ''; $startStr = ''; $endStr = ''; $fieldName = ''; //字段名称 $splFieldName = ''; //分割字段 $replaceStr = ''; //替换字符 $tableName = lCase($actionName); //表名称 $listFileName = ''; //列表文件名称 $listFileName = RParam($action, 'listFileName'); $abcolorStr = ''; //A加粗和颜色 $atargetStr = ''; //A链接打开方式 $atitleStr = ''; //A链接的title20160407 $anofollowStr = ''; //A链接的nofollow $id = ''; $idPage = ''; $id = rq('id'); checkIDSQL(@$_REQUEST['id']); if ($fieldNameList == '*') { $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表'); } $fieldNameList = specialStrReplace($fieldNameList); //特殊字符处理 $splFieldName = aspSplit($fieldNameList, ','); //字段分割成数组 $defaultStr = getStrCut($content, '<!--#body start#-->', '<!--#body end#-->', 2); $pageInfo = getStrCut($content, '[page]', '[/page]', 1); if ($pageInfo != '') { $content = replace($content, $pageInfo, ''); } //call eerr("pageInfo",pageInfo) $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . $tableName . ' ' . $addSql; //检测SQL if (checkSql($sql) == false) { errorLog('出错提示:<br>sql=' . $sql . '<br>'); return ''; } $rsObj = $GLOBALS['conn']->query($sql); $rs = mysql_fetch_array($rsObj); $nCount = @mysql_num_rows($rsObj); //为动态翻页网址 if ($GLOBALS['isMakeHtml'] == true) { $url = ''; if (len($listFileName) > 5) { $url = mid($listFileName, 1, len($listFileName) - 5) . '[id].html'; $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); } } else { $url = getUrlAddToParam(getUrl(), '?page=[id]', 'replace'); } $content = replace($content, '[$pageInfo$]', webPageControl($nCount, $nPageSize, $nPage, $url, $pageInfo)); if (EDITORTYPE == 'asp') { $x = getRsPageNumber($rs, $nCount, $nPageSize, $nPage); //获得Rs页数 '记录总数 } else { if ($nPage != '') { $nPage = $nPage - 1; } $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . '' . $tableName . ' ' . $addSql . ' limit ' . $nPageSize * $nPage . ',' . $nPageSize; $rsObj = $GLOBALS['conn']->query($sql); $rs = mysql_fetch_array($rsObj); $x = @mysql_num_rows($rsObj); } //call echo("sql",sql) for ($i = 1; $i <= $x; $i++) { $rs = mysql_fetch_array($rsObj); //给PHP用,因为在 asptophp转换不完善 $startStr = '[list-' . $i . ']'; $endStr = '[/list-' . $i . ']'; //在最后时排序当前交点20160202 if ($i == $x) { $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 == '') { $startStr = '[list]'; $endStr = '[/list]'; } if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $s = StrCut($defaultStr, $startStr, $endStr, 2); //s = defaultStr $s = replace($s, '[$id$]', $rs['id']); for ($j = 0; $j <= uBound($splFieldName); $j++) { if ($splFieldName[$j] != '') { $splxx = aspSplit($splFieldName[$j] . '|||', '|'); $fieldName = $splxx[0]; $replaceStr = $rs[$fieldName] . ''; $s = replaceValueParam($s, $fieldName, $replaceStr); } if ($GLOBALS['isMakeHtml'] == true) { $url = getHandleRsUrl($rs['filename'], $rs['customaurl'], '/detail/detail' . $rs['id']); } else { $url = handleWebUrl('?act=detail&id=' . $rs['id']); if ($rs['customaurl'] != '') { $url = $rs['customaurl']; } } //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"', ''); } $s = replaceValueParam($s, 'url', $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链接打开方式 } } //call echo("tableName",tableName) $idPage = getThisIdPage($GLOBALS['db_PREFIX'] . $tableName, $rs['id'], 10); //【留言】 if ($tableName == 'guestbook') { $url = WEB_ADMINURL . '?act=addEditHandle&actionType=GuestBook&lableTitle=留言&nPageSize=10&parentid=&searchfield=bodycontent&keyword=&addsql=&page=' . $idPage . '&id=' . $rs['id'] . '&n=' . getRnd(11); //【默认显示文章】 } else { $url = WEB_ADMINURL . '?act=addEditHandle&actionType=ArticleDetail&lableTitle=分类信息&nPageSize=10&page=' . $idPage . '&parentid=' . $rs['parentid'] . '&id=' . $rs['id'] . '&n=' . getRnd(11); } $s = handleDisplayOnlineEditDialog($url, $s, '', 'div|li|span'); $c = $c . $s; } $content = replace($content, '<!--#body start#-->' . $defaultStr . '<!--#body end#-->', $c); if ($GLOBALS['isMakeHtml'] == true) { $url = ''; if (len($listFileName) > 5) { $url = mid($listFileName, 1, len($listFileName) - 5) . '[id].html'; $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); } } else { $url = getUrlAddToParam(getUrl(), '?page=[id]', 'replace'); } $getDetailList = $content; return @$getDetailList; }
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>'); } }
function showOnOffImg($id, $Table, $fieldName, $Recommend, $url) { $temp = ''; $Img = ''; $aUrl = ''; if (rq('page') != '') { $temp = '&page=' . rq('page'); } else { $temp == ''; } if ($Recommend == true) { $Img = '<img src="' . $GLOBALS['adminDir'] . 'Images/yes.gif">'; } else { $Img = '<img src="' . $GLOBALS['adminDir'] . 'Images/webno.gif">'; } //Call Echo(GetUrl(),""& adminDir &"HandleDatabase.Asp?act=SetTrueFalse&Table=" & Table & "&FieldName=" & FieldName & "&Url=" & Url & "&Id=" & Id) $aUrl = getUrlAddToParam(getUrl(), '' . $GLOBALS['adminDir'] . 'HandleDatabase.Asp?act=SetTrueFalse&Table=' . $Table . '&FieldName=' . $fieldName . '&Url=' . $url . '&Id=' . $id, 'replace'); $showOnOffImg = '<a href="' . $aUrl . '">' . $Img . '</a>'; //旧版 //ShowOnOffImg = "<a href="& adminDir &"HandleDatabase.Asp?act=SetTrueFalse&Table=" & Table & "&FieldName=" & FieldName & "&Url=" & Url & "&Id=" & Id & Temp & ">" & Img & "</a>" return @$showOnOffImg; }
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; }
function handleWebUrl($url) { if (@$_REQUEST['gl'] != '') { $url = getUrlAddToParam($url, '&gl=' . @$_REQUEST['gl'], 'replace'); } if (@$_REQUEST['templatedir'] != '') { $url = getUrlAddToParam($url, '&templatedir=' . @$_REQUEST['templatedir'], 'replace'); } $handleWebUrl = $url; return @$handleWebUrl; }