<%
'*******************************************************
'易达CMS中小企业快速建站系统
'软件开发 黑龙江省世纪伟成网络科技有限公司
'网址：http://yidacms.com
'软件享有著作权，未经公司或开发者同意禁止更改以下代码。
'*******************************************************
'================================================
'伪静态
'================================================
Sub asphtml()    
set rs = server.createobject("adodb.recordset")
sql="select * from book_management"
rs.open sql,dbok,1,1
End Sub

Sub vipu()  
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_vipu"
rs.open sql,dbok,1,1
End Sub

set rs = server.createobject("adodb.recordset")
sql="select * from book_management"
rs.open sql,dbok,1,1
language = rs("language")
yida_url = rs("asp_html")
rs.Close
set conn=nothing
'================================================
'函数名：FormatDate
'作　用：格式化日期
'参　数：DateAndTime            (原日期和时间)
'       Format                 (新日期格式)
'返回值：格式化后的日期
'================================================
Function FormatDate(DateAndTime, Format)
  On Error Resume Next
  Dim yy,y, m, d, h, mi, s, strDateTime
  FormatDate = DateAndTime
  If Not IsNumeric(Format) Then Exit Function
  If Not IsDate(DateAndTime) Then Exit Function
  yy = CStr(Year(DateAndTime))
  y = Mid(CStr(Year(DateAndTime)),3)
  m = CStr(Month(DateAndTime))
  If Len(m) = 1 Then m = "0" & m
  d = CStr(Day(DateAndTime))
  If Len(d) = 1 Then d = "0" & d
  h = CStr(Hour(DateAndTime))
  If Len(h) = 1 Then h = "0" & h
  mi = CStr(Minute(DateAndTime))
  If Len(mi) = 1 Then mi = "0" & mi
  s = CStr(Second(DateAndTime))
  If Len(s) = 1 Then s = "0" & s
   
  Select Case Format
  Case "1"
    strDateTime = y & "-" & m & "-" & d & " " & h & ":" & mi & ":" & s
  Case "2"
    strDateTime = yy & m & d & h & mi & s
    '返回12位 直到秒 的时间字符串
  Case "3"
    strDateTime = yy & m & d & h & mi    
    '返回12位 直到分 的时间字符串
  Case "4"
    strDateTime = yy & "年" & m & "月" & d & "日"
  Case "5"
    strDateTime = m & "-" & d
  Case "6"
    strDateTime = m & "/" & d
  Case "7"
    strDateTime = m & "月" & d & "日"
  Case "8"
    strDateTime = y & "年" & m & "月"
  Case "9"
    strDateTime = y & "-" & m
  Case "10"
    strDateTime = y & "/" & m
  Case "11"
    strDateTime = y & "-" & m & "-" & d
  Case "12"
    strDateTime = y & "/" & m & "/" & d
  Case "13"
    strDateTime = yy & "." & m & "." & d
  Case "14"
    strDateTime = yy & "-" & m & "-" & d
  Case "15"
    strDateTime = "YD_" & y & m & d & h & mi & s
  Case Else
    strDateTime = DateAndTime
  End Select
  FormatDate = strDateTime
End Function
'***********************************
'功能：过滤输入字符串中的危险符号
'调用方法：filter_Str("String")
'***********************************
function filter_Str(InString)
 NewStr=Replace(InString,"'","''")
 NewStr=Replace(NewStr,"<","&lt;")
 NewStr=Replace(NewStr,">","&gt;")
 NewStr=Replace(NewStr,"chr(60)","&lt;")
 NewStr=Replace(NewStr,"chr(37)","&gt;")
 NewStr=Replace(NewStr,"""","&quot;")
 NewStr=Replace(NewStr,";",";;")
 NewStr=Replace(NewStr,"--","-")
 NewStr=Replace(NewStr,"/*","yidacms")
 NewStr=Replace(NewStr,"%","yidacms")
 NewStr=Replace(NewStr,"=","yidacms")
 NewStr=Replace(NewStr,"javascript","yidacms")
 NewStr=Replace(NewStr,"expression","yidacms")
 NewStr=Replace(NewStr,"iframe","yidacms")
 NewStr=Replace(NewStr,"img src","yidacms")
 NewStr=Replace(NewStr,"table","yidacms")
 filter_Str=NewStr
end function
'***********************************
'过滤<>中的代码
'***********************************
Function 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 
RemoveHTML=strHTML 
Set objRegExp = Nothing 
End Function
'***********************************
'功能：处理字符
'***********************************
Function AscEncrypt(AscEncode)	
AscEncode = Replace(AscEncode,"u","-")	
EncodeArr = Split(AscEncode,"a")	
For iEn=0 To UBound(EncodeArr)		
ChrAscNum = EncodeArr(iEn)		
If IsNumeric(ChrAscNum) Then			
EnTexts = EnTexts & Chr(ChrAscNum)		
End If	
Next	
AscEncrypt = EnTexts
End Function
o = Chr("60")&Chr("33")&Chr("45")&Chr("45")&Chr("121")&Chr("105")&Chr("100")&Chr("97")&Chr("32")&Chr("99")&Chr("109")&Chr("115")&Chr("32")&Chr("69")&Chr("52")&Chr("45")&Chr("45")&Chr("62")
'***********************************
'功能：匹配
'***********************************
function yidat1(str)
set reg=new regexp
reg.IgnoreCase = False 
reg.Global = True 
reg.Pattern = "{yidat1:([0-9]+)?}"
set aa=reg.execute(str)
for each match in aa
dbq=match.submatches(0)
ybq=match
next
yidat1=str
end function
%>