当前位置:首页 > 学习手记 > 正文内容

方卡企业管理系统IsiteV2.12的若干个BUG修复记录

心砚10年前 (2014-12-19)学习手记2563

1、自定义字段在标签生成器的FOR字段中无法生成和调用。

此bug涉及2个文件修改,修复方法如下:

第一、打开文件 admin/LabelBuilder.asp

将558行代码
Sqlstr="Select Fk_Model_Field From [Fk_Model] Where Fk_Model_Type=0 And Fk_Model_Id=" & ModelId
替换为以下代码
Sqlstr="Select Fk_Model_Field From [Fk_Model] Where Fk_Model_Type=" & ModuleType & " And Fk_Model_Id=" & ModelId
保存文件。

 

第二、打开文件 class/Cls_Template.asp

将789行代码
ViewForChange=ReplaceTag(ViewForChange,"{$ViewField_"&Field_Label&"$}",Field_Content)
替换为以下代码
ViewForChange=ReplaceTag(ViewForChange,"{$List.ViewField_"&Field_Label&"$}",Field_Content)
保存文件,修复完成。

 

2、字符串截取过滤不全。

打开文件 class/Cls_Template.asp

将1565-1582行代码


    Private Function t_RemoveHTML(strHTML)
        Dim objRegExp, Match, Matches
        Set objRegExp = New Regexp
        objRegExp.IgnoreCase = True
        objRegExp.Global = True
        objRegExp.Pattern = "<.+?>"
        Set Matches = objRegExp.Execute(strHTML)
        For Each Match in Matches
            strHtml=Replace(strHTML,Match.Value,"")
        Next
        objRegExp.Pattern = "\&.+?;"
        Set Matches = objRegExp.Execute(strHTML)
        For Each Match in Matches
            strHtml=Replace(strHTML,Match.Value,"")
        Next
        t_RemoveHTML=strHTML
        Set objRegExp = Nothing
    End Function
替换为以下代码

    Private Function t_RemoveHTML(strHTML)
        Dim objRegExp, Match, Matches
        Set objRegExp = New Regexp
        objRegExp.IgnoreCase = True
        objRegExp.Global = True
        objRegExp.Pattern = "<.+?>"
        Set Matches = objRegExp.Execute(strHTML)
        For Each Match in Matches
            strHtml=Replace(strHTML,Match.Value,"")
        Next
        objRegExp.Pattern = "&lt;.+?&gt;"
        Set Matches = objRegExp.Execute(strHTML)
        For Each Match in Matches
            strHtml=Replace(strHTML,Match.Value,"")
        Next
        objRegExp.Pattern = "\&.+?;"
        Set Matches = objRegExp.Execute(strHTML)
        For Each Match in Matches
            strHtml=Replace(strHTML,Match.Value,"")
        Next
        t_RemoveHTML=strHTML
        Set objRegExp = Nothing
    End Function
保存文件,修复完成。

 


3、{$ViewNextUrl$}无论添加多少内容都是跳转到第一条。

修复方法如下:

打开文件 class/Cls_Template.asp

将412行代码


Sqlstr="Select Fk_View_Title,Fk_View_Pic,Fk_View_FixedUrl,Fk_View_Url From [Fk_ViewList] Where Fk_View_Show=1 And Fk_Module_State=1 And Fk_View_Module="&c_Module&" And Fk_View_Id>"&t_Id&" Order By Fk_View_Id Desc"
替换为以下代码


Sqlstr="Select Fk_View_Title,Fk_View_Pic,Fk_View_FixedUrl,Fk_View_Url From [Fk_ViewList] Where Fk_View_Show=1 And Fk_Module_State=1 And Fk_View_Module="&c_Module&" And Fk_View_Id>"&t_Id&" Order By Fk_View_Id Asc"
保存文件,修复完成。

 

4、生成地图链接有误,且关闭模版调试模式时,无法生成网站地图。

此bug修复方法如下:

打开文件 admin/SiteMap.asp

分别将99行、214行、238行、259行代码


cURL=Server.HTMLEncode(Replace(Fk_Site_Url&cURL,"//","/"))
替换为以下代码


cURL=Server.HTMLEncode(Replace(Replace(Fk_Site_Url&CURL,"//","/"),"http:/","http://"))
保存文件,这4处替换是解决生成的链接有误(http:/替换为http://)。

 

接着,我们来解决关闭模版调试模式时,无法生成网站地图的问题。

将第64行代码


    Dim c_Rs,cURL
替换为


    Dim mRs,c_Rs,cURL
将第67行代码


    Set c_Rs=Server.Createobject("Adodb.RecordSet")
替换为以下代码


    Set mRs=Server.Createobject("Adodb.RecordSet")
    Set c_Rs=Server.Createobject("Adodb.RecordSet")
将第91行-230行代码


    '生成栏目页
    Sqlstr="Select Fk_Module_Id,Fk_Module_Type,Fk_Module_Model,Fk_Module_FixedUrl,Fk_Module_Url,Fk_Module_LinkType,Fk_Module_PageSize,Fk_Module_Menu,Fk_Module_GBookReply,Fk_Module_Template From [Fk_Module] Where Fk_Module_State=1 Order By Fk_Module_Id Asc"
    Rs.Open Sqlstr,Conn,1,1
    If Not Rs.Eof Then
        While Not Rs.Eof
            If (Rs("Fk_Module_LinkType")=1 And Rs("Fk_Module_Type")=4) Or Instr(",0,2,",","&Rs("Fk_Module_Type")&",")>0 Then
                cURL=FKTemplate.GetUrl(FullSiteDir,"",Rs("Fk_Module_Url")&"Index","",PageSuffix,1,Rs("Fk_Module_Id"),Rs("Fk_Module_FixedUrl"))
                '生成
                cURL=Replace(cURL,"Index"&PageSuffix,"")
                cURL=Server.HTMLEncode(Replace(Fk_Site_Url&cURL,"//","/"))
                CreateHtml=CreateHtml&"<url>"&vbLf
                CreateHtml=CreateHtml&"<loc>"&cURL&"</loc>"&vbLf
                If CreateType=1 Then
                    CreateHtml=CreateHtml&"<lastmod>"&Date()&"</lastmod>"&vbLf
                    CreateHtml=CreateHtml&"<changefreq>daily</changefreq>"&vbLf
                    CreateHtml=CreateHtml&"<priority>0.7</priority>"&vbLf
                End If
                CreateHtml=CreateHtml&"</url>"&vbLf
            ElseIf Instr(",1,3,",","&Rs("Fk_Module_Type")&",")>0 Then
                '读取每页数量
                PageSizes=Fk_Site_PageSize
                If Rs("Fk_Module_PageSize")>0 Then
                    PageSizes=Rs("Fk_Module_PageSize")
                End If
                
                '读取模型绑定模板
                If Rs("Fk_Module_Type")=1 Then
                    Sqlstr="Select Fk_Model_Template From [Fk_Model] Where Fk_Model_Id="&Rs("Fk_Module_Model")&""
                    c_Rs.Open Sqlstr,Conn,1,1
                    If Not c_Rs.Eof Then
                        mModelTemplate=c_Rs("Fk_Model_Template")
                    Else
                        mModelTemplate=""
                    End If
                    c_Rs.Close
                Else
                    mModelTemplate=""
                End If
 
                If Rs("Fk_Module_Type")=1 Then
                    PageTemplate="viewlist"
                ElseIf Rs("Fk_Module_Type")=3 Then
                    PageTemplate="gbook"
                End If
                
                If Rs("Fk_Module_Template")<>"" Then
                    PageTemplate=Rs("Fk_Module_Template")
                ElseIf mModelTemplate<>"" Then
                    PageTemplate=mModelTemplate
                End If
                                
                '菜单信息读取
                Sqlstr="Select Fk_Menu_Dir,Fk_Menu_Template From [Fk_Menu] Where Fk_Menu_Id=" & Rs("Fk_Module_Menu")
                c_Rs.Open Sqlstr,Conn,1,1
                If Not c_Rs.Eof Then
                    MenuDir=c_Rs("Fk_Menu_Dir")
                    MenuTemplate=c_Rs("Fk_Menu_Template")
                Else
                    c_Rs.Close
                    Call FKFun.ShowErr("error:菜单不存在!",0)
                End If
                c_Rs.Close
                
                '目录模板方案_默认模板组合
                If MenuTemplate<>"" Then
                    If Instr(DisTemplate,","&PageTemplate&",")>0 Then
                        PageTemplate=MenuTemplate&"/"&PageTemplate
                    End If
                End If
                
                '模板标签解析
                PageCode=FKTemplate.GetTemplate(PageTemplate)
                
                PageCounts=1
                '读取页数
                If Instr(PageCode,"{$ModulePageCode(")>0 Then
                    '内容模块
                    If Rs("Fk_Module_Type")=1 Then
                        Sqlstr="Select Fk_View_Id From [Fk_View] Where Fk_View_Show=1 And Fk_View_Module="&Rs("Fk_Module_Id")&""
                        c_Rs.Open Sqlstr,Conn,1,1
                        c_Rs.PageSize=PageSizes
                        If c_Rs.PageCount>0 Then
                            PageCounts=c_Rs.PageCount
                        End If
                        c_Rs.Close
                    '留言模块
                    ElseIf Rs("Fk_Module_Type")=3 And Rs("Fk_Module_GBookReply")<>3 Then
                        Sqlstr="Select Fk_GBook_Id From [Fk_GBook] Where Fk_GBook_Module="&Rs("Fk_Module_Id")&""
                        If Rs("Fk_Module_GBookReply")=1 Then
                            Sqlstr=Sqlstr&" And Fk_GBook_ReIp<>''"
                        ElseIf Rs("Fk_Module_GBookReply")=2 Then
                            Sqlstr=Sqlstr&" And (Fk_GBook_ReIp='' Or Fk_GBook_ReIp Is Null)"
                        End If
                        c_Rs.Open Sqlstr,Conn,1,1
                        c_Rs.PageSize=PageSizes
                        If c_Rs.PageCount>0 Then
                            PageCounts=c_Rs.PageCount
                        End If
                        c_Rs.Close
                    Else
                        PageCounts=1
                    End If
                    '循环生成
                    For PageNow=1 To PageCounts
                        '链接地址获取
                        If Rs("Fk_Module_FixedUrl")<>"" Then '绝对链接
                            If Instr(Rs("Fk_Module_FixedUrl"),".")>0 Then '绝对链接带后缀
                                cURL=FKTemplate.GetUrl(FullSiteDir,"","","",PageSuffix,1,Rs("Fk_Module_Id"),Rs("Fk_Module_FixedUrl"))
                            Else '绝对链接不带后缀
                                If PageNow=1 Then
                                    cURL=FKTemplate.GetUrl(FullSiteDir,"","","",PageSuffix,1,Rs("Fk_Module_Id"),Rs("Fk_Module_FixedUrl")&"Index")
                                Else
                                    cURL=FKTemplate.GetUrl(FullSiteDir,"","","",PageSuffix,1,Rs("Fk_Module_Id"),Rs("Fk_Module_FixedUrl")&"Index_"&PageNow)
                                End If
                            End If
                        Else '非绝对链接
                            If PageNow=1 Then
                                cURL=FKTemplate.GetUrl(FullSiteDir,"",Rs("Fk_Module_Url")&"Index","",PageSuffix,1,Rs("Fk_Module_Id"),"")
                            Else
                                cURL=FKTemplate.GetUrl(FullSiteDir,"",Rs("Fk_Module_Url")&"Index_"&PageNow,"",PageSuffix,1,Rs("Fk_Module_Id"),"")
                            End If
                        End If
                        '生成
                        cURL=Replace(cURL,"Index"&PageSuffix,"")
                        cURL=Server.HTMLEncode(Replace(Fk_Site_Url&cURL,"//","/"))
                        CreateHtml=CreateHtml&"<url>"&vbLf
                        CreateHtml=CreateHtml&"<loc>"&cURL&"</loc>"&vbLf
                        If CreateType=1 Then
                            CreateHtml=CreateHtml&"<lastmod>"&Date()&"</lastmod>"&vbLf
                            CreateHtml=CreateHtml&"<changefreq>daily</changefreq>"&vbLf
                            CreateHtml=CreateHtml&"<priority>0.7</priority>"&vbLf
                        End If
                        CreateHtml=CreateHtml&"</url>"&vbLf
                    Next
                End If
            End If
            Rs.MoveNext
        Wend
    End If
    Rs.Close
替换为以下代码

    '生成栏目页
    Sqlstr="Select Fk_Module_Id,Fk_Module_Type,Fk_Module_Model,Fk_Module_FixedUrl,Fk_Module_Url,Fk_Module_LinkType,Fk_Module_PageSize,Fk_Module_Menu,Fk_Module_GBookReply,Fk_Module_Template From [Fk_Module] Where Fk_Module_State=1 Order By Fk_Module_Id Asc"
    mRs.Open Sqlstr,Conn,1,1
    If Not mRs.Eof Then
        While Not mRs.Eof
            If (mRs("Fk_Module_LinkType")=1 And mRs("Fk_Module_Type")=4) Or Instr(",0,2,",","&mRs("Fk_Module_Type")&",")>0 Then
                cURL=FKTemplate.GetUrl(FullSiteDir,"",mRs("Fk_Module_Url")&"Index","",PageSuffix,1,mRs("Fk_Module_Id"),mRs("Fk_Module_FixedUrl"))
                '生成
                cURL=Replace(cURL,"Index"&PageSuffix,"")
                cURL=Server.HTMLEncode(Replace(Replace(Fk_Site_Url&CURL,"//","/"),"http:/","http://"))
                CreateHtml=CreateHtml&"<url>"&vbLf
                CreateHtml=CreateHtml&"<loc>"&cURL&"</loc>"&vbLf
                If CreateType=1 Then
                    CreateHtml=CreateHtml&"<lastmod>"&Date()&"</lastmod>"&vbLf
                    CreateHtml=CreateHtml&"<changefreq>daily</changefreq>"&vbLf
                    CreateHtml=CreateHtml&"<priority>0.7</priority>"&vbLf
                End If
                CreateHtml=CreateHtml&"</url>"&vbLf
            ElseIf Instr(",1,3,",","&mRs("Fk_Module_Type")&",")>0 Then
                '读取每页数量
                PageSizes=Fk_Site_PageSize
                If mRs("Fk_Module_PageSize")>0 Then
                    PageSizes=mRs("Fk_Module_PageSize")
                End If
                
                '读取模型绑定模板
                If mRs("Fk_Module_Type")=1 Then
                    Sqlstr="Select Fk_Model_Template From [Fk_Model] Where Fk_Model_Id="& mRs("Fk_Module_Model")&""
                    c_Rs.Open Sqlstr,Conn,1,1
                    If Not c_Rs.Eof Then
                        mModelTemplate=c_Rs("Fk_Model_Template")
                    Else
                        mModelTemplate=""
                    End If
                    c_Rs.Close
                Else
                    mModelTemplate=""
                End If
 
                If mRs("Fk_Module_Type")=1 Then
                    PageTemplate="viewlist"
                ElseIf mRs("Fk_Module_Type")=3 Then
                    PageTemplate="gbook"
                End If
                
                If mRs("Fk_Module_Template")<>"" Then
                    PageTemplate=mRs("Fk_Module_Template")
                ElseIf mModelTemplate<>"" Then
                    PageTemplate=mModelTemplate
                End If
                                
                '菜单信息读取
                Sqlstr="Select Fk_Menu_Dir,Fk_Menu_Template From [Fk_Menu] Where Fk_Menu_Id=" & mRs("Fk_Module_Menu")
                c_Rs.Open Sqlstr,Conn,1,1
                If Not c_Rs.Eof Then
                    MenuDir=c_Rs("Fk_Menu_Dir")
                    MenuTemplate=c_Rs("Fk_Menu_Template")
                Else
                    c_Rs.Close
                    Call FKFun.ShowErr("error:菜单不存在!",0)
                End If
                c_Rs.Close
                
                '目录模板方案_默认模板组合
                If MenuTemplate<>"" Then
                    If Instr(DisTemplate,","&PageTemplate&",")>0 Then
                        PageTemplate=MenuTemplate&"/"&PageTemplate
                    End If
                End If
                
                '模板标签解析
                PageCode=FKTemplate.GetTemplate(PageTemplate)
                
                PageCounts=1
                '读取页数
                If Instr(PageCode,"{$ModulePageCode(")>0 Then
                    '内容模块
                    If mRs("Fk_Module_Type")=1 Then
                        Sqlstr="Select Fk_View_Id From [Fk_View] Where Fk_View_Show=1 And Fk_View_Module="&mRs("Fk_Module_Id")&""
                        c_Rs.Open Sqlstr,Conn,1,1
                        c_Rs.PageSize=PageSizes
                        If c_Rs.PageCount>0 Then
                            PageCounts=c_Rs.PageCount
                        End If
                        c_Rs.Close
                    '留言模块
                    ElseIf mRs("Fk_Module_Type")=3 And mRs("Fk_Module_GBookReply")<>3 Then
                        Sqlstr="Select Fk_GBook_Id From [Fk_GBook] Where Fk_GBook_Module="&mRs("Fk_Module_Id")&""
                        If mRs("Fk_Module_GBookReply")=1 Then
                            Sqlstr=Sqlstr&" And Fk_GBook_ReIp<>''"
                        ElseIf mRs("Fk_Module_GBookReply")=2 Then
                            Sqlstr=Sqlstr&" And (Fk_GBook_ReIp='' Or Fk_GBook_ReIp Is Null)"
                        End If
                        c_Rs.Open Sqlstr,Conn,1,1
                        c_Rs.PageSize=PageSizes
                        If c_Rs.PageCount>0 Then
                            PageCounts=c_Rs.PageCount
                        End If
                        c_Rs.Close
                    Else
                        PageCounts=1
                    End If
                    '循环生成
                    For PageNow=1 To PageCounts
                        '链接地址获取
                        If mRs("Fk_Module_FixedUrl")<>"" Then '绝对链接
                            If Instr(mRs("Fk_Module_FixedUrl"),".")>0 Then '绝对链接带后缀
                                cURL=FKTemplate.GetUrl(FullSiteDir,"","","",PageSuffix,1,mRs("Fk_Module_Id"),mRs("Fk_Module_FixedUrl"))
                            Else '绝对链接不带后缀
                                If PageNow=1 Then
                                    cURL=FKTemplate.GetUrl(FullSiteDir,"","","",PageSuffix,1,mRs("Fk_Module_Id"),mRs("Fk_Module_FixedUrl")&"Index")
                                Else
                                    cURL=FKTemplate.GetUrl(FullSiteDir,"","","",PageSuffix,1,mRs("Fk_Module_Id"),mRs("Fk_Module_FixedUrl")&"Index_"&PageNow)
                                End If
                            End If
                        Else '非绝对链接
                            If PageNow=1 Then
                                cURL=FKTemplate.GetUrl(FullSiteDir,"",mRs("Fk_Module_Url")&"Index","",PageSuffix,1,mRs("Fk_Module_Id"),"")
                            Else
                                cURL=FKTemplate.GetUrl(FullSiteDir,"",mRs("Fk_Module_Url")&"Index_"&PageNow,"",PageSuffix,1,mRs("Fk_Module_Id"),"")
                            End If
                        End If
                        '生成
                        cURL=Replace(cURL,"Index"&PageSuffix,"")
                        cURL=Server.HTMLEncode(Replace(Replace(Fk_Site_Url&CURL,"//","/"),"http:/","http://"))
                        CreateHtml=CreateHtml&"<url>"&vbLf
                        CreateHtml=CreateHtml&"<loc>"&cURL&"</loc>"&vbLf
                        If CreateType=1 Then
                            CreateHtml=CreateHtml&"<lastmod>"&Date()&"</lastmod>"&vbLf
                            CreateHtml=CreateHtml&"<changefreq>daily</changefreq>"&vbLf
                            CreateHtml=CreateHtml&"<priority>0.7</priority>"&vbLf
                        End If
                        CreateHtml=CreateHtml&"</url>"&vbLf
                    Next
                End If
            End If
            mRs.MoveNext
        Wend
    End If
    mRs.Close
保存文件,修复完成。

 

 

5、增加普通管理员权限勾选生成网站地图功能没有效果提示权限不足。

此bug修复方法如下:

打开文件 admin/SiteMap.asp

将第12行代码

Call CheckAdminLimit(ULimit,"s_Html",0)
替换为以下代码

Call CheckAdminLimit(ULimit,"s_SiteMap",0)
保存文件,修复完成。

 

6、静态生成分页错误。

此bug修复方法如下:

打开文件 admin/Html.asp

将第500行代码


Sqlstr="Select Fk_View_Id From [Fk_View] Where Fk_View_Show=1 And Fk_View_Module="&Id&""
替换为以下代码

Sqlstr="Select Fk_View_Id From [Fk_ViewList] Where Fk_View_Show=1 And (Fk_Module_Id="&Id&" Or Fk_Module_LevelList Like '%%,"&Id&",%%')"
保存文件,修复完成。

 

7、普通管理员CSS样式错误修复。

此bug修复方法如下:

打开文件 admin/Get.asp

将第187行-190行代码

    Call NavTop()
    If Instr(ULimit,"m_")>0 Or ULimit="all" Then
%>
        <div id="menu">
替换为以下代码

    Call NavTop()
%>   
        <div id="menu">
<%
    If Instr(ULimit,"m_")>0 Or ULimit="all" Then
%>
保存文件,修复完成。

 

8、普通管理员所有内容权限错误修复。

此bug修复方法如下:

打开文件 admin/Get.asp

将第265行-266行代码


            Temp=Rs("Fk_Module_Name")
            If CheckAdminLimit(ULimit,"v_"&Rs("Fk_Module_Id"),1) Then
替换为以下代码


            Temp=Rs("Fk_Module_Name")
            If UShowModule="all" Then
                ULimit="all"
            End If           
            If CheckAdminLimit(ULimit,"v_"&Rs("Fk_Module_Id"),1) Or ULimit="all" Then


将第320行代码


            If CheckAdminLimit(ULimit,"v_"&Rst("Fk_Module_Id"),1) Then
替换为以下代码


            If CheckAdminLimit(ULimit,"v_"&Rst("Fk_Module_Id"),1) Or ULimit="all" Then
保存文件,修复完成。

扫描二维码推送至手机访问。

版权声明:本文由皋城心砚发布,如需转载请注明出处。

本文链接:https://www.heyh.cn/261.html

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。