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

📄 user_article.asp

📁 Art2008 CMS是一款具有强大的功能的基于ASP语言的网站管理软件
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="User_conn.asp"-->
<!--#include file="../admin/md5.ASP"-->
<!--#include file="../Include/cls_pageview.asp"-->

<%

Dim  UserHS,U_Simple
		Set UserHS = New Art_User
		IF Cbool(UserHS.UserLoginChecked)=false then
		  Response.Write "<script>top.location.href ='login.asp' ;</script>"
		  Response.end
		End If
	If UserHS.G_Simple="" Then 
		U_Simple="Simple"
	Else
		U_Simple=UserHS.G_Simple
	End If 
	
		   
		 ztid=G("ztid")
         if (not isNumeric(ztid)) then
  	      ztid=0
         end if
		 title=Trim(S("title"))
		 htitle=Trim(S("htitle"))
		 content=request("content")
		 piczz=S("piczz")
		 sh=S("sh")
		 zz=S("zz")
		PaginationType=trim(request("PaginationType"))     '2008_07_02art添加自动分页功能
        MaxCharPerPage=trim(request("MaxCharPerPage"))
	    if PaginationType="" then PaginationType=0
        if MaxCharPerPage="" then MaxCharPerPage=10000
	    tuwen=G("tuwen")
	
 %>
 <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="Images/css.css" rel="stylesheet" type="text/css">
<title>添加内容</title>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  <tr>
    <td colspan="2" class="bg_tr">当前操作:网站首页 &gt;&gt; 会员中心 &gt;&gt; 添加/修改</td>
  </tr>
  <tr class="tdbg">
    <td > 我发布的文章</td>
    <td align="right" >·<a href="?action=add"><font color="red">发表文章</font></a>&nbsp;·<a href="User_Article.asp?Status=Listcg">草 稿[<%=conn.execute("select count(id) from news where sh=0 and userid<>0 and adduser='"& UserHS.UserName &"'")(0)%></a>]&nbsp;·<a href="User_Article.asp?Status=ListNoAccept">待审核[<%=conn.execute("select count(id) from news where sh=2 and userid<>0 and adduser='"& UserHS.UserName &"'")(0)%>]</a>&nbsp;·<a href="User_Article.asp?Status=ListisAccept">已审核[<%=conn.execute("select count(id) from news where sh=1 and userid<>0 and adduser='"& UserHS.UserName &"'")(0)%>]</a>&nbsp;·<a href="User_Article.asp?Status=Listtg">被退稿[<%=conn.execute("select count(id) from news where sh=4 and userid<>0 and adduser='"& UserHS.UserName &"'")(0)%>]&nbsp;</a></td>
  </tr>
</table>
<% 
	dim frmAction,ClassID,title,author,content,id,pic,sh,action,tuwen,TGGroupID,PaginationType,MaxCharPerPage
	dim zz, htitle,ztid
	 action=request("action")
	 select case action
	 	case "add"
			call add()
		case "adds","edit"
			call adds()
		case "Saveadd"
			call Saveadd()
		case "Saveedit"
			call Saveedit()
		case "del"
			call del()
		case else
			call main()
	end select


  Sub del()
	Dim ID:ID=G("ID")
	If ID="" Then Call Alert("你没有选中要删除的文章!",""):Response.End
	Conn.Execute("Delete From news Where sh<>1 and adduser='"& UserHS.UserName &"' and ID In(" & ID & ")")
	Response.Redirect "user_article.asp"
  End Sub
	
	sub Saveedit()
	dim Save_SQL
         
         if pic="" then
	     nr=content
	     nr=replace(nr,"<IMG","<img")
	     nr=replace(nr,"SRC=","src=")
	     nr=replace(nr,"","")
	     nr=replace(nr,"","")
	     nr=replace(nr,"","")
	     if instr(nr,"<img")<>0 and instr(nr,"src=")<>0 then
	     nr=replace(nr,"""","")
	     aa=Split(nr,"<img")
	     bb=aa(1)
	     cc=split(bb,">")
	     dd=cc(0)
	     ee=split(dd,"src=")
	     ff=ee(1)
	     gg=split(ff," ")
	        if tuwen="1" then
	          pic=gg(0)		   
		      if instr(pic,"small" )=0 and config("ThumbComponent") <> "0" then	'art增加显示远程上传缩图	   
		      pic=replace(pic,".","_s.")
		      end if
	        end if		 
	    end if
      end if
     if pic="" then pic=" "


				 If UserHS.G_A_SH="0" And sh=1 Then 
				 	sh=1 
				 elseIf sh=0 Then 
					sh=0
				else
					sh=2
				end if
			If UserHS.G_A_SH="1" Then sh=2:Else:sh=1 
				
				  If title="" Then
					Call alert("请输入简短标题","")
				    Exit Sub
				  End IF
				  If content="" Then
					Call alert("请输入文章内容","")
				    Exit Sub
				  End IF
		Set Save_SQL=Server.CreateObject("Adodb.Recordset")		  
		Save_SQL.Open "Select * From news  Where userid<>0 and adduser='"& UserHS.UserName &"' and ID=" & ChkNumeric(G("ID")),Conn,1,3
        Save_SQL("title")=title
        Save_SQL("htitle")=htitle
        Save_SQL("content")=content
        Save_SQL("zz")=zz
        Save_SQL("piczz")=piczz
        Save_SQL("ztid")=ztid
        pic=replace(pic,"../",path) 
        Save_SQL("pic")=pic
		Save_SQL("Time")=now
		Save_SQL("sh")=sh
        Save_SQL("PaginationType")=PaginationType     
        Save_SQL("MaxCharPerPage")=MaxCharPerPage
        If sh=1 Then Conn.Execute("Update Art_User Set ArticleNum=ArticleNum+1 Where UserName='" & UserHS.UserName & "'")		
		Save_SQL.update
	    Save_SQL.Close:Set Save_SQL=Nothing
		If sh=1 Then  
		  if UserHS.G_tgdianshu<>0 then Call PointInOrOut(1,0,UserHS.UserName,1,UserHS.G_tgdianshu ,"系统","添加文章时,获得的点数")
		
		  if UserHS.G_tgzijin<>0 then Call MoneysInOrOut(UserHS.UserName,UserHS.Realname,UserHS.G_tgzijin,4,1,"0",0,"系统","添加文章时,获得的资金")
		end if

		call alert("文章修改成功!","User_Article.asp")
				
	end sub
	
  sub Saveadd()
	dim TGGroupID,NewsID,Save_SQL,path
		 path=config("path")
		 lm1=G("lm1")
		 lm2=G("lm2")
		 lm3=G("lm3")
         if pic="" then
	     nr=content
	     nr=replace(nr,"<IMG","<img")
	     nr=replace(nr,"SRC=","src=")
	     nr=replace(nr,"","")
	     nr=replace(nr,"","")
	     nr=replace(nr,"","")
	     if instr(nr,"<img")<>0 and instr(nr,"src=")<>0 then
	     nr=replace(nr,"""","")
	     aa=Split(nr,"<img")
	     bb=aa(1)
	     cc=split(bb,">")
	     dd=cc(0)
	     ee=split(dd,"src=")
	     ff=ee(1)
	     gg=split(ff," ")
	        if tuwen="1" then
	          pic=gg(0)		   
		      if instr(pic,"small" )=0 and config("ThumbComponent") <> "0" then	'art增加显示远程上传缩图	   
		      pic=replace(pic,".","_s.")
		      end if
	        end if		 
	    end if
      end if
     if pic="" then pic=" "

				If sh="0" Then 
					sh=0
				elseif UserHS.G_A_SH="0" And sh=1 Then 
				 	sh=1
				else
					sh=2
				end If
				
				  If lm1="" or lm2=""or lm3="" Then
					Call alert("请选择投稿栏目","")
				    Exit Sub
				  End IF
				  If title="" Then
					Call alert("请输入简短标题","")
				    Exit Sub
				  End IF
				  If content="" Then
					Call alert("请输入文章内容","")
				    Exit Sub
				  End IF
		
		Set Save_SQL = server.CreateObject("adodb.recordset")
		Save_SQL.Open "Select * from news where 1=0",Conn,1,3
		
		Save_SQL.AddNew
		
		Save_SQL("lm")=lm1
        Save_SQL("lm2")=lm2
        Save_SQL("lm3")=lm3
        Save_SQL("title")=title
        Save_SQL("htitle")=htitle
        Save_SQL("content")=content
        Save_SQL("zz")=zz
        Save_SQL("piczz")=piczz
        Save_SQL("ztid")=ztid
        Save_SQL("tj")="不推荐"
        pic=replace(pic,"../",path) 
        Save_SQL("pic")=pic
		Save_SQL("url")=" "
        Save_SQL("xgnews")=""
		Save_SQL("adduser") = UserHS.UserName
		Save_SQL("Time")=now
		Save_SQL("sh")=sh
		Save_SQL("updat")=Save_SQL("id")
        Save_SQL("hit")=0
        Save_SQL("PaginationType")=PaginationType     
        Save_SQL("MaxCharPerPage")=MaxCharPerPage
		Save_SQL("userid") = UserHS.GroupID
		
		Save_SQL.update
	    Save_SQL.Close:Set Save_SQL=Nothing
		If UserHS.G_A_SH="0" Then  
		 Conn.Execute("Update Art_User Set ArticleNum=ArticleNum+1 Where UserName='" & UserHS.UserName & "'")
		 if UserHS.G_tgdianshu<>0 then Call PointInOrOut(1,0,UserHS.UserName,1,UserHS.G_tgdianshu ,"系统","添加文章时,获得的点数")
		 if UserHS.G_tgzijin<>0 then Call MoneysInOrOut(UserHS.UserName,UserHS.Realname,UserHS.G_tgzijin,4,1,"0",0,"系统","添加文章时,获得的资金")
		end if

	    Response.Write "<script>if (confirm('文章添加成功,继续添加吗?')){location.href='User_Article.asp?action=add&ClassID=" & ClassID &"';}else{location.href='User_Article.asp';}</script>"
	end sub
	
	sub adds()
	Dim I,MaxCharPerPage
		MaxCharPerPage=10000
		sh=1
		
	Set Rs=server.CreateObject("adodb.recordset") 

	IF Action = "edit" Then
	id=ChkNumeric(G("ID"))
	Rs.Open "Select * From news  Where adduser='"& UserHS.UserName &"' and ID=" & id,Conn,1,3
		IF Rs.eof Then 
			call alert("非法提交数据,试图更改其他用户文章!","User_Article.asp")
			Response.End
		Else
			title=RS("Title")
			lm1=RS("lm")
            lm2=RS("lm2")
            lm3=RS("lm3")
			ztid=RS("ztid")
			If RS("Content") <> "" Then Content=Server.HTMLEncode(RS("Content"))
            htitle=RS("htitle")
			zz=RS("zz")
			sh=RS("sh")
			author=RS("zz")
			pic=RS("pic")
			piczz=RS("piczz")
            PaginationType=RS("PaginationType")
			MaxCharPerPage=RS("MaxCharPerPage")
			Rs.close
			frmAction="edit"
	End IF
	else
		frmAction="add"
        ClassID=trim(request("ClassID"))
		  aaa=split(ClassID,"|")
          lm1=aaa(0)
          lm2=aaa(1)
          lm3=aaa(2)		  		  
		author=UserHS.UserName
	end if	
			ClassLm=trim(lm3)
			    if ClassLm="0" or ClassLm="" then ClassLm=trim(lm2)
			    if ClassLm="0" or ClassLm="" then ClassLm=trim(lm1)
			    if ClassLm="" then ClassLm=0
				if (not isNumeric(ClassLm)) then 
			    	ClassLm=0
			    end if		
		Rs.OPen "Select * from lm  where id = "&ClassLm&" ",Conn,1,1
		IF Not Rs.eof Then
			LmName =rs("lm")&rs("lm2")&rs("lm3")
		End IF

	%>	
  
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  <form  action="?" method="post" name="tcjdxr" id="tcjdxr"> <tr>
    <td width="15%" align="center" class="bg_tr">发布文章 </td>
    <td width="85%" align="center" class="bg_tr">&nbsp;</td>
  </tr>
  <tr class="tdbg">
    <td height="23"align="right" >所属分类:</td>
    <td height="23" align="left"><%= LmName %></td>
  </tr>
  <tr class="tdbg">
    <td height="23"align="right" >文章专题:</td>
    <td height="23"align="left"><select size="1" name="ztid">
								<option value="0">请选择:::</option>
								<%
									set rszt = Server.CreateObject("ADODB.RecordSet")
									rszt.Open "select id,title from [NewsZT] order by id asc",conn,1,1
									while not rszt.eof
								%>
								<option value="<%=rszt("id")%>" <% if clng(ztid)=clng(rszt("id")) then Response.Write " selected "%>><%=rszt("title")%></option>
								<%
									rszt.movenext
									wend
									rszt.close:set rszt=nothing
								%>
								</select>		</td>
  </tr>
  <tr class="tdbg">
    <td height="23"align="right" >简短标题:</td>
    <td height="23"align="left"><input name="title" type="text" id="Title" value="<%= title %>" size="50" /></td>
  </tr>
	<tr class="tdbg">
    <td height="23" align="right">副标题:</td>
    <td height="23" align="left"><input type="text" name="htitle" size="50" maxlength="100" value='<%=htitle%>'></td>
  </tr>
  <tr class="tdbg">
    <td height="23" align="right" >文章作者:</td>
    <td height="23" align="left"><input name="zz" type="text" id="zz" value="<%= author %>"  size="50" /></td>
  </tr>
  <tr class="tdbg">
    <td height="23" align="right" >文章状态:</td>
    <td >
	<input checked <% IF sh = 1 Then Response.Write "Checked" %> name="sh" id="sh1" type="radio" value="1"  ><label for="sh1">投搞</label>

⌨️ 快捷键说明

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