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 getRand($nCount) { $getRand = getRnd($nCount); return @$getRand; }
function makeWebHtml($action) { $actionType = ''; $npagesize = ''; $npage = ''; $url = ''; $addSql = ''; $sortSql = ''; $sortFieldName = ''; $ascOrDesc = ''; $serchKeyWordName = ''; $parentid = ''; //追加于20160716 home $actionType = RParam($action, 'actionType'); $npage = RParam($action, 'npage'); $npage = getNumber($npage); if ($npage == '') { $npage = 1; } else { $npage = CInt($npage); } //导航 if ($actionType == 'nav') { $GLOBALS['glb_columnType'] = RParam($action, 'columnType'); $GLOBALS['glb_columnName'] = RParam($action, 'columnName'); $GLOBALS['glb_columnId'] = RParam($action, 'columnId'); if ($GLOBALS['glb_columnId'] == '') { $GLOBALS['glb_columnId'] = RParam($action, 'id'); } if ($GLOBALS['glb_columnType'] != '') { $addSql = 'where columnType=\'' . $GLOBALS['glb_columnType'] . '\''; } if ($GLOBALS['glb_columnName'] != '') { $addSql = getWhereAnd($addSql, 'where columnName=\'' . $GLOBALS['glb_columnName'] . '\''); } if ($GLOBALS['glb_columnId'] != '') { $addSql = getWhereAnd($addSql, 'where id=' . $GLOBALS['glb_columnId'] . ''); } //call echo("addsql",addsql) $rsObj = $GLOBALS['conn']->query('Select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn ' . $addSql); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); $GLOBALS['glb_columnId'] = $rs['id']; $GLOBALS['glb_columnName'] = $rs['columnname']; $GLOBALS['glb_columnType'] = $rs['columntype']; $GLOBALS['glb_bodyContent'] = $rs['bodycontent']; $GLOBALS['glb_detailTitle'] = $GLOBALS['glb_columnName']; $GLOBALS['glb_flags'] = $rs['flags']; $npagesize = $rs['npagesize']; //每页显示条数 $GLOBALS['glb_isonhtml'] = $rs['isonhtml']; //是否生成静态网页 $sortSql = ' ' . $rs['sortsql']; //排序SQL if ($rs['webtitle'] != '') { $GLOBALS['cfg_webTitle'] = $rs['webtitle']; //网址标题 } if ($rs['webkeywords'] != '') { $GLOBALS['cfg_webKeywords'] = $rs['webkeywords']; //网站关键词 } if ($rs['webdescription'] != '') { $GLOBALS['cfg_webDescription'] = $rs['webdescription']; //网站描述 } if ($GLOBALS['templateName'] == '') { if (aspTrim($rs['templatepath']) != '') { $GLOBALS['templateName'] = $rs['templatepath']; } else { if ($rs['columntype'] != '首页') { $GLOBALS['templateName'] = getDateilTemplate($rs['id'], 'List'); } } } } $GLOBALS['glb_columnENType'] = handleColumnType($GLOBALS['glb_columnType']); $GLOBALS['glb_url'] = getColumnUrl($GLOBALS['glb_columnName'], 'name'); //文章类列表 if (inStr('|产品|新闻|视频|下载|案例|', '|' . $GLOBALS['glb_columnType'] . '|') > 0) { $GLOBALS['glb_bodyContent'] = getDetailList($action, defaultListTemplate($GLOBALS['glb_columnType'], $GLOBALS['glb_columnName']), 'ArticleDetail', '栏目列表', '*', $npagesize, $npage, 'where parentid=' . $GLOBALS['glb_columnId'] . $sortSql); //留言类列表 } else { if (inStr('|留言|', '|' . $GLOBALS['glb_columnType'] . '|') > 0) { $GLOBALS['glb_bodyContent'] = getDetailList($action, defaultListTemplate($GLOBALS['glb_columnType'], $GLOBALS['glb_columnName']), 'GuestBook', '留言列表', '*', $npagesize, $npage, ' where isthrough<>0 ' . $sortSql); } else { if ($GLOBALS['glb_columnType'] == '文本') { //航行栏目加管理 if (@$_REQUEST['gl'] == 'edit') { $GLOBALS['glb_bodyContent'] = '<span>' . $GLOBALS['glb_bodyContent'] . '</span>'; } $url = WEB_ADMINURL . '?act=addEditHandle&actionType=WebColumn&lableTitle=网站栏目&nPageSize=10&page=&id=' . $GLOBALS['glb_columnId'] . '&n=' . getRnd(11); $GLOBALS['glb_bodyContent'] = handleDisplayOnlineEditDialog($url, $GLOBALS['glb_bodyContent'], '', 'span'); } } } //细节 } else { if ($actionType == 'detail') { $GLOBALS['glb_locationType'] = 'detail'; $rsObj = $GLOBALS['conn']->query('Select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where id=' . RParam($action, 'id')); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); $GLOBALS['glb_columnName'] = getColumnName($rs['parentid']); $GLOBALS['glb_detailTitle'] = $rs['title']; $GLOBALS['glb_flags'] = $rs['flags']; $GLOBALS['glb_isonhtml'] = $rs['isonhtml']; //是否生成静态网页 $GLOBALS['glb_id'] = $rs['id']; //文章ID if ($GLOBALS['isMakeHtml'] == true) { $GLOBALS['glb_url'] = getHandleRsUrl($rs['filename'], $rs['customaurl'], '/detail/detail' . $rs['id']); } else { $GLOBALS['glb_url'] = handleWebUrl('?act=detail&id=' . $rs['id']); } if ($rs['webtitle'] != '') { $GLOBALS['cfg_webTitle'] = $rs['webtitle']; //网址标题 } if ($rs['webkeywords'] != '') { $GLOBALS['cfg_webKeywords'] = $rs['webkeywords']; //网站关键词 } if ($rs['webdescription'] != '') { $GLOBALS['cfg_webDescription'] = $rs['webdescription']; //网站描述 } //改进20160628 $sortFieldName = 'id'; $ascOrDesc = 'asc'; $addsql = aspTrim(getWebColumnSortSql($rs['parentid'])); if ($addsql != '') { $sortFieldName = aspTrim(replace(replace(replace($addsql, 'order by', ''), ' desc', ''), ' asc', '')); if (inStr($addsql, ' desc') > 0) { $ascOrDesc = 'desc'; } } $GLOBALS['glb_artitleAuthor'] = $rs['author']; $GLOBALS['glb_artitleAdddatetime'] = $rs['adddatetime']; $GLOBALS['glb_upArticle'] = upArticle($rs['parentid'], $sortFieldName, $rs[$sortFieldName], $ascOrDesc); $GLOBALS['glb_downArticle'] = downArticle($rs['parentid'], $sortFieldName, $rs[$sortFieldName], $ascOrDesc); $GLOBALS['glb_aritcleRelatedTags'] = aritcleRelatedTags($rs['relatedtags']); $GLOBALS['glb_aritcleSmallImage'] = $rs['smallimage']; $GLOBALS['glb_aritcleBigImage'] = $rs['bigimage']; //文章内容 //glb_bodyContent = "<div class=""articleinfowrap"">[$articleinfowrap$]</div>" & rs("bodycontent") & "[$relatedtags$]<ul class=""updownarticlewrap"">[$updownArticle$]</ul>" //上一篇文章,下一篇文章 //glb_bodyContent = Replace(glb_bodyContent, "[$updownArticle$]", upArticle(rs("parentid"), "sortrank", rs("sortrank")) & downArticle(rs("parentid"), "sortrank", rs("sortrank"))) //glb_bodyContent = Replace(glb_bodyContent, "[$articleinfowrap$]", "来源:" & rs("author") & " 发布时间:" & format_Time(rs("adddatetime"), 1)) //glb_bodyContent = Replace(glb_bodyContent, "[$relatedtags$]", aritcleRelatedTags(rs("relatedtags"))) $GLOBALS['glb_bodyContent'] = $rs['bodycontent']; //文章详细加控制 if (@$_REQUEST['gl'] == 'edit') { $GLOBALS['glb_bodyContent'] = '<span>' . $GLOBALS['glb_bodyContent'] . '</span>'; } $url = WEB_ADMINURL . '?act=addEditHandle&actionType=ArticleDetail&lableTitle=分类信息&nPageSize=10&page=&parentid=&id=' . RParam($action, 'id') . '&n=' . getRnd(11); $GLOBALS['glb_bodyContent'] = handleDisplayOnlineEditDialog($url, $GLOBALS['glb_bodyContent'], '', 'span'); if ($GLOBALS['templateName'] == '') { if (aspTrim($rs['templatepath']) != '') { $GLOBALS['templateName'] = $rs['templatepath']; } else { $GLOBALS['templateName'] = getDateilTemplate($rs['parentid'], 'Detail'); } } } //单页 } else { if ($actionType == 'onepage') { $rsObj = $GLOBALS['conn']->query('Select * from ' . $GLOBALS['db_PREFIX'] . 'onepage where id=' . RParam($action, 'id')); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); $GLOBALS['glb_detailTitle'] = $rs['title']; $GLOBALS['glb_isonhtml'] = $rs['isonhtml']; //是否生成静态网页 if ($GLOBALS['isMakeHtml'] == true) { $GLOBALS['glb_url'] = getHandleRsUrl($rs['filename'], $rs['customaurl'], '/page/page' . $rs['id']); } else { $GLOBALS['glb_url'] = handleWebUrl('?act=detail&id=' . $rs['id']); } if ($rs['webtitle'] != '') { $GLOBALS['cfg_webTitle'] = $rs['webtitle']; //网址标题 } if ($rs['webkeywords'] != '') { $GLOBALS['cfg_webKeywords'] = $rs['webkeywords']; //网站关键词 } if ($rs['webdescription'] != '') { $GLOBALS['cfg_webDescription'] = $rs['webdescription']; //网站描述 } //内容 $GLOBALS['glb_bodyContent'] = $rs['bodycontent']; //文章详细加控制 if (@$_REQUEST['gl'] == 'edit') { $GLOBALS['glb_bodyContent'] = '<span>' . $GLOBALS['glb_bodyContent'] . '</span>'; } $url = WEB_ADMINURL . '?act=addEditHandle&actionType=ArticleDetail&lableTitle=分类信息&nPageSize=10&page=&parentid=&id=' . RParam($action, 'id') . '&n=' . getRnd(11); $GLOBALS['glb_bodyContent'] = handleDisplayOnlineEditDialog($url, $GLOBALS['glb_bodyContent'], '', 'span'); if ($GLOBALS['templateName'] == '') { if (aspTrim($rs['templatepath']) != '') { $GLOBALS['templateName'] = $rs['templatepath']; } else { $GLOBALS['templateName'] = 'Main_Model.html'; //call echo(templateName,"templateName") } } } //搜索 } else { if ($actionType == 'Search') { $GLOBALS['templateName'] = 'Main_Model.html'; $serchKeyWordName = @$_REQUEST['keywordname']; $parentid = @$_REQUEST['parentid']; if ($serchKeyWordName == '') { $serchKeyWordName = 'wd'; } $GLOBALS['glb_searchKeyWord'] = replace(@$_REQUEST[$serchKeyWordName], '<', '<'); $addSql = ''; if ($parentid != '') { $addSql = ' where parentid=' . $parentid; } $addSql = getWhereAnd($addSql, ' where title like \'%' . $GLOBALS['glb_searchKeyWord'] . '%\''); $npagesize = 20; //call echo(npagesize, npage) $GLOBALS['glb_bodyContent'] = getDetailList($action, defaultListTemplate($GLOBALS['glb_columnType'], $GLOBALS['glb_columnName']), 'ArticleDetail', '网站栏目', '*', $npagesize, $npage, $addSql); $GLOBALS['positionEndStr'] = ' >> 搜索内容”' . $GLOBALS['glb_searchKeyWord'] . '“'; //加载等待 } else { if ($actionType == 'loading') { rwEnd('页面正在加载中。。。'); } } } } } //模板为空,则用默认首页模板 if ($GLOBALS['templateName'] == '') { $GLOBALS['templateName'] = 'Index_Model.html'; //默认模板 } //检测当前路径是否有模板 if (inStr($GLOBALS['templateName'], '/') == false) { $GLOBALS['templateName'] = $GLOBALS['cfg_webTemplate'] . '/' . $GLOBALS['templateName']; } //call echo("templateName",templateName) if (CheckFile($GLOBALS['templateName']) == false) { Eerr('未找到模板文件', $GLOBALS['templateName']); } $GLOBALS['code'] = getFText($GLOBALS['templateName']); $GLOBALS['code'] = handleAction($GLOBALS['code']); //处理动作 $GLOBALS['code'] = thisPosition($GLOBALS['code']); //位置 $GLOBALS['code'] = replaceGlobleVariable($GLOBALS['code']); //替换全局标签 $GLOBALS['code'] = handleAction($GLOBALS['code']); //处理动作 '再来一次,处理数据内容里动作 $GLOBALS['code'] = handleAction($GLOBALS['code']); //处理动作 $GLOBALS['code'] = handleAction($GLOBALS['code']); //处理动作 $GLOBALS['code'] = thisPosition($GLOBALS['code']); //位置 $GLOBALS['code'] = replaceGlobleVariable($GLOBALS['code']); //替换全局标签 $GLOBALS['code'] = delTemplateMyNote($GLOBALS['code']); //删除无用内容 //格式化HTML if (inStr($GLOBALS['cfg_flags'], '|formattinghtml|') > 0) { //code = HtmlFormatting(code) '简单 $GLOBALS['code'] = handleHtmlFormatting($GLOBALS['code'], false, 0, '删除空行'); //自定义 //格式化HTML第二种 } else { if (inStr($GLOBALS['cfg_flags'], '|formattinghtmltow|') > 0) { $GLOBALS['code'] = htmlFormatting($GLOBALS['code']); //简单 $GLOBALS['code'] = handleHtmlFormatting($GLOBALS['code'], false, 0, '删除空行'); //自定义 //压缩HTML } else { if (inStr($GLOBALS['cfg_flags'], '|ziphtml|') > 0) { $GLOBALS['code'] = zipHTML($GLOBALS['code']); } } } //闭合标签 if (inStr($GLOBALS['cfg_flags'], '|labelclose|') > 0) { $GLOBALS['code'] = handleCloseHtml($GLOBALS['code'], true, ''); //图片自动加alt "|*|", } //在线编辑20160127 if (rq('gl') == 'edit') { if (inStr($GLOBALS['code'], '</head>') > 0) { if (inStr(lCase($GLOBALS['code']), 'jquery.min.js') == false) { $GLOBALS['code'] = replace($GLOBALS['code'], '</head>', '<script src="/Jquery/jquery.Min.js"></script></head>'); } $GLOBALS['code'] = replace($GLOBALS['code'], '</head>', '<script src="/Jquery/Callcontext_menu.js"></script></head>'); } if (inStr($GLOBALS['code'], '<body>') > 0) { //Code = Replace(Code,"<body>", "<body onLoad=""ContextMenu.intializeContextMenu()"">") } } //call echo(templateName,templateName) $makeWebHtml = $GLOBALS['code']; return @$makeWebHtml; }
function showColumnList($parentid, $tableName, $showFieldName, $thisPId, $nCount, $action) { $i = ''; $s = ''; $c = ''; $selectcolumnname = ''; $selStr = ''; $url = ''; $isFocus = ''; $sql = ''; $addSql = ''; $listLableStr = ''; $topnav = ''; $thisColumnName = ''; $navheaderStr = ''; $navfooterStr = ''; $parentid = aspTrim($parentid); $listLableStr = 'list'; $topnav = getStrCut($action, '[topnav]', '[/topnav]', 2); $thisColumnName = getColumnName($parentid); //call echo(parentid,topnav) if ($parentid != $topnav) { if (inStr($action, '[small-list') > 0) { $listLableStr = 'small-list'; } } //call echo("listLableStr",listLableStr) $fieldNameList = ''; $splFieldName = ''; $k = ''; $fieldName = ''; $replaceStr = ''; $startStr = ''; $endStr = ''; $topNumb = ''; $modI = ''; $title = ''; $subHeaderStr = ''; $subFooterStr = ''; $subHeaderStartStr = ''; $subHeaderEndStr = ''; $subFooterStartStr = ''; $subFooterEndStr = ''; $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表'); $splFieldName = aspSplit($fieldNameList, ','); $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . $tableName . ' where parentid=' . $parentid; // call echo("sql1111111111111",tableName) //处理追加SQL $startStr = '[sql-' . $nCount . ']'; $endStr = '[/sql-' . $nCount . ']'; if (inStr($action, $startStr) == false && inStr($action, $endStr) == false) { $startStr = '[sql]'; $endStr = '[/sql]'; } $addSql = getStrCut($action, $startStr, $endStr, 2); if ($addSql != '') { $sql = getWhereAnd($sql, $addSql); } $rsObj = $GLOBALS['conn']->query($sql . ' order by sortrank asc'); //call echo(sql,rs.recordcount) for ($i = 1; $i <= @mysql_num_rows($rsObj); $i++) { $rs = mysql_fetch_array($rsObj); if (@mysql_num_rows($rsObj) != 0) { $startStr = ''; $endStr = ''; $selStr = ''; $isFocus = false; if (cStr($rs['id']) == cStr($thisPId)) { $selStr = ' selected '; $isFocus = true; } //网址判断 if ($isFocus == true) { $startStr = '[' . $listLableStr . '-focus]'; $endStr = '[/' . $listLableStr . '-focus]'; } else { $startStr = '[' . $listLableStr . '-' . $thisColumnName . ']'; $endStr = '[/' . $listLableStr . '-' . $thisColumnName . ']'; if (inStr($action, $startStr) == false && inStr($action, $endStr) == false) { $startStr = '[' . $listLableStr . '-' . $i . ']'; $endStr = '[/' . $listLableStr . '-' . $i . ']'; } else { //call echo(rs("columnname"),startStr) } } //在最后时排序当前交点20160202 if ($i == $topNumb && $isFocus == false) { $startStr = '[' . $listLableStr . '-end]'; $endStr = '[/' . $listLableStr . '-end]'; } //例[list-mod2] [/list-mod2] 20150112 for ($modI = 6; $modI >= 2; $modI--) { if (inStr($action, $startStr) == false && $i % $modI == 0) { $startStr = '[' . $listLableStr . '-mod' . $modI . ']'; $endStr = '[/' . $listLableStr . '-mod' . $modI . ']'; if (inStr($action, $startStr) > 0) { break; } } } //没有则用默认 if (inStr($action, $startStr) == false && inStr($action, $endStr) == false) { $startStr = '[' . $listLableStr . ']'; $endStr = '[/' . $listLableStr . ']'; } //call rwend(action) //call echo(startStr,endStr) if (inStr($action, $startStr) > 0 && inStr($action, $endStr) > 0) { $s = StrCut($action, $startStr, $endStr, 2); $s = replaceValueParam($s, 'id', $rs['id']); $s = replaceValueParam($s, 'selected', $selStr); $selectcolumnname = $rs[$showFieldName]; $title = $selectcolumnname; if ($nCount >= 1) { $selectcolumnname = copyStr(' ', $nCount) . '├─' . $selectcolumnname; } $s = replaceValueParam($s, 'selectcolumnname', $selectcolumnname); $s = replaceValueParam($s, 'title', $title); for ($k = 0; $k <= uBound($splFieldName); $k++) { if ($splFieldName[$k] != '') { $fieldName = $splFieldName[$k]; $replaceStr = $rs[$fieldName] . ''; $s = replaceValueParam($s, $fieldName, $replaceStr); } } //url = WEB_VIEWURL & "?act=nav&columnName=" & rs(showFieldName) '以栏目名称显示列表 $url = WEB_VIEWURL . '?act=nav&id=' . $rs['id']; //以栏目ID显示列表 //自定义网址 if (aspTrim($rs['customaurl']) != '') { $url = aspTrim($rs['customaurl']); } $s = replace($s, '[$viewWeb$]', $url); $s = replaceValueParam($s, 'url', $url); //网站栏目没有page位置处理 追加于20160716 home $url = WEB_ADMINURL . '?act=addEditHandle&actionType=WebColumn&lableTitle=网站栏目&nPageSize=10&page=&id=' . $rs['id'] . '&n=' . getRnd(11); $s = handleDisplayOnlineEditDialog($url, $s, '', 'div|li|span'); //处理是否添加在线修改管理器 if (EDITORTYPE == 'php') { $s = replace($s, '[$phpArray$]', '[]'); } else { $s = replace($s, '[$phpArray$]', ''); } //s=copystr("",nCount) & rs("columnname") & "<hr>" if ($rs['parentid'] == '-1' && inStr($action, '[navheader]') > 0) { $navheaderStr = getStrCut($action, '[navheader]', '[/navheader]', 2); $navfooterStr = getStrCut($action, '[navfooter]', '[/navfooter]', 2); //call die(navfooterStr) } $c = $c . $navheaderStr . $s . vbCrlf(); $s = showColumnList($rs['id'], $tableName, $showFieldName, $thisPId, $nCount + 1, $action) . $navfooterStr; $subHeaderStartStr = '[subheader-' . $rs['columnname'] . ']'; $subHeaderEndStr = '[/subheader-' . $rs['columnname'] . ']'; if (inStr($action, $subHeaderStartStr) == false && inStr($action, $subHeaderEndStr) == false) { $subHeaderStartStr = '[subheader]'; $subHeaderEndStr = '[/subheader]'; } $subFooterStartStr = '[subfooter-' . $rs['columnname'] . ']'; $subFooterEndStr = '[/subfooter-' . $rs['columnname'] . ']'; if (inStr($action, $subFooterStartStr) == false && inStr($action, $subFooterStartStr) == false) { $subFooterStartStr = '[subfooter]'; $subFooterEndStr = '[/subfooter]'; } $subHeaderStr = getStrCut($action, $subHeaderStartStr, $subHeaderEndStr, 2); $subFooterStr = getStrCut($action, $subFooterStartStr, $subFooterEndStr, 2); //call echo(rs("columnname"),"哈哈") if ($s != '') { $s = vbCrlf() . $subHeaderStr . $s . $subFooterStr; } $c = $c . $s; } } } $showColumnList = $c; return @$showColumnList; }
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>'); } }