📄 admin_article.asp
字号:
<!-- #include file="include/onlogin.asp" -->
<!-- #INCLUDE FILE="include/conn.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<script language = "JavaScript">
function CheckForm()
{
if (editor.EditMode.checked==true)
document.add_frm.word.value=editor.HtmlEdit.document.body.innerText;
else
document.add_frm.word.value=editor.HtmlEdit.document.body.innerHTML;
return true;
}
function loadForm()
{
editor.HtmlEdit.document.body.innerHTML=document.add_frm.word.value;
return true
}
</script>
<%
dim nsort,sql2,rs2,del_temp,data_name,cid,sid,nid,ncid,nsid,id,left_type,now_id,nummer,sqladd,page,rssum,thepages,viewpage,pageurl,topic,csid,keyword
tit=vbcrlf & "<a href='?'>文栏管理</a> ┋ " & _
vbcrlf & "<a href='?action=HTMLadd'>HTML添加文章</a> ┋ " & _
vbcrlf & "<a href='?action=UBBadd'>UBB添加文章</a> ┋ " & _
vbcrlf & "<a href='admin_nsort.asp?nsort=article'>文栏分类</a>"
response.write header(13,tit)
pageurl="?action="&action&"&":nsort="art":data_name="article":sqladd="":nummer=15
call admin_cid_sid()
if trim(request("del_ok"))="ok" then
response.write del_select(trim(request.form("del_id")))
end if
id=trim(request.querystring("id"))
keyword=trim(request.querystring("keyword"))
if keyword<>"" and not isnull(keyword) then
if sqladd<>"" then
sqladd=sqladd&" and topic like '%"&keyword&"%' "
else
sqladd=sqladd&" where topic like '%"&keyword&"%' "
end if
pageurl=pageurl&"keyword="&server.urlencode(keyword)&"&"
end if
if (action="hidden" or action="istop") and isnumeric(id) then
sql="select "&action&" from "&data_name&" where id="&id
set rs=conn.execute(sql)
if not(rs.eof and rs.bof) then
if action="istop" then
if int(rs(action))=1 then
sql="update "&data_name&" set "&action&"=0 where id="&id
else
sql="update "&data_name&" set "&action&"=1 where id="&id
end if
else
if rs(action)=true then
sql="update "&data_name&" set "&action&"=0 where id="&id
else
sql="update "&data_name&" set "&action&"=1 where id="&id
end if
end if
conn.execute(sql)
end if
rs.close:action=""
end if
select case action
case "UBBadd"
call news_add()
case "HTMLadd"
call htmlnews_add()
case "edit"
if not(isnumeric(id)) then
call news_main()
else
set rs=server.createobject("adodb.recordset")
sql="select * from "&data_name&" where id="&id
rs.open sql,conn,1,3
call news_edit()
end if
case else
call news_main()
end select
call close_conn()
response.write ender()
%>
<%
sub news_edit()
%>
<%
if trim(request.querystring("edit"))="chk" then
topic=code_admin(request.form("topic"))
csid=trim(request.form("csid"))
if len(csid)<1 then
response.write "<font class=red_2>请选择文章类型!</font><br><br>"&go_back
elseif topic="" then
response.write "<font class=red_2>文章标题不能为空!</font><br><br>"&go_back
else
call chk_cid_sid()
rs("c_id")=cid
rs("s_id")=sid
if trim(request.form("username_my"))="yes" then rs("username")=login_username
rs("topic")=topic
rs("word")=request.form("word")
if isnumeric(trim(request.form("emoney"))) then
rs("emoney")=trim(request.form("emoney"))
else
rs("emoney")=0
end if
rs("author")=code_admin(request.form("author"))
rs("power")=replace(replace(trim(request.form("power"))," ",""),",",".")
rs("keyes")=code_admin(request.form("keyes"))
if trim(request.form("istop"))="yes" then
rs("istop")=1
else
rs("istop")=0
end if
if trim(request.form("hidden"))="yes" then
rs("hidden")=false
else
rs("hidden")=true
end if
if isnumeric(trim(request.form("counter"))) then rs("counter")=trim(request.form("counter"))
rs.update
rs.close:set rs=nothing
call upload_note(data_name,id)
response.write "<font class=red>已成功修改了一篇文章!</font><br><br><a href='?c_id="&cid&"&s_id="&sid&"'>点击返回</a><br><br>"
end if
else
dim sql3,rs3
%>
<% if rs("ishtml")="1" then %>
<body leftmargin="5" topmargin="10" onLoad="javascipt:setTimeout('loadForm()',1000);">
<% end if %>
<table border=0 width='98%' cellspacing=0 cellpadding=1>
<form name='add_frm' onSubmit="return CheckForm();" action='<%response.write pageurl%>c_id=<%response.write cid%>&s_id=<%response.write sid%>&id=<%response.write id%>&edit=chk' method=post>
<input type=hidden name=upid value=''>
<tr><td width='15%' align=center>文章标题:</td><td width='85%'><input type=text size=70 name=topic value='<%=rs("topic")%>' maxlength=40><%=redx%></td></tr>
<tr><td align=center>文章类型:</td><td><%call chk_csid(cid,sid):call chk_emoney(rs("emoney")):call chk_h_u()%></td></tr>
<tr><td align=center>浏览权限:</td><td><%call chk_power(rs("power"),0)%></td></tr>
<tr><td align=center> </td><td> 文章作者:<input type=text size=13 name=author value='<%response.write rs("author")%>' maxlength=20> 关键字:<input type=text name=keyes value='<%response.write rs("keyes")%>' size=17 maxlength=20> 推荐:<input type=checkbox name=istop value='yes'<%if int(rs("istop"))=1 then response.write " checked"%>> <br>
阅读人次:<input type=text name=counter value='<%response.write rs("counter")%>' size=13 maxlength=10>
发布人:<input type=text name=username value='<%response.write rs("username")%>' size=17 maxlength=50></td></tr>
<% if rs("ishtml")="1" then %>
<tr>
<td width="15%" align="center" height="30">文章内容:</td>
<td width="85%" height="30"><textarea name=word style="display:none" rows="1" cols="20"><%=rs("word")%></textarea><iframe ID="editor" src="htmledit/editor.asp" frameborder=1 scrolling=no width="95%" height="350"></iframe> </td>
</tr>
<% else %>
<tr height=35<%response.write format_table(3,1)%>><td align=center><%call frm_ubb_type()%></td><td><%call frm_ubb("add_frm","word"," ")%></td></tr>
<tr><td valign=top align=center><br>文章内容:</td><td><textarea name=word rows=15 cols=70><%=rs("word")%></textarea></td></tr>
<tr><td align=center>上传文件:</td><td><iframe frameborder=0 name=upload_frame width='100%' height=30 scrolling=no src='upload.asp?uppath=article&upname=a&uptext=word'></iframe></td></tr>
<% end if %>
<tr height=25><td></td><td><input type=submit value=' 修 改 文 章 '></td></tr>
</form>
</table><%
end if
end sub
sub news_add()
dim word
if trim(request.querystring("add"))="chk" then
topic=code_admin(request.form("topic"))
csid=trim(request.form("csid"))
word=trim(request.form("word"))
if len(csid)<1 then
response.write "<font class=red_2>请选择文章类型!</font><br><br>"&go_back
elseif topic="" then
response.write "<font class=red_2>文章标题不能为空!</font><br><br>"&go_back
else
call chk_cid_sid()
set rs=server.createobject("adodb.recordset")
sql="select * from "&data_name
rs.open sql,conn,1,3
rs.addnew
rs("c_id")=cid
rs("s_id")=sid
rs("username")=login_username
rs("hidden")=true
rs("topic")=topic
rs("word")=word
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -