Beispiel #1
0
function dispalyManage($actionName, $lableTitle, $nPageSize, $addSql)
{
    handlePower('显示' . $lableTitle);
    //管理权限处理
    loadWebConfig();
    $content = '';
    $i = '';
    $s = '';
    $c = '';
    $fieldNameList = '';
    $sql = '';
    $action = '';
    $x = '';
    $url = '';
    $nCount = '';
    $nPage = '';
    $idInputName = '';
    $tableName = '';
    $j = '';
    $splxx = '';
    $fieldName = '';
    //字段名称
    $splFieldName = '';
    //分割字段
    $searchfield = '';
    $keyWord = '';
    //搜索字段,搜索关键词
    $parentid = '';
    //栏目id
    $replaceStr = '';
    //替换字符
    $tableName = lCase($actionName);
    //表名称
    $searchfield = @$_REQUEST['searchfield'];
    //获得搜索字段值
    $keyWord = @$_REQUEST['keyword'];
    //获得搜索关键词值
    if (@$_POST['parentid'] != '') {
        $parentid = @$_POST['parentid'];
    } else {
        $parentid = @$_GET['parentid'];
    }
    $id = '';
    $focusid = '';
    //是判断传过来的id是否在当前列表中是交点20160715 home
    $id = rq('id');
    $focusid = rq('focusid');
    $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表');
    $fieldNameList = specialStrReplace($fieldNameList);
    //特殊字符处理
    $splFieldName = aspSplit($fieldNameList, ',');
    //字段分割成数组
    //读模板
    $content = getTemplateContent('manage_' . $tableName . '.html');
    $action = getStrCut($content, '[list]', '[/list]', 2);
    //网站栏目单独处理      栏目不一样20160301
    if ($actionName == 'WebColumn') {
        $action = getStrCut($content, '[action]', '[/action]', 1);
        $content = replace($content, $action, showColumnList(-1, 'WebColumn', 'columnname', '', 0, $action));
    } else {
        if ($actionName == 'ListMenu') {
            $action = getStrCut($content, '[action]', '[/action]', 1);
            $content = replace($content, $action, showColumnList(-1, 'listmenu', 'title', '', 0, $action));
        } else {
            if ($keyWord != '' && $searchfield != '') {
                $addSql = getWhereAnd(' where ' . $searchfield . ' like \'%' . $keyWord . '%\' ', $addSql);
            }
            if ($parentid != '') {
                $addSql = getWhereAnd(' where parentid=' . $parentid . ' ', $addSql);
            }
            //call echo(tableName,addsql)
            $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . $tableName . ' ' . $addSql;
            //检测SQL
            if (checkSql($sql) == false) {
                errorLog('出错提示:<br>action=' . $action . '<hr>sql=' . $sql . '<br>');
                return '';
            }
            $rsObj = $GLOBALS['conn']->query($sql);
            $nCount = @mysql_num_rows($rsObj);
            $nPage = @$_REQUEST['page'];
            $content = replace($content, '[$pageInfo$]', webPageControl($nCount, $nPageSize, $nPage, $url, ''));
            $content = replace($content, '[$accessSql$]', $sql);
            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);
                $x = @mysql_num_rows($rsObj);
            }
            for ($i = 1; $i <= $x; $i++) {
                $rs = mysql_fetch_array($rsObj);
                //给PHP用,因为在 asptophp转换不完善  特殊
                $s = replace($action, '[$id$]', $rs['id']);
                for ($j = 0; $j <= uBound($splFieldName); $j++) {
                    if ($splFieldName[$j] != '') {
                        $splxx = aspSplit($splFieldName[$j] . '|||', '|');
                        $fieldName = $splxx[0];
                        $replaceStr = $rs[$fieldName] . '';
                        //对文章旗处理
                        if ($fieldName == 'flags') {
                            $replaceStr = displayFlags($replaceStr);
                        }
                        //call echo("fieldname",fieldname)
                        //s = Replace(s, "[$" & fieldName & "$]", replaceStr)
                        $s = replaceValueParam($s, $fieldName, $replaceStr);
                    }
                }
                $idInputName = 'id';
                $s = replace($s, '[$selectid$]', '<input type=\'checkbox\' name=\'' . $idInputName . '\' id=\'' . $idInputName . '\' value=\'' . $rs['id'] . '\' >');
                $s = replace($s, '[$phpArray$]', '');
                $url = '【NO】';
                if ($actionName == 'ArticleDetail') {
                    $url = WEB_VIEWURL . '?act=detail&id=' . $rs['id'];
                } else {
                    if ($actionName == 'OnePage') {
                        $url = WEB_VIEWURL . '?act=onepage&id=' . $rs['id'];
                        //给评论加预览=文章  20160129
                    } else {
                        if ($actionName == 'TableComment') {
                            $url = WEB_VIEWURL . '?act=detail&id=' . $rs['itemid'];
                        }
                    }
                }
                //必需有自定义字段
                if (inStr($fieldNameList, 'customaurl') > 0) {
                    //自定义网址
                    if (aspTrim($rs['customaurl']) != '') {
                        $url = aspTrim($rs['customaurl']);
                    }
                }
                $s = replace($s, '[$viewWeb$]', $url);
                $s = replaceValueParam($s, 'cfg_websiteurl', $GLOBALS['cfg_webSiteUrl']);
                //call echo(focusid & "/" & rs("id"),IIF(focusid=cstr(rs("id")),"true","false"))
                $s = replaceValueParam($s, 'focusid', $focusid);
                $c = $c . $s;
            }
            $content = replace($content, '[list]' . $action . '[/list]', $c);
            //表单提交处理,parentid(栏目ID) searchfield(搜索字段) keyword(关键词) addsql(排序)
            $url = '?page=[id]&addsql=' . @$_REQUEST['addsql'] . '&keyword=' . @$_REQUEST['keyword'] . '&searchfield=' . @$_REQUEST['searchfield'] . '&parentid=' . @$_REQUEST['parentid'];
            $url = getUrlAddToParam(getUrl(), $url, 'replace');
            //call echo("url",url)
            $content = replace($content, '[list]' . $action . '[/list]', $c);
        }
    }
    if (inStr($content, '[$input_parentid$]') > 0) {
        $action = '[list]<option value="[$id$]"[$selected$]>[$selectcolumnname$]</option>[/list]';
        $c = '<select name="parentid" id="parentid"><option value="">≡ 选择栏目 ≡</option>' . showColumnList(-1, 'webcolumn', 'columnname', $parentid, 0, $action) . vbCrlf() . '</select>';
        $content = replace($content, '[$input_parentid$]', $c);
        //上级栏目
    }
    $content = replaceValueParam($content, 'searchfield', @$_REQUEST['searchfield']);
    //搜索字段
    $content = replaceValueParam($content, 'keyword', @$_REQUEST['keyword']);
    //搜索关键词
    $content = replaceValueParam($content, 'nPageSize', @$_REQUEST['nPageSize']);
    //每页显示条数
    $content = replaceValueParam($content, 'addsql', @$_REQUEST['addsql']);
    //追加sql值条数
    $content = replaceValueParam($content, 'tableName', $tableName);
    //表名称
    $content = replaceValueParam($content, 'actionType', @$_REQUEST['actionType']);
    //动作类型
    $content = replaceValueParam($content, 'lableTitle', @$_REQUEST['lableTitle']);
    //动作标题
    $content = replaceValueParam($content, 'id', $id);
    //id
    $content = replaceValueParam($content, 'page', @$_REQUEST['page']);
    //页
    $content = replaceValueParam($content, 'parentid', @$_REQUEST['parentid']);
    //栏目id
    $content = replaceValueParam($content, 'focusid', $focusid);
    $url = getUrlAddToParam(getThisUrl(), '?parentid=&keyword=&searchfield=&page=', 'delete');
    $content = replaceValueParam($content, 'position', '系统管理 > <a href=\'' . $url . '\'>' . $lableTitle . '列表</a>');
    //position位置
    $content = replace($content, '{$EDITORTYPE$}', EDITORTYPE);
    //asp与phh
    $content = replace($content, '{$WEB_VIEWURL$}', WEB_VIEWURL);
    //前端浏览网址
    $content = replace($content, '{$Web_Title$}', $GLOBALS['cfg_webTitle']);
    $content = $content . stat2016(true);
    $content = handleDisplayLanguage($content, 'handleDisplayLanguage');
    //语言处理
    Rw($content);
}
Beispiel #2
0
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;
}
Beispiel #3
0
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'] = '';
            //清空模板文件名称
        }
    }
}