📄 fun2html.asp
字号:
Select Case templet_str2(0)
Case "SD_Soft_List_Img":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List_Img(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3)))
Case "SD_Soft_List":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3),templet_str_l(4)))
Case "SD_Soft_One":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_One(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case "SD_Soft_List_Text":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List_Text(templet_str_l(0),Cyc,Cyc_Time,S_Class_1))
Case "SD_Class_List_Page":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Class_List_Page(templet_str_l(0)))
Case "SD_Img_Star":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Img_Star(templet_str_l(0)))
Case "SD_S_plugin":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_S_plugin(templet_str_l(0)))
Case "SD_Down_Url":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Down_Url(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case "SD_link_more":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_link_more(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case "SD_FriendLinks":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_FriendLinks(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3),templet_str_l(4)))
Case "SD_SiteInfo":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_SiteInfo(templet_str_l(0)))
Case "SD_Topic_List":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Topic_List(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case else:Templet_content=replace(Templet_content,"{$"&templet_str&"$}",templet_str&"参数错误!")
End Select
wend
file_path = "../"&Directory & Dir_Class &"Class_"&S_Class_1&"_"&Cyc&".html"
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Open
.Charset = "utf-8"
.Position = objStream.Size
.WriteText=Templet_content
.SaveToFile server.mappath(file_path),2
.Close
End With
Set objStream = Nothing
next
rsHtml.movenext
wend
end if
rsHtml.close
if ErrText<>"" then
response.Write(ErrText)
response.End()
else
response.Write("列表已生成!")
response.End()
end if
End Sub
'End 生成分类
'生成软件
Sub CreateSoft(n)
sql="select * from [Templet] where SD_templet_default=1 and SD_templet_type='Text'"
rsq.open sql,conn,1,1
if not rsq.eof then
Templet_content_Soft_Oringial = rsq("SD_templet_content")
else
response.Write "未设置""软件内容""模板!"
response.End()
end if
rsq.close
if not isnumeric(n) then
sqlHtml="select * from [Softs] where SD_Soft_Del=1 and DateValue(SD_Soft_Update)='"&n&"' order by SD_Soft_Id desc"
elseif cint(n)=-1 then
sqlHtml="select * from [Softs] where SD_Soft_Del=1 order by SD_Soft_Id desc"
elseif cint(n)=0 then
sqlHtml="select * from [Softs] where SD_Soft_Del=1 and SD_Soft_Html=0 order by SD_Soft_Id desc"
end if
'debug(sqlHtml)
rsHtml.open sqlHtml,conn,1,1
if not rsHtml.eof then
while not rsHtml.eof
'初始化模板内容
Templet_content = Templet_content_Soft_Oringial
'debug(Templet_content)
'读取结束
Soft_Id=rsHtml("SD_Soft_Id")
Soft_Name=rsHtml("SD_Soft_Name")
Soft_Class_Parent_Name=rsHtml("S_Class_1.SD_S_Class_Name")
Soft_Class_Name=rsHtml("S_Class.SD_S_Class_Name")
Soft_Class_Id=rsHtml("S_Class.SD_S_Class_Id")
Soft_Class_Parent_Id=rsHtml("S_Class_1.SD_S_Class_Id")
Soft_Size=rsHtml("SD_Soft_Size")
Soft_Language=rsHtml("SD_Soft_Language")
Soft_Class=rsHtml("SD_Soft_Class")
Soft_Right=rsHtml("SD_Soft_Right")
Soft_Level=rsHtml("SD_Soft_Level")
Soft_Update=rsHtml("SD_Soft_Update")
Soft_Developer=rsHtml("SD_Soft_Developer")
Soft_Operation=rsHtml("SD_Soft_Operation")
Soft_Level=rsHtml("SD_Soft_Level")
Soft_Annex=rsHtml("SD_Soft_Annex")
Soft_Info=rsHtml("SD_Soft_Info")
Soft_Img=rsHtml("SD_Soft_Img")
Soft_Url=rsHtml("SD_Soft_Url")
SD_Soft_Update=rsHtml("SD_Soft_Update")
Soft_Name1 = left(Soft_Name,instr(Soft_Name,"【")-1)
Soft_Name2 = mid(Soft_Name,instr(Soft_Name,"【")+1,instr(Soft_Name,"】")-instr(Soft_Name,"【")-1)
Soft_Name3 = right(Soft_Name,len(Soft_Name)-instr(Soft_Name,"】"))
'生成日期文件夹
CheckAndCreateFolder("../"&Directory&Dir_Soft&DateValue(SD_Soft_Update))
'设置已生成标志
conn.execute("update [Soft] set SD_Soft_Html=1 where SD_Soft_Id="&Soft_Id)
while cint(InStr(Templet_content,"{$Templet("))>0
Templet_str=mid(Templet_content,cint(InStr(Templet_content,"{$Templet("))+2,cint(InStr(Templet_content,")Templet$}"))-cint(InStr(Templet_content,"{$Templet("))-2)
Templet_content=replace(Templet_content,"{$"&Templet_str&")Templet$}",SD_Templet_change(replace(Templet_str,"Templet(","")))
wend
'基本标签替换
Templet_content=replace(Templet_content,"{$HomePage$}","{$SiteUrl$}{$Directory$}{$Dir_Index$}index.html")
Templet_content=replace(Templet_content,"{$DowuHomeUrl$}","{$SiteUrl$}{$Directory$}{$Dir_Class$}ClassList.html")
Templet_content=replace(Templet_content,"{$P_Class_Url$}","{$SiteUrl$}{$Directory$}{$Dir_Class$}Class_{$Soft_Class_Parent_Id$}_1.html")
Templet_content=replace(Templet_content,"{$Class_Url$}","{$SiteUrl$}{$Directory$}{$Dir_Class$}Class_{$Soft_Class_Id$}_1.html")
Templet_content=replace(Templet_content,"{$SoftUrl$}","{$SiteUrl$}{$Directory$}{$Dir_Soft$}"&DateValue(SD_Soft_Update)&"/Soft_"&Soft_Id&".html")
if Soft_Img<>"" then
Templet_content=replace(Templet_content,"{$Soft_Img$}","<img src='{$SiteUrl$}images/Upload/"&Soft_Img&"' />")
else
Templet_content=replace(Templet_content,"{$Soft_Img$}","")
end if
Templet_content=replace(Templet_content,"{$SearchUrl$}",SiteUrl&"inc/Search2Html.asp")
Templet_content=replace(Templet_content,"{$SiteUrl$}",SiteUrl)
Templet_content=replace(Templet_content,"{$Directory$}",Directory)
Templet_content=replace(Templet_content,"{$Dir_Index$}",Dir_Index)
Templet_content=replace(Templet_content,"{$Dir_Class$}",Dir_Class)
Templet_content=replace(Templet_content,"{$Dir_Soft$}",Dir_Soft)
Templet_content=replace(Templet_content,"{$SiteName$}",SiteName)
Templet_content=replace(Templet_content,"{$SiteLogo$}",SiteLogo)
Templet_content=replace(Templet_content,"{$SiteBanner$}",SiteBanner)
Templet_content=replace(Templet_content,"{$SiteMail$}",SiteMail)
Templet_content=replace(Templet_content,"{$Jquery2Search$}",Jquery2Search)
Templet_content=replace(Templet_content,"{$Soft_Id$}",Soft_Id)
Templet_content=replace(Templet_content,"{$Soft_Name$}",Soft_Name)
Templet_content=replace(Templet_content,"{$Soft_Class_Parent_Name$}",Soft_Class_Parent_Name)
Templet_content=replace(Templet_content,"{$Soft_Class_Name$}",Soft_Class_Name)
Templet_content=replace(Templet_content,"{$Soft_Class_Id$}",Soft_Class_Id)
Templet_content=replace(Templet_content,"{$Soft_Class_Parent_Id$}",Soft_Class_Parent_Id)
Templet_content=replace(Templet_content,"{$Soft_Size$}",Soft_Size)
Templet_content=replace(Templet_content,"{$Soft_Language$}",Soft_Language)
Templet_content=replace(Templet_content,"{$Soft_Class$}",Soft_Class)
Templet_content=replace(Templet_content,"{$Soft_Right$}",Soft_Right)
Templet_content=replace(Templet_content,"{$Soft_Level$}",Soft_Level)
Templet_content=replace(Templet_content,"{$Soft_Update$}",Soft_Update)
Templet_content=replace(Templet_content,"{$Soft_Developer$}",Soft_Developer)
Templet_content=replace(Templet_content,"{$Soft_Operation$}",Soft_Operation)
Templet_content=replace(Templet_content,"{$Soft_Level$}",Soft_Level)
Templet_content=replace(Templet_content,"{$Soft_Annex$}",Soft_Annex)
Templet_content=replace(Templet_content,"{$Soft_Info$}",Soft_Info)
Templet_content=replace(Templet_content,"{$Soft_Name1$}",Soft_Name1)
Templet_content=replace(Templet_content,"{$Soft_Name2$}",Soft_Name2)
Templet_content=replace(Templet_content,"{$Soft_Name3$}",Soft_Name3)
Templet_content=replace(Templet_content,"{$Soft_Url$}",Soft_Url)
'函数替换
'debug(Templet_content)
i=0
while cint(InStr(Templet_content,"{$"))>0
templet_str=mid(Templet_content,cint(InStr(Templet_content,"{$"))+2,cint(InStr(Templet_content,"$}"))-cint(InStr(Templet_content,"{$"))-2)
'exp:templet_str -->SD_Soft_List(15,1,,1,4)
templet_str2 = split(templet_str,"(") 'exp:templet_str2(0) -->SD_Soft_List templet_str2(1) -->15,1,,1,4)
templet_str3 = split(templet_str2(1),")")(0) 'exp:templet_str3 -->15,1,,1,4
templet_str_l = split(templet_str3,",")
Select Case templet_str2(0)
Case "SD_Soft_List_Img":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List_Img(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3)))
Case "SD_Soft_List":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3),templet_str_l(4)))
Case "SD_Soft_One":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_One(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case "SD_Soft_List_Text":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List_Text(templet_str_l(0)))
Case "SD_Class_List_Page":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Class_List_Page(templet_str_l(0)))
Case "SD_Img_Star":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Img_Star(templet_str_l(0)))
Case "SD_S_plugin":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_S_plugin(templet_str_l(0)))
Case "SD_Down_Url":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Down_Url(templet_str_l(0),templet_str_l(1),templet_str_l(2))):
Case "SD_link_more":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_link_more(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case "SD_FriendLinks":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_FriendLinks(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3),templet_str_l(4)))
Case "SD_SiteInfo":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_SiteInfo(templet_str_l(0)))
Case "SD_Topic_List":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Topic_List(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case else:Templet_content=replace(Templet_content,"{$"&templet_str&"$}",templet_str&"参数错误!")
End Select
wend
'debug(Templet_content)
file_path = "../"&Directory&Dir_Soft&DateValue(SD_Soft_Update)&"/Soft_"&Soft_Id&".html"
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Open
.Charset = "utf-8"
.Position = objStream.Size
.WriteText=Templet_content
.SaveToFile server.mappath(file_path),2
.Close
End With
Set objStream = Nothing
rsHtml.movenext
wend
end if
rsHtml.close
response.Write "Soft已生成"
response.End()
End Sub
'End 软件
Sub CreateTopic(op) 'Topic
sql="select * from [Templet] where SD_templet_default=1 and SD_templet_type='Topic'"
if op>0 then
sql="select * from [Templet] where SD_templet_default=1 and SD_templet_type='Topic' and SD_templet_project="&op
end if
rsq.open sql,conn,1,1
if not rsq.eof then
while not rsq.eof
Topic_id = rsq("SD_templet_project")
Templet_content = HTMLDncode(rsq("SD_templet_content"))
while cint(InStr(Templet_content,"{$Templet("))>0
Templet_str=mid(Templet_content,cint(InStr(Templet_content,"{$Templet("))+2,cint(InStr(Templet_content,")Templet$}"))-cint(InStr(Templet_content,"{$Templet("))-2)
Templet_content=replace(Templet_content,"{$"&Templet_str&")Templet$}",SD_Templet_change(replace(Templet_str,"Templet(","")))
wend
'基本标签替换
Templet_content=replace(Templet_content,"{$HomePage$}","{$SiteUrl$}{$Directory$}{$Dir_Index$}index.html")
Templet_content=replace(Templet_content,"{$SearchUrl$}",SiteUrl&"inc/Search2Html.asp")
Templet_content=replace(Templet_content,"{$SiteUrl$}",SiteUrl)
Templet_content=replace(Templet_content,"{$Directory$}",Directory)
Templet_content=replace(Templet_content,"{$Dir_Index$}",Dir_Index)
Templet_content=replace(Templet_content,"{$SiteName$}",SiteName)
Templet_content=replace(Templet_content,"{$SiteLogo$}",SiteLogo)
Templet_content=replace(Templet_content,"{$SiteBanner$}",SiteBanner)
Templet_content=replace(Templet_content,"{$SiteMail$}",SiteMail)
Templet_content=replace(Templet_content,"{$Jquery2Search$}",Jquery2Search)
'函数替换
while cint(InStr(Templet_content,"{$"))>0
templet_str=mid(Templet_content,cint(InStr(Templet_content,"{$"))+2,cint(InStr(Templet_content,"$}"))-cint(InStr(Templet_content,"{$"))-2)
templet_str2 = split(templet_str,"(")
templet_str3 = split(templet_str2(1),")")(0)
templet_str_l = split(templet_str3,",")
Select Case templet_str2(0)
Case "SD_Soft_List_Img":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List_Img(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3)))
Case "SD_Soft_List":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3),templet_str_l(4)))
Case "SD_Soft_One":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_One(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case "SD_Soft_List_Text":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Soft_List_Text(templet_str_l(0)))
Case "SD_Class_List_Page":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Class_List_Page(templet_str_l(0)))
Case "SD_link_more":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_link_more(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case "SD_FriendLinks":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_FriendLinks(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3),templet_str_l(4)))
Case "SD_SiteInfo":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_SiteInfo(templet_str_l(0)))
Case "SD_Topic_Soft_List":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Topic_Soft_List(templet_str_l(0),templet_str_l(1),templet_str_l(2),templet_str_l(3)))
Case "SD_Topic_Info":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Topic_Info(templet_str_l(0)))
Case "SD_Topic_List":Templet_content=replace(Templet_content,"{$"&templet_str&"$}",SD_Topic_List(templet_str_l(0),templet_str_l(1),templet_str_l(2)))
Case else:Templet_content=replace(Templet_content,"{$"&templet_str&"$}",templet_str&"参数错误!")
End Select
wend
file_path = "../"&Directory & Dir_Topic &"Topic_"&Topic_id&".html"
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Open
.Charset = "utf-8"
.Position = objStream.Size
.WriteText=Templet_content
.SaveToFile server.mappath(file_path),2
.Close
End With
Set objStream = Nothing
rsq.movenext
wend
debug("Topic 已生成!")
else
ErrText=ErrText&"没有设置默认""专题""模板!"
end if
rsq.close
End Sub
'End 专题
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -