📄 ks.publiccls.asp
字号:
G_O_T_S = " target=""" & OpenType & """"
End If
End Function
'--------------------------------------------------------------------------------------------------
'函数名: GetCss
'功 能:取得样式
'参 数: CssName样式名称
'--------------------------------------------------------------------------------------------
Function GetCss(CssName)
If CssName = "" Then GetCss = "" Else GetCss = " class=""" & CssName & """"
End Function
'取得CSS的ID
Function GetCssID(ID)
If ID="" Then GetCssID="" Else GetCssID=" id=""" & ID & """"
End Function
'-------------------------------------------------------------------------------------------------------------
'函数名: G_R_H
'功 能:取得单元格行距
'参 数: RowHeight 默认行距
'-----------------------------------------------------------------------------------------------------------
Function G_R_H(RowHeight)
If IsNumeric(RowHeight) Then G_R_H = RowHeight Else G_R_H = 20
End Function
'----------------------------------------------------------------------------------------------------------------------------
'函数名:GetMenuBg
'功 能:取得表头背景
'参 数: MenuBGType 类型 1 取背景图片 0 取背景颜色, MenuBg 背景颜色的值 如#CCCCCC 或 /Upfies/TITLE_BG.GIF ,ColNumber列数
'---------------------------------------------------------------------------------------------------------------------------
Function GetMenuBg(MenuBgType, MenuBg, ColNumber)
If MenuBgType = 0 Then
If MenuBg = "" Then GetMenuBg = "" Else GetMenuBg = MenuBg
Else
If MenuBg = "" Then
GetMenuBg = "url(" & GetDomain & "Images/Default/MenuBg" & ColNumber & ".Gif)"
Else
If Left(MenuBg, 1) = "/" Or Left(MenuBg, 1) = "\" Then MenuBg = Right(MenuBg, Len(MenuBg) - 1)
If LCase(Left(MenuBg, 4)) = "http" Then MenuBg = MenuBg Else MenuBg = GetDomain & MenuBg
GetMenuBg = "url(" & MenuBg & ")"
End If
End If
End Function
'----------------------------------------------------------------------------------------------------------------------------
'函数名:GetPhotoBorder
'功 能: 取得图片的边框
'参 数: BorderType 类型 1 取透明图片边框 0 取颜色边框, Border 背景颜色的值 如#CCCCCC 或 /Upfies/TITLE_BG.GIF ,ColNumber列数
'----------------------------------------------------------------------------------------------------------------------------
Function GetPhotoBorder(LinkPhotoStr, BorderType, Border)
Dim bgColorStr
If Trim(Border) = "" Then
GetPhotoBorder = LinkPhotoStr:Exit Function
Else
If BorderType = 0 Then
bgColorStr = " bgcolor=""" & Border & """"
GetPhotoBorder = "<table borderColor=#ffffff cellSpacing=1 cellPadding=1 align=center " & bgColorStr & " border=0>" & vbCrLf
GetPhotoBorder = GetPhotoBorder & " <tr>" & vbCrLf
GetPhotoBorder = GetPhotoBorder & " <td valign=center align=middle bgColor=#ffffff>" & LinkPhotoStr & "</td>" & vbCrLf
GetPhotoBorder = GetPhotoBorder & " </tr>" & vbCrLf
GetPhotoBorder = GetPhotoBorder & "</table>" & vbCrLf
Exit Function
Else
If Left(Border, 1) = "/" Or Left(Border, 1) = "\" Then Border = Right(Border, Len(Border) - 1)
If LCase(Left(Border, 4)) = "http" Then
Border = Border
Else
Border = GetDomain & Border
End If
bgColorStr = " style=""background:url(" & Border & ") #FFF no-repeat;"""
GetPhotoBorder = "<table borderColor=#ffffff cellSpacing=0 cellPadding=0 align=center " & bgColorStr & " border=0>" & vbCrLf
GetPhotoBorder = GetPhotoBorder & " <tr>" & vbCrLf
GetPhotoBorder = GetPhotoBorder & " <td valign=center align=middle>" & LinkPhotoStr & "</td>" & vbCrLf
GetPhotoBorder = GetPhotoBorder & " </tr>" & vbCrLf
GetPhotoBorder = GetPhotoBorder & "</table>" & vbCrLf
End If
End If
End Function
'--------------------------------------------------------------------------------------------------------------------
'函数名: GetNavi
'功 能: 取得导航值
'参 数: NaviType 导航类型, NaviStr导航值
'---------------------------------------------------------------------------------------------------------------
Function GetNavi(NaviType, NaviStr)
If NaviType = "0" Then
If NaviStr = "" Then GetNavi = "" Else GetNavi = NaviStr
ElseIf NaviType = "1" Then
If NaviStr <> "" Then GetNavi = "<img src=""" & NaviStr & """ border=""0""/>"
Else
GetNavi = ""
End If
End Function
'---------------------------------------------------------------
'函数名:GetDateStr
'作用:取日期的样式
'参数:AddDate,DateRule,DateAlign,DateCssStr,ByRef ColSpanNum
'---------------------------------------------------------------
Function GetDateStr(AddDate,DateRule,DateAlign,DateCssStr,ByVal ColNumber,ByRef ColSpanNum)
If CStr(DateRule) <> "0" And CStr("DateRule") <> "" Then
Dim NowDate,NowFormatStr
NowDate=Now
If (Year(NowDate) & Month(NowDate) & Day(NowDate)) = (Year(AddDate) & Month(AddDate) & Day(AddDate)) Then
NowFormatStr=" style=""color:red"""
Else
NowFormatStr=""
End If
If Lcase(DateAlign)="left" Then
GetDateStr=" <span" & NowFormatStr & DateCssStr &">" & DateFormat(AddDate, DateRule) & "</span>"
ColSpanNum = 1
Else
GetDateStr="</td><td width=""*"" nowrap align=" & DateAlign & "><span" & NowFormatStr & DateCssStr & ">" & DateFormat(AddDate, DateRule) & "</span>"
ColSpanNum = 2
End If
Else
GetDateStr="":ColSpanNum = 1
End If
If ColNumber>=2 Then ColSpanNum = ColNumber
End Function
'取得日期样式(div+css)
Function GetDCDateStr(AddDate,DateRule,DateCssStr)
If CStr(DateRule) <> "0" And CStr("DateRule") <> "" Then
Dim NowDate,NowFormatStr
NowDate=Now
If (Year(NowDate) & Month(NowDate) & Day(NowDate)) = (Year(AddDate) & Month(AddDate) & Day(AddDate)) Then
NowFormatStr=" style=""color:red"""
Else
NowFormatStr=""
End If
GetDCDateStr=" <span" & NowFormatStr & DateCssStr &">" & DateFormat(AddDate, DateRule) & "</span>"
Else
GetDCDateStr=""
End If
End Function '----------------------------------------------------------------------------------------------------------------------------
'函数名:DateFormat
'功 能:日期格式函数
'参 数: DateStr日期, Types转换类型 '----------------------------------------------------------------------------------------------------------------------------
Function DateFormat(DateStr, Types)
Dim DateString
If IsDate(DateStr) = False Then
DateFormat = "":Exit Function
End If
Select Case CStr(Types)
Case "0"
DateFormat = ""
Exit Function
Case 1,21,41
DateString=Year(DateStr) & "-" & Right("0" & Month(DateStr), 2) & "-" & Right("0" & Day(DateStr), 2)
if Types=21 then
DateString = "(" & DateString &")"
elseIf Types=41 then
DateString = "[" & DateString &"]"
end if
Case 2,22,42
DateString=Year(DateStr) & "." & Right("0" & Month(DateStr), 2) & "." & Right("0" & Day(DateStr), 2)
if Types=22 then
DateString = "(" & DateString &")"
elseIf Types=42 then
DateString = "[" & DateString &"]"
end if
Case 3,23,43
DateString=Year(DateStr) & "/" & Right("0" & Month(DateStr), 2) & "/" & Right("0" & Day(DateStr), 2)
if Types=23 then
DateString = "(" & DateString &")"
elseIf Types=43 then
DateString = "[" & DateString &"]"
end if
Case 4,24,44
DateString=Right("0" & Month(DateStr), 2) & "/" & Right("0" & Day(DateStr), 2) & "/" & Year(DateStr)
if Types=24 then
DateString = "(" & DateString &")"
elseIf Types=44 then
DateString = "[" & DateString &"]"
end if
Case 5,25,45
DateString = Year(DateStr) & "年" & Right("0" & Month(DateStr), 2) & "月"
if Types=25 then
DateString = "(" & DateString &")"
elseIf Types=45 then
DateString = "[" & DateString &"]"
end if
Case 6,26,46
DateString = Year(DateStr) & "年" & Right("0" & Month(DateStr), 2) & "月" & Right("0" & Day(DateStr), 2) & "日"
if Types=26 then
DateString = "(" & DateString &")"
elseIf Types=46 then
DateString = "[" & DateString &"]"
end if
Case 7,27,47
DateString = Right("0" & Month(DateStr), 2) & "." & Right("0" & Day(DateStr), 2) & "." & Year(DateStr)
if Types=27 then
DateString = "(" & DateString &")"
elseIf Types=47 then
DateString = "[" & DateString &"]"
end if
Case 8,28,48
DateString = Right("0" & Month(DateStr), 2) & "-" & Right("0" & Day(DateStr), 2) & "-" & Year(DateStr)
if Types=28 then
DateString = "(" & DateString &")"
elseIf Types=48 then
DateString = "[" & DateString &"]"
end if
Case 9,29,49
DateString = Right("0" & Month(DateStr), 2) & "/" & Right("0" & Day(DateStr), 2)
if Types=29 then
DateString = "(" & DateString &")"
elseIf Types=49 then
DateString = "[" & DateString &"]"
end if
Case 10,30,50
DateString = Right("0" & Month(DateStr), 2) & "." & Right("0" & Day(DateStr), 2)
if Types=30 then
DateString = "(" & DateString &")"
elseIf Types=50 then
DateString = "[" & DateString &"]"
end if
Case 11,31,51
DateString = Right("0" & Month(DateStr), 2) & "月" & Right("0" & Day(DateStr), 2) & "日"
if Types=31 then
DateString = "(" & DateString &")"
elseIf Types=51 then
DateString = "[" & DateString &"]"
end if
Case 12,32,52
DateString = Right("0" & Day(DateStr), 2) & "日" & Right("0" & Hour(DateStr), 2) & "时"
if Types=32 then
DateString = "(" & DateString &")"
elseIf Types=52 then
DateString = "[" & DateString &"]"
end if
Case 13,33,53
DateString = Right("0" & Day(DateStr), 2) & "日" & Right("0" & Hour(DateStr), 2) & "点"
if Types=33 then
DateString = "(" & DateString &")"
elseIf Types=53 then
DateString = "[" & DateString &"]"
end if
Case 14,34,54
DateString = Right("0" & Hour(DateStr), 2) & "时" & Minute(DateStr) & "分"
if Types=34 then
DateString = "(" & DateString &")"
elseIf Types=54 then
DateString = "[" & DateString &"]"
end if
Case 15,35,55
DateString = Right("0" & Hour(DateStr), 2) & ":" & Right("0" & Minute(DateStr), 2)
if Types=35 then
DateString = "(" & DateString &")"
elseIf Types=55 then
DateString = "[" & DateString &"]"
end if
Case 16,36,56
DateString = Right("0" & Month(DateStr), 2) & "-" & Right("0" & Day(DateStr), 2)
if Types=36 then
DateString = "(" & DateString &")"
elseIf Types=56 then
DateString = "[" & DateString &"]"
end if
Case 17,37,57
DateString = Right("0" & Month(DateStr), 2) & "/" & Right("0" & Day(DateStr), 2) &" " &Right("0" & Hour(DateStr), 2)&":"&Right("0" & Minute(DateStr), 2)
if Types=37 then
DateString = "(" & DateString &")"
elseIf Types=57 then
DateString = "[" & DateString &"]"
end if
Case Else
DateString = DateStr
End Select
DateFormat = DateString
End Function
'----------------------------------------------------------------------------------------------------------------------------
'函数名:GetOrigin
'功 能:取得文章来源并附加上链接
'参 数: OriginName名称
'返回值: 形如 <a href="http://www.xinhua.com" target="_blank">新华网</a>
'----------------------------------------------------------------------------------------------------------------------------
Function GetOrigin(OriginName)
Dim RS: Set RS=Server.CreateObject("ADODB.Recordset")
RS.Open "select OriginName,HomePage From KS_Origin Where OriginName='" & Trim(OriginName) & "'", Conn, 1, 1
If RS.EOF Then
GetOrigin = OriginName
Else
If RS("HomePage") <> "" And UCase(Trim(RS("HomePage"))) <> "HTTP://" Then
GetOrigin = "<a href=""" & Trim(RS("HomePage")) & """ target=""_blank"">" & OriginName & "</a>"
Else
GetOrigin = OriginName
End If
End If
RS.Close:Set RS = Nothing
End Function
'----------------------------------------------------------------------------------------------------------------------------
'函数名:GetMoreLink
'功 能:取得更多链接
'参 数: ColNum列数, RowHeight行距, MoreLinkType链接类型, LinkUrl链接地址, OpenTypeStr是否新窗口打开
'----------------------------------------------------------------------------------------------------------------------------
Function GetMoreLink(PrintType,ColNum, RowHeight, MoreLinkType, LinkNameStr, LinkUrl, OpenTypeStr)
If LinkNameStr = "" Then GetMoreLink = "":Exit Function
If PrintType=2 Then
If MoreLinkType = "0" Then
GetMoreLink = "<li><a href=""" & LinkUrl & """" & OpenTypeStr & " > " & LinkNameStr & "</a></li>"
ElseIf MoreLinkType = "1" Then
GetMoreLink = "<li><a href=""" & LinkUrl & """" & OpenTypeStr & " > <img src=""" & LinkNameStr & """ border=""0"" align=""absmiddle""/></a></li>"
Else
GetMoreLink = ""
End If
Else
LinkNameStr = Trim(LinkNameStr):LinkUrl = Trim(LinkUrl)
If CStr(MoreLinkType) = "0" Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -