📄 wm.skin.asp
字号:
<!--#include file="WM.Sys_Cook.asp"-->
<%
If CheckAdminFlag("Skin") = False Then Call WRMPS.ErrView("·您没有权限进行此操作",0)
Dim DBPath,sConn,sRs,i
Dim WM_SkinName, WM_SkinFolder, WM_SkinExplain, WM_SkinCss
Dim Path, StyleFileName
Dim WM_Name,WM_SortID,WM_ModuleID,WM_IsDefault,WM_TempPath,WM_Explain
Dim WM_Contents,WM_Type,WM_Taxis,WM_SaveType,WM_ChannelID,WM_ClassID,WM_ParentID,WM_ParentPath,WM_Depth,WM_Child,WM_SkinDir,WM_Sort,WM_Cache
Dim WM_ADBig,WM_Tag,WM_ADBigID,WM_ADSmall,WM_ADSize,WM_AdsType,WM_AreaID,WM_Big,WM_Small,WM_Pic,WM_Text,WM_Url,WM_Code,WM_Size,WM_OpenType,WM_PlayType,WM_Begin,WM_End,WM_SiteTitle,WM_Contact,WM_Remark,WM_Time,WM_Magic
Call WM_Content
Sub sConnOpen()
DBPath = WRMPS.CheckStr(Request("DBPath"), 0)
On Error Resume Next
Set sConn = Server.CreateObject("ADODB.Connection")
sConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(DBPath)
If Err Then Set sConn = Nothing:Err.Clear:Call WRMPS.ErrView("·数据库路径不正确", 0)
End Sub
Sub sConnEnd()
sConn.Close
Set sConn = Nothing
End Sub
Sub WM_Content()
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Content = Content & "<tr class=td2><td><a href=WM.Skin.asp>管理首页</a> | <a href=?Action=AddSkin>添加主题</a> | <a href=?Action=Admit>主题导入</a> | <a href=?Action=Export>主题导出</a></td></tr>" & vbCrLf
Content = Content & "</table>" & vbCrLf
Call DBConnBegin()
Set Rs = Server.CreateObject("ADODB.RecordSet")
Set sRs = Server.CreateObject("ADODB.RecordSet")
Select Case Request("Action")
Case "AdmitSave"
WM_SkinFolder = WRMPS.CheckStr(Request("WM_SkinFolder"), 0)
WM_SkinFolder = Replace(WM_SkinFolder," ","")
If WM_SkinFolder <> "" Then
WM_SkinFolder = Split(WM_SkinFolder,",")
Call sConnOpen()
For i = 0 To Ubound(WM_SkinFolder)
If WM_SkinFolder(i) <> "" Then
Set Rs = Conn.Execute("Select WM_SkinName,WM_SkinExplain From WM_Skin Where WM_SkinFolder='"&WM_SkinFolder(i)&"'")
If Not Rs.Eof Then
Call WRMPS.ErrView("·此模板在目标数据库可能已经存在", 0)
End If
Rs.Close
Set sRs = sConn.Execute("Select WM_SkinName,WM_SkinExplain From WM_Skin Where WM_SkinFolder='"&WM_SkinFolder(i)&"'")
If Not sRs.Eof Then
WM_SkinName = sRs(0)
WM_SkinExplain = sRs(1)
Conn.Execute("INSERT Into WM_Skin(WM_SkinFolder,WM_SkinName,WM_SkinExplain)values('"&WM_SkinFolder(i)&"','"&WM_SkinName&"','"&WM_SkinExplain&"')")
End If
sRs.Close
Set sRs = sConn.Execute("Select WM_Name,WM_SortID,WM_ModuleID,WM_IsDefault,WM_TempPath,WM_Explain,WM_ChannelID From WM_Templates Where WM_SkinFolder='"&WM_SkinFolder(i)&"'")
Do While Not sRs.Eof
WM_Name = sRs(0)
WM_SortID = sRs(1)
WM_ModuleID = sRs(2)
WM_IsDefault = sRs(3)
WM_TempPath = sRs(4)
WM_Explain = sRs(5)
WM_ChannelID = sRs(6)
Conn.Execute("INSERT Into WM_Templates(WM_Name,WM_SkinFolder,WM_SortID,WM_ModuleID,WM_IsDefault,WM_TempPath,WM_Explain,WM_ChannelID)values('"&WM_Name&"','"&WM_SkinFolder(i)&"',"&WM_SortID&","&WM_ModuleID&","&WM_IsDefault&",'"&WM_TempPath&"','"&WM_Explain&"',"&WM_ChannelID&")")
sRs.MoveNext
Loop
sRs.Close
Set sRs = sConn.Execute("Select WM_ClassID,WM_Taxis,WM_ParentID,WM_ParentPath,WM_Depth,WM_Child,WM_Name,WM_Type From WM_LabelSort Where WM_SkinDir='"&WM_SkinFolder(i)&"'")
Do While Not sRs.Eof
WM_ClassID = sRs(0)
WM_Taxis = sRs(1)
WM_ParentID = sRs(2)
WM_ParentPath = sRs(3)
WM_Depth = sRs(4)
WM_Child = sRs(5)
WM_Name = sRs(6)
WM_Type = sRs(7)
Conn.Execute("INSERT Into WM_LabelSort(WM_ClassID,WM_Taxis,WM_ParentID,WM_ParentPath,WM_Depth,WM_Child,WM_Name,WM_Type,WM_SkinDir)values("&WM_ClassID&","&WM_Taxis&","&WM_ParentID&",'"&WM_ParentPath&"',"&WM_Depth&","&WM_Child&",'"&WM_Name&"',"&WM_Type&",'"&WM_SkinFolder(i)&"')")
sRs.MoveNext
Loop
sRs.Close
Set sRs = sConn.Execute("Select WM_Name,WM_Explain,WM_Content,WM_Type,WM_Taxis,WM_SaveType,WM_Sort,WM_Cache From WM_Label Where WM_SkinDir='"&WM_SkinFolder(i)&"'")
Do While Not sRs.Eof
WM_Name = sRs(0)
WM_Explain = sRs(1)
WM_Contents = sRs(2)
WM_Type = sRs(3)
WM_Taxis = sRs(4)
WM_SaveType = sRs(5)
WM_Sort = sRs(6)
WM_Cache = sRs(7)
Rs.Open "Select WM_Name,WM_Explain,WM_Content,WM_Type,WM_Taxis,WM_SaveType,WM_SkinDir,WM_Sort,WM_Cache From WM_Label",Conn,1,3
Rs.AddNew
Rs(0) = WM_Name
Rs(1) = WM_Explain
Rs(2) = WM_Contents
Rs(3) = WM_Type
Rs(4) = WM_Taxis
Rs(5) = WM_SaveType
Rs(6) = WM_SkinFolder(i)
Rs(7) = WM_Sort
Rs(8) = WM_Cache
Rs.Update
Rs.Close
sRs.MoveNext
Loop
sRs.Close
Set sRs = sConn.Execute("Select WM_ADBig,WM_Tag From WM_ADSbig Where WM_SkinDir='"&WM_SkinFolder(i)&"'")
Do While Not sRs.Eof
WM_ADBig = sRs(0)
WM_Tag = sRs(1)
Conn.Execute("INSERT Into WM_ADSbig(WM_ADBig,WM_Tag,WM_SkinDir)values('"&WM_ADBig&"','"&WM_Tag&"','"&WM_SkinFolder(i)&"')")
sRs.MoveNext
Loop
sRs.Close
Set sRs = sConn.Execute("Select WM_ADBigID,WM_Tag,WM_ADSmall,WM_ADSize,WM_AdsType From WM_ADSsmall Where WM_SkinDir='"&WM_SkinFolder(i)&"'")
Do While Not sRs.Eof
WM_ADBigID = sRs(0)
WM_Tag = sRs(1)
WM_ADSmall = sRs(2)
WM_ADSize = sRs(3)
WM_AdsType = sRs(4)
Conn.Execute("INSERT Into WM_ADSsmall(WM_ADBigID,WM_Tag,WM_ADSmall,WM_ADSize,WM_AdsType,WM_SkinDir)values('"&WM_ADBigID&"','"&WM_Tag&"','"&WM_ADSmall&"','"&WM_ADSize&"',"&WM_AdsType&",'"&WM_SkinFolder(i)&"')")
sRs.MoveNext
Loop
sRs.Close
Set sRs = sConn.Execute("Select WM_AreaID,WM_Big,WM_Small,WM_Sort,WM_Type,WM_Pic,WM_Text,WM_Url,WM_Code,WM_Size,WM_OpenType,WM_PlayType,WM_Begin,WM_End,WM_SiteTitle,WM_Name,WM_Contact,WM_Remark,WM_Time,WM_Magic From WM_ADS Where WM_SkinDir='"&WM_SkinFolder(i)&"'")
Do While Not sRs.Eof
WM_AreaID = sRs(0)
WM_Big= sRs(1)
WM_Small= sRs(2)
WM_Sort= sRs(3)
WM_Type= sRs(4)
WM_Pic= sRs(5)
WM_Text= sRs(6)
WM_Url= sRs(7)
WM_Code= sRs(8)
WM_Size= sRs(9)
WM_OpenType= sRs(10)
WM_PlayType= sRs(11)
WM_Begin= sRs(12)
WM_End= sRs(13)
WM_SiteTitle= sRs(14)
WM_Name= sRs(15)
WM_Contact= sRs(16)
WM_Remark= sRs(17)
WM_Time= sRs(18)
WM_Magic= sRs(19)
Rs.Open "Select WM_AreaID,WM_Big,WM_Small,WM_Sort,WM_Type,WM_Pic,WM_Text,WM_Url,WM_Code,WM_Size,WM_OpenType,WM_PlayType,WM_Begin,WM_End,WM_SiteTitle,WM_Name,WM_Contact,WM_Remark,WM_Time,WM_Magic,WM_SkinDir From WM_ADS",Conn,1,3
Rs.AddNew
Rs(0) = WM_AreaID
Rs(1) = WM_Big
Rs(2) = WM_Small
Rs(3) = WM_Sort
Rs(4) = WM_Type
Rs(5) = WM_Pic
Rs(6) = WM_Text
Rs(7) = WM_Url
Rs(8) = WM_Code
Rs(9) = WM_Size
Rs(10) = WM_OpenType
Rs(11) = WM_PlayType
Rs(12) = WM_Begin
Rs(13) = WM_End
Rs(14) = WM_SiteTitle
Rs(15) = WM_Name
Rs(16) = WM_Contact
Rs(17) = WM_Remark
Rs(18) = WM_Time
Rs(19) = WM_Magic
Rs(20) = WM_SkinFolder(i)
Rs.Update
Rs.Close
sRs.MoveNext
Loop
sRs.Close
End If
Next
Call sConnEnd()
End If
Set sRs = Nothing
Set Rs = Nothing
Call WRMPS.ErrView("·模板导入成功<meta http-equiv=refresh content='1;URL=WM.Skin.asp'>", 1)
Case "AdmitTwo"
Call sConnOpen()
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 Class=td1>" & vbCrLf
Content = Content & "<form name=addform method='post' action='?Action=AdmitSave'>" & vbCrLf
Content = Content & "<input name=DBPath type=hidden value=" & WRMPS.CheckStr(Request("DBPath"), 0) & ">" & vbCrLf
Content = Content & "<tr Class=td4><td colspan=5><strong>可导入主题</strong></td></tr>" & vbCrLf
Content = Content & "<tr class=td3 align=center>" & vbCrLf
Content = Content & "<td width='4%'><input name='chkall' type='checkbox' id='chkall' value='select' onclick=""CheckAll(this.form)"" style='border:0'></td>" & vbCrLf
Content = Content & "<td width='15%'>主题名称</td>" & vbCrLf
Content = Content & "<td width='10%'>主题目录</td>" & vbCrLf
Content = Content & "<td width=*>说明</td>" & vbCrLf
Content = Content & "</tr>" & vbCrLf
Set sRs = sConn.Execute("Select WM_SkinName,WM_SkinFolder,WM_SkinExplain,WM_ID from WM_Skin Order By WM_ID Desc")
Do While Not sRs.Eof
Content = Content & "<tr class=td2>" & vbCrLf
Content = Content & "<td align=center><input type=checkbox name=WM_SkinFolder value="&sRs(1)&"></td>" & vbCrLf
Content = Content & "<td>"&sRs(0)&"</td>" & vbCrLf
Content = Content & "<td>"&sRs(1)&"</td>" & vbCrLf
Content = Content & "<td>"&sRs(2)&"</td>" & vbCrLf
Content = Content & "</tr>" & vbCrLf
sRs.MoveNext
Loop
sRs.Close
Set sRs = Nothing
Call sConnEnd()
Content = Content & "<tr class=td2><td colspan=3></td><td><input type=submit name=Submit value='提 交'></td></tr>" & vbCrLf
Content = Content & "<tr><td class=td2 colspan=5><b>注:</b><br>选择要导入的主题后请将此主题相关的图片模板一并考贝至当前站点/Skins/文件夹下相关主题目录</td></tr>" & vbCrLf
Content = Content & "</form>" & vbCrLf
Content = Content & "</table>" & vbCrLf
Case "Admit"
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 Class=td1>" & vbCrLf
Content = Content & "<form name=addform method='post' action='?Action=AdmitTwo'>" & vbCrLf
Content = Content & "<tr Class=td4><td colspan=5><strong>主题导入</strong></td></tr>" & vbCrLf
Content = Content & "<tr class=td3>" & vbCrLf
Content = Content & "<td width='35%'><strong>源数据库路径</strong></td>" & vbCrLf
Content = Content & "<td width='65%'><input name='DBPath' type='text' size=20 style='width:200' value='../Skins/Skin.Mdb'></td>" & vbCrLf
Content = Content & "</tr>" & vbCrLf
Content = Content & "<tr class=td2><td></td><td><input type=submit name=Submit value='提 交'></td></tr>" & vbCrLf
Content = Content & "</form>" & vbCrLf
Content = Content & "</table>" & vbCrLf
Case "ExportSave"
WM_SkinFolder = WRMPS.CheckStr(Request("WM_SkinFolder"), 0)
WM_SkinFolder = Replace(WM_SkinFolder," ","")
If WM_SkinFolder <> "" Then
WM_SkinFolder = Split(WM_SkinFolder,",")
Call sConnOpen()
For i = 0 To Ubound(WM_SkinFolder)
If WM_SkinFolder(i) <> "" Then
Set sRs = sConn.Execute("Select WM_SkinName,WM_SkinExplain From WM_Skin Where WM_SkinFolder='"&WM_SkinFolder(i)&"'")
If Not sRs.Eof Then
Call WRMPS.ErrView("·此模板在目标数据库可能已经存在", 0)
End If
sRs.Close
Set Rs = Conn.Execute("Select WM_SkinName,WM_SkinExplain From WM_Skin Where WM_SkinFolder='"&WM_SkinFolder(i)&"'")
If Not Rs.Eof Then
WM_SkinName = Rs(0)
WM_SkinExplain = Rs(1)
sConn.Execute("INSERT Into WM_Skin(WM_SkinFolder,WM_SkinName,WM_SkinExplain)values('"&WM_SkinFolder(i)&"','"&WM_SkinName&"','"&WM_SkinExplain&"')")
End If
Rs.Close
Set Rs = Conn.Execute("Select WM_Name,WM_SortID,WM_ModuleID,WM_IsDefault,WM_TempPath,WM_Explain,WM_ChannelID From WM_Templates Where WM_SkinFolder='"&WM_SkinFolder(i)&"'")
Do While Not Rs.Eof
WM_Name = Rs(0)
WM_SortID = Rs(1)
WM_ModuleID = Rs(2)
WM_IsDefault = Rs(3)
WM_TempPath = Rs(4)
WM_Explain = Rs(5)
WM_ChannelID = Rs(6)
sConn.Execute("INSERT Into WM_Templates(WM_Name,WM_SkinFolder,WM_SortID,WM_ModuleID,WM_IsDefault,WM_TempPath,WM_Explain,WM_ChannelID)values('"&WM_Name&"','"&WM_SkinFolder(i)&"',"&WM_SortID&","&WM_ModuleID&","&WM_IsDefault&",'"&WM_TempPath&"','"&WM_Explain&"',"&WM_ChannelID&")")
Rs.MoveNext
Loop
Rs.Close
Set Rs = Conn.Execute("Select WM_ClassID,WM_Taxis,WM_ParentID,WM_ParentPath,WM_Depth,WM_Child,WM_Name,WM_Type From WM_LabelSort Where WM_SkinDir='"&WM_SkinFolder(i)&"'")
Do While Not Rs.Eof
WM_ClassID = Rs(0)
WM_Taxis = Rs(1)
WM_ParentID = Rs(2)
WM_ParentPath = Rs(3)
WM_Depth = Rs(4)
WM_Child = Rs(5)
WM_Name = Rs(6)
WM_Type = Rs(7)
sConn.Execute("INSERT Into WM_LabelSort(WM_ClassID,WM_Taxis,WM_ParentID,WM_ParentPath,WM_Depth,WM_Child,WM_Name,WM_Type,WM_SkinDir)values("&WM_ClassID&","&WM_Taxis&","&WM_ParentID&",'"&WM_ParentPath&"',"&WM_Depth&","&WM_Child&",'"&WM_Name&"',"&WM_Type&",'"&WM_SkinFolder(i)&"')")
Rs.MoveNext
Loop
Rs.Close
Set Rs = Conn.Execute("Select WM_Name,WM_Explain,WM_Content,WM_Type,WM_Taxis,WM_SaveType,WM_Sort,WM_Cache From WM_Label Where WM_SkinDir='"&WM_SkinFolder(i)&"'")
Do While Not Rs.Eof
WM_Name = Rs(0)
WM_Explain = Rs(1)
WM_Contents = Rs(2)
WM_Type = Rs(3)
WM_Taxis = Rs(4)
WM_SaveType = Rs(5)
WM_Sort = Rs(6)
WM_Cache = Rs(7)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -