Cls_Template.asp
上传用户:jiajie98
上传日期:2020-04-24
资源大小:1206k
文件大小:44k
- <%
- '==========================================
- '文 件 名:Cls_Template.asp
- '文件用途:模板引擎函数类
- '版权所有:方卡在线
- '==========================================
- Class Cls_Template
- Private TemplateTag,TemplatePar,TemplateBCode
- Private If1,If2
- '==============================
- '函 数 名:SiteChange
- '作 用:替换站点参数
- '参 数:
- '==============================
- Public Function SiteChange(TemplateCode)
- TemplateCode=Replace(TemplateCode,"{$SiteName$}",SiteName)
- TemplateCode=Replace(TemplateCode,"{$SiteUrl$}",SiteUrl)
- TemplateCode=Replace(TemplateCode,"{$SiteKeyword$}",SiteKeyword)
- TemplateCode=Replace(TemplateCode,"{$SiteDescription$}",SiteDescription)
- TemplateCode=Replace(TemplateCode,"{$SiteSkin$}",SiteDir&"Skin/"&SiteTemplate&"/")
- TemplateCode=Replace(TemplateCode,"{$SiteDir$}",SiteDir)
- TemplateCode=Replace(TemplateCode,"{$SystemName$}",FkSystemNameEn)
- TemplateCode=Replace(TemplateCode,"{$SystemVersion$}",FkSystemVersion)
- SiteChange=TemplateCode
- End Function
- '==============================
- '函 数 名:PageChange
- '作 用:替换信息页参数
- '参 数:
- '==============================
- Public Function PageChange(TemplateCode)
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=0 And Fk_Module_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$PageTitle$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$PageKeyword$}",Rs("Fk_Module_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$PageDescription$}",Rs("Fk_Module_Description"))
- End If
- Rs.Close
- PageChange=TemplateCode
- End Function
- '==============================
- '函 数 名:JobChange
- '作 用:替换招聘页参数
- '参 数:
- '==============================
- Public Function JobChange(TemplateCode)
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=6 And Fk_Module_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$JobTitle$}",Rs("Fk_Module_Name"))
- End If
- Rs.Close
- JobChange=TemplateCode
- End Function
- '==============================
- '函 数 名:PageNows
- '作 用:当前位置
- '参 数:
- '==============================
- Public Function PageNows(ModuleId)
- PageNows=""
- While ModuleId>0
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Id=" & ModuleId
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- ModuleId=Rs("Fk_Module_Level")
- PageNows=" » "&"<a href="""&GetGoUrl(Rs("Fk_Module_Type"),Rs("Fk_Module_Id"),Rs("Fk_Module_Dir"),Rs("Fk_Module_FileName"))&""" title="""&Rs("Fk_Module_Name")&""">"&Rs("Fk_Module_Name")&"</a>"&PageNows
- Else
- ModuleId=0
- End If
- Rs.Close
- Wend
- PageNows="<a href="""&SiteDir&""" title=""首页"">首页</a>"&PageNows
- End Function
- '==============================
- '函 数 名:InfoChange
- '作 用:替换信息页参数
- '参 数:
- '==============================
- Public Function InfoChange(TemplateCode)
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=3 And Fk_Module_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$InfoTitle$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$InfoKeyword$}",Rs("Fk_Module_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$InfoDescription$}",Rs("Fk_Module_Description"))
- Temp=Rs("Fk_Module_Content")
- Rs.Close
- Sqlstr="Select * From [Fk_Word] Order By Fk_Word_Id Desc"
- Rs.Open Sqlstr,Conn,1,3
- While Not Rs.Eof
- Temp=Replace(Temp,Rs("Fk_Word_Name"),"<a href="""&Rs("Fk_Word_Url")&""" target=""_blank"" title="""&Rs("Fk_Word_Name")&""">"&Rs("Fk_Word_Name")&"</a>")
- Rs.MoveNext
- Wend
- TemplateCode=Replace(TemplateCode,"{$InfoContent$}",Temp)
- End If
- Rs.Close
- InfoChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:ArticleListChange
- '作 用:替换文章列表页参数
- '参 数:
- '==============================
- Public Function ArticleListChange(TemplateCode)
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=1 And Fk_Module_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$ArticleCategoryName$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$ArticleCategoryId$}",Id)
- TemplateCode=Replace(TemplateCode,"{$ArticleCategoryKeyword$}",Rs("Fk_Module_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$ArticleCategoryDescription$}",Rs("Fk_Module_Description"))
- End If
- Rs.Close
- ArticleListChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:ProductListChange
- '作 用:替换产品列表页参数
- '参 数:
- '==============================
- Public Function ProductListChange(TemplateCode)
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=2 And Fk_Module_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$ProductCategoryName$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$ProductCategoryId$}",Id)
- TemplateCode=Replace(TemplateCode,"{$ProductCategoryKeyword$}",Rs("Fk_Module_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$ProductCategoryDescription$}",Rs("Fk_Module_Description"))
- End If
- Rs.Close
- ProductListChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:DownListChange
- '作 用:替换下载列表页参数
- '参 数:
- '==============================
- Public Function DownListChange(TemplateCode)
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=7 And Fk_Module_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$DownCategoryName$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$DownCategoryId$}",Id)
- TemplateCode=Replace(TemplateCode,"{$DownCategoryKeyword$}",Rs("Fk_Module_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$DownCategoryDescription$}",Rs("Fk_Module_Description"))
- End If
- Rs.Close
- DownListChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:ArticleChange
- '作 用:替换文章页参数
- '参 数:
- '==============================
- Public Function ArticleChange(TemplateCode)
- Sqlstr="Select * From [Fk_ArticleList] Where Fk_Article_Show=1 And Fk_Article_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$ArticleId$}",Id)
- TemplateCode=Replace(TemplateCode,"{$ArticleTitle$}",Rs("Fk_Article_Title"))
- TemplateCode=Replace(TemplateCode,"{$ArticleFrom$}",Rs("Fk_Article_From"))
- TemplateCode=Replace(TemplateCode,"{$ArticleModuleName$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$ArticleModuleId$}",Rs("Fk_Module_Id"))
- TemplateCode=Replace(TemplateCode,"{$ArticleTime$}",Rs("Fk_Article_Time"))
- TemplateCode=Replace(TemplateCode,"{$ArticleKeyword$}",Rs("Fk_Article_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$ArticleDescription$}",Rs("Fk_Article_Description"))
- TemplateCode=Replace(TemplateCode,"{$ArticleClick$}","<span id=""Click""></span>")
- Temp=Rs("Fk_Article_Content")
- Rs.Close
- Sqlstr="Select * From [Fk_Word] Order By Fk_Word_Id Desc"
- Rs.Open Sqlstr,Conn,1,3
- While Not Rs.Eof
- Temp=Replace(Temp,Rs("Fk_Word_Name"),"<a href="""&Rs("Fk_Word_Url")&""" target=""_blank"" title="""&Rs("Fk_Word_Name")&""">"&Rs("Fk_Word_Name")&"</a>")
- Rs.MoveNext
- Wend
- TemplateCode=Replace(TemplateCode,"{$ArticleContent$}",Temp)
- End If
- Rs.Close
- ArticleChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:ProductChange
- '作 用:替换产品页参数
- '参 数:
- '==============================
- Public Function ProductChange(TemplateCode)
- Sqlstr="Select * From [Fk_ProductList] Where Fk_Product_Show=1 And Fk_Product_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$ProductId$}",Id)
- TemplateCode=Replace(TemplateCode,"{$ProductTitle$}",Rs("Fk_Product_Title"))
- TemplateCode=Replace(TemplateCode,"{$ProductTime$}",Rs("Fk_Product_Time"))
- TemplateCode=Replace(TemplateCode,"{$ProductDate$}",FormatDateTime(Rs("Fk_Product_Time"),2))
- TemplateCode=Replace(TemplateCode,"{$ProductPic$}",Rs("Fk_Product_Pic"))
- TemplateCode=Replace(TemplateCode,"{$ProductModuleName$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$ProductModuleId$}",Rs("Fk_Module_Id"))
- TemplateCode=Replace(TemplateCode,"{$ProductKeyword$}",Rs("Fk_Product_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$ProductDescription$}",Rs("Fk_Product_Description"))
- TemplateCode=Replace(TemplateCode,"{$ProductClick$}","<span id=""Click""></span>")
- Temp=Rs("Fk_Product_Content")
- Rs.Close
- Sqlstr="Select * From [Fk_Word] Order By Fk_Word_Id Desc"
- Rs.Open Sqlstr,Conn,1,3
- While Not Rs.Eof
- Temp=Replace(Temp,Rs("Fk_Word_Name"),"<a href="""&Rs("Fk_Word_Url")&""" target=""_blank"" title="""&Rs("Fk_Word_Name")&""">"&Rs("Fk_Word_Name")&"</a>")
- Rs.MoveNext
- Wend
- TemplateCode=Replace(TemplateCode,"{$ProductContent$}",Temp)
- End If
- Rs.Close
- ProductChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:DownChange
- '作 用:替换下载页参数
- '参 数:
- '==============================
- Public Function DownChange(TemplateCode)
- Sqlstr="Select * From [Fk_DownList] Where Fk_Down_Show=1 And Fk_Down_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$DownId$}",Id)
- TemplateCode=Replace(TemplateCode,"{$DownTitle$}",Rs("Fk_Down_Title"))
- TemplateCode=Replace(TemplateCode,"{$DownLanguage$}",Rs("Fk_Down_Language"))
- TemplateCode=Replace(TemplateCode,"{$DownSystem$}",Rs("Fk_Down_System"))
- TemplateCode=Replace(TemplateCode,"{$DownFile$}",Rs("Fk_Down_File"))
- TemplateCode=Replace(TemplateCode,"{$DownTime$}",Rs("Fk_Down_Time"))
- TemplateCode=Replace(TemplateCode,"{$DownDate$}",FormatDateTime(Rs("Fk_Down_Time"),2))
- TemplateCode=Replace(TemplateCode,"{$DownPic$}",Rs("Fk_Down_Pic"))
- TemplateCode=Replace(TemplateCode,"{$DownModuleName$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$DownModuleId$}",Rs("Fk_Module_Id"))
- TemplateCode=Replace(TemplateCode,"{$DownKeyword$}",Rs("Fk_Down_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$DownDescription$}",Rs("Fk_Down_Description"))
- TemplateCode=Replace(TemplateCode,"{$DownClick$}","<span id=""Click""></span>")
- Temp=Rs("Fk_Down_Content")
- Rs.Close
- Sqlstr="Select * From [Fk_Word] Order By Fk_Word_Id Desc"
- Rs.Open Sqlstr,Conn,1,3
- While Not Rs.Eof
- Temp=Replace(Temp,Rs("Fk_Word_Name"),"<a href="""&Rs("Fk_Word_Url")&""" target=""_blank"" title="""&Rs("Fk_Word_Name")&""">"&Rs("Fk_Word_Name")&"</a>")
- Rs.MoveNext
- Wend
- TemplateCode=Replace(TemplateCode,"{$DownContent$}",Temp)
- End If
- Rs.Close
- DownChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:GBookChange
- '作 用:替换留言页参数
- '参 数:
- '==============================
- Public Function GBookChange(TemplateCode)
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Type=4 And Fk_Module_Id=" & Id
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$GBookTitle$}",Rs("Fk_Module_Name"))
- TemplateCode=Replace(TemplateCode,"{$GBookId$}",Id)
- TemplateCode=Replace(TemplateCode,"{$GBookKeyword$}",Rs("Fk_Module_Keyword"))
- TemplateCode=Replace(TemplateCode,"{$GBookDescription$}",Rs("Fk_Module_Description"))
- End If
- Rs.Close
- GBookChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:SubjectChange
- '作 用:专题页参数
- '参 数:
- '==============================
- Public Function SubjectChange(TemplateCode)
- TemplateCode=Replace(TemplateCode,"{$SubjectName$}",Fk_Subject_Name)
- SubjectChange=TemplateCode
- End Function
-
- '==============================
- '函 数 名:FileChange
- '作 用:替换模板模块参数
- '参 数:
- '==============================
- Public Function FileChange(TemplateCode)
- While Instr(TemplateCode,"{$File(")
- Temp=Split(Split(TemplateCode,"{$File(")(1),")$}")(0)
- Sqlstr="Select * From [Fk_Template] Where Fk_Template_Name='"&Temp&"'"
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TemplateCode=Replace(TemplateCode,"{$File("&Temp&")$}",Rs("Fk_Template_Content"))
- Else
- TemplateCode=Replace(TemplateCode,"{$File("&Temp&")$}","")
- End If
- Rs.Close
- Wend
- FileChange=TemplateCode
- End Function
-
- '========================标签处理区===========================
-
- '==============================
- '函 数 名:FkNav
- '作 用:菜单标签操作
- '参 数:
- '==============================
- Private Function FkNav(BCode,BPar)
- Dim NavUrl
- TempArr=Split(BPar,"/")
- While TempArr(3)<0 And TempArr(1)>0
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Id="&TempArr(1)&""
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- TempArr(1)=Rs("Fk_Module_Level")
- TempArr(3)=TempArr(3)+1
- Else
- TempArr(1)=0
- End If
- Rs.Close
- Wend
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Show=1 And Fk_Module_Menu="&TempArr(0)&" And Fk_Module_Level="&TempArr(1)&" Order By Fk_Module_Order Asc,Fk_Module_Id Asc"
- Rs.Open Sqlstr,Conn,1,3
- While Not Rs.Eof
- If Rs("Fk_Module_Type")=5 Then
- NavUrl=Rs("Fk_Module_Url")
- Else
- NavUrl=GetGoUrl(Rs("Fk_Module_Type"),Rs("Fk_Module_Id"),Rs("Fk_Module_Dir"),Rs("Fk_Module_FileName"))
- End If
- FkNav=FkNav&BCode
- FkNav=Replace(FkNav,"{$NavId$}",Rs("Fk_Module_Id"))
- FkNav=Replace(FkNav,"{$NavName$}",Rs("Fk_Module_Name"))
- FkNav=Replace(FkNav,"{$NavUr$}",NavUrl)
- FkNav=Replace(FkNav,"{$NavId$}",Rs("Fk_Module_Id"))
- If TempArr(2)>1 Then
- FkNav=Replace(FkNav,"{$NavSub$}",FkNavs(Rs("Fk_Module_Id"),Clng(TempArr(2))-1))
- End If
- Rs.MoveNext
- Wend
- Rs.Close
- End Function
- '==============================
- '函 数 名:FkNavs
- '作 用:读取多级菜单操作
- '参 数:当前父ID GetId,还要读取级数GetCount
- '==============================
- Private Function FkNavs(GetId,GetCount)
- Dim NavUrl,Rs2
- Set Rs2=Server.Createobject("Adodb.RecordSet")
- Sqlstr="Select * From [Fk_Module] Where Fk_Module_Show=1 And Fk_Module_Level="&GetId&" Order By Fk_Module_Order Desc,Fk_Module_Id Asc"
- Rs2.Open Sqlstr,Conn,1,3
- If Not Rs2.Eof Then
- FkNavs="<ul>" & vbCrLf
- While Not Rs2.Eof
- If Rs2("Fk_Module_Type")=5 Then
- NavUrl=Rs2("Fk_Module_Url")
- Else
- NavUrl=GetGoUrl(Rs2("Fk_Module_Type"),Rs2("Fk_Module_Id"),Rs2("Fk_Module_Dir"),Rs2("Fk_Module_FileName"))
- End If
- FkNavs=FkNavs&"<li><a href="""&NavUrl&""">"&Rs2("Fk_Module_Name")&"</a>"
- If GetCount>1 Then
- FkNavs=FkNavs&FkNavs(Rs2("Fk_Module_Id"),GetCount-1)
- End If
- FkNavs=FkNavs&"</li>" & vbCrLf
- Rs2.MoveNext
- Wend
- FkNavs=FkNavs&"</ul>" & vbCrLf
- End If
- Rs2.Close
- Set Rs2=Nothing
- End Function
-
- '==============================
- '函 数 名:FkArticleList
- '作 用:文章列表标签操作
- '参 数:
- '==============================
- Private Function FkArticleList(BCode,BPar)
- Dim ArticleUrl,ArticleTitle
- TempArr=Split(BPar,"/")
- Sqlstr="Select"
- If TempArr(3)>0 And TempArr(4)=0 Then
- Sqlstr=Sqlstr&" Top "&TempArr(3)&""
- End If
- Sqlstr=Sqlstr&" * From [Fk_ArticleList] Where Fk_Article_Show=1 And Fk_Module_Menu=" & TempArr(0)
- If TempArr(1)>0 Then
- Sqlstr=Sqlstr&" And (Fk_Article_Module="&TempArr(1)&" Or Fk_Module_LevelList Like '%%,"&TempArr(1)&",%%')"
- End If
- If TempArr(5)>0 Then
- Sqlstr=Sqlstr&" And Fk_Article_Recommend Like '%%,"&TempArr(5)&",%%'"
- End If
- If TempArr(6)>0 Then
- Sqlstr=Sqlstr&" And Fk_Article_Subject Like '%%,"&TempArr(6)&",%%'"
- End If
- If TempArr(4)=1 And SearchStr<>"" Then
- Sqlstr=Sqlstr&" And Fk_Article_Title Like '%%"&SearchStr&"%%'"
- End If
- Select Case TempArr(2)
- Case 0
- Sqlstr=Sqlstr&" Order By Fk_Article_Id Desc"
- Case 1
- Sqlstr=Sqlstr&" Order By Fk_Article_Time Desc,Fk_Article_Id Desc"
- Case 2
- Sqlstr=Sqlstr&" Order By Fk_Article_Click Desc,Fk_Article_Id Desc"
- End Select
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- If TempArr(4)=0 Then
- While Not Rs.Eof
- If Rs("Fk_Module_Dir")<>"" Then
- ArticleUrl=Rs("Fk_Module_Dir")&"/"
- Else
- ArticleUrl="Article"&Rs("Fk_Module_Id")&"/"
- End If
- If Rs("Fk_Article_FileName")<>"" Then
- ArticleUrl=ArticleUrl&Rs("Fk_Article_FileName")&".html"
- Else
- ArticleUrl=ArticleUrl&Rs("Fk_Article_Id")&".html"
- End If
- If SiteHtml=1 Then
- ArticleUrl=SiteDir&ArticleUrl
- Else
- ArticleUrl=SiteDir&"?"&ArticleUrl
- End If
- ArticleTitle=Rs("Fk_Article_Title")
- If Len(ArticleTitle)>TempArr(7) And TempArr(7)>0 Then
- ArticleTitle=Left(ArticleTitle,TempArr(7))&"..."
- End If
- FkArticleList=FkArticleList&BCode
- If Rs("Fk_Article_Color")<>"" Then
- FkArticleList=Replace(FkArticleList,"{$ArticleListTitle$}","<span style='color:"&Rs("Fk_Article_Color")&"'>"&ArticleTitle&"</span>")
- Else
- FkArticleList=Replace(FkArticleList,"{$ArticleListTitle$}",ArticleTitle)
- End If
- FkArticleList=Replace(FkArticleList,"{$ArticleListUrl$}",ArticleUrl)
- FkArticleList=Replace(FkArticleList,"{$ArticleListTime$}",Rs("Fk_Article_Time"))
- FkArticleList=Replace(FkArticleList,"{$ArticleListDate$}",FormatDateTime(Rs("Fk_Article_Time"),2))
- FkArticleList=Replace(FkArticleList,"{$ArticleListYear$}",Year(Rs("Fk_Article_Time")))
- FkArticleList=Replace(FkArticleList,"{$ArticleListMonth$}",Month(Rs("Fk_Article_Time")))
- FkArticleList=Replace(FkArticleList,"{$ArticleListDay$}",Day(Rs("Fk_Article_Time")))
- FkArticleList=Replace(FkArticleList,"{$ArticleListPic$}",Rs("Fk_Article_Pic"))
- FkArticleList=Replace(FkArticleList,"{$ArticleListNew$}",DateDiff("d",Rs("Fk_Article_Time"),Now()))
- FkArticleList=Replace(FkArticleList,"{$ArticleListClick$}",Rs("Fk_Article_Click"))
- Rs.MoveNext
- Wend
- Else
- Rs.PageSize=PageSizes
- If PageNow>Rs.PageCount Or PageNow<=0 Then
- PageNow=1
- End If
- PageCounts=Rs.PageCount
- Rs.AbsolutePage=PageNow
- PageAll=Rs.RecordCount
- i=1
- While (Not Rs.Eof) And i<PageSizes+1
- If Rs("Fk_Module_Dir")<>"" Then
- ArticleUrl=Rs("Fk_Module_Dir")&"/"
- Else
- ArticleUrl="Article"&Rs("Fk_Module_Id")&"/"
- End If
- If Rs("Fk_Article_FileName")<>"" Then
- ArticleUrl=ArticleUrl&Rs("Fk_Article_FileName")&".html"
- Else
- ArticleUrl=ArticleUrl&Rs("Fk_Article_Id")&".html"
- End If
- If SiteHtml=1 Then
- ArticleUrl=SiteDir&ArticleUrl
- Else
- ArticleUrl=SiteDir&"?"&ArticleUrl
- End If
- ArticleTitle=Rs("Fk_Article_Title")
- If Len(ArticleTitle)>TempArr(7) And TempArr(7)>0 Then
- ArticleTitle=Left(ArticleTitle,TempArr(7))&"..."
- End If
- FkArticleList=FkArticleList&BCode
- If Rs("Fk_Article_Color")<>"" Then
- FkArticleList=Replace(FkArticleList,"{$ArticleListTitle$}","<span style='color:"&Rs("Fk_Article_Color")&"'>"&ArticleTitle&"</span>")
- Else
- FkArticleList=Replace(FkArticleList,"{$ArticleListTitle$}",ArticleTitle)
- End If
- FkArticleList=Replace(FkArticleList,"{$ArticleListTime$}",Rs("Fk_Article_Time"))
- FkArticleList=Replace(FkArticleList,"{$ArticleListDate$}",FormatDateTime(Rs("Fk_Article_Time"),2))
- FkArticleList=Replace(FkArticleList,"{$ArticleListUrl$}",ArticleUrl)
- FkArticleList=Replace(FkArticleList,"{$ArticleListPic$}",Rs("Fk_Article_Pic"))
- FkArticleList=Replace(FkArticleList,"{$ArticleListYear$}",Year(Rs("Fk_Article_Time")))
- FkArticleList=Replace(FkArticleList,"{$ArticleListMonth$}",Month(Rs("Fk_Article_Time")))
- FkArticleList=Replace(FkArticleList,"{$ArticleListDay$}",Day(Rs("Fk_Article_Time")))
- FkArticleList=Replace(FkArticleList,"{$ArticleListNew$}",DateDiff("d",Rs("Fk_Article_Time"),Now()))
- FkArticleList=Replace(FkArticleList,"{$ArticleListClick$}",Rs("Fk_Article_Click"))
- Rs.MoveNext
- i=i+1
- Wend
- End If
- End If
- Rs.Close
- End Function
- '==============================
- '函 数 名:FkProductList
- '作 用:产品列表标签操作
- '参 数:
- '==============================
- Private Function FkProductList(BCode,BPar)
- Dim ProductUrl,ProductTitle
- TempArr=Split(BPar,"/")
- Sqlstr="Select"
- If TempArr(3)>0 And TempArr(4)=0 Then
- Sqlstr=Sqlstr&" Top "&TempArr(3)&""
- End If
- Sqlstr=Sqlstr&" * From [Fk_ProductList] Where Fk_Product_Show=1 And Fk_Module_Menu=" & TempArr(0)
- If TempArr(1)>0 Then
- Sqlstr=Sqlstr&" And (Fk_Product_Module="&TempArr(1)&" Or Fk_Module_LevelList Like '%%,"&TempArr(1)&",%%')"
- End If
- If TempArr(5)>0 Then
- Sqlstr=Sqlstr&" And Fk_Product_Recommend Like '%%,"&TempArr(5)&",%%'"
- End If
- If TempArr(6)>0 Then
- Sqlstr=Sqlstr&" And Fk_Product_Subject Like '%%,"&TempArr(6)&",%%'"
- End If
- If TempArr(4)=1 And SearchStr<>"" Then
- Sqlstr=Sqlstr&" And Fk_Product_Title Like '%%"&SearchStr&"%%'"
- End If
- Select Case TempArr(2)
- Case 0
- Sqlstr=Sqlstr&" Order By Fk_Product_Id Desc"
- Case 1
- Sqlstr=Sqlstr&" Order By Fk_Product_Time Desc,Fk_Product_Id Desc"
- Case 2
- Sqlstr=Sqlstr&" Order By Fk_Product_Click Desc,Fk_Product_Id Desc"
- End Select
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- If TempArr(4)=0 Then
- While Not Rs.Eof
- If Rs("Fk_Module_Dir")<>"" Then
- ProductUrl=Rs("Fk_Module_Dir")&"/"
- Else
- ProductUrl="Product"&Rs("Fk_Module_Id")&"/"
- End If
- If Rs("Fk_Product_FileName")<>"" Then
- ProductUrl=ProductUrl&Rs("Fk_Product_FileName")&".html"
- Else
- ProductUrl=ProductUrl&Rs("Fk_Product_Id")&".html"
- End If
- If SiteHtml=1 Then
- ProductUrl=SiteDir&ProductUrl
- Else
- ProductUrl=SiteDir&"?"&ProductUrl
- End If
- ProductTitle=Rs("Fk_Product_Title")
- If Len(ProductTitle)>TempArr(7) And TempArr(7)>0 Then
- ProductTitle=Left(ProductTitle,TempArr(7))&"..."
- End If
- FkProductList=FkProductList&BCode
- If Rs("Fk_Product_Color")<>"" Then
- FkProductList=Replace(FkProductList,"{$ProductListTitle$}","<span style='color:"&Rs("Fk_Product_Color")&"'>"&ProductTitle&"</span>")
- Else
- FkProductList=Replace(FkProductList,"{$ProductListTitle$}",ProductTitle)
- End If
- FkProductList=Replace(FkProductList,"{$ProductListUrl$}",ProductUrl)
- FkProductList=Replace(FkProductList,"{$ProductListClick$}",Rs("Fk_Product_Click"))
- FkProductList=Replace(FkProductList,"{$ProductListTime$}",Rs("Fk_Product_Time"))
- FkProductList=Replace(FkProductList,"{$ProductListDate$}",FormatDateTime(Rs("Fk_Product_Time"),2))
- FkProductList=Replace(FkProductList,"{$ProductListYear$}",Year(Rs("Fk_Product_Time")))
- FkProductList=Replace(FkProductList,"{$ProductListMonth$}",Month(Rs("Fk_Product_Time")))
- FkProductList=Replace(FkProductList,"{$ProductListDay$}",Day(Rs("Fk_Product_Time")))
- FkProductList=Replace(FkProductList,"{$ProductListNew$}",DateDiff("d",Rs("Fk_Product_Time"),Now()))
- FkProductList=Replace(FkProductList,"{$ProductListPic$}",Rs("Fk_Product_Pic"))
- Rs.MoveNext
- Wend
- Else
- Rs.PageSize=PageSizes
- If PageNow>Rs.PageCount Or PageNow<=0 Then
- PageNow=1
- End If
- PageCounts=Rs.PageCount
- Rs.AbsolutePage=PageNow
- PageAll=Rs.RecordCount
- i=1
- While (Not Rs.Eof) And i<PageSizes+1
- If Rs("Fk_Module_Dir")<>"" Then
- ProductUrl=Rs("Fk_Module_Dir")&"/"
- Else
- ProductUrl="Product"&Rs("Fk_Module_Id")&"/"
- End If
- If Rs("Fk_Product_FileName")<>"" Then
- ProductUrl=ProductUrl&Rs("Fk_Product_FileName")&".html"
- Else
- ProductUrl=ProductUrl&Rs("Fk_Product_Id")&".html"
- End If
- If SiteHtml=1 Then
- ProductUrl=SiteDir&ProductUrl
- Else
- ProductUrl=SiteDir&"?"&ProductUrl
- End If
- ProductTitle=Rs("Fk_Product_Title")
- If Len(ProductTitle)>TempArr(7) And TempArr(7)>0 Then
- ProductTitle=Left(ProductTitle,TempArr(7))&"..."
- End If
- FkProductList=FkProductList&BCode
- If Rs("Fk_Product_Color")<>"" Then
- FkProductList=Replace(FkProductList,"{$ProductListTitle$}","<span style='color:"&Rs("Fk_Product_Color")&"'>"&ProductTitle&"</span>")
- Else
- FkProductList=Replace(FkProductList,"{$ProductListTitle$}",ProductTitle)
- End If
- FkProductList=Replace(FkProductList,"{$ProductListUrl$}",ProductUrl)
- FkProductList=Replace(FkProductList,"{$ProductListClick$}",Rs("Fk_Product_Click"))
- FkProductList=Replace(FkProductList,"{$ProductListTime$}",Rs("Fk_Product_Time"))
- FkProductList=Replace(FkProductList,"{$ProductListDate$}",FormatDateTime(Rs("Fk_Product_Time"),2))
- FkProductList=Replace(FkProductList,"{$ProductListYear$}",Year(Rs("Fk_Product_Time")))
- FkProductList=Replace(FkProductList,"{$ProductListMonth$}",Month(Rs("Fk_Product_Time")))
- FkProductList=Replace(FkProductList,"{$ProductListDay$}",Day(Rs("Fk_Product_Time")))
- FkProductList=Replace(FkProductList,"{$ProductListNew$}",DateDiff("d",Rs("Fk_Product_Time"),Now()))
- FkProductList=Replace(FkProductList,"{$ProductListPic$}",Rs("Fk_Product_Pic"))
- Rs.MoveNext
- i=i+1
- Wend
- End If
- End If
- Rs.Close
- End Function
- '==============================
- '函 数 名:FkDownList
- '作 用:下载列表标签操作
- '参 数:
- '==============================
- Private Function FkDownList(BCode,BPar)
- Dim DownUrl,DownTitle
- TempArr=Split(BPar,"/")
- Sqlstr="Select"
- If TempArr(3)>0 And TempArr(4)=0 Then
- Sqlstr=Sqlstr&" Top "&TempArr(3)&""
- End If
- Sqlstr=Sqlstr&" * From [Fk_DownList] Where Fk_Down_Show=1 And Fk_Module_Menu=" & TempArr(0)
- If TempArr(1)>0 Then
- Sqlstr=Sqlstr&" And (Fk_Down_Module="&TempArr(1)&" Or Fk_Module_LevelList Like '%%,"&TempArr(1)&",%%')"
- End If
- If TempArr(5)>0 Then
- Sqlstr=Sqlstr&" And Fk_Down_Recommend Like '%%,"&TempArr(5)&",%%'"
- End If
- If TempArr(6)>0 Then
- Sqlstr=Sqlstr&" And Fk_Down_Subject Like '%%,"&TempArr(6)&",%%'"
- End If
- If TempArr(4)=1 And SearchStr<>"" Then
- Sqlstr=Sqlstr&" And Fk_Down_Title Like '%%"&SearchStr&"%%'"
- End If
- Select Case TempArr(2)
- Case 0
- Sqlstr=Sqlstr&" Order By Fk_Down_Id Desc"
- Case 1
- Sqlstr=Sqlstr&" Order By Fk_Down_Time Desc,Fk_Down_Id Desc"
- Case 2
- Sqlstr=Sqlstr&" Order By Fk_Down_Click Desc,Fk_Down_Id Desc"
- End Select
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- If TempArr(4)=0 Then
- While Not Rs.Eof
- If Rs("Fk_Module_Dir")<>"" Then
- DownUrl=Rs("Fk_Module_Dir")&"/"
- Else
- DownUrl="Down"&Rs("Fk_Module_Id")&"/"
- End If
- If Rs("Fk_Down_FileName")<>"" Then
- DownUrl=DownUrl&Rs("Fk_Down_FileName")&".html"
- Else
- DownUrl=DownUrl&Rs("Fk_Down_Id")&".html"
- End If
- If SiteHtml=1 Then
- DownUrl=SiteDir&DownUrl
- Else
- DownUrl=SiteDir&"?"&DownUrl
- End If
- DownTitle=Rs("Fk_Down_Title")
- If Len(DownTitle)>TempArr(7) And TempArr(7)>0 Then
- DownTitle=Left(DownTitle,TempArr(7))&"..."
- End If
- FkDownList=FkDownList&BCode
- If Rs("Fk_Down_Color")<>"" Then
- FkDownList=Replace(FkDownList,"{$DownListTitle$}","<span style='color:"&Rs("Fk_Down_Color")&"'>"&DownTitle&"</span>")
- Else
- FkDownList=Replace(FkDownList,"{$DownListTitle$}",DownTitle)
- End If
- FkDownList=Replace(FkDownList,"{$DownListUrl$}",DownUrl)
- FkDownList=Replace(FkDownList,"{$DownListClick$}",Rs("Fk_Down_Click"))
- FkDownList=Replace(FkDownList,"{$DownListTime$}",Rs("Fk_Down_Time"))
- FkDownList=Replace(FkDownList,"{$DownListSystem$}",Rs("Fk_Down_System"))
- FkDownList=Replace(FkDownList,"{$DownListLanguage$}",Rs("Fk_Down_Language"))
- FkDownList=Replace(FkDownList,"{$DownListFile$}",Rs("Fk_Down_File"))
- FkDownList=Replace(FkDownList,"{$DownListDate$}",FormatDateTime(Rs("Fk_Down_Time"),2))
- FkDownList=Replace(FkDownList,"{$DownListYear$}",Year(Rs("Fk_Down_Time")))
- FkDownList=Replace(FkDownList,"{$DownListMonth$}",Month(Rs("Fk_Down_Time")))
- FkDownList=Replace(FkDownList,"{$DownListDay$}",Day(Rs("Fk_Down_Time")))
- FkDownList=Replace(FkDownList,"{$DownListNew$}",DateDiff("d",Rs("Fk_Down_Time"),Now()))
- FkDownList=Replace(FkDownList,"{$DownListPic$}",Rs("Fk_Down_Pic"))
- Rs.MoveNext
- Wend
- Else
- Rs.PageSize=PageSizes
- If PageNow>Rs.PageCount Or PageNow<=0 Then
- PageNow=1
- End If
- PageCounts=Rs.PageCount
- Rs.AbsolutePage=PageNow
- PageAll=Rs.RecordCount
- i=1
- While (Not Rs.Eof) And i<PageSizes+1
- If Rs("Fk_Module_Dir")<>"" Then
- DownUrl=Rs("Fk_Module_Dir")&"/"
- Else
- DownUrl="Down"&Rs("Fk_Module_Id")&"/"
- End If
- If Rs("Fk_Down_FileName")<>"" Then
- DownUrl=DownUrl&Rs("Fk_Down_FileName")&".html"
- Else
- DownUrl=DownUrl&Rs("Fk_Down_Id")&".html"
- End If
- If SiteHtml=1 Then
- DownUrl=SiteDir&DownUrl
- Else
- DownUrl=SiteDir&"?"&DownUrl
- End If
- DownTitle=Rs("Fk_Down_Title")
- If Len(DownTitle)>TempArr(7) And TempArr(7)>0 Then
- DownTitle=Left(DownTitle,TempArr(7))&"..."
- End If
- FkDownList=FkDownList&BCode
- If Rs("Fk_Down_Color")<>"" Then
- FkDownList=Replace(FkDownList,"{$DownListTitle$}","<span style='color:"&Rs("Fk_Down_Color")&"'>"&DownTitle&"</span>")
- Else
- FkDownList=Replace(FkDownList,"{$DownListTitle$}",DownTitle)
- End If
- FkDownList=Replace(FkDownList,"{$DownListUrl$}",DownUrl)
- FkDownList=Replace(FkDownList,"{$DownListClick$}",Rs("Fk_Down_Click"))
- FkDownList=Replace(FkDownList,"{$DownListTime$}",Rs("Fk_Down_Time"))
- FkDownList=Replace(FkDownList,"{$DownListSystem$}",Rs("Fk_Down_System"))
- FkDownList=Replace(FkDownList,"{$DownListLanguage$}",Rs("Fk_Down_Language"))
- FkDownList=Replace(FkDownList,"{$DownListFile$}",Rs("Fk_Down_File"))
- FkDownList=Replace(FkDownList,"{$DownListDate$}",FormatDateTime(Rs("Fk_Down_Time"),2))
- FkDownList=Replace(FkDownList,"{$DownListYear$}",Year(Rs("Fk_Down_Time")))
- FkDownList=Replace(FkDownList,"{$DownListMonth$}",Month(Rs("Fk_Down_Time")))
- FkDownList=Replace(FkDownList,"{$DownListDay$}",Day(Rs("Fk_Down_Time")))
- FkDownList=Replace(FkDownList,"{$DownListNew$}",DateDiff("d",Rs("Fk_Down_Time"),Now()))
- FkDownList=Replace(FkDownList,"{$DownListPic$}",Rs("Fk_Down_Pic"))
- Rs.MoveNext
- i=i+1
- Wend
- End If
- End If
- Rs.Close
- End Function
-
- '==============================
- '函 数 名:FkFriendsList
- '作 用:友情链接列表标签操作
- '参 数:
- '==============================
- Private Function FkFriendsList(BCode,BPar)
- TempArr=Split(BPar,"/")
- Sqlstr="Select"
- If TempArr(2)>0 Then
- Sqlstr=Sqlstr&" Top "&TempArr(2)&""
- End If
- Sqlstr=Sqlstr&" * From [Fk_Friends] Where 1=1"
- If TempArr(0)>0 Then
- Sqlstr=Sqlstr&" And Fk_Friends_FriendsType="&TempArr(0)&""
- End If
- If TempArr(1)=1 Then
- Sqlstr=Sqlstr&" And Fk_Friends_ShowType=1"
- Else
- Sqlstr=Sqlstr&" And Fk_Friends_ShowType=2"
- End If
- Sqlstr=Sqlstr&" Order By Fk_Friends_Id Asc"
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- While Not Rs.Eof
- FkFriendsList=FkFriendsList&BCode
- FkFriendsList=Replace(FkFriendsList,"{$FriendsName$}",Rs("Fk_Friends_Name"))
- FkFriendsList=Replace(FkFriendsList,"{$FriendsUrl$}",Rs("Fk_Friends_Url"))
- FkFriendsList=Replace(FkFriendsList,"{$FriendsAbout$}",Rs("Fk_Friends_About"))
- If Rs("Fk_Friends_Logo")<>"" Then
- FkFriendsList=Replace(FkFriendsList,"{$FriendsLogo$}",Rs("Fk_Friends_Logo"))
- End If
- Rs.MoveNext
- Wend
- End If
- Rs.Close
- End Function
-
- '==============================
- '函 数 名:FkJobList
- '作 用:招聘列表标签操作
- '参 数:
- '==============================
- Private Function FkJobList(BCode,BPar)
- TempArr=Split(BPar,"/")
- Sqlstr="Select"
- If TempArr(0)>0 Then
- Sqlstr=Sqlstr&" Top "&TempArr(0)&""
- End If
- Sqlstr=Sqlstr&" * From [Fk_Job] Where 1=1"
- If TempArr(1)=1 Then
- Sqlstr=Sqlstr&" And DateAdd('d',Fk_Job_Date,Fk_Job_Time)<=#"&Now()&"#"
- End If
- If TempArr(1)=2 Then
- Sqlstr=Sqlstr&" And DateAdd('d',Fk_Job_Date,Fk_Job_Time)>#"&Now()&"#"
- End If
- Sqlstr=Sqlstr&" Order By Fk_Job_Id Desc"
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- While Not Rs.Eof
- FkJobList=FkJobList&BCode
- FkJobList=Replace(FkJobList,"{$JobName$}",Rs("Fk_Job_Name"))
- FkJobList=Replace(FkJobList,"{$JobCount$}",Rs("Fk_Job_Count"))
- FkJobList=Replace(FkJobList,"{$JobAbout$}",Rs("Fk_Job_About"))
- FkJobList=Replace(FkJobList,"{$JobArea$}",Rs("Fk_Job_Area"))
- If Rs("Fk_Job_Date")=0 Then
- FkJobList=Replace(FkJobList,"{$JobDate$}","长期有效")
- Else
- FkJobList=Replace(FkJobList,"{$JobDate$}",Rs("Fk_Job_Date")&"天")
- End If
- FkJobList=Replace(FkJobList,"{$JobTime$}",Rs("Fk_Job_Time"))
- Rs.MoveNext
- Wend
- End If
- Rs.Close
- End Function
-
- '==============================
- '函 数 名:FkSubjectList
- '作 用:专题列表标签操作
- '参 数:
- '==============================
- Private Function FkSubjectList(BCode,BPar)
- Dim SubjectUrl
- TempArr=Split(BPar,"/")
- Sqlstr="Select"
- If TempArr(0)>0 Then
- Sqlstr=Sqlstr&" Top "&TempArr(0)&""
- End If
- Sqlstr=Sqlstr&" * From [Fk_Subject] Where 1=1"
- Sqlstr=Sqlstr&" Order By Fk_Subject_Id Desc"
- Rs.Open Sqlstr,Conn,1,3
- If Not Rs.Eof Then
- While Not Rs.Eof
- SubjectUrl="Subject.asp?Id=" & Rs("Fk_Subject_Id")
- FkSubjectList=FkSubjectList&BCode
- FkSubjectList=Replace(FkSubjectList,"{$SubjectListName$}",Rs("Fk_Subject_Name"))
- FkSubjectList=Replace(FkSubjectList,"{$SubjectListPic$}",Rs("Fk_Subject_Pic"))
- FkSubjectList=Replace(FkSubjectList,"{$SubjectListUrl$}",SubjectUrl)
- Rs.MoveNext
- Wend
- End If
- Rs.Close
- End Function
-
- '==============================
- '函 数 名:GetGoUrl
- '作 用:获取内容操作链接
- '参 数:模块类型ModuleType,模块ID ModuleId
- '==============================
- Public Function GetGoUrl(ModuleType,ModuleId,ModuleDir,ModuleFileName)
- If SiteHtml=0 Then
- Select Case ModuleType
- ' Case 0
- ' GetGoUrl="Page.asp?Id=" & ModuleId
- ' Case 1
- ' GetGoUrl="ArticleList.asp?Id=" & ModuleId
- ' Case 2
- ' GetGoUrl="ProductList.asp?Id=" & ModuleId
- ' Case 3
- ' GetGoUrl="Info.asp?Id=" & ModuleId
- ' Case 4
- ' GetGoUrl="GBook.asp?Id=" & ModuleId
- ' Case 6
- ' GetGoUrl="Job.asp"
- ' Case 7
- ' GetGoUrl="DownList.asp?Id=" & ModuleId
- Case 0
- GetGoUrl=SiteDir&"?Page"&ModuleId&".html"
- Case 1
- GetGoUrl=SiteDir&"?Article"&ModuleId&"/Index.html"
- Case 2
- GetGoUrl=SiteDir&"?Product"&ModuleId&"/Index.html"
- Case 3
- GetGoUrl=SiteDir&"?Info"&ModuleId&".html"
- Case 4
- GetGoUrl=SiteDir&"?GBook"&ModuleId&".html"
- Case 6
- GetGoUrl=SiteDir&"?Job"&ModuleId&".html"
- Case 7
- GetGoUrl=SiteDir&"?Down"&ModuleId&"/Index.html"
- Case Else
- GetGoUrl="#"
- End Select
- If (ModuleType=1 Or ModuleType=2 Or ModuleType=7) And ModuleDir<>"" Then
- GetGoUrl=SiteDir&"?"&ModuleDir&"/Index.html"
- End If
- If (ModuleType=0 Or ModuleType=3 Or ModuleType=4) And ModuleFileName<>"" Then
- GetGoUrl=SiteDir&"?"&ModuleFileName&".html"
- End If
- ElseIf SiteHtml=1 Then
- Select Case ModuleType
- Case 0
- GetGoUrl=SiteDir&"Page"&ModuleId&".html"
- Case 1
- GetGoUrl=SiteDir&"Article"&ModuleId&"/Index.html"
- Case 2
- GetGoUrl=SiteDir&"Product"&ModuleId&"/Index.html"
- Case 3
- GetGoUrl=SiteDir&"Info"&ModuleId&".html"
- Case 4
- GetGoUrl=SiteDir&"GBook"&ModuleId&".html"
- Case 6
- GetGoUrl=SiteDir&"Job"&ModuleId&".html"
- Case 7
- GetGoUrl=SiteDir&"Down"&ModuleId&"/Index.html"
- Case Else
- GetGoUrl="#"
- End Select
- If (ModuleType=1 Or ModuleType=2 Or ModuleType=7) And ModuleDir<>"" Then
- GetGoUrl=SiteDir&ModuleDir&"/Index.html"
- End If
- If (ModuleType=0 Or ModuleType=3 Or ModuleType=4) And ModuleFileName<>"" Then
- GetGoUrl=SiteDir&ModuleFileName&".html"
- End If
- End If
- End Function
-
- '==============================
- '函 数 名:ShowPageCode
- '作 用:显示页码
- '参 数:链接PageUrl,当前页Nows,记录数AllCount,每页数量Sizes,总页数AllPage
- '==============================
- Public Function ShowPageCode(PageUrl,Nows,AllCount,Sizes,AllPage)
- If Nows>1 Then
- ShowPageCode="<a href="""&Replace(PageUrl,"{Pages}",1)&""">第一页</a>"
- ShowPageCode=ShowPageCode&" "
- ShowPageCode=ShowPageCode&"<a href="""&Replace(PageUrl,"{Pages}",Nows-1)&""">上一页</a>"
- If SiteHtml=1 And SearchStr="" Then
- ShowPageCode=Replace(ShowPageCode,"_1.",".")
- End If
- Else
- ShowPageCode=ShowPageCode&"第一页"
- ShowPageCode=ShowPageCode&" "
- ShowPageCode=ShowPageCode&"上一页"
- End If
- ShowPageCode=ShowPageCode&" "
- If AllPage>Nows Then
- ShowPageCode=ShowPageCode&"<a href="""&Replace(PageUrl,"{Pages}",Nows+1)&""">下一页</a>"
- ShowPageCode=ShowPageCode&" "
- ShowPageCode=ShowPageCode&"<a href="""&Replace(PageUrl,"{Pages}",AllPage)&""">尾页</a>"
- Else
- ShowPageCode=ShowPageCode&"下一页"
- ShowPageCode=ShowPageCode&" "
- ShowPageCode=ShowPageCode&"尾页"
- End If
- TempArr=Split(PageUrl,"{Pages}")
- ShowPageCode=ShowPageCode&" "&Sizes&"条/页 共"&AllPage&"页/"&AllCount&"条 当前第"&Nows&"页 "
- ShowPageCode=ShowPageCode&"<select name=""Change_Page"" id=""Change_Page"" onChange=""window.location.href=this.options[this.selectedIndex].value"">"
- For i=1 To AllPage
- If SiteHtml=1 And SearchStr="" Then
- If i=1 Then
- If i=Nows Then
- ShowPageCode=ShowPageCode&"<option value=""Index.html"" selected=""selected"">第"&i&"页</option>"
- Else
- ShowPageCode=ShowPageCode&"<option value=""Index.html"">第"&i&"页</option>"
- End If
- Else
- If i=Nows Then
- ShowPageCode=ShowPageCode&"<option value="""&Replace(PageUrl,"{Pages}",i)&""" selected=""selected"">第"&i&"页</option>"
- Else
- ShowPageCode=ShowPageCode&"<option value="""&Replace(PageUrl,"{Pages}",i)&""">第"&i&"页</option>"
- End If
- End If
- Else
- If i=Nows Then
- ShowPageCode=ShowPageCode&"<option value="""&Replace(PageUrl,"{Pages}",i)&""" selected=""selected"">第"&i&"页</option>"
- Else
- ShowPageCode=ShowPageCode&"<option value="""&Replace(PageUrl,"{Pages}",i)&""">第"&i&"页</option>"
- End If
- End If
- Next
- ShowPageCode=ShowPageCode&"</select>"
- End Function
- '========================模板引擎区===========================
- '==============================
- '函 数 名:TemplateDo
- '作 用:获取优先处理函数
- '参 数:
- '==============================
- Public Function TemplateDo(TemplateCode)
- Dim ForI,IfI
- ForI=Instr(TemplateCode,"{$For")
- IfI=Instr(TemplateCode,"{$If")
- If ForI=0 And IfI=0 Then
- TemplateDo=TemplateCode
- Exit Function
- End If
- If ForI>0 And IfI>0 Then
- If ForI<IfI Then
- TemplateCode=TemplateFor(TemplateCode)
- Else
- TemplateCode=TemplateIf(TemplateCode)
- End If
- ElseIf ForI>0 Then
- TemplateCode=TemplateFor(TemplateCode)
- ElseIf IfI>0 Then
- TemplateCode=TemplateIf(TemplateCode)
- ELse
- TemplateDo=TemplateCode
- Exit Function
- End If
- Call TemplateDo(TemplateCode)
- TemplateDo=TemplateCode
- End Function
- '==============================
- '函 数 名:TemplateFor
- '作 用:处理For
- '参 数:
- '==============================
- Private Function TemplateFor(TemplateCode)
- Temp=GetFor(TemplateCode)
- TemplateTag=Split(Split(Temp,"{$For(")(1),",")(0)
- TemplatePar=Split(Split(Temp,",")(1),")")(0)
- TemplateBCode=Right(Temp,Len(Temp)-Len("{$For("&TemplateTag&","&TemplatePar&")$}"))
- TemplateBCode=Left(TemplateBCode,Len(TemplateBCode)-8)
- Select Case TemplateTag
- Case "Nav"
- TemplateFor=Replace(TemplateCode,Temp,FkNav(TemplateBCode,TemplatePar))
- Case "ArticleList"
- TemplateFor=Replace(TemplateCode,Temp,FkArticleList(TemplateBCode,TemplatePar))
- Case "ProductList"
- TemplateFor=Replace(TemplateCode,Temp,FkProductList(TemplateBCode,TemplatePar))
- Case "DownList"
- TemplateFor=Replace(TemplateCode,Temp,FkDownList(TemplateBCode,TemplatePar))
- Case "FriendsList"
- TemplateFor=Replace(TemplateCode,Temp,FkFriendsList(TemplateBCode,TemplatePar))
- Case "JobList"
- TemplateFor=Replace(TemplateCode,Temp,FkJobList(TemplateBCode,TemplatePar))
- Case "SubjectList"
- TemplateFor=Replace(TemplateCode,Temp,FkSubjectList(TemplateBCode,TemplatePar))
- Case Else
- TemplateFor=Replace(TemplateCode,Temp,"")
- End Select
- End Function
- '==============================
- '函 数 名:TemplateIf
- '作 用:处理If
- '参 数:
- '==============================
- Private Function TemplateIf(TemplateCode)
- Temp=GetIf(TemplateCode)
- TemplatePar=Split(Split(Temp,"{$If(")(1),")")(0)
- If1=GetIfOne(Temp,"{$If("&TemplatePar&")$}")
- If2=Replace(Temp,If1,"")
- If2=Replace(If2,"{$If("&TemplatePar&")$}","")
- If2=Left(If2,Len(If2)-10)
- If2=Right(If2,Len(If2)-8)
- If If2="{$Null$}" Then
- If2=""
- End If
- TempArr=Split(TemplatePar,",")
- Select Case TempArr(2)
- Case ">"
- If TempArr(0)>TempArr(1) Then
- TemplateIf=Replace(TemplateCode,Temp,If1)
- Else
- TemplateIf=Replace(TemplateCode,Temp,If2)
- End If
- Case "<"
- If TempArr(0)<TempArr(1) Then
- TemplateIf=Replace(TemplateCode,Temp,If1)
- Else
- TemplateIf=Replace(TemplateCode,Temp,If2)
- End If
- Case "="
- If TempArr(0)=TempArr(1) Then
- TemplateIf=Replace(TemplateCode,Temp,If1)
- Else
- TemplateIf=Replace(TemplateCode,Temp,If2)
- End If
- Case "<>"
- If TempArr(0)<>TempArr(1) Then
- TemplateIf=Replace(TemplateCode,Temp,If1)
- Else
- TemplateIf=Replace(TemplateCode,Temp,If2)
- End If
- Case "<="
- If TempArr(0)<=TempArr(1) Then
- TemplateIf=Replace(TemplateCode,Temp,If1)
- Else
- TemplateIf=Replace(TemplateCode,Temp,If2)
- End If
- Case ">="
- If TempArr(0)>=TempArr(1) Then
- TemplateIf=Replace(TemplateCode,Temp,If1)
- Else
- TemplateIf=Replace(TemplateCode,Temp,If2)
- End If
- Case Else
- TemplateIf=Replace(TemplateCode,Temp,"")
- End Select
-
- End Function
-
- '==============================
- '函 数 名:GetFor
- '作 用:获取For字符串
- '参 数:
- '==============================
- Private Function GetFor(TemplateCode)
- Temp=Split(TemplateCode,"{$For")(0)
- Temp=Replace(TemplateCode,Temp,"")
- TempArr=Split(Temp,"{$Next$}")
- GetFor=TempArr(0)&"{$Next$}"
- i=1
- While GetCount(GetFor,"{$For")<>GetCount(GetFor,"{$Next$}")
- GetFor=GetFor&TempArr(i)&"{$Next$}"
- i=i+1
- Wend
- End Function
- '==============================
- '函 数 名:GetIf
- '作 用:获取If字符串
- '参 数:
- '==============================
- Private Function GetIf(TemplateCode)
- Temp=Split(TemplateCode,"{$If")(0)
- Temp=Replace(TemplateCode,Temp,"")
- TempArr=Split(Temp,"{$End If$}")
- GetIf=TempArr(0)&"{$End If$}"
- i=1
- While GetCount(GetIf,"{$If")<>GetCount(GetIf,"{$End If$}")
- GetIf=GetIf&TempArr(i)&"{$End If$}"
- i=i+1
- Wend
- End Function
- '==============================
- '函 数 名:GetIfOne
- '作 用:获取If字符串Else前
- '参 数:
- '==============================
- Private Function GetIfOne(TemplateCode,IfCode)
- TempArr=Split(TemplateCode,"{$Else$}")
- GetIfOne=Replace(TempArr(0),IfCode,"")
- i=1
- While GetCount(GetIfOne,"{$If")<>GetCount(GetIfOne,"{$End If$}")
- GetIfOne=GetIfOne&TempArr(i)
- i=i+1
- Wend
- End Function
- '==============================
- '函 数 名:GetCount
- '作 用:判断字符串中相同字符的个数
- '参 数:
- '==============================
- Private Function GetCount(Strs,Word)
- Dim N1,N2,N3
- N1=Len(Strs)
- N2=Len(Replace(Strs,Word,""))
- N3=Len(Word)
- GetCount=Clng(((N1-N2)/N3))
- End Function
- End Class
- %>