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

📄 user_news.asp

📁 本系统是一套开源WEB的网站管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="user_popedom.asp"-->
<%
'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1   Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com   www.maosin.net
'      QQ:57861417  
'电子邮箱:maosin@163.com  maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
sub naviNews()%>
<div align="center" style="padding-top:8px;height:30px;vertical-align:middle;"><a href="?channel=news&action=newsList&list=1">所有新闻</a>&nbsp; <a href="?channel=news&action=newsList&list=2">通过审核的新闻</a>&nbsp; <a href="?channel=news&action=newsList&list=3">未审核的新闻</a>&nbsp; <a href="user_publish.asp?channel=news&action=maosin_appNews">发布新闻</a></div>
<%end sub
sub addNews()
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_savenews" 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="title" type="text" 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="#000000" 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" 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" 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" 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%>
					<option value="<%=rs1("catId")&","&rs2("classID")%>">├<%=rs2("class")%></option>
					<%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"><label style="cursor:hand;" for="isgood">设为推荐</label> &nbsp;
	<input type="checkbox" name="istop" id="istop" value="true"><label style="cursor:hand;" for="istop">置顶新闻</label> &nbsp;
	<%end if%>
	<input type="checkbox" name="allowPl" id="allowPl" value="true" checked><label for="allowPl" style="cursor:hand;">允许评论</label> &nbsp;<input type="checkbox" name="picnews" id="picnews" value="1"><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&form.urlname=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" size=40></td>
  </tr>
  <tr class="tdBC"> 
    <td align="right" valign="top">新闻内容:</td><td valign="top"><input type="hidden" name="content" id="edit"><!--#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">
	<select name="showpage">
		<option value="0" selected>不分页</option>
		<option value="1">自动分页</option>
		<option value="2">手动分页</option>
	</select>
    注意:手动方式要在分页处输入:[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: response.write("checked"):else:response.write("disabled")end if%>><label for="pass1" style="cursor:hand;">通过审核</label>
      <input name="addnews" type="submit" id="addnews" value="发布新闻" class="but1" onMouseOver="this.className='but2'" onMouseOut="this.className='but1'">
    </td>
  </tr>
</form>
</table>
<%End Sub
Sub saveNews()
action=lcase(request.querystring("action"))
id=request.form("id")
title=Request.form("title")
titlecolor=Request.form("titlecolor")
authors=Request.form("authors")
from=Request.form("newsfrom")
imgurl=Request.form("imgurl")
newsclass=Request.form("newsclass")
keyword=Request.form("keyword")
content=Request.form("content")
showpage=Request.form("showpage")
if cint(userinfo(2))=3 then
	if Request.form("isgood")="true" then
		isgood=true
	else
		isgood=false
	end if
	if Request.form("istop")="true" then
		istop=true
	else
		istop=false
	end if
	if Request.form("pass")="true" then
		pass=true
	else
		pass=false
	end if
else
	isgood=false
	istop=false
	pass=false
	if fabuPass=0 then
		pass=true
	elseif fabuPass=1 then
		pass=false
	end if
end if
if Request.form("allowPl")="true" then
	allowpl=true
else
	allowpl=false
end if
if Request.form("picnews")<>"" then
	picnews=1
else
	picnews=0
end if
if trim(title)="" then
	errmsg="<li>请您输入新闻标题</li>"
end if
if trim(authors)="" then
	errmsg=errmsg&"<li>请您输入新闻作者</li>"
end if
if newsclass="" then
	errmsg=errmsg&"<li>请您选择新闻所属分类</li>"
else
	clStr=split(newsclass,",")
	if ubound(clStr)=1 then
		catid=clStr(0)
		classId=clStr(1)
	else
		errmsg=errmsg&"<li>您输入的分类ID不正确</li>"
	end if
end if
if trim(content)="" then
	errmsg=errmsg&"<li>请您输入新闻内容</li>"
end if
if picnews=1 then
	if trim(imgurl)="" then
		errmsg=errmsg&"<li>如果您设为图片新闻,请您输入图片地址</li>"
	end if
end if
if errmsg<>"" then
	showmsg "<font color=""#ff0000"">系统发生如下错误:</font><br>"&errmsg,"出错信息"
	errmsg=""
	exit sub
end if
if action=lcase("maosin_savemdf") then
	sql="select * from ms_news where id="&id
else
	sql="select * from ms_news where (id is null)"
end if
Set urs=Server.CreateObject("ADODB.RecordSet")
urs.open sql,connstr,1,3
if action<>lcase("maosin_savemdf") then
	urs.AddNew
end if
urs("catID")=catID
urs("classID")=classID
urs("news_title")=chkFormStr(title)
urs("titlecolor")=chkColor(titlecolor)
urs("news_keyword")=chkFormStr(replace(keyword,"|",","))
if action<>lcase("savemodify") then
	urs("news_date")=now()
	urs("post_member")=userinfo(1)
end if
urs("news_content")=content
urs("news_imgurl")=ChkFormStr(imgurl)
urs("news_authors")=ChkFormStr(authors)
urs("news_from")=ChkFormStr(from)
urs("pass")=pass
urs("news_good")=isgood
urs("news_istop")=istop
urs("allow_pl")=allowpl
urs("picnews")=picnews
urs("showpage")=showpage
urs.Update
urs.close
set urs=nothing
if fabupass=0 and action<>lcase("maosin_savemdf") then
	conn.execute("update ms_user set user_money=user_money+"&fabuPointNum&" where user_id="&cint(userinfo(0))&" and user_name='"&userinfo(1)&"'")
	userinfo=session("userinfo")
	userinfo(3)=userinfo(3)+fabuPointNum

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -