📄 admin_ads.asp
字号:
<%
end sub
'############################################ 图片广告 ############################################
sub joekoe_chk_handle()
dim sel_type,seltype,sel_id,hdim,hnum,hid,hi,htype
htype=1
sel_type=trim(request.form("sel_type"))
select case sel_type
case "删除"
seltype="delete"
case else
sel_type=""
seltype=""
end select
if joekoe_cms.post_chk()=false or seltype="" then exit sub
sel_id=trim(request.form("sel_id"))
sel_id=replace(sel_id," ","")
hdim=split(sel_id,",")
hnum=ubound(hdim)
for hi=0 to hnum
hid=hdim(hi)
if isnumeric(hid) then
sql="select top 1 asort from ads where aid="&hid
set rs=joekoe_cms.exec(sql,1)
if not rs.eof then call del_file("ads/ads_"&rs(0)&".js",5)
rs.close
call joekoe_cms.exec("delete from ads where aid="&hid,0)
end if
next
erase hdim
action=""
call admin_event(sel_type&" "&(hnum+1)&" 条 "&ntit,0,0)
response.write vbcrlf&"<script language=javascript>alert(""已成功"&sel_type&"了 "&(hnum+1)&" "&ntit&"!"");</script>"
end sub
sub joekoe_chk_edit()
sql="select top 1 * from ads where aid="&id
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,3
if rs.eof then
rs.close
call admin_msg(ntit&"(ID:"&id&")不在存!",pageurl,1)
exit sub
end if
dim asort,atype,asize,awidth,aheight,aname,alink,aurl
call admin_td("添加"&ntit)
if chk() then
asort=code_admin("asort",1,10)
atype=int(request.form("atype"))
asize=trim(request.form("asize"))
awidth=trim(request.form("awidth"))
aheight=trim(request.form("aheight"))
aname=code_admin("aname",1,50)
alink=code_admin("alink",1,100)
aurl=code_admin("aurl",1,100)
if not joekoe_cms.int_true(atype) then atype=1
if int(atype)>3 or int(atype)<1 then atype=1
if var_null(asort)="" or var_null(aname)="" then
rs.close
call admin_error(tit_fir&"代码 和 文字说明 不能为空!")
exit sub
end if
if asize="yes" and (not(isnumeric(awidth)) or not(isnumeric(aheight))) then
rs.close
call admin_error(tit_fir&" 宽 和 高 只能为数字!")
exit sub
end if
rs("atype")=atype
if asize="yes" then
rs("asize")=true
rs("awidth")=awidth
rs("aheight")=aheight
else
rs("asize")=false
end if
rs("aname")=aname
rs("alink")=alink
rs("aurl")=aurl
rs.update
rs.close
call joekoe_ads_file(id)
call admin_msg("成功编辑一条"&ntit,pageurl,1)
exit sub
end if
call form_first()
atype=rs("atype")
%>
<form action='<%response.write pageurl%>action=edit&id=<%response.write id%>' method=post>
<input type=hidden name=chk value='yes'>
<tr><td width='15%'><%response.write tit_fir%>代码:</td><td width='85%'><input type=text name=asort value='<%response.write rs("asort")%>' size=15 maxlength=10><%response.write redx%>区别某一版块,不可修改,如:down_1</td></tr>
<tr><td><%response.write tit_fir%>类型:</td><td><input type=radio name=atype value='1'<%if int(atype)<>2 and int(atype)<>3 then response.write " checked"%>> 图片广告 <input type=radio name=atype value='2'<%if int(atype)=2 then response.write " checked"%>> FLASH广告 <input type=radio name=atype value='3'<%if int(atype)=3 then response.write " checked"%>> 文字广告</td></tr>
<tr><td><%response.write tit_fir%>大小:</td><td><input type=checkbox name=asize value='yes'<%if rs("asize") then response.write " checked"%>> 按固顶像素大小显示 宽:<input type=text name=awidth size=5 maxlength=10 value='<%response.write rs("awidth")%>'> 像素 高:<input type=text name=aheight size=5 maxlength=10 value='<%response.write rs("aheight")%>'> 像素</td></tr>
<tr><td>文字说明:</td><td><input type=text name=aname value='<%response.write rs("aname")%>' size=55 maxlength=50></td></tr>
<tr><td>链接地址:</td><td><input type=text name=alink value='<%response.write rs("alink")%>' size=55 maxlength=100></td></tr>
<tr><td>文件地址:</td><td><input type=text name=aurl value='<%response.write rs("aurl")%>' size=55 maxlength=100></td></tr>
<%
rs.close
call submit_edit()
end sub
sub joekoe_chk_add()
dim asort,atype,asize,awidth,aheight,aname,alink,aurl
call admin_td("添加"&ntit)
if chk() then
asort=code_admin("asort",1,10)
atype=int(request.form("atype"))
asize=trim(request.form("asize"))
awidth=trim(request.form("awidth"))
aheight=trim(request.form("aheight"))
aname=code_admin("aname",1,50)
alink=code_admin("alink",1,100)
aurl=code_admin("aurl",1,100)
if not joekoe_cms.int_true(atype) then atype=1
if int(atype)>3 or int(atype)<1 then atype=1
if var_null(asort)="" or var_null(aname)="" then
call admin_error(tit_fir&"代码 和 文字说明 不能为空!")
exit sub
end if
if asize="yes" and (not(isnumeric(awidth)) or not(isnumeric(aheight))) then
call admin_error(tit_fir&" 宽 和 高 只能为数字!")
exit sub
end if
sql="select top 1 * from ads where asort='"&asort&"'"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,3
if not rs.eof then
rs.close
call admin_error("广告代码(<font class=red>"&asort&"</font>)已存在!请选用其它的代码。")
exit sub
end if
rs.addnew
rs("asort")=asort
rs("atype")=atype
if asize="yes" then
rs("asize")=true
rs("awidth")=awidth
rs("aheight")=aheight
else
rs("asize")=false
end if
rs("aname")=aname
rs("alink")=alink
rs("aurl")=aurl
rs.update
rs.close
call joekoe_ads_file(first_id("ads","aid"))
call admin_msg("成功添加一条新的"&ntit,pageurl,1)
exit sub
end if
call form_first()
%>
<form action='<%response.write pageurl%>action=add' method=post>
<input type=hidden name=chk value='yes'>
<tr><td width='15%'><%response.write tit_fir%>代码:</td><td width='85%'><input type=text name=asort size=15 maxlength=10><%response.write redx%>区别某一版块,不可修改,如:down_1</td></tr>
<tr><td><%response.write tit_fir%>类型:</td><td><input type=radio name=atype value='1' checked> 图片广告 <input type=radio name=atype value='2'> FLASH广告 <input type=radio name=atype value='3'> 文字广告</td></tr>
<tr><td><%response.write tit_fir%>大小:</td><td><input type=checkbox name=asize value='yes'> 按固顶像素大小显示 宽:<input type=text name=awidth size=5 maxlength=10> 像素 高:<input type=text name=aheight size=5 maxlength=10> 像素</td></tr>
<tr><td>文字说明:</td><td><input type=text name=aname size=55 maxlength=50></td></tr>
<tr><td>链接地址:</td><td><input type=text name=alink value='http://' size=55 maxlength=100></td></tr>
<tr><td>文件地址:</td><td><input type=text name=aurl value='ads/' size=55 maxlength=100></td></tr>
<%
call submit_add()
end sub
sub joekoe_ads_file(aid)
dim file_name,asort,atype,atemp,awh
awh=""
sql="select top 1 asort,atype,asize,awidth,aheight,aname,alink,aurl from ads where aid="&aid
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
rs.close
exit sub
end if
asort=rs("asort")
atype=int(rs("atype"))
if rs("asize")=true then awh=" width="&rs("awidth")&" height="&rs("aheight")
select case atype
case 1
atemp="<a href='"&rs("alink")&"' target=_blank><img src='"&rs("aurl")&"' border=0 alt='"&rs("aname")&"'"&awh&"></a>"
case 2
atemp="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'"&awh&">" & _
"<param name=movie value='"&rs("aurl")&"'><param name=quality value=high>" & _
"<embed src='"&rs("aurl")&"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'"&awh&">" & _
"</embed></object>"
case 3
atemp="<a href='"&rs("alink")&"' target=_blank>"&rs("aname")&"</a>"
end select
rs.close
atemp="document.write("""&atemp&""");"
file_name="ads/ads_"&asort&".js"
call create_file(file_name,atemp)
end sub
sub joekoe_chk_view()
dim file_name,asort,atype,atemp,awh
awh=""
sql="select top 1 asort,atype,asize,awidth,aheight,aname,alink,aurl from ads where aid="&id
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
rs.close
call admin_msg(ntit&"(ID:"&id&")不在存!",pageurl,1)
exit sub
end if
call admin_td("浏览"&ntit)
asort=rs("asort")
atype=int(rs("atype"))
if rs("asize")=true then awh=" width="&rs("awidth")&" height="&rs("aheight")
select case atype
case 1
atemp="<a href='"&rs("alink")&"' target=_blank><img src='"&rs("aurl")&"' border=0 alt='"&rs("aname")&"'"&awh&"></a>"
case 2
atemp="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'"&awh&">" & _
"<param name=movie value='"&rs("aurl")&"'><param name=quality value=high>" & _
"<embed src='"&rs("aurl")&"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'"&awh&">" & _
"</embed></object>"
case 3
atemp="<a href='"&rs("alink")&"' target=_blank>"&rs("aname")&"</a>"
end select
rs.close
%>
<tr><td colspan=2 align=center><br><%response.write atemp%><br><br></td></tr>
<tr class=tr1><td colspan=2 align=center height=40><a href='<%response.write pageurl%>action=edit&id=<%response.write id%>'>编辑此<%response.write ntit%></a> <%response.write go_back%></td></tr>
<%
end sub
sub joekoe_chk_main()
dim topic
%>
<form name=sel_form action='<%response.write pageurl%>action=handle' method=post>
<tr align=center>
<td class=td width='7%'>序号</td>
<td class=td width='16%'>广告代码</td>
<td class=td width='14%'>广告类型</td>
<td class=td width='44%'>文字说明</td>
<td class=td width='12%'>编辑</td>
<td class=td width='6%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
sql="select count(aid) from ads"&sql_add
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
rs.close
call format_pagecute()
sql="select top "&nummer*viewpage&" * from ads"&sql_add&" order by aid desc"
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,1,1
if int(viewpage)>1 then rs.move (viewpage-1)*nummer
if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
for i=1 to nums
id=rs("aid")
topic=rs("aname")
%>
<tr align=center>
<td class=tims><%response.write (viewpage-1)*nummer+i%></td>
<td align=left><a href='<%response.write pageurl%>action=view&id=<%response.write id%>' alt='浏览此<%response.write ntit%>'><%response.write rs("asort")%></a></td>
<td><%
select case int(rs("atype"))
case 1
response.write "图片广告"
case 2
response.write "FLASH广告"
case 3
response.write "文字广告"
end select
%></td>
<td align=left><a href='<%response.write pageurl%>action=edit&id=<%response.write id%>' alt='<%response.write joekoe_cms.code_html(topic,1,0)%>'><%response.write joekoe_cms.code_html(topic,1,(20+tnum))%></a></td>
<td><%response.write pro_edit(pageurl&"action=edit&id="&id,"编辑该"&tit_fir)%> <a href='<%response.write pageurl%>action=view&id=<%response.write id%>' alt='浏览此<%response.write ntit%>'>浏览</a></td>
<td><input type=checkbox name=sel_id value='<%response.write id%>'></td>
</tr>
<%
rs.movenext
next
rs.close
%>
<tr class=tr1>
<td colspan=4>
现有<font class=red><%response.write rssum%></font>条<%response.write tit_fir%>,
每页<font class=red><%response.write nummer%></font>条,
页次:<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>
分页:<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td>
<td colspan=2 align=center><input type=submit value='删除' onclick="return sel_click(this.form);"></td>
</tr>
<input type=hidden name=sel_type value='删除'>
</form>
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -