📄 admin_ads.asp
字号:
maosinADcode.style.display="none";
}
}
</script>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="text table_border mainTable">
<tr class="td_titleT">
<td height="22" colspan="2" align="center" valign="middle">编辑广告</td>
</tr>
<form action="?action=maosin_mdfsava" method="post" name="form">
<tr class="td_bgcolor">
<td width="141" height="22" align="right" valign="middle">广告类型:</td>
<td width="*" valign="middle">
<select name="adType" id="adType" onChange="showSetting(this.form)">
<option value="1" <%if rs(8)=1 then%> selected<%end if%>>普通广告</option>
<option value="2" <%if rs(8)=2 then%> selected<%end if%>>代码广告</option>
</select></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">广告名称:</td>
<td valign="middle">
<input name="adTitle" type="text" id="adTitle" size="50" value="<%=rs(1)%>"><input name="id" type="hidden" value="<%=rs(0)%>"></td>
</tr>
<tbody id="maosinP">
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">是否FLASH:</td>
<td valign="middle">
<input type="radio" name="isFlash" value="1" <%if rs(7)=1 then%> checked<%end if%>>
是
<input name="isFlash" type="radio" value="0" <%if rs(7)=0 then%> checked<%end if%>>
否</td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">广告连接地址:</td>
<td valign="middle">
<input name="adUrl" type="text" id="adUrl" size="50" value="<%=rs(2)%>"></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">图片或FLASH地址:</td>
<td valign="middle">
<input name="adPicUrl" type="text" id="adPicUrl" size="50" value="<%=rs(6)%>"></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">图片上传:</td>
<td valign="middle"><iframe height="25" width="100%" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" src="myup.asp?cat=../adfile/&uptype=pic&urlname=adPicUrl" name="upimg"></iframe></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">广告大小:</td>
<td valign="middle">宽度:
<input name="width" type="text" id="width" size="10" value="<%=rs(4)%>">
px * 高度:
<input name="height" type="text" id="height" size="10" value="<%=rs(5)%>">
px</td>
</tr>
</tbody>
<tbody id="maosinADcode">
<tr class="td_bgcolor">
<td align="right" valign="middle">广告代码:</td>
<td valign="middle"> <textarea rows="9" style="width:80%;" name="ADCode" id="ADCode"><%if rs(9)<>"" then response.write(rs(9)) end if%></textarea></td>
</tr>
</tbody>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">广告说明:</td>
<td valign="middle"> <input name="adinfo" type="text" id="adinfo" size="50" value="<%=rs(3)%>"></td>
</tr>
<tr class="td_bgcolor">
<td height="22" align="right" valign="middle">是否使用:</td>
<td valign="middle">
<input name="isOpen" type="radio" value="1"<%if rs(10)=1 then%> checked<%end if%>>
是
<input type="radio" name="isOpen" value="0"<%if rs(10)=0 then%> checked<%end if%>>
否</td>
</tr>
<tr>
<td class="td_titleB" height="22" colspan="2" align="center" valign="middle">
<input type="submit" name="Submit" value="保存编辑">
<input type="reset" name="Submit2" value="重新填写"></td>
</tr>
</form>
</table><script language="javascript">isTran(<%=rs(8)%>);</script>
<%
rs.close
set rs=nothing
End Sub
Sub appsave()
dim adTitle,adType,adUrl,adPicUrl,isFlash,isOpen,adInfo,width,height,ADCode,sql,rs
adTitle=trim(Request("adTitle"))
adType=trim(Request("adType"))
adUrl=trim(Request("adUrl"))
adPicUrl=trim(Request("adPicUrl"))
isFlash=trim(Request("isFlash"))
isOpen=trim(Request("isOpen"))
adInfo=trim(Request("adInfo"))
picwidth=trim(Request("width"))
picheight=trim(Request("height"))
ADCode=trim(Request("adCode"))
adTitle=chkFormStr(adTitle)
adUrl=chkFormStr(adUrl)
adPicUrl=chkFormStr(adPicUrl)
adInfo=chkFormStr(adInfo)
if adUrl="" then adUrl="http://www.maosin.com"
if adPicurl="" then adPicUrl="http://www.maosin.com"
sql="select * from ms_ads where (id is null)"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,1,3
rs.addnew
rs(1)=adTitle
if adType="2" then
rs(9)=ADCode
else
rs(2)=adUrl
rs(4)=picwidth
rs(5)=picheight
rs(6)=adpicurl
rs(7)=isFlash
end if
rs(3)=adInfo
rs(8)=adType
rs(10)=isOpen
rs.update
'if adType="2" then
'sql="insert into ms_ads(adTitle,adInfo,adType,adCode,isOpen) values('"&adTitle&"','"&adInfo&"',"&adType&",'"&adCode&"',"&isOpen&")"
'else
'sql="insert into ms_ads(adTitle,adUrl,adInfo,width,height,adpicurl,isFlash,adType,isOpen) values('"&adTitle&"','"&adUrl&"','"&adInfo&"',"&picwidth&","&picheight&",'"&adpicurl&"',"&isFlash&","&adType&","&isOpen&")"
'end if
'conn.execute(sql)
rs.close
set rs=nothing
adminShowMsg "操作成功信息","<li>恭喜您,已成功添加一条广告信息</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回广告定理首页......</b><meta http-equiv=refresh content=3;url=admin_ads.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
Sub modifysava()
dim id,adTitle,adType,adUrl,adPicUrl,isFlash,isOpen,adInfo,width,height,ADCode,sql
id=trim(Request("id"))
adTitle=trim(Request("adTitle"))
adType=trim(Request("adType"))
adUrl=trim(Request("adUrl"))
adPicUrl=trim(Request("adPicUrl"))
isFlash=trim(Request("isFlash"))
isOpen=trim(Request("isOpen"))
adInfo=trim(Request("adInfo"))
picwidth=trim(Request("width"))
picheight=trim(Request("height"))
ADCode=trim(Request("adCode"))
adTitle=chkFormStr(adTitle)
adUrl=chkFormStr(adUrl)
adPicUrl=chkFormStr(adPicUrl)
adInfo=chkFormStr(adInfo)
sql="select * from ms_ads where id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,1,3
rs(1)=adTitle
if adType="2" then
rs(9)=ADCode
else
rs(2)=adUrl
rs(4)=picwidth
rs(5)=picheight
rs(6)=adpicurl
rs(7)=isFlash
end if
rs(3)=adInfo
rs(8)=adType
rs(10)=isOpen
rs.update
rs.close
set rs=nothing
'if adType="2" then
'sql="update ms_ads set adTitle='"&adTitle&"',adInfo='"&adInfo&"',adType="&adType&",adCode='"&adCode&"',isOpen="&isOpen&" where id="&id
'else
'sql="update ms_ads set adTitle='"&adTitle&"',adUrl='"&adUrl&"',adInfo='"&adInfo&"',width="&picwidth&",height="&picheight&",adpicurl='"&adpicurl&"',isFlash="&isFlash&",adType="&adType&",isOpen="&isOpen&" where id="&id
'end if
conn.execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,广告已修改保存成功了</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回广告管理页......</b><meta http-equiv=refresh content=3;url=admin_ads.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
Sub operate()
dim adset,id,sql
adset=trim(Request("adset"))
id=trim(Request("id"))
if adset="0" then
sql="update ms_ads set isOpen=1 where id="&id
elseif adset="1" then
sql="update ms_ads set isOpen=0 where id="&id
end if
conn.execute(sql)
response.redirect request.servervariables("http_referer")
End Sub
'=================================
'功 能:删除电视节目
'函数名:deletechannel()
'================================
Sub deleteAD()
if getPopedom("channelAdmin")=false then
popedomMsg
exit sub
end if
sql="delete from ms_ads where id="&Request.QueryString("id")
conn.execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,已成功删除一条广告信息</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回广告管理页......</b><meta http-equiv=refresh content=3;url=admin_ads.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
exit sub
End Sub
Function getadsType(adType1,adType2)
if adType1=1 then
if adType2=0 then
getAdsType="普通广告(图片)"
elseif adType2=1 then
getAdsType="普通广告(Flash)"
end if
elseif adType1=2 then
getAdsType="文字广告"
end if
End Function
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -