⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user_news.asp

📁 本系统是一套开源WEB的网站管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
	session("userinfo")=userinfo
end if
if action=lcase("maosin_savemdf") then
	showmsg "<li>恭喜恭喜,您已成功修改完成一篇新闻</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回新闻管理页......</b><meta http-equiv=refresh content=3;url=user_publish.asp?channel=news&action=NewsList><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>","操作成功信息"
else
	showmsg "<li>恭喜您,已成功添加一篇新闻</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回新闻管理页......</b><meta http-equiv=refresh content=3;url=user_publish.asp?channel=news&action=NewsList><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>","操作成功信息"
end if
exit sub
End Sub

sub newsList()
dim mytitle
if Request("list")="1" then
	sql="select * from ms_news where post_member='"&userinfo(1)&"' order by news_date desc"
	mytitle="我的全部新闻"
elseif Request("list")="2" then
	sql="select * from ms_news where pass=true and post_member='"&userinfo(1)&"' order by news_date desc"
	mytitle="通过审核的新闻"
elseif Request("list")="3" then
	sql="select * from ms_news where pass=false and post_member='"&userinfo(1)&"' order by news_date desc"
	mytitle="没有通过审核的新闻"
else
	sql="select * from ms_news where post_member='"&userinfo(1)&"'"
end if
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableBC">
  <tr> 
    <td height="22" colspan="3" valign="middle" class="tdT">我的全部新闻</td>
  </tr>
  <tr class="tdBC"> 
    <td width="420" height="22" valign="middle">标 题</td>
    <td width="80" align="center" valign="middle">状 态</td>
    <td width="80" align="center" valign="middle">管 理 操 作</td>
  </tr>
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,connstr,1,1
dim newsList(7),tempStr:tempStr=""
dim n:n=5
url="user_publish.asp?channel=news&action=newsList&list=1&"
nextpage=pagetitle(rs,n,url,"篇新闻")
dim lineNo:lineNo=1
if not rs.eof and not rs.bof then
do while not rs.eof and lineNo<=rs.pagesize
newsList(0)=rs("id")
newslist(4)="新闻标题:"&rs("news_title")&"&#10;发表日期:"&rs("news_date")&"&#10;录入会员:"&rs("post_member")&"&#10;阅读次数:"&rs("news_clicks")
newsList(1)="<a href=""shownews.asp?id="&newsList(0)&""" title="""&newsList(4)&"""><font color="""&rs("titlecolor")&""">"&rs("news_title")&"</font></a>"
if rs("pass")=true then
	newsList(2)="核(<font color=""#ff0000"">√</font>)"
	newsList(5)="<font color=""#707070"">修改</font>&nbsp;"
	newsList(6)="<font color=""#707070"">删除</font>"
else
	newsList(5)="<a href=""user_publish.asp?channel=news&action=maosin_mdfnews&id="&newsList(0)&""">修改</a>&nbsp;"
	newsList(6)="<a href=""user_publish.asp?channel=news&action=maosin_delnews&id="&newsList(0)&""">删除</a>"
	newsList(2)="核(<font color=""#ff0000"">×</font>)"
end if
if rs("news_good")=true then
	newsList(2)=newsList(2)&"&nbsp;荐(<font color=""#ff0000"">√</font>)"
else
	newsList(2)=newsList(2)&"&nbsp;荐(<font color=""#ff0000"">×</font>)"
end if
newsList(3)=rs("news_date")
tempStr=tempStr&"<tr class=""tdBC""><td height=""22"" valign=""middle"">"&newsList(1)&"</td><td valign=""middle"" align=""center"">"&newsList(2)&"</td><td valign=""middle"" align=""center"">"&newsList(5)&newsList(6)&"</td></tr>"
rs.movenext
lineNo=lineNo+1
loop
response.write tempStr
else
response.write "<tr><td height=""30"" colspan=""3"" valign=""middle"" align=""center"" class=""tdBC"">您在此类暂时还没有新闻</td></tr>"
end if
if rs.RecordCount>n then%> 
  <tr> 
    <td height="22" colspan="3" valign="middle" class="tdBC"><%=nextpage%></td>
  </tr>
<%end if%>
</table>
<%
rs.close
set rs=nothing
End Sub
Sub deleteNews()
dim id,sql,modNum
id=Request.QueryString("id")
sql="delete from ms_news where pass=false and post_member='"&replace(trim(userinfo(1)),"'","")&"' and id="&id
conn.execute sql,modNum
if cint(modNum)=0 then
	showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><li>此篇新闻已通过审核了,您没有删除的权限,如有什么问题请联系管理员!</li>","操作错误信息"
else
	showmsg "<li>已成功删除一篇新闻</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回......</b><meta http-equiv=refresh content=3;url=user_publish.asp?channel=news&action=newsList><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>","操作成功信息"
end if
End Sub
Sub modifynews()
sql="Select * from ms_news where id="&Request.QueryString("id")
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,connstr,1,1
dim editpath:editpath="editor/"
%>
<script language="javascript">
function mych(){
submits();
if(document.form.newsclass.options[document.form.newsclass.selectedIndex].value==""){
alert("请选择所属分类");
return false;
document.form.classes.focus();
}
if(document.form.authors.value==""){
alert("新闻作者不能为空!");
document.form.authors.focus();
return false;}
if(document.form.keyword.value==""){
alert("新闻关键词不能为空!");
document.form.keyword.focus();
return false;
}
if(document.form.title.value==""){
alert("新闻标题不能为空");
document.form.title.focus();
return false;}
if(document.form.content.value==""){
alert("新闻内容不能为空");
IframeID.document.body.focus();
return false;}
return true;}
var editorpath="editor/";
</Script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableBC" style="margin-top:3px;">
  <tr> 
    <td height="25" colspan="2" valign="middle" class="tdT"> &nbsp;编辑新闻</td>
  </tr>
<form action="user_publish.asp?channel=news&action=maosin_savemdf" name="form" Method="post" onSubmit="return mych()">
  <tr class="tdBC"> 
    <td width="70" height="25" align="right" valign="middle">新闻标题:</td>
    <td width="*" valign="middle">
	<input name="id" type="hidden" value=<%=rs("id")%>>
	<input name="title" type="text" value='<%=rs("news_title")%>' class="wenbenkang" id="title" size="40" ondrop="document.form.keyword.value=document.form.title.value;" onpaste="document.form.keyword.value=document.form.title.value;" onKeyUp="document.form.keyword.value=document.form.title.value;">
      标题颜色:<input name="titlecolor" type="text" class="wenbenkang" value="<%=rs("titlecolor")%>" id="titlecolor" size="7">
	  <select name="colorrs" onChange="titlecolor.value=this.value;">
	  <option value="#000000">选择颜色</option>
	  <%
	  colorStr=split(colorRS,",")
	  for i=0 to ubound(colorStr)
		  Response.Write ("<option style=""background-color:"& colorStr(i) &";color: "& colorStr(i) &""" value="""&colorStr(i)&""">"&colorStr(i)&"</option>")
	  next
	  %>
	  </select>
      </td>
  </tr>
  <tr class="tdBC"> 
    <td height="25" align="right" valign="middle">关 键 词:</td>
    <td valign="middle"><input name="keyword" type="text" class="wenbenkang" id="keyword" value="<%=rs("news_keyword")%>" size="40">  &nbsp;<font color="#3d3d3d">*多个关键词请用“|”分隔</font></td>
  </tr>
  <tr class="tdBC"> 
    <td height="25" align="right" valign="middle">新闻作者:</td>
    <td valign="middle"><input name="authors" type="text" class="wenbenkang" value="<%=rs("news_authors")%>" id="authors"> &nbsp;
	<select name="name1" onChange="authors.value=this.value;">
		<option value="">选择作者</option>
		<option value="佚名">佚名</option>
		<option value="不详">不详</option>
		<option value="网络">网络</option>
		<option value="<%=webname%>"><%=webname%></option>
		<option value="<%=userinfo(1)%>"><%=userinfo(1)%></option>
	</select></td>
  </tr>
  <tr class="tdBC"> 
    <td height="25" align="right" valign="middle">新闻来源:</td>
    <td valign="middle"><input name="newsfrom" type="text" class="wenbenkang" value="<%=rs("news_from")%>" id="newsfrom"> &nbsp;
	<select name="from1" onChange="newsfrom.value=this.value;">
		<option value="">选择来源</option>
		<option value="转载">转载</option>
		<option value="不详">不详</option>
		<option value="网络">网络</option>
		<option value="原创">原创</option>
		<option value="整理">整理</option>
		<option value="<%=webname%>"><%=webname%></option>
		<option value="<%=userinfo(1)%>"><%=userinfo(1)%></option>
	</select></td>
  </tr>
  <tr class="tdBC"> 
    <td height="25" align="right" valign="middle">新闻分类:</td>
    <td valign="middle">
	<select name="newsclass" id="newsclass">
		 <%sql="select * from ms_news_cat"
		 Set rs1=Server.CreateObject("ADODB.RecordSet")
		 rs1.Open sql,connstr,1,1
		 If Not rs1.Bof And Not rs1.Eof Then
		 Do While Not rs1.Eof
			 sql="select * from ms_news_class where catID="&rs1("catID")
			 Set rs2=Server.CreateObject("ADODB.RecordSet")
			 rs2.Open sql,connstr,1,1
			 If Not rs2.Eof And Not rs2.Bof Then%>
			 		<option style="color:#ff0000;font-weight:bold;">----<%=rs1("catName")%>----</option>
				<%Do While Not rs2.Eof
					if rs("classID")=rs2("classID") then%>
					<option value="<%=rs1("catId")&","&rs2("classID")%>" selected><%=rs2("class")%></option>
					<%else%>
					<option value="<%=rs1("catId")&","&rs2("classID")%>"><%=rs2("class")%></option>
					<%end if
					rs2.MoveNext
				Loop
			 	rs2.close
				Set rs2=Nothing
			 Else%>
					<option>请添加子分类</option>
					<%rs2.close
				Set rs2=Nothing
			 End If
		rs1.MoveNext
		Loop
		rs1.close
		Set rs1=Nothing
		Else%>
		<option style="color:#ff0000;font-weight:bold;">----请添加大分类----</option>
		<%rs1.close
		Set rs1=Nothing
		End If
			 %>
          </select></td>
  </tr>
  <tr class="tdBC"> 
    <td height="25" align="right" valign="middle">新闻属性:</td>
    <td valign="middle">
	<%if cint(userinfo(2))=3 then%>
	<input type="checkbox" name="isgood" id="isgood" value="true" <%if rs("news_good")=true then response.write("checked") end if%>><label style="cursor:hand;" for="isgood">设为推荐</label> &nbsp;
	<input type="checkbox" name="istop" id="istop" value="true" <%if rs("news_istop")=true then response.write("checked") end if%>><label style="cursor:hand;" for="istop">置顶新闻</label> &nbsp;
	<%end if%>
	<input type="checkbox" name="allowPl" id="allowPl" value="true" <%if rs("allow_pl")=true then response.write("checked") end if%>><label for="allowPl" style="cursor:hand;">允许评论</label> &nbsp;<input type="checkbox" name="picnews" id="picnews" value="1" <%if cint(rs("picnews"))=1 then response.write("checked") end if%>><label for="picnews" style="cursor:hand;">图片新闻</label>   &nbsp;<br><span style="color:#3D3D3D;">[说明:选中为有效,如果选定为图片新闻,请填上图片地址。]</span></td>
  </tr>
  <tr class="tdBC"> 
    <td height="25" align="right" valign="middle">图片上传:</td>
    <td valign="middle"><iframe height="25" width="100%" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" src="upload.asp?uptype=img&urlname=form.imgurl&content=oblog_Composition" name="upimg"></iframe></td>
  </tr>
  <tr class="tdBC"> 
    <td height="25" align="right" valign="middle">图片地址:</td>
    <td valign="middle"><input name="imgurl" type="text" class="wenbenkang" id="imgurl" value="<%=rs("news_imgurl")%>" size=40></td>
  </tr>
  <tr class="tdBC"> 
    <td align="right" valign="top">新闻内容:</td><td valign="top"><input type="hidden" name="content" id="edit" value="<%=server.HTMLENCode(rs("news_content"))%>"><!--#include file="editor/edit.asp"--><div style="margin-top:4px;color:#3D3D3D;">换行请按Shift+Enter,直接按Enter为起一段</div></td>
  </tr>
  <tr class="tdBC"> 
    <td height="25" align="right" valign="middle">分页方式:</td>
    <td valign="top">
	<%if rs("showpage")=0 then%>
	  	<input type="radio" name="showpage" id="sp0" value=0 checked><label for="">不分页</label>
        <input type="radio" name="showpage" id="sp1" value=1><label for="sp1">自动分页</label>
        <input type="radio" name="showpage" id="sp2" value=2><label for="sp2">手动分页</label>
	<%elseif rs("showpage")=1 then%>
	  	<input type="radio" name="showpage" id="sp0" value=0><label for="sp0">不分页</label>
        <input type="radio" name="showpage" id="sp1" value=1 checked><label for="sp1">自动分页</label>
        <input type="radio" name="showpage" id="sp2" value=2><label for="sp2">手动分页</label>
	<%else%>
		<input type="radio" name="showpage" id="sp0" value=0><label for="sp0">不分页</label>
        <input type="radio" name="showpage" id="sp1" value=1><label for="sp1">自动分页</label>
        <input type="radio" name="showpage" id="sp2" value=2 checked><label for="sp2">手动分页</label>
	<%end if%>
    注意:手动方式要在分页处输入:[NextPage] 字符</td>
  </tr>
  <tr valign="middle"> 
    <td height="25" colspan="2" align="center" class="tdT"> 
      <input type="checkbox" name="pass" id="pass1" value="true" <%if cint(userinfo(2))=3 then:if  rs("pass")=true then: response.write("checked"):end if:else:response.write("disabled")end if%>><label for="pass1" style="cursor:hand;">通过审核</label>
      <input name="modifynews" type="submit" id="modifynews" value="保存修改" class="but1" onMouseOver="this.className='but2'" onMouseOut="this.className='but1'">
    </td>
  </tr>
</form>
</table>
<%End Sub
'========================================================
'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 + -