📄 admin_ads.asp
字号:
<!-- #include file="include/admin_onlogin.asp" -->
<!-- #include file="include/ads_txt_dim.asp" -->
<%
dim ntit2,tmp1
index_url="ads"
call admin_master(0,0)
call admin_header(0,0)
if jk_mod="txt" then
call dim_ndim()
ntit="文字"&tit_fir
nsort_name=nsort_name&ntit
pageurl=pageurl&"nsort="&nsort&"&"
else
ntit="图片"&tit_fir
jk_mod=""
end if
%>
<tr><td align=center colspan=2 height=30>
<table border=0>
<tr>
<td><a href='?jk_mod='<%if jk_mod<>"txt" then response.write " class=red"%>>图片<%response.write tit_fir%>管理</a></td>
<td width=10></td>
<td><a href='?jk_mod=txt'<%if jk_mod="txt" then response.write " class=red"%>>文字<%response.write tit_fir%>管理</a></td>
</tr>
</table>
</td></tr>
</table>
<%
call admin_table(1)
call admin_td(ntit)
select case jk_mod
case "txt"
%>
<tr align=center valign=top>
<td>
<table border=0>
<tr><td height=30><%response.write img_admin("","")%> <a href='<%response.write pageurl%>'>所有<%response.write ntit%></a></td></tr>
<%
for i=1 to nnum
tmp1=""
response.write vbcrlf&" <tr><td>"&img_admin("","")&" <a href='?jk_mod="&jk_mod&"&nsort="&ndim(0,i)&"'"
if nsort=ndim(0,i) then
response.write " class=red"
ntit2=ndim(1,i)
tmp1=vbcrlf&" <tr><td>"&img_admin("s_imp","")&" <a href='"&pageurl&"action=js' onclick=""javascript:return click_return('更新"&ntit2&ntit&"JS',0);"" class=blue>更新"&ntit2&"JS</td></tr><tr><td height=5></td></tr>"
end if
response.write ">"&ndim(1,i)&ntit&"</a></td></tr>" & tmp1
next
%>
<tr><td height=30><%response.write img_admin("","")%> <a href='<%response.write pageurl%>action=add'<%if action="add" then response.write " class=red"%>>添加<%response.write ntit%></a></td></tr>
</table>
</td>
<td>
<table cellspacing=1 cellpadding=3 class=table0>
<%
if action="handle" then call joekoe_chk_txt_handle()
select case action
case "js"
call joekoe_chk_txt_js()
case "edit"
call joekoe_chk_txt_edit()
case "add"
call joekoe_chk_txt_add()
case else
call joekoe_chk_txt_main()
end select
%>
</table>
</td>
</tr>
<%
case else
%>
<tr align=center valign=top>
<td width='20%'>
<table border=0>
<tr><td height=30><%response.write img_admin("","")%> <a href='<%response.write pageurl%>'>所有<%response.write ntit%></a></td></tr>
<tr><td height=30><%response.write img_admin("","")%> <a href='<%response.write pageurl%>action=add'<%if action="add" then response.write " class=red"%>>添加<%response.write ntit%></a></td></tr>
</table>
</td>
<td width='80%'>
<table cellspacing=1 cellpadding=3 class=table0>
<%
if action="handle" then call joekoe_chk_handle()
select case action
case "view"
call joekoe_chk_view()
case "edit"
call joekoe_chk_edit()
case "add"
call joekoe_chk_add()
case else
call joekoe_chk_main()
end select
%>
</table>
</td>
</tr>
<tr class=tr2><td>调用方法:</td><td><script language=javascript src='ads/ads_<font class=red>(广告代码)</font>.js'></script></td></tr>
<tr class=tr2><td>相关说明:</td><td>每当您添加或修改<%response.write ntit%>时都会自动生成一个 JS 脚本,即为广告的内容。</td></tr>
<%
end select
call erase_ndim()
call admin_ender(1)
sub joekoe_chk_txt_js()
dim filetype,file_name,topic,rssum
file_name="style/data_ads_txt_"&nsort&".js"
rssum=1
sql="select * from ads_txt where nsort='"&nsort&"' order by id"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
filetype=filetype&"ads_txt_dim["&rssum&"]="""&rs("head")&"|"&rs("topic")&"|"&rs("tit")&"|"&rs("url")&""";"&vbcrlf
rs.movenext
rssum=rssum+1
loop
rs.close
rssum=rssum-1
filetype="<!--"&vbcrlf & _
"var ads_txt_dim=new Array("&rssum&");"&vbcrlf & _
"var ads_txt_num="&rssum&";"&vbcrlf & _
filetype & _
"-->"
call create_file(file_name,filetype)
call admin_msg("生成 "&nsort_name&" JS 成功!",pageurl,1)
end sub
sub joekoe_chk_txt_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
call joekoe_cms.exec("delete from ads_txt where id="&hid,0)
end if
next
erase hdim
action=""
call admin_event(sel_type&" "&(hnum+1)&" 条 ("&ntit2&")"&ntit,0,0)
response.write vbcrlf&"<script language=javascript>alert(""已成功"&sel_type&"了 "&(hnum+1)&" ("&ntit2&")"&ntit&"!"");</script>"
end sub
sub joekoe_chk_txt_edit()
sql="select top 1 * from ads_txt where id="&id
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,3
if rs.eof then
rs.close
call admin_msg(nsort_name&"(ID:"&id&")不在存!",pageurl,1)
exit sub
end if
dim head,topic,url
call admin_td("编辑"&ntit)
if chk() then
nsort=nsort_type(trim(request.form("nsort")),0)
head=code_admin("head",1,10)
topic=code_admin("topic",1,50)
tit=code_admin("tit",1,30)
url=code_admin("url",1,200)
if nsort="" or head="" or topic="" or url="" or lcase(url)="http://" then
call admin_error("请填写"&ntit&"的相关信息!")
exit sub
end if
rs("nsort")=nsort
rs("head")=head
rs("topic")=topic
rs("tit")=tit
rs("url")=url
rs.update
rs.close
call admin_msg("成功编辑一条"&nsort_name,pageurl,1)
exit sub
end if
call form_first()
%>
<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%'><%response.write nsort_select(rs("nsort"),ntit)%></td></tr>
<tr height=30><td><%response.write tit_fir%>题头:</td><td><input type=text name=head value='<%response.write rs("head")%>' size=10 maxlength=10><%response.write redx%>如:<font class=blue>广告</font> <font class=gray>注意:不要加入“[”、“]”</a></td></tr>
<tr height=30><td><%response.write tit_fir%>内容:</td><td><input type=text name=topic value='<%response.write rs("topic")%>' size=50 maxlength=50><%response.write redx%></td></tr>
<tr height=30><td><%response.write tit_fir%>参数:</td><td><input type=text name=tit value='<%response.write rs("tit")%>' size=30 maxlength=30></td></tr>
<tr height=30><td>链接地址:</td><td><input type=text name=url value='<%response.write rs("url")%>' size=50 maxlength=200><%response.write redx%></td></tr>
<%
rs.close
call submit_edit()
end sub
sub joekoe_chk_txt_add()
dim head,topic,url
call admin_td("添加"&ntit)
if chk() then
nsort=nsort_type(trim(request.form("nsort")),0)
head=code_admin("head",1,10)
topic=code_admin("topic",1,50)
tit=code_admin("tit",1,30)
url=code_admin("url",1,200)
if nsort="" or head="" or topic="" or url="" or lcase(url)="http://" then
call admin_error("请填写"&ntit&"的相关信息!")
exit sub
end if
sql="select * from ads_txt"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,3
rs.addnew
rs("nsort")=nsort
rs("head")=head
rs("topic")=topic
rs("tit")=tit
rs("url")=url
rs.update
rs.close
call admin_msg("成功添加一条新的"&nsort_name,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%'><%response.write nsort_select(nsort,ntit)%></td></tr>
<tr height=30><td><%response.write tit_fir%>题头:</td><td><input type=text name=head value='广告' size=10 maxlength=10><%response.write redx%>如:<font class=blue>广告</font> <font class=gray>注意:不要加入“[”、“]”</a></td></tr>
<tr height=30><td><%response.write tit_fir%>内容:</td><td><input type=text name=topic size=50 maxlength=50><%response.write redx%></td></tr>
<tr height=30><td><%response.write tit_fir%>参数:</td><td><input type=text name=tit size=30 maxlength=30></td></tr>
<tr height=30><td>链接地址:</td><td><input type=text name=url value='http://' size=50 maxlength=200><%response.write redx%></td></tr>
<%
call submit_add()
end sub
sub joekoe_chk_txt_main()
%>
<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='10%'>题头</td>
<td class=td width='70%'><%response.write ntit%>内容</td>
<td class=td width='7%'>编辑</td>
<td class=td width='6%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
if nsort<>"" then sql_add=" where nsort='"&nsort&"'"
sql="select count(id) from ads_txt"&sql_add
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
rs.close
call format_pagecute()
sql="select top "&nummer*viewpage&" * from ads_txt"&sql_add&" order by id 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("id")
%>
<tr align=center>
<td class=tims><%response.write (viewpage-1)*nummer+i%></td>
<td class=gray>[<font class=red><%response.write rs("head")%></font>]</td>
<td align=left><a href='<%response.write rs("url")%>' target=_blank <%response.write rs("tit")%>><%response.write joekoe_cms.code_html(rs("topic"),1,0)%></a></td>
<td><%response.write pro_edit(pageurl&"action=edit&id="&id,"编辑该"&tit_fir)%></td>
<td><input type=checkbox name=sel_id value='<%response.write id%>'></td>
</tr>
<%
rs.movenext
next
rs.close
%>
<tr class=tr1>
<td colspan=3>
现有<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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -