📄 template.asp
字号:
<%
'----------------------------------------------------------
'显示问卷排行的函数
'num:排行榜选取的问卷个数
'jiequ:列表显示截取几个字符
'orderby:排行方式,1:有效问卷数2:问卷访问数3:问卷ID
'kind:1:不包括过期的问卷2:包括过期的问卷
'exp:Get_Survey_Paihang(8,14,2,1)
'----------------------------------------------------------
Function Get_Survey_Paihang(num,jiequ,orderby,kind)
Select Case orderby
Case "1"
orderway="Survey_usehits"
Case "2"
orderway="Survey_hits"
Case "3"
orderway="Survey_id"
End Select
Select Case kind
Case "1"
sql="select top "& num &" Survey_id,Survey_name from [Survey] where Survey_isOpen=true and Survey_isAuditing=true and datediff(""d"",now(),Survey_dateOver)>0 order by "&orderway&" desc"
Case "2"
sql="select top "& num &" Survey_id,Survey_name from [Survey] where Survey_isOpen=true and Survey_isAuditing=true order by "&orderway&" desc"
End Select
rs.open sql,conn,1,1
if rs.eof or rs.bof then
Get_Survey_Paihang="暂时没有问卷"
else
while not rs.eof
if len(rs(1))>cint(jiequ) then
Get_Survey_Paihang=Get_Survey_Paihang&"<li class=""li""><a href=""Survey_Show.asp?Survey_id="&rs(0)&""" title="&rs(1)&" target=""_blank"">"&left(rs(1),jiequ)&"</a></li>"
else
Get_Survey_Paihang=Get_Survey_Paihang&"<li class=""li""><a href=""Survey_Show.asp?Survey_id="&rs(0)&""" title="&rs(1)&" target=""_blank"">"&rs(1)&"</a></li>"
end if
rs.movenext
wend
end if
rs.close
End Function
'----------------------------------------------------------
'显示友情链接的函数
'num:友情链接的个数
'width:logo的宽
'height:logo的高
'orderby:排序方式1:按照Id,2:按照添加日期
'kind:1:以文字方式显示链接,2:显示所有有logo的链接
'exp:FriendLink(8,88,31,1,2)
'----------------------------------------------------------
Function FriendLink(num,width,height,orderby,kind)
Select Case orderby
Case "1"
orderway="Link_id"
Case "2"
orderway="Link_addtime"
End Select
if cint(kind)=1 then
sql="select top "&num&" Link_name,Link_info,Link_imgurl,Link_url from [FriendLink] where Link_state=true order by "&orderway&" desc"
rs.open sql,conn,1,1
while not rs.eof
FriendLink=FriendLink&"<div class=""friendBox"">"& vbCrLf
FriendLink=FriendLink&"<a href="""&rs(3)&""">"&rs(0)&"</a>"
FriendLink=FriendLink&"</div>"& vbCrLf
rs.movenext
wend
rs.close
else
sql="select top "&num&" Link_name,Link_info,Link_imgurl,Link_url from [FriendLink] where Link_state=true and Link_imgurl<>'' order by "&orderway&" desc"
rs.open sql,conn,1,1
while not rs.eof
FriendLink=FriendLink&"<div class=""friendBox"">"& vbCrLf
FriendLink=FriendLink&"<a href="""& rs(3) &"""><img src="""& rs(2) &""" width="""& width &""" height="""& height &""" alt=""描述:"& rs(1) &"""></a>"& vbCrLf
FriendLink=FriendLink&"<a href="""&rs(3)&""">"&rs(0)&"</a>"& vbCrLf
FriendLink=FriendLink&"</div>"& vbCrLf
rs.movenext
wend
rs.close
end if
End Function
'----------------------------------------------------------
'最新问卷列表
'num:最新问卷列表的个数
'jiequ:最新问卷列表显示胡截取字符数
'orderby:排行方式,1: Survey_id,问卷ID,2:Survey_creatDate,问卷创建日期
'kind:1:不包括过期的问卷2:包括过期的问卷
'exp:New_Survey_List(8,23,2,1)
'----------------------------------------------------------
Function New_Survey_List(num,jiequ,orderby,kind)
Select Case orderby
Case "1"
orderway="Survey_id"
Case "2"
orderway="Survey_creatDate"
End Select
if cint(kind)=2 then
sql="select top "&num&" Survey_id,Survey_name from [Survey] where Survey_isOpen=true and Survey_isAuditing=true order by "&orderway&" desc"
else
sql="select top "&num&" Survey_id,Survey_name from [Survey] where Survey_isOpen=true and Survey_isAuditing=true and datediff(""d"",now(),Survey_dateOver)>0 order by "&orderway&" desc"
end if
application.lock()
rs.open sql,conn,1,1
if rs.eof or bof then
New_Survey_List="暂时没有问卷"
else
while not rs.eof
if len(rs(1))>cint(jiequ) then
New_Survey_List=New_Survey_List&"<li class=""li""><a href=""Survey_Show.asp?Survey_id="&rs(0)&""" target=""_blank"">"&left(rs(1),jiequ)&"</a></li>"& vbCrLf
else
New_Survey_List=New_Survey_List&"<li class=""li""><a href=""Survey_Show.asp?Survey_id="&rs(0)&""" target=""_blank"">"&rs(1)&"</a></li>"& vbCrLf
end if
rs.movenext
wend
end if
application.unlock()
rs.close
End Function
'----------------------------------------------------------
'首页FLASH轮换
'num:轮换数量
'width:宽
'height:高
'text_height:文字高度
'exp:FlashRing(5,250,180,22)
'----------------------------------------------------------
Function FlashRing(num,width,height,text_height)
sql="select top "&num&" Survey_id,Survey_img,Survey_name from [Survey] where Survey_isOpen=true and Survey_isAuditing=true and datediff(""d"",now(),Survey_dateOver)>0 and Survey_img<>'' order by Survey_id desc"
rs.open sql,conn,1,1
FlashRing=FlashRing&"<script type='text/javascript'>"& vbCrLf
FlashRing=FlashRing&"var imgUrl = new Array();"& vbCrLf
FlashRing=FlashRing&"var imgtext = new Array();"& vbCrLf
FlashRing=FlashRing&"var imgLink = new Array();"& vbCrLf
dim i:i=0
while not rs.eof
FlashRing=FlashRing&"imgUrl["&i&"]='"&rs(1)&"';"& vbCrLf
FlashRing=FlashRing&"imgLink["&i&"]='Survey_Show.asp?Survey_id="&rs(0)&"';"& vbCrLf
FlashRing=FlashRing&"imgtext["&i&"]='"&rs(2)&"';"& vbCrLf
i=i+1
rs.movenext
wend
FlashRing=FlashRing&"var pics=imgUrl[0];"& vbCrLf
FlashRing=FlashRing&"var links=imgLink[0];"& vbCrLf
FlashRing=FlashRing&"var texts=imgtext[0];"& vbCrLf
FlashRing=FlashRing&"for(var i=1;i<imgUrl.length;i++){"& vbCrLf
FlashRing=FlashRing&" pics+='|'+imgUrl[i];"& vbCrLf
FlashRing=FlashRing&" links+='|'+imgLink[i];"& vbCrLf
FlashRing=FlashRing&" texts+='|'+imgtext[i];"& vbCrLf
FlashRing=FlashRing&"}"& vbCrLf
FlashRing=FlashRing&"var focus_width="&width&";"& vbCrLf
FlashRing=FlashRing&"var focus_height="& height &";"& vbCrLf
FlashRing=FlashRing&"var text_height="&text_height&";"& vbCrLf
FlashRing=FlashRing&"var swf_height = focus_height+text_height;"& vbCrLf
FlashRing=FlashRing&"document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ focus_width +'"" height=""'+ swf_height +'"">');"& vbCrLf
FlashRing=FlashRing&"document.write('<param name=""allowScriptAccess"" value=""sameDomain"" /><param name=""movie"" value=""Flash/rollpic.swf"" /><param name=""quality"" value=""high"" /><param name=""bgcolor"" value=""#F0F0F0"">');"& vbCrLf
FlashRing=FlashRing&"document.write('<param name=""menu"" value=""false""><param name=wmode value=""opaque"">');"& vbCrLf
FlashRing=FlashRing&"document.write('<param name=""FlashVars"" value=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"">');"& vbCrLf
FlashRing=FlashRing&"document.write('<embed src=""Flash/rollpic.swf"" wmode=""opaque"" FlashVars=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"" menu=""false"" bgcolor=""#F0F0F0"" quality=""high"" width=""'+ focus_width +'"" height=""'+ focus_height +'"" allowScriptAccess=""sameDomain"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" />');"& vbCrLf
FlashRing=FlashRing&"document.write('</object>');"& vbCrLf
FlashRing=FlashRing&"</script>"& vbCrLf
rs.close
End Function
Function Templet_change(Templet_id)
if isnumeric(Templet_id) and Templet_id>0 then
sql="select * from [Templet] where Templet_column=8 and Templet_id=" & Templet_id
rs.open sql,conn,1,3
if not rs.eof then
Templet_change=rs("Templet_content")
else
Templet_change=""
end if
rs.close
else
Templet_change=""
end if
End Function
'----------------------------------------------------------
'问卷列表
'num:分页每个页多少条记录
'orderby:排序方式1:按照Id,2:按照添加日期,3:问卷访问数: 4:有效问卷数
'kind:1:不包括过期的问卷2:包括过期的问卷
'exp:Survey_List(10,3,1)
'----------------------------------------------------------
Function Survey_List(num,orderby,kind)
Select Case orderby
Case 1
orderway="Survey_id"
Case 2
orderway="Survey_creatDate"
Case 3
orderway="Survey_hits"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -