📄 templet2html.asp
字号:
<!--#include file="../Admin/SiteConfig.asp"-->
<%
function SD_Templet_change(Templet_id)
'on error resume next
sql="select * from [Templet] where SD_templet_id="&Templet_id
rs.open sql,conn,1,1
if not rs.eof then
SD_Templet_change=rs("SD_templet_content")
else
SD_Templet_change="<div style=""text-align:center;"">Templet调用参数id错误!</div>"
end if
rs.close
' if err then
' err.clear
' SD_Templet_change="<div style=""text-align:center;"">Templet参数调用错误!</div>"
' exit function
' end if
end function
'num 列表显示数目
'condition 1 推荐软件 2固顶软件 3软件授权 4根据一级分类
'Cond_Name当condition为3,4时有效, 一级栏目分类名称
'orderby 排序 1 更新时间 2 下载次数 3 软件编号
'exp:SD_Soft_List_Img(15,2,,2)
function SD_Soft_List_Img(num,condition,Cond_Name,orderby) '有图片软件列表
sql="select top "& num &" * from [Softs] where SD_Soft_Del=1 "
Select Case condition
Case 1:sql=sql&"and SD_Soft_Commend=1 "
Case 2:sql=sql&"and SD_Soft_Commend=2 "
Case 3:sql=sql&"and SD_Soft_Right='"& Cond_Name &"' "
Case 4:sql=sql&"and SD_S_Class_Parent_Name='"& Cond_Name &"' "
End Select
Select Case orderby
Case 1:sql=sql&"order by SD_Soft_Update desc"
Case 2:sql=sql&"order by SD_Soft_Times desc"
Case 3:sql=sql&"order by SD_Soft_Id desc"
End Select
'response.Write(sql)
rs.open sql,conn,1,1
if not rs.eof then
i=0
while not rs.eof and i<cint(num)
Soft_Img2=rs("SD_Soft_Img")
if Soft_Img2="" then
Soft_Img2="Noimg.jpg"
end if
SD_Soft_List_Img=SD_Soft_List_Img&"<dl><dt><a href="""& SiteUrl & Directory & Dir_Soft & DateValue(rs("SD_Soft_Update")) &"/Soft_"& rs("SD_Soft_Id") &".html"" target=_blank><img width=""30"" height=""30"" src="""& SiteUrl &"images/Upload/"& Soft_Img2 &""" alt="""& rs("SD_Soft_Name") &""" /></a></dt>"&vbCrlf
SD_Soft_List_Img=SD_Soft_List_Img&"<dd><a href="""& SiteUrl & Directory & Dir_Soft & DateValue(rs("SD_Soft_Update")) &"/Soft_"& rs("SD_Soft_Id") &".html"" target=_blank>" &left(rs("SD_Soft_Name"),instr(rs("SD_Soft_Name"),"【")-1)& "</a>:"&Replacehtml(rs("SD_Soft_Info"))&"</dd>"&vbCrlf
SD_Soft_List_Img=SD_Soft_List_Img&"</dl>"&vbCrlf
rs.movenext
i=i+1
wend
else
SD_Soft_List_Img="<li>没有相关软件</li>"
end if
rs.close
end function
'num 列表显示数目
'condition 1 推荐软件 2固顶软件 3软件版本 4根据二级分类 5一级 6无效
'Cond_Name当condition为3,4,5时有效, 一级栏目分类名称
'orderby 排序 1 更新时间 2 下载次数 3 软件编号 4 月下载排行
'Show_type 1显示时间 2显示分类 3时间分类均显示 4都不显示
'exp:SD_Soft_List(15,5,,1,3)
function SD_Soft_List(num,condition,Cond_Name,orderby,Show_type) '无图片软件列表
sql="select top "& num &" * from [Softs] where SD_Soft_Del=1 "
Select Case condition
Case 1:sql=sql&"and SD_Soft_Commend=1 "
Case 2:sql=sql&"and SD_Soft_Commend=2 "
Case 3:sql=sql&"and SD_Soft_Right='"& Cond_Name &"' "
Case 4:sql=sql&"and S_Class.SD_S_Class_Name='"& Cond_Name &"' "
Case 5:sql=sql&"and S_Class_1.SD_S_Class_Name='"& Cond_Name &"' "
End Select
if condition<2 and Cond_Name<>"" then
sql=sql&"and S_Class.SD_S_Class_Name='"& Cond_Name &"' "
end if
Select Case orderby
Case 1:sql=sql&"order by SD_Soft_Update desc"
Case 2:sql=sql&"order by SD_Soft_Times desc"
Case 3:sql=sql&"order by SD_Soft_Id desc"
Case 4:sql=sql&"order by SD_Soft_Times_m desc"
End Select
rs.open sql,conn,1,1
if not rs.eof then
i=0
while not rs.eof and i<cint(num)
Soft_Img2=rs("SD_Soft_Img")
if Soft_Img2="" then
Soft_Img2="Noimg.jpg"
end if
Select Case Show_type
Case 1:SD_Soft_List=SD_Soft_List&"<li><span class=""today"">"& month(rs("SD_Soft_Update")) &"-"& day(rs("SD_Soft_Update")) &"</span>"&vbCrlf
Case 2:SD_Soft_List=SD_Soft_List&"<li><a href="""& SiteUrl & Directory & Dir_Class &"Class_"& rs("SD_S_Class_Id") &"_1.html"& rs("SD_S_Class_Id") &""" class=""type"">["& rs("SD_S_Class_Name") &"]</a>"&vbCrlf
Case 3:SD_Soft_List=SD_Soft_List&"<li><span class=""today"">"& month(rs("SD_Soft_Update")) &"-"& day(rs("SD_Soft_Update")) &"</span><a href="""& SiteUrl & Directory & Dir_Class &"Class_"& rs("S_Class.SD_S_Class_Id") &"_1.html"" class=""type"">["& rs("S_Class.SD_S_Class_Name") &"]</a>"&vbCrlf
Case 4:SD_Soft_List=SD_Soft_List&"<li>"&vbCrlf
End Select
SD_Soft_Name=rs("SD_Soft_Name")
SD_Soft_Name=replace(SD_Soft_Name,"【说明】"," ")
SD_Soft_List=SD_Soft_List&"<a href="""& SiteUrl & Directory & Dir_Soft & DateValue(rs("SD_Soft_Update")) &"/Soft_"& rs("SD_Soft_Id") &".html"" target=_blank>"& SD_Soft_Name &"</a></li>"&vbCrlf
rs.movenext
i=i+1
wend
else
SD_Soft_List=SD_Soft_List&"<li>没有相关软件</li>"
end if
rs.close
end function
function SD_Topic_Soft_List(num,Cond_Name,orderby,Show_type) '无图片推荐软件列表
set rst=conn.execute("select SD_Topic_Soft,SD_Topic_Name,SD_Topic_Id from [SD_Topic] where SD_Topic_Name='"&Cond_Name&"'")
SD_Topic_Soft=rst(0)
SD_Topic_Name=rst(1)
SD_Topic_Id=rst(2)
rst.close
sql="select top "& num &" * from [Softs] where SD_Soft_Del=1 and SD_Soft_Id in ("&SD_Topic_Soft&") "
Select Case orderby
Case 1:sql=sql&"order by SD_Soft_Update desc"
Case 2:sql=sql&"order by SD_Soft_Times desc"
Case 3:sql=sql&"order by SD_Soft_Id desc"
Case 4:sql=sql&"order by SD_Soft_Times_m desc"
End Select
rs.open sql,conn,1,1
if not rs.eof then
i=0
while not rs.eof and i<cint(num)
Soft_Img2=rs("SD_Soft_Img")
if Soft_Img2="" then
Soft_Img2="Noimg.jpg"
end if
Select Case Show_type
Case 1:SD_Topic_Soft_List=SD_Topic_Soft_List&"<li><span class=""today"">"& month(rs("SD_Soft_Update")) &"-"& day(rs("SD_Soft_Update")) &"</span>"&vbCrlf
Case 2:SD_Topic_Soft_List=SD_Topic_Soft_List&"<li><a href="""& SiteUrl & Directory & Dir_Class &"Class_"& rs("SD_S_Class_Id") &"_1.html"& rs("SD_S_Class_Id") &""" class=""type"">["& rs("SD_S_Class_Name") &"]</a>"&vbCrlf
Case 3:SD_Topic_Soft_List=SD_Topic_Soft_List&"<li><span class=""today"">"& month(rs("SD_Soft_Update")) &"-"& day(rs("SD_Soft_Update")) &"</span><a href="""& SiteUrl & Directory & Dir_Class &"Class_"& rs("S_Class.SD_S_Class_Id") &"_1.html"" class=""type"">["& rs("S_Class.SD_S_Class_Name") &"]</a>"&vbCrlf
Case 4:SD_Topic_Soft_List=SD_Topic_Soft_List&"<li>"&vbCrlf
End Select
SD_Soft_Name=rs("SD_Soft_Name")
SD_Soft_Name=replace(SD_Soft_Name,"【说明】"," ")
SD_Topic_Soft_List=SD_Topic_Soft_List&"<a href="""& SiteUrl & Directory & Dir_Soft & DateValue(rs("SD_Soft_Update")) &"/Soft_"& rs("SD_Soft_Id") &".html"" target=_blank>"& SD_Soft_Name &"</a></li>"&vbCrlf
rs.movenext
i=i+1
wend
else
SD_Topic_Soft_List=SD_Topic_Soft_List&"<li>没有相关软件</li>"
end if
rs.close
end function
function SD_Topic_Info(Cond_Name) '专题介绍
set rst=conn.execute("select SD_Topic_Info from [SD_Topic] where SD_Topic_Name='"&Cond_Name&"'")
SD_Topic_Soft=rst(0)
rst.close
SD_Topic_Info=SD_Topic_Soft
end function
'num 列表显示数目
'orderby 排序 1编号 2 更新时间
'exp:SD_Topic_List(15,2,2)
function SD_Topic_List(num,orderby,S_open) '专题列表
sql="select top "& num &" * from [SD_Topic] where SD_Topic_Parent=0 "
Select Case orderby
Case 1:sql=sql&"order by SD_Topic_Id desc"
Case 2:sql=sql&"order by SD_Topic_Date desc"
End Select
' SD_Topic_List=sql
' exit function
rs.open sql,conn,1,1
if not rs.eof then
i=0
Select Case S_open
Case 2: S_open="target='_blank'"
End Select
while not rs.eof and i<cint(num)
SD_Topic_List=SD_Topic_List&"<li><a href='"& SiteUrl & Directory & Dir_Topic &"Topic_"&rs("SD_Topic_Id")&".html' "&S_open&">"&rs("SD_Topic_Name")&"</a></li>"
rs.movenext
i=i+1
wend
end if
rs.close
end function
'UseFor 1单一软件 2相关软件搜索
'Word UseFor是1则为软件ID 是2 则为软件关键字,多个用","分隔
'compart UseFor是1有效 用于显示时分隔关键字
function SD_Soft_One(UseFor,Word,compart)
if UseFor=1 then
sql="select * from [Softs] where SD_Soft_Id="&Cint(Word)
'debug(sql)
rs.open sql,conn,1,1
if not rs.eof then
SD_Soft_One="<a href="""& SiteUrl & Directory & Dir_Soft & DateValue(rs("SD_Soft_Update")) &"/Soft_"& Word &".html"" target=""_blank"">"& left(rs("SD_Soft_Name"),instr(rs("SD_Soft_Name"),"【")-1) &"</a>"
else
SD_Soft_One="没有该软件"
end if
rs.close
elseif UseFor=2 then
'debug(Word)
WordList = split(Word,"|")
for i = 0 to Ubound(WordList)
SD_Soft_One=SD_Soft_One&"<a href=""#"" onclick=""location.href='"& SiteUrl &"inc/Search2Html.asp?q="& WordList(i) &"'"">"& WordList(i) &"</a>"& compart &vbCrlf
next
end if
end function
function SD_Soft_List_Text(S_Class_Name_1,Cyc_page,Cyc_page_max,P_class_id)
set rst=conn.execute("select Count(*) as SD_SoftsNum from [Softs] where S_Class_1.SD_S_Class_Name='"&S_Class_Name_1&"' or S_Class.SD_S_Class_Name='"&S_Class_Name_1&"'")
SoftsNum = rst("SD_SoftsNum")
rst.close
SD_Soft_List_Text=SD_Soft_List_Text&"<div class=""listitem"">"&vbCrlf
SD_Soft_List_Text=SD_Soft_List_Text&"<h2>当前共有 <strong>"&SoftsNum&" </strong> 个软件列于"& S_Class_Name_1 &"中</h2>"&vbCrlf
sql="select * from [Softs] where S_Class_1.SD_S_Class_Name='"&S_Class_Name_1&"' or S_Class.SD_S_Class_Name='"&S_Class_Name_1&"' order by SD_Soft_Id desc"
'debug(sql)
rs.open sql,conn,1,1
if not rs.eof then
page_size=Page_Size_All
rs.pagesize=page_size
page_now=1
if Cyc_page<>"" then
page_now=Cyc_page
end if
if page_now>rs.pagecount or page_now<0 then
page_now=1
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -