📄 admin_advertisement.asp
字号:
End With
If AdCmd(0) = 40 Then
EL_Common.ShowErrorMsg("指定广告不存在")
Set AdCmd = Nothing
Exit Sub
End If
If UpdateType = 0 Then
AdID = AdCmd(2)
Set AdCmd = Nothing
ComeURL = EL_CurrentScriptName &"?Action=AdList&ZoneID="& ZoneID
Call CreateAdFile(ZoneID)
EL_Common.ShowSuccessMsg("添加广告成功<br>广告名称:"& EL_Common.ServerHTMLEncode(AdName) &"<p>【<a href='"& EL_CurrentScriptName &"?Action=AdList'>广告管理</a>】【<a href='"& EL_CurrentScriptName &"?Action=ModifyAd&AdID="& AdID &"'>修改广告</a>】【<a href='"& EL_CurrentScriptName &"?Action=AddAd&ZoneID="& ZoneID &"'>添加广告</a>】</p>")
ElseIf UpdateType = 1 Then
Set AdCmd = Nothing
Call CreateAdFile(ZoneID)
EL_Common.ShowSuccessMsg("修改广告成功<br>广告名称:"& EL_Common.ServerHTMLEncode(AdName) &"<p>【<a href='"& EL_CurrentScriptName &"?Action=AdList'>广告管理</a>】【<a href='"& EL_CurrentScriptName &"?Action=ModifyAd&AdID="& AdID &"'>修改广告</a>】【<a href='"& EL_CurrentScriptName &"?Action=AddAd&ZoneID="& ZoneID &"'>添加广告</a>】</p>")
Else
Set AdCmd = Nothing
EL_Common.ShowScriptError()
If ComeURL = "" Then ComeURL = "Admin_Advertisement.asp"
Response.Redirect ComeURL
End If
EL_Common.ShowScriptError()
End Sub
Sub SaveJsTemplate()
On Error Resume Next
Dim FSO, JsFile, JsContent, i, FilePath, AdDir
AdDir = GetAdDir()
Set FSO = Server.CreateObject(Object_FSO)
EL_Common.ShowScriptError()
FilePath = Server.MapPath(InstallDir & AdDir &"/JsTemplate") &"\"
For i = 0 To Ubound(ArrZoneType)
JsContent = EL_Common.ELRequest("Template"& i, 1)
Set JsFile = FSO.CreateTextFile(FilePath &"Template"& i &".js", True)
JsFile.Write JsContent
JsFile.Close()
Set JsFile = Nothing
EL_Common.ShowScriptError()
Next
Set FSO = Nothing
EL_Common.ShowScriptError()
EL_Common.ShowSuccessMsg("模板修改成功")
End Sub
Sub SaveZone(UpdateType)
On Error Resume Next
Dim ZoneCmd
Dim ZoneID, ZoneName, Intro, ZoneType, ShowType, ZoneWidth, ZoneHeight, ArrSetting
Dim PopupX, PopupY, PopupType
Dim MoveX, MoveY, MoveSpeed, MoveAdType
Dim PositionX, PositionY
Dim FloatType, FloatX, FloatY
ZoneID = EL_Common.ELRequest("ZoneID", 2)
ZoneName = EL_Common.ELRequest("ZoneName", 1)
Intro = EL_Common.ELRequest("Intro", 1)
ZoneType = EL_Common.ELRequest("ZoneType", 2)
ShowType = EL_Common.ELRequest("ShowType", 2)
ZoneWidth = EL_Common.ELRequest("ZoneWidth", 2)
ZoneHeight = EL_Common.ELRequest("ZoneHeight", 2)
Select Case UpdateType
Case 0, 1:
ArrSetting = ""
Select Case ZoneType
Case 0:
ArrSetting = "0"
Case 1:
PopupX = EL_Common.ELRequest("PopupX", 2)
PopupY = EL_Common.ELRequest("PopupY", 2)
PopupType = EL_Common.ELRequest("PopupType", 2)
ArrSetting = PopupX &","& PopupY &","& PopupType
Case 2:
MoveX = EL_Common.ELRequest("MoveX", 2)
MoveY = EL_Common.ELRequest("MoveY", 2)
MoveSpeed = EL_Common.ELRequest("MoveSpeed", 1)
MoveAdType = EL_Common.ELRequest("MoveAdType", 2)
ArrSetting = MoveX &","& MoveY &","& MoveAdType &","& MoveSpeed
Case 3:
PositionX = EL_Common.ELRequest("PositionX", 2)
PositionY = EL_Common.ELRequest("PositionY", 2)
ArrSetting = PositionX &","& PositionY
Case 4:
FloatType = EL_Common.ELRequest("FloatType", 2)
FloatX = EL_Common.ELRequest("FloatX", 2)
FloatY = EL_Common.ELRequest("FloatY", 2)
ArrSetting = FloatX &","& FloatY &","& FloatType
End Select
Case Else:
ArrSetting = EL_Common.ELRequest("CheckObject", 1)
If ZoneID <> 0 Then ArrSetting = EL_Common.Join2String(ArrSetting, ZoneID, ",")
End Select
Call EL_Common.InitCommand(ZoneCmd, "EL_SP_Zone")
With ZoneCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@UpdateType", 3, 1, 4, UpdateType)
If UpdateType = 0 Then
.Parameters.Append .CreateParameter("@ZoneID", 3, 2, 4)
Else
.Parameters.Append .CreateParameter("@ZoneID", 3, 1, 4, ZoneID)
End If
.Parameters.Append .CreateParameter("@ZoneName", 200, 1, 100, ZoneName)
.Parameters.Append .CreateParameter("@Intro", 200, 1, 255, Intro)
.Parameters.Append .CreateParameter("@ZoneType", 3, 1, 4, ZoneType)
.Parameters.Append .CreateParameter("@ShowType", 3, 1, 4, ShowType)
.Parameters.Append .CreateParameter("@ZoneWidth", 3, 1, 4, ZoneWidth)
.Parameters.Append .CreateParameter("@ZoneHeight", 3, 1, 4, ZoneHeight)
.Parameters.Append .CreateParameter("@ArrSetting", 200, 1, 255, ArrSetting)
.Execute()
End With
If ZoneCmd(0) = 40 Then
Set ZoneCmd = Nothing
EL_Common.ShowErrorMsg("指定版位不存在")
Exit Sub
End If
If UpdateType = 0 Then
ZoneID = ZoneCmd(2)
Set ZoneCmd = Nothing
EL_Common.ShowSuccessMsg("添加版位成功<br>版位名称:"& EL_Common.ServerHTMLEncode(ZoneName) &"<p>【<a href='"& EL_CurrentScriptName &"?Action=ModifyZone&ZoneID="& ZoneID &"'>修改版位</a>】【<a href='"& EL_CurrentScriptName &"?Action=ZoneList'>版位管理</a>】【<a href='"& EL_CurrentScriptName &"?Action=AddZone'>添加版位</a>】</p>")
ElseIf UpdateType = 1 Then
Set ZoneCmd = Nothing
EL_Common.ShowSuccessMsg("修改版位成功<br>版位名称:"& EL_Common.ServerHTMLEncode(ZoneName) &"<p>【<a href='"& EL_CurrentScriptName &"?Action=ModifyZone&ZoneID="& ZoneID &"'>修改版位</a>】【<a href='"& EL_CurrentScriptName &"?Action=ZoneList'>版位管理</a>】【<a href='"& EL_CurrentScriptName &"?Action=AddZone'>添加版位</a>】</p>")
ElseIf UpdateType = 2 Then
Set ZoneCmd = Nothing
EL_Common.ShowScriptError()
If ComeURL = "" Then ComeURL = "Admin_Advertisement.asp"
Response.Redirect ComeURL
ElseIf UpdateType = 3 Then
Set ZoneCmd = Nothing
EL_Common.ShowSuccessMsg("成功清空广告版位")
End If
EL_Common.ShowScriptError()
End Sub
Sub IncludeZone()
On Error Resume Next
Dim ZoneCmd, rsZone
Dim ZoneID, ZoneName, AdDir, AdDateFolder, IncludeJs
ZoneID = EL_Common.ELRequest("ZoneID", 2)
AdDir = GetAdDir()
Call EL_Common.InitCommonCmd(ZoneCmd, rsZone, "EL_Zone", "ZoneName,UpdateTime", "ZoneID="& ZoneID)
rsZone.Close()
If ZoneCmd(0) <> 1 Then
Set rsZone = Nothing
Set ZoneCmd = Nothing
EL_Common.ShowErrorMsg("指定广告不存在")
Exit Sub
End If
rsZone.Open()
ZoneName = rsZone(0)
AdDateFolder = rsZone(1)
rsZone.Close()
Set rsZone = Nothing
Set ZoneCmd = Nothing
AdDateFolder = Year(AdDateFolder) & Right("0"& Month(AdDateFolder), 2)
IncludeJs = "<script language='javascript' src='"& InstallDir & AdDir &"/"& AdDateFolder &"/"& ZoneID &".js'></script>"
Call CreateAdFile(ZoneID)
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td class="top_25"><strong>广告调用 —— <%=ZoneName%></strong></td>
</tr>
<tr>
<td align="center" class="td_ItemName">调用方法:将下面的代码插入到网页中设定的广告位置</td>
</tr>
<tr>
<td align="center" class="td_25">
<textarea name="textarea" rows="10" style="width:80%;"><%=IncludeJs%></textarea>
</td>
</tr>
<tr>
<td align="center" class="td_50"><input type="button" name="Submit7" value="返回上页" onClick="history.back()"></td>
</tr>
</table>
<%
EL_Common.ShowScriptError()
End Sub
Sub PreviewZone()
On Error Resume Next
Dim ZoneCmd, rsZone
Dim ZoneID, ZoneName, AdDir, AdDateFolder
ZoneID = EL_Common.ELRequest("ZoneID", 2)
AdDir = GetAdDir()
Call EL_Common.InitCommonCmd(ZoneCmd, rsZone, "EL_Zone", "ZoneName,UpdateTime", "ZoneID="& ZoneID)
rsZone.Close()
If ZoneCmd(0) <> 1 Then
Set rsZone = Nothing
Set ZoneCmd = Nothing
EL_Common.ShowErrorMsg("指定广告不存在")
Exit Sub
End If
rsZone.Open()
ZoneName = rsZone(0)
AdDateFolder = rsZone(1)
rsZone.Close()
Set rsZone = Nothing
Set ZoneCmd = Nothing
AdDateFolder = Year(AdDateFolder) & Right("0"& Month(AdDateFolder), 2)
Call CreateAdFile(ZoneID)
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td class="top_25"><strong>广告预览 —— <%=ZoneName%></strong></td>
</tr>
<tr>
<td align="center" class="td_ItemName"><a href="javascript:window.location.reload()">刷新页面</a> | <a href="<%=EL_CurrentScriptName%>">返回上页</a></td>
</tr>
<tr>
<td align="center" valign="top" class="td_50" style="height:300px;"><script language="javascript" src="<%=InstallDir & AdDir &"/"& AdDateFolder &"/"& ZoneID &".js"%>"></script></td>
</tr>
</table>
<%
EL_Common.ShowScriptError()
End Sub
Sub ModifyAd()
On Error Resume Next
Dim AdCmd, rsAd
Dim AdID, ArrStyleDisplay(1)
Dim ImageURL, ImageWidth, ImageHeight
Dim FlashURL, FlashWidth, FlashHeight
AdID = EL_Common.ELRequest("AdID", 2)
Call EL_Common.InitCommonCmd(AdCmd, rsAd, "EL_Advertisement", "*", "AdID="& AdID)
rsAd.Close()
If AdCmd(0) <> 1 Then
EL_Common.ShowErrorMsg("指定广告不存在")
Set rsAd = Nothing
Set AdCmd = Nothing
Exit Sub
End If
rsAd.Open()
If rsAd("AdType") = 0 Then
ImageURL = rsAd("AdFileURL")
ImageWidth = rsAd("AdWidth")
ImageHeight = rsAd("AdHeight")
ArrStyleDisplay(0) = ""
ArrStyleDisplay(1) = "display:none;"
Else
FlashURL = rsAd("AdFileURL")
FlashWidth = rsAd("AdWidth")
FlashHeight = rsAd("AdHeight")
ArrStyleDisplay(0) = "display:none;"
ArrStyleDisplay(1) = ""
End If
%>
<script language="javascript">
function AddPicture(strFileName){
var arrName = strFileName.split('.');
var FileExt = arrName[1];
if (FileExt == 'gif' || FileExt == 'jpg' || FileExt == 'jpeg' || FileExt == 'jpe' || FileExt == 'bmp' || FileExt == 'png'){
if(strFileName.indexOf('$$$')>-1){
var arr = strFileName.split('$$$')
document.myform.ImageURL.value = '<%=InstallDir & GetAdDir() &"/Uploadfiles/"%>'+arr[0];
}else{
document.myform.ImageURL.value = '<%=InstallDir & GetAdDir() &"/Uploadfiles/"%>'+strFileName;
}
}
}
function AddFlash(strFileName){
var arrName = strFileName.split('.');
var FileExt = arrName[1];
if (FileExt == 'swf'){
document.myform.FlashURL.value = '<%=InstallDir & GetAdDir() &"/Uploadfiles/"%>'+strFileName;
}
}
function onAdType(value){
for(var i=0;i<2;i++){
getObject("AdType"+ i).style.display = "none";
}
getObject("AdType"+ value).style.display = "";
}
function onAdURLChange(str){
if(str.indexOf(".swf")>-1){
onAdType(1);
getObject("FlashURL").value = str;
document.myform.AdType[1].checked = true;
}else{
onAdType(0);
getObject("ImageURL").value = str;
document.myform.AdType[0].checked = true;
}
}
function Check(frm){
if(frm.AdName.value.trim()==""){
alert("请输入广告名称");
frm.AdName.focus();
return false;
}
if(frm.AdType[0].checked){
if(frm.ImageURL.value.trim()==""){
alert("请输入图片地址");
frm.ImageURL.focus();
return false;
}
var FileExt = frm.ImageURL.value.split(".")[1].toLowerCase();
if(FileExt != 'gif' && FileExt != 'jpg' && FileExt != 'jpeg' && FileExt != 'jpe' && FileExt != 'bmp' && FileExt != 'png'){
alert("图片格式不正确");
frm.ImageURL.focus();
return false;
}
if(frm.ImageWidth.value.trim()==""){
alert("请输入图片宽度");
frm.ImageWidth.focus();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -