Admin_Admanage.Asp
资源名称:haohj.rar [点击查看]
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:30k
源码类别:
外挂编程
开发平台:
ASP/ASPX
- <!--#include file="setup.asp"-->
- <!--#include file="check.asp"-->
- <!--#include file="../inc/Cls_Admanage.asp"-->
- <%
- If Not CheckAdmin("Advertise") Then
- Server.Transfer("showerr.asp")
- Response.End
- End If
- '=====================================================================
- ' 作者声明:转载请保留版权信息,鄙视不要脸的人
- '=====================================================================
- ' 程序名称:蓝宇网络发布系统
- ' 程序作者:蓝宇 QQ:18159079 ╲、随心゛ QQ:6821845
- ' 文件名称:Admin_Admanage.Asp
- ' 更新日期:2007-6-5
- '=====================================================================
- ' 联系方式:Tel:13203117383,QQ:18159079,hi.baidu.com/hezeyu
- ' 程序开发:蓝宇,╲、随心゛
- ' 官方网站:蓝宇网络(http://hi.baidu.com/hezeyu)
- '=====================================================================
- ' Copyright 2004-2007 蓝宇 - All Rights Reserved.
- '=====================================================================
- Dim isEdit,AdvertiseID
- Admin_header
- Response.Write "<table border=0 align=center cellpadding=2 cellspacing=1 class=tableBorder>" & vbNewLine
- Response.Write " <tr>" & vbNewLine
- Response.Write " <th>广告管理</th></tr>" & vbNewLine
- Response.Write " <tr height=25>" & vbNewLine
- Response.Write " <td " & LeftClass & "><B>操作说明:</B><br> " & vbNewLine
- Response.Write "①、本系统所有广告代码都将生成JS文件,文件位于/adfile/目录下面,请在锁定删除操作后<font color=red>重新生成相关JS</font>文件;<br>" & vbNewLine
- Response.Write "②、你可以任意增加广告位,然后<span Class=style2>复制调用代码</span>在系统的相应位置调用此JS文件即可。" & vbNewLine
- Response.Write " </td>" & vbNewLine
- Response.Write " </tr>" & vbNewLine
- Response.Write " <tr height=25>" & vbNewLine
- Response.Write " <td " & LeftClass & "><B>广告导航:</B> <A HREF='admin_admanage.asp'>广告管理首页</A> |" & vbNewLine
- Response.Write " <a href='admin_admanage.asp?action=add' class=showmeun>添加广告</a> |" & vbNewLine
- Response.Write " <a href='admin_admanage.asp?action=board' class=showmeun>广告位管理</a> |" & vbNewLine
- Response.Write " <a href='admin_admanage.asp?action=create&stype=all&boardid=0'><span style=""color: red;"">生成所有广告的JS文件</span></a>" & vbNewLine
- Response.Write " </td>" & vbNewLine
- Response.Write " </tr>" & vbNewLine
- Response.Write "</table>" & vbNewLine
- Response.Write "<br>" & vbNewLine
- Dim tablestyle
- Dim maxperpage,CurrentPage,Pcount,totalrec,totalnumber
- maxperpage = 30
- totalrec = 0
- Pcount = 1
- CurrentPage = tee5.ChkNumeric(Request("page"))
- If CurrentPage = 0 Then CurrentPage = 1
- Response.Write "<script src=""/js/showpage.js"" type=""text/javascript""></script>" & vbCrLf
- Action = LCase(Request("action"))
- Select Case Trim(Action)
- Case "save"
- Call saveAdvertise
- Case "modify"
- Call modifyAdvertise
- Case "add"
- isEdit = False
- Call EditAdvertise(isEdit)
- Case "edit"
- isEdit = True
- Call EditAdvertise(isEdit)
- Case "del"
- Call DelAdvertise
- Case "board"
- Call boardlist
- Case "saveboard"
- Call saveboard
- Case "delboard"
- Call delboard
- Case "create"
- Call CreateBoardJs
- Case Else
- Call showmain
- End Select
- If FoundErr = True Then
- Gq_Admin.ReturnError(ErrMsg)
- End If
- Admin_footer
- CloseConn
- Sub showmain()
- If LCase(Request("act")) = "lock" Then
- Call isLock
- End If
- Dim intWidth,intHeight
- Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>" & vbNewLine
- Response.Write "<tr>" & vbNewLine
- Response.Write " <th width='20%' nowrap>网站名称</th>" & vbNewLine
- Response.Write " <th width='50%'>广告图片代码</th>" & vbNewLine
- Response.Write " <th width='10%' nowrap> 广告性质 </th>" & vbNewLine
- Response.Write " <th width='10%' nowrap> 操作选项 </th>" & vbNewLine
- Response.Write " <th width='10%' nowrap>状 态</th>" & vbNewLine
- Response.Write "</tr>" & vbNewLine
- SQL = "SELECT * FROM Gq_Adlist ORDER BY id DESC"
- Set Rs = Server.CreateObject("ADODB.Recordset")
- Rs.Open SQL,conn,1,1
- If Rs.bof And Rs.EOF Then
- Response.Write "<tr><td colspan=6 " & CenterClass & ">还没有找到任何广告!</td></tr>"
- Else
- totalrec = Rs.RecordCount
- Pcount = CLng(totalrec / maxperpage) '得到总页数
- If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
- If CurrentPage < 1 Then CurrentPage = 1
- If CurrentPage > Pcount Then CurrentPage = Pcount
- Rs.PageSize = maxperpage
- Rs.AbsolutePage = CurrentPage
- i = 0
- Do While Not Rs.EOF And i < maxperpage
- If Not Response.IsClientConnected Then ResponseEnd
- If Rs("width") > 468 Then
- intWidth = 486
- Else
- intWidth = Rs("width")
- End If
- If Rs("height") > 60 Then
- intHeight = 60
- Else
- intHeight = Rs("height")
- End If
- Response.Write "<tr>"
- Response.Write " <td " & CenterClass & "><a href='?action=edit&id="
- Response.Write Rs("id")
- Response.Write "' title='点击此处修改该广告'>"
- Response.Write Rs("title")
- Response.Write " </a></td>"
- Response.Write " <td " & CenterClass & ">"
- If Rs("flag") = 5 Then
- Response.Write Left(Server.HTMLEncode(Rs("AdCode")),200)
- Else
- If Rs("isFlash") = 1 Then
- Response.Write "<embed src=" & tee5.ReadFileUrl(Rs("picurl")) & " quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" & intwidth & "' height='" & intHeight & "'></embed>"
- Else
- Response.Write "<a href='" & Rs("url") & "' target=_blank><img src='" & tee5.ReadFileUrl(Rs("picurl")) & "' width='" & intwidth & "' height='" & intHeight & "' border=0 alt='" & Rs("Readme") & "'></a>"
- End If
- End If
- Response.Write " </td>"
- Response.Write " <td nowrap " & CenterClass & "><a href='admin_admanage.asp?action=create&boardid=" & Rs("boardid") & "' title='点击生成广告JS文件'>"
- Response.Write ReadBoardName(Rs("boardid"))
- Response.Write "</a><br><br style=""OVERFLOW: hidden; LINE-HEIGHT: 5px""><font color=blue>"
- Select Case Cint(Rs("flag"))
- Case 1
- Response.Write "漂浮广告"
- Case 2
- Response.Write "左边固定广告"
- Case 3
- Response.Write "右边固定广告"
- Case 4
- Response.Write "弹出广告"
- Case 5
- Response.Write "代码广告"
- Case Else
- Response.Write "普通广告"
- End Select
- Response.Write " </font></td>" & vbNewLine
- Response.Write " <td " & CenterClass & "><a href='?action=edit&id=" & Rs("id") & "'>编辑广告</a><br><br style=""OVERFLOW: hidden; LINE-HEIGHT: 5px"">" & vbNewLine
- Response.Write " <a href='?action=del&id=" & Rs("id") & "' onclick=""{if(confirm('广告删除后将不能恢复,您确定要删除该广告吗?')){return true;}return false;}"">删除广告</a></td>" & vbNewLine
- Response.Write " <td " & CenterClass & ">"
- If Rs("IsLock") <> 0 Then
- Response.Write "<a href='?act=lock&isLock=0&id="& Rs("id") &"' title='点击此处解除锁定' onclick=""{if(confirm('您确定要解除锁定吗?')){return true;}return false;}""><font color=red>"
- Response.Write "锁定"
- Response.Write "</font></a>"
- Else
- Response.Write "<a href='?act=lock&isLock=1&id="& Rs("id") &"' title='点击此处锁定广告' onclick=""{if(confirm('您确定要锁定该广告吗?')){return true;}return false;}"">正常</a>"
- End If
- Response.Write " </td>" & vbNewLine
- Response.Write "</tr>" & vbNewLine
- Rs.movenext
- i = i + 1
- If i >= maxperpage Then Exit Do
- Loop
- End If
- Rs.Close:Set Rs = Nothing
- Response.Write "<tr height=20>" & vbNewLine
- Response.Write " <td colspan=6 " & RightClass & ">"
- tee5.ShowListPage CurrentPage,Pcount,totalrec,maxperpage,"","广告管理"
- Response.Write "</td>"
- Response.Write "</tr>" & vbNewLine
- Response.Write "</table>"
- End Sub
- Function ReadBoardName(Byval boardid)
- Dim rsBoard
- Set rsBoard = tee5.Execute("SELECT BoardName FROM Gq_AdBoard WHERE boardid="& boardid)
- If rsBoard.BOF And rsBoard.EOF Then
- Set rsBoard = Nothing
- ReadBoardName = ""
- Exit Function
- End If
- ReadBoardName = rsBoard("BoardName")
- Set rsBoard = Nothing
- End Function
- Public Sub CreateBoardJs()
- Dim rsBoard,sqlBoard,adTeGq
- If LCase(Request("stype")) = "all" Then
- sqlBoard = " ORDER BY boardid DESC"
- Else
- sqlBoard = " WHERE boardid=" & Request("boardid") & " ORDER BY boardid DESC"
- End If
- If Not IsNumeric(Request.Form("boardid")) Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>广告位ID请输入整数!</li>"
- Exit Sub
- End If
- Set rsBoard = tee5.Execute("SELECT boardid FROM Gq_AdBoard " & sqlBoard & "")
- If rsBoard.BOF And rsBoard.EOF Then
- Set rsBoard = Nothing
- Exit Sub
- End If
- Set adTeGq = New Admanage_Cls
- Do While Not rsBoard.EOF
- adTeGq.adboardid = rsBoard("boardid")
- adTeGq.CreateJsFile
- rsBoard.movenext
- Loop
- Set adTeGq = Nothing
- rsBoard.Close:Set rsBoard = Nothing
- Succeed("<li>恭喜您!生成广告JS文件完成。</li>")
- End Sub
- Sub boardlist()
- Dim newboardid
- Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>" & vbNewLine
- Response.Write "<tr>" & vbNewLine
- Response.Write " <th>广告位名称</th>" & vbNewLine
- Response.Write " <th>JS文件名</th>" & vbNewLine
- Response.Write " <th>最多广告数</th>" & vbNewLine
- Response.Write " <th>广告位价格</th>" & vbNewLine
- Response.Write " <th>管理操作</th>" & vbNewLine
- Response.Write "</tr>" & vbNewLine
- SQL = "SELECT boardid,BoardName,AdRate,FileName,Maxads FROM Gq_Adboard ORDER BY boardid ASC"
- Set Rs = Server.CreateObject("ADODB.Recordset")
- Rs.Open SQL,conn,1,1
- If Rs.bof And Rs.EOF Then
- Response.Write "<tr><td colspan=6 " & CenterClass & ">还没有找到任何广告位!</td></tr>"
- Else
- totalrec = Rs.RecordCount
- Pcount = CLng(totalrec / maxperpage) '得到总页数
- If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
- If CurrentPage < 1 Then CurrentPage = 1
- If CurrentPage > Pcount Then CurrentPage = Pcount
- Rs.PageSize = maxperpage
- Rs.AbsolutePage = CurrentPage
- i = 0
- Do While Not Rs.EOF And i < maxperpage
- If Not Response.IsClientConnected Then ResponseEnd
- Response.Write "<form name=form" & Rs("boardid") & " method=post action=admin_admanage.asp>" & vbNewLine
- Response.Write "<tr>" & vbNewLine
- Response.Write "<input type=hidden name=action value='saveboard'>" & vbNewLine
- Response.Write "<input type=hidden name=boardid value='" & Rs("boardid") & "'>" & vbNewLine
- Response.Write "<td " & CenterClass & "><input type=text name=BoardName size=30 value='" & Rs("BoardName") & "'></td>" & vbNewLine
- Response.Write "<td " & CenterClass & "><input type=text name=FileName size=15 value='" & Rs("FileName") & "'></td>" & vbNewLine
- Response.Write "<td " & CenterClass & "><input type=text name=Maxads size=5 value='" & Rs("Maxads") & "'> 条</td>" & vbNewLine
- Response.Write "<td " & CenterClass & "><input type=text name=AdRate size=8 value='" & Rs("AdRate") & "'> 元/月</td>" & vbNewLine
- Response.Write "<td " & CenterClass & "><input class=Button type=submit name=act value='修改'>"
- Response.Write "<input class=Button type=Button value='复制代码' title=""点击复制此广告JS调用代码"" onclick=""copyToClipBoard" & Rs("boardid") & "()"">"
- Response.Write "<input class=Button type=submit name=act value='生成广告JS' onclick=""document.form" & Rs("boardid") & ".action.value='create';"">"
- Response.Write "<input class=Button type=submit name=submit2 value='删除' "
- If Rs("boardid") < 3 Then Response.Write " disabled "
- Response.Write "onclick=""document.form" & Rs("boardid") & ".action.value='delboard';return confirm('本次操作将删除此广告位下所有的广告信息。nn确定要删除当前广告位吗?')""></td>" & vbNewLine
- Response.Write "</tr>" & vbNewLine
- Response.Write "</form>" & vbNewLine%>
- <script language="javascript">
- <!--
- function copyToClipBoard<%=Rs("boardid")%>(){
- var clipBoardContent='<';
- clipBoardContent+='script src=/adfile/<%=Rs("FileName")%>></script>';
- window.clipboardData.setData("Text",clipBoardContent);
- alert("代码复制成功喽!你可以粘贴在模板相应位置使用了!");
- }
- //-->
- </script>
- <%Rs.movenext
- i = i + 1
- If i >= maxperpage Then Exit Do
- Loop
- End If
- Rs.Close:Set Rs = Nothing
- Response.Write "<tr height=20>" & vbNewLine
- Response.Write " <td colspan=6 " & RightClass & ">"
- tee5.ShowListPage CurrentPage,Pcount,totalrec,maxperpage,"","广告管理"
- Response.Write "</td>"
- Response.Write "</tr>" & vbNewLine
- Set Rs = tee5.Execute("SELECT MAX(boardid) FROM Gq_Adboard")
- If Rs.BOF And Rs.EOF Then
- newboardid = 1
- Else
- newboardid = Rs(0) + 1
- End If
- If IsNull(newboardid) Then newboardid = 1
- Rs.close:Set Rs = nothing
- Response.Write "<form name=addform method=post action=admin_admanage.asp>" & vbNewLine
- Response.Write "<input type=hidden name=action value='saveboard'>" & vbNewLine
- Response.Write "<input type=hidden name=boardid value='" & newboardid & "'>" & vbNewLine
- Response.Write "<tr>" & vbNewLine
- Response.Write " <td " & CenterClass & "><input type=text name=BoardName size=30></td>" & vbNewLine
- Response.Write " <td " & CenterClass & "><input type=text name=FileName size=15></td>" & vbNewLine
- Response.Write " <td " & CenterClass & "><input type=text name=Maxads size=5> 条</td>" & vbNewLine
- Response.Write " <td " & CenterClass & "><input type=text name=AdRate size=8> 元/月</td>" & vbNewLine
- Response.Write " <td " & CenterClass & "><input type=submit name=act value='添加广告位' class=Button></td>" & vbNewLine
- Response.Write "</tr>" & vbNewLine
- Response.Write "</form>" & vbNewLine
- Response.Write " <tr height=20>" & vbNewLine
- Response.Write " <td colspan=6 " & LeftClass & ">"
- Response.Write "<b>说明:</b><br>①、广告位名称任意填写;<br>②、JS文件名的扩展名一定要是*.js,文件路径相对于站点根目录下在adfile目录;<br>"
- Response.Write "③、最多广告数,是指在此广告位显示多少条广告;<br>④、广告位价格,供做广告者参考;<br>"
- Response.Write "⑤、JS文件的调用方法:<script src=/adfile/ad.js></script>"
- Response.Write "</td>" & vbNewLine
- Response.Write " </tr>" & vbNewLine
- Response.Write "</table>" & vbNewLine
- End Sub
- Sub saveboard()
- If Trim(Request.Form("BoardName")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>广告位名称不能为空!</li>"
- End If
- If Not IsNumeric(Request.Form("boardid")) Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>广告位ID请输入整数!</li>"
- End If
- If Not IsNumeric(Request.Form("AdRate")) Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>广告位价格请输入整数!</li>"
- End If
- If Not IsNumeric(Request.Form("Maxads")) Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>显示最多广告数请输入整数!</li>"
- End If
- If Trim(Request.Form("FileName")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>JS文件名不能为空!</li>"
- End If
- If LCase(Right(Trim(Request.Form("FileName")),3)) <> ".js" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>请输入正确的JS文件名,扩展名一定要是*.js!</li>"
- End If
- If Founderr = True Then Exit Sub
- If Trim(Request.Form("act")) = "修改" Then
- tee5.Execute ("update Gq_Adboard set BoardName='"& Request.Form("BoardName") & "',FileName='"& Request.Form("FileName") & "',Maxads="& Request.Form("Maxads") & ",AdRate="& Request.Form("AdRate") & " where boardid="& CLng(Request.Form("boardid")))
- Succeed("<li>恭喜您!修改广告位成功</li>")
- Else
- SQL = "Insert into Gq_Adboard (boardid,BoardName,Readme,AdRate,FileName,Maxads,useup) values (" &_
- ""& Request.Form("boardid") & "," &_
- "'"& Request.Form("BoardName") & "'," &_
- "''," &_
- Request.Form("AdRate") & "," &_
- "'"& Request.Form("FileName") & "'," &_
- Request.Form("Maxads") & "," &_
- "0)"
- tee5.Execute(SQL)
- Succeed("<li>恭喜您!添加新的广告位成功</li>")
- End If
- End Sub
- Sub delboard()
- If Not IsNumeric(Request.Form("boardid")) Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>广告位ID请输入整数!</li>"
- Exit Sub
- End If
- On Error Resume Next
- Set Rs = tee5.Execute("SELECT FileName FROM Gq_AdBoard WHERE boardid=" & CLng(Request("boardid")))
- If Not (Rs.BOF And Rs.EOF) Then
- tee5.FileDelete("../adfile/" & Rs("FileName"))
- End If
- Set Rs = Nothing
- tee5.Execute("DELETE FROM Gq_Adboard WHERE boardid="& CLng(Request.Form("boardid")))
- tee5.Execute("DELETE FROM Gq_Adlist WHERE boardid="& CLng(Request.Form("boardid")))
- Response.Redirect Request.ServerVariables("HTTP_REFERER")
- End Sub
- Sub isLock()
- If Trim(Request("id")) = "" Or Trim(Request("isLock")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>Sorry!您选择了错误的系统参数。</li>"
- Exit Sub
- End If
- tee5.Execute ("update Gq_Adlist set isLock = "& CInt(Request("isLock")) &" where id=" & CLng(Request("id")))
- Response.redirect (Request.ServerVariables("HTTP_REFERER"))
- End Sub
- Sub DelAdvertise()
- If Not IsNumeric(Request("id")) Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>ID请输入整数!</li>"
- Exit Sub
- End If
- tee5.Execute("DELETE FROM Gq_Adlist WHERE id="& CLng(Request("id")))
- Response.Redirect (Request.ServerVariables("HTTP_REFERER"))
- End Sub
- Function FrontAdvertise(id)
- Dim Rss, SQL
- SQL = "SELECT TOP 1 id,title FROM Gq_Adlist WHERE id < " & id & " ORDER BY id DESC"
- Set Rss = tee5.Execute(SQL)
- If Rss.EOF And Rss.bof Then
- FrontAdvertise = "已经没有了"
- Else
- FrontAdvertise = "<a href=?action=view&id=" & Rss("id") & ">" & Rss("title") & "</a>"
- End If
- Rss.Close
- Set Rss = Nothing
- End Function
- Function NextAdvertise(id)
- Dim Rss, SQL
- SQL = "SELECT TOP 1 id,title FROM Gq_Adlist WHERE id > " & id & " ORDER BY id ASC"
- Set Rss = tee5.Execute(SQL)
- If Rss.EOF And Rss.bof Then
- NextAdvertise = "已经没有了"
- Else
- NextAdvertise = "<a href=?action=view&id=" & Rss("id") & ">" & Rss("title") & "</a>"
- End If
- Rss.Close
- Set Rss = Nothing
- End Function
- Private Sub EditAdvertise(isEdit)
- Dim EditTitle
- If isEdit Then
- SQL = "select * from Gq_Adlist where id=" & Request("id")
- Set Rs = tee5.Execute(SQL)
- EditTitle = "编辑广告"
- Else
- EditTitle = "添加新的广告"
- End If
- %>
- <script language = JavaScript>
- function showsetting(myform){
- var tab = myform.flag.selectedIndex;
- if(tab==5) {
- flagsetting1.style.display='none';
- flagsetting2.style.display='none';
- flagsetting3.style.display='none';
- flagsetting4.style.display='none';
- flagsetting5.style.display='none';
- flagsetting6.style.display='';
- }
- if(tab==1||tab==2||tab==3||tab==4) {
- flagsetting1.style.display='';
- flagsetting2.style.display = '';
- flagsetting3.style.display='';
- flagsetting4.style.display='';
- flagsetting5.style.display='';
- flagsetting6.style.display='none';
- }
- if(tab==0){
- flagsetting1.style.display='none';
- flagsetting2.style.display = '';
- flagsetting3.style.display='';
- flagsetting4.style.display='';
- flagsetting5.style.display='';
- flagsetting6.style.display='none';
- }
- }
- function flagsetting(n){
- if (n == 1){
- flagsetting3.style.display='';
- flagsetting4.style.display='';
- flagsetting5.style.display='';
- flagsetting6.style.display='none';
- }
- if (n == 2){
- flagsetting3.style.display='none';
- flagsetting4.style.display='none';
- flagsetting5.style.display='';
- flagsetting6.style.display='none';
- }
- }
- </script>
- <%
- Response.Write "<table border=0 align=center cellpadding=2 cellspacing=1 class=tableBorder>"
- Response.Write "<tr>"
- Response.Write " <th colspan=2>" & EditTitle & "</th>"
- Response.Write "</tr>"
- Response.Write "<form name=myform method=post action='admin_admanage.asp'>"
- If isEdit Then
- Response.Write "<input type=""Hidden"" name=""action"" value=""modify"">"
- Response.Write "<input type=""Hidden"" name=""id"" value="""& Request("id") &""">"
- Else
- Response.Write "<input type=""Hidden"" name=""action"" value=""save"">"
- End If
- Response.Write "<tr>"
- Response.Write " <td width='20%' " & RightClass & "><strong>广告位置:</strong></td>"
- Response.Write " <td width='80%' " & LeftClass & "><select name='boardid' id='boardid'>"
- Dim oRs
- Set oRs = tee5.Execute("SELECT boardid,BoardName FROM Gq_Adboard")
- Do While Not oRs.EOF
- Response.Write "<option value="""& oRs("boardid") &""""
- If isEdit Then
- If oRs("boardid") = Rs("boardid") Then Response.Write " selected"
- End If
- Response.Write ">"
- Response.Write oRs("BoardName")
- Response.Write "</option>"
- oRs.movenext
- Loop
- oRs.Close:Set oRs = Nothing
- Response.Write "</select> </td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write "<td " & RightClass & "><strong>广告类型:</strong></td>"
- Response.Write "<td " & LeftClass & "><select name='flag' id='flag' onchange=showsetting(this.form)>"
- Response.Write "<option value='0'"
- If isEdit Then
- If Rs("flag") = 0 Then
- Response.Write " selected"
- End If
- End If
- Response.Write ">普通广告</option>"
- Response.Write "<option value='1'"
- If isEdit Then
- If Rs("flag") = 1 Then
- Response.Write " selected"
- End If
- End If
- Response.Write ">漂浮广告</option>"
- Response.Write "<option value='2'"
- If isEdit Then
- If Rs("flag") = 2 Then
- Response.Write " selected"
- End If
- End If
- Response.Write ">左边固定广告</option>"
- Response.Write "<option value='3'"
- If isEdit Then
- If Rs("flag") = 3 Then
- Response.Write " selected"
- End If
- End If
- Response.Write ">右边固定广告</option>"
- Response.Write "<option value='4'"
- If isEdit Then
- If Rs("flag") = 4 Then
- Response.Write " selected"
- End If
- End If
- Response.Write ">弹出广告</option>"
- Response.Write "<option value='5'"
- If isEdit Then
- If Rs("flag") = 5 Then
- Response.Write " selected"
- End If
- End If
- Response.Write ">代码广告</option>"
- Response.Write "</select></td>"
- Response.Write "</tr>"
- Response.Write "<tr id='flagsetting1'"
- If isEdit Then
- If Rs("flag")<>5 And Rs("flag")<>0 Then
- Response.Write " style=""display:''"""
- Else
- Response.Write " style=""display:'none'"""
- End If
- End If
- Response.Write ">"
- Response.Write " <td " & RightClass & "><strong>广告设置:</strong></td>"
- Response.Write " <td " & LeftClass & ">左边距:<input name='sidemargin' type='text' id='sidemargin' value='"
- If isEdit Then Response.Write Rs("sidemargin") Else Response.Write "10" End If
- Response.Write "' size='6' maxlength='5'>"
- Response.Write " 上边距:<input name='topmargin' type='text' id='topmargin' value='"
- If isEdit Then Response.Write Rs("topmargin") Else Response.Write "100" End If
- Response.Write "' size='6' maxlength='5'></td>"
- Response.Write "</tr>"
- Response.Write "<tr id=flagsetting2"
- If isEdit Then If Rs("flag")=5 Then Response.Write " style=""display:none"""
- Response.Write ">"
- Response.Write "<td " & RightClass & "><strong>图片或FLASH:</strong></td>"
- Response.Write " <td " & LeftClass & "><input type='radio' name='isFlash' value='0' onClick=""flagsetting(1)"""
- If isEdit Then If Rs("isFlash") = 0 Then Response.Write " checked" End If:Else Response.Write " checked" End If
- Response.Write ">图片 "
- Response.Write " <input type='radio' name='isFlash' value='1' onClick=""flagsetting(2)"""
- If isEdit Then If Rs("isFlash") = 1 Then Response.Write " checked"
- Response.Write ">FLASH "
- If isEdit Then
- Response.Write "<input type=checkbox name=UpdateTime value='yes'> 更新成最新广告"
- End If
- Response.Write "</td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write " <td " & RightClass & "><strong>网站名称:</strong></td>"
- Response.Write " <td " & LeftClass & "><input name='title' type='text' id='title' size=30 value='"
- If isEdit Then Response.Write Rs("title")
- Response.Write "'></td>"
- Response.Write "</tr>"
- Response.Write "<tr id=flagsetting3"
- If isEdit Then If Rs("isFlash")=1 Or Rs("flag")=5 Then Response.Write " style=""display:none"""
- Response.Write ">"
- Response.Write " <td " & RightClass & "><strong>网站连接URL:</strong></td>"
- Response.Write " <td " & LeftClass & "><input name='url' type='text' id='url' size=60 value='"
- If isEdit Then Response.Write Rs("url") Else Response.Write "http://" End If
- Response.Write "'></td>"
- Response.Write "</tr>"
- Response.Write "<tr id=flagsetting4"
- If isEdit Then If Rs("isFlash")=1 Or Rs("flag")=5 Then Response.Write " style=""display:none"""
- Response.Write ">"
- Response.Write " <td " & RightClass & "><strong>连接注释:</strong></td>"
- Response.Write " <td " & LeftClass & "><input name='Readme' type='text' id='Readme' size=60 value='"
- If isEdit Then Response.Write Rs("Readme")
- Response.Write "'></td>"
- Response.Write "</tr>"
- Response.Write "<tr id=flagsetting5"
- If isEdit Then If Rs("flag")=5 Then Response.Write " style=""display:none"""
- Response.Write ">"
- Response.Write " <td width='20%' " & RightClass & "><strong>图片或FLASH URL:</strong></td>"
- Response.Write " <td width='80%' " & LeftClass & "><input name='picurl' id=ImageUrl type='text' size=60 value='"
- If isEdit Then Response.Write Rs("picurl")
- Response.Write "'></td>"
- Response.Write "</tr>"
- Response.Write "<tr id=flagsetting6"
- If isEdit Then If Rs("flag") <> 5 Then Response.Write " style=""display:none""" End If:Else Response.Write " style=""display:none""" End If
- Response.Write ">"
- Response.Write " <td " & RightClass & "><strong>广告代码:</strong><br>支持HTML方法</td>"
- Response.Write " <td " & LeftClass & "><textarea name=AdCode rows=10 cols=102>"
- If isEdit Then Response.Write Server.HTMLEncode(Rs("AdCode"))
- Response.Write "</textarea></td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write " <td " & RightClass & "><strong>文件尺寸:</strong></td>"
- Response.Write " <td " & LeftClass & ">宽度:<input name='width' type='text' id='width' size='6' maxlength='5' value='"
- If isEdit Then Response.Write Rs("width") Else Response.Write 100
- Response.Write "'> 像素 * "
- Response.Write " 高度:<input name='height' type='text' id='height' size='6' maxlength='5' value='"
- If isEdit Then Response.Write Rs("height") Else Response.Write 100
- Response.Write "'> 像素 "
- Response.Write " <font color=blue>* 设置图片、FLASH、弹出窗口的大小</font></td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write " <td " & RightClass & "><strong>是否锁定广告:</strong></td>"
- Response.Write " <td " & LeftClass & "><input type='radio' name='isLock' value='0' "
- If isEdit Then : If Rs("isLock") = 0 Then Response.Write " checked" End If:Else Response.Write " checked" End If
- Response.Write "> 否 "
- Response.Write " <input type='radio' name='isLock' value='1'"
- If isEdit Then
- If Rs("isLock") = 1 Then : Response.Write " checked" : End If
- End If
- Response.Write "> 是 "
- Response.Write " </td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write " <td colspan=2 " & CenterClass & ">"
- Response.Write " <input type='button' name='Submit1' onclick='javascript:history.go(-1)' value='返回上一页' class=button> "
- Response.Write " <input type='submit' name='Submit' value='保存广告' class=button>"
- Response.Write "</td>"
- Response.Write "</tr></form>"
- Response.Write "</table>"
- End Sub
- Sub CheckSave()
- If Trim(Request.Form("title")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>网站名称不能为空!</li>"
- End If
- If Trim(Request.Form("flag")) = 5 Then
- If Trim(Request.Form("AdCode")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>请输入广告代码!</li>"
- End If
- Else
- If Trim(Request.Form("picurl")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>URL不能为空!</li>"
- End If
- End IF
- If Trim(Request.Form("height")) = "" Or Trim(Request.Form("width")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>文件尺寸不能为空!</li>"
- End If
- If Trim(Request.Form("sidemargin")) = "" Or Trim(Request.Form("topmargin")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>请设置边距!</li>"
- End If
- If Trim(Request.Form("flag")) = "" Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>请设置广告类型!</li>"
- End If
- End Sub
- Sub SaveAdvertise()
- CheckSave
- If Founderr = True Then Exit Sub
- Set Rs = Server.CreateObject("ADODB.Recordset")
- SQL = "select * from Gq_Adlist where (id is null)"
- Rs.Open SQL,Conn,1,3
- Rs.Addnew
- Rs("boardid") = Trim(Request.Form("boardid"))
- Rs("title") = tee5.ChkFormStr(Request.Form("title"))
- Rs("url") = Trim(Request.Form("url"))
- Rs("picurl") = Trim(Request.Form("picurl"))
- Rs("Readme") = tee5.ChkFormStr(Request.Form("Readme"))
- Rs("AdCode") = Request.Form("AdCode")
- Rs("height") = Trim(Request.Form("height"))
- Rs("width") = Trim(Request.Form("width"))
- Rs("topmargin") = Trim(Request.Form("topmargin"))
- Rs("sidemargin") = Trim(Request.Form("sidemargin"))
- Rs("startime") = Now()
- Rs("flag") = Trim(Request.Form("flag"))
- Rs("isFlash") = Trim(Request.Form("isFlash"))
- Rs("IsLock") = CInt(Request.Form("IsLock"))
- Rs.update
- Rs.Close:Set Rs = Nothing
- Dim adTeGq
- Set adTeGq = New Admanage_Cls
- adTeGq.adboardid = CLng(Request.Form("boardid"))
- adTeGq.CreateJsFile
- Set adTeGq = Nothing
- Succeed("<li>恭喜您!添加新的广告成功。</li>")
- End Sub
- Sub ModifyAdvertise()
- CheckSave
- If Founderr = True Then Exit Sub
- Set Rs = Server.CreateObject("ADODB.Recordset")
- SQL = "SELECT * FROM Gq_Adlist WHERE id = " &CLng( Request("id"))
- Rs.Open SQL,Conn,1,3
- Rs("boardid") = Trim(Request.Form("boardid"))
- Rs("title") = tee5.ChkFormStr(Request.Form("title"))
- Rs("url") = Trim(Request.Form("url"))
- Rs("picurl") = Trim(Request.Form("picurl"))
- Rs("Readme") = tee5.ChkFormStr(Request.Form("Readme"))
- Rs("AdCode") = Request.Form("AdCode")
- Rs("height") = Trim(Request.Form("height"))
- Rs("width") = Trim(Request.Form("width"))
- Rs("topmargin") = Trim(Request.Form("topmargin"))
- Rs("sidemargin") = Trim(Request.Form("sidemargin"))
- If LCase(Request.Form("UpdateTime")) = "yes" Then Rs("startime") = Now()
- Rs("flag") = Trim(Request.Form("flag"))
- Rs("isFlash") = Trim(Request.Form("isFlash"))
- Rs("IsLock") = CInt(Request.Form("IsLock"))
- Rs.update
- AdvertiseID = Rs("id")
- Rs.Close:Set Rs = Nothing
- Dim adTeGq
- Set adTeGq = New Admanage_Cls
- adTeGq.adboardid = CLng(Request.Form("boardid"))
- adTeGq.CreateJsFile
- Set adTeGq = Nothing
- Succeed("<li>恭喜您!修改广告成功。</li>")
- End Sub
- %>