Constr_Action.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:14k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <% Option Explicit %>
- <!--#include file="../../FS_Inc/Const.asp" -->
- <!--#include file="../../FS_InterFace/MF_Function.asp" -->
- <!--#include file="../../FS_InterFace/ns_Function.asp" -->
- <!--#include file="../../FS_Inc/Function.asp" -->
- <!--#include file="../../FS_Inc/Func_page.asp" -->
- <!--#include file="lib/cls_main.asp" -->
- <%'Copyright (c) 2006 Foosun Inc. Code by Einstein.Liu
- Dim Conn,User_Conn,FS_News,values,action,info_Rs,news_Rs,sql_cmd,sql_news_cmd,str_FileName
- Dim contrPoint,contrMoney,contrAuditPoint,contrAuditMoney,Rs,MainID
- 'Admin_Login_State'判断是否登陆
- MF_User_Conn
- MF_Default_Conn
- MF_Session_TF
- if not MF_Check_Pop_TF("NS_Constr") then Err_Show
- Set info_Rs=Server.CreateObject(G_FS_RS)
- Set news_Rs=Server.CreateObject(G_FS_RS)
- Set FS_News=New Cls_News
- FS_News.GetSysParam()
- values=NoSqlHack(request.QueryString("values"))
- values=DelHeadAndEndDot(values)'去处首尾逗号
- action=NoSqlHack(request.QueryString("act"))
- Set Rs=User_Conn.execute("Select top 1 contrPoint,contrMoney,contrAuditPoint,contrAuditMoney from FS_ME_SysPara")
- if Rs.eof then
- Response.Redirect("../error.asp?ErrCodes=<li>请先设置会员参数</li>&ErrorUrl=")
- ELse
- contrPoint=Rs("contrPoint")
- if not isnumeric(contrPoint) then contrPoint=0
- contrMoney=Rs("contrMoney")
- if not isnumeric(contrMoney) then contrMoney=0
- contrAuditPoint=Rs("contrAuditPoint")
- if not isnumeric(contrAuditPoint) then contrAuditPoint=0
- contrAuditMoney=Rs("contrAuditMoney")
- if not isnumeric(contrAuditMoney) then contrAuditMoney=0
- End if
- Rs.close
- Set Rs=nothing
- '审核
- if action="audit" then
- if not MF_Check_Pop_TF("NS030") then Err_Show
- sql_news_cmd="select id,NewsID,NewsTitle,CurtTitle,Content,Keywords,Editor,isPicNews,Author,classID,Templet,NewsPicFile,SaveNewsPath,FileName,FileExtName,addtime,NewsProperty from FS_NS_News"
- if instr(values,",")=0 then
- sql_cmd="select AuditTF,ContTitle,SubTitle,ContContent,KeyWords,UserNumber,MainID,PicFile from FS_ME_InfoContribution where contid="&values
- info_Rs.open sql_cmd,User_Conn,1,3
- news_Rs.open sql_news_cmd ,Conn,1,3
- news_Rs.addNew
- if not info_Rs.eof then
- news_Rs("NewsTitle")=info_Rs("ContTitle")
- news_Rs("CurtTitle")=info_Rs("SubTitle")
- news_Rs("Content")=info_Rs("ContContent")
- news_Rs("Keywords")=info_Rs("KeyWords")
- if trim(info_Rs("PicFile"))<>"" then
- news_Rs("NewsPicFile")=info_Rs("PicFile")
- news_Rs("isPicNews")=1
- ENd if
- news_Rs("Author")=FS_News.GetUserName(info_Rs("userNumber"))
- news_Rs("Editor")=session("Admin_Name")
- if not isnull(info_Rs("MainID")) and not info_Rs("MainID")="" then
- Set Rs= Conn.execute("select Classid from FS_NS_NewsClass where id="&info_Rs("MainID"))
- if not Rs.eof then
- MainID=Rs("Classid")
- Else
- MainID="0"
- End if
- Else
- MainID="0"
- End If
- If MainID="0" Then
- Response.Redirect("lib/error.asp?ErrCodes=<li>请选择栏目n</li>")
- Response.End()
- End if
- news_Rs("classID")=MainID
- news_Rs("NewsID")=FS_News.getRamCode(15)
- news_Rs("SaveNewsPath") = Fs_news.SaveNewsPath(Fs_news.fileDirRule)
- news_Rs("FileName")=Fs_news.strFileNameRule(Fs_news.fileNameRule,0,0)
- news_Rs("NewsProperty")="0,1,1,1,0,0,0,0,1,0,0"
- if trim(request.Form("NewsTemplet"))<>"" then
- news_Rs("Templet")=request.Form("NewsTemplet")
- Else
- news_Rs("Templet")=Replace("/"& G_TEMPLETS_DIR &"/NewsClass/news.htm","//","/")
- ENd if
- Dim fileExtName
- select case Fs_news.fileExtName
- case 1 fileExtName="htm"
- case 2 fileExtName="shtml"
- case 3 fileExtName="shtml"
- case 4 fileExtName="shtm"
- case else fileExtName="html"
- End select
- news_Rs("FileExtName")=fileExtName
- news_Rs("addtime")=Now()
- news_Rs.update
- if G_IS_SQL_DB = 0 then'是否是sqlserver
- newsID = news_Rs("ID")
- Else
- 'select ident_current('FS_NS_News') 有待修正
- newsID = ""
- End if
- str_FileName=news_Rs("FileName")
- Dim TempRsObj
- If Instr(str_FileName,"自动编号ID") Then
- str_FileName = Replace(str_FileName,"自动编号ID",newsID)
- Set TempRsObj=server.CreateObject(G_FS_RS)
- TempRsObj.open "select FileName From [Fs_NS_News] where NewsID='"&news_Rs("NewsID")&"' and ID="&Clng(newsID)&"",Conn,1,3
- if not TempRsObj.eof Then
- TempRsObj("FileName") = Replace(TempRsObj("FileName"),"自动编号ID",newsID)
- TempRsObj.update
- End If
- TempRsObj.Close
- End IF
- Dim TempRsObj_1
- If Instr(str_FileName,"唯一NewsID") Then
- str_FileName = Replace(str_FileName,"唯一NewsID",news_Rs("NewsID"))
- Set TempRsObj_1=server.CreateObject(G_FS_RS)
- TempRsObj_1.open "select FileName From [Fs_NS_News] where NewsID='"&news_Rs("NewsID")&"'",Conn,1,3
- if not TempRsObj_1.eof Then
- TempRsObj_1("FileName") = str_FileName
- TempRsObj_1.update
- End If
- TempRsObj_1.Close
- End IF
- User_Conn.execute("Update FS_ME_InfoContribution set NewsID="&newsID)
- User_Conn.execute("Update FS_ME_Users set Integral=Integral+"&(contrAuditPoint)&" , FS_Money=FS_Money+"&(contrAuditMoney)&",ConNumberNews=ConNumberNews+1 where usernumber='"&info_Rs("UserNumber")&"'")
- Else
- Response.Redirect("lib/error.asp?ErrCodes=<li>投稿数据异常</li>")
- Response.End()
- End if
- info_Rs.close
- news_Rs.close
- else
- if not MF_Check_Pop_TF("NS030") then Err_Show
- Dim i,contID_Array'稿件id数组,
- contID_Array=split(values,",")
- for i =0 to Ubound(contID_Array)
- sql_cmd="select AuditTF,ContTitle,SubTitle,ContContent,KeyWords,UserNumber,MainID,PicFile from FS_ME_InfoContribution where contid="&contID_Array(i)
- info_Rs.open sql_cmd,User_Conn,1,3
- if not info_Rs.eof then
- news_Rs.open sql_news_cmd,Conn,1,3
- news_Rs.addNew
- news_Rs("NewsTitle")=info_Rs("ContTitle")
- news_Rs("CurtTitle")=info_Rs("SubTitle")
- news_Rs("Content")=info_Rs("ContContent")
- news_Rs("Keywords")=info_Rs("KeyWords")
- if trim(info_Rs("PicFile"))<>"" then
- news_Rs("NewsPicFile")=info_Rs("PicFile")
- news_Rs("isPicNews")=1
- ENd if
- news_Rs("Author")=FS_News.GetUserName(info_Rs("UserNumber"))
- news_Rs("Editor")=session("Admin_Name")
- if not isnull(info_Rs("MainID")) and not info_Rs("MainID")="" then
- Set Rs= Conn.execute("select Classid from FS_NS_NewsClass where id="&info_Rs("MainID"))
- if not Rs.eof then
- MainID=Rs("Classid")
- Else
- MainID="0"
- End if
- Else
- MainID="0"
- End If
- If MainID="0" Then
- Response.Redirect("lib/error.asp?ErrCodes=<li>请选择栏目a</li>")
- Response.End()
- End if
- news_Rs("classID")=MainID
- news_Rs("NewsID")=FS_News.getRamCode(15)
- news_Rs("SaveNewsPath") = Fs_news.SaveNewsPath(Fs_news.fileDirRule)
- news_Rs("FileName")=Fs_news.strFileNameRule(Fs_news.fileNameRule,0,0)
- news_Rs("NewsProperty")="0,1,1,1,0,0,0,0,1,0,0"
- if trim(request.Form("NewsTemplet"))<>"" then
- news_Rs("Templet")=request.Form("NewsTemplet")
- Else
- news_Rs("Templet")=Replace("/"& G_TEMPLETS_DIR &"/NewsClass/news.htm","//","/")
- ENd if
- select case Fs_news.fileExtName
- case 1 fileExtName="htm"
- case 2 fileExtName="shtml"
- case 3 fileExtName="shtml"
- case 4 fileExtName="shtm"
- case else fileExtName="html"
- End select
- news_Rs("FileExtName")=fileExtName
- news_Rs("addtime")=Now()
- news_Rs.update
- if G_IS_SQL_DB = 0 then'是否是sqlserver
- newsID = news_Rs("ID")
- Else
- 'select ident_current('FS_NS_News') 有待修正
- newsID = ""
- End if
- User_Conn.execute("Update FS_ME_InfoContribution set NewsID="&newsID&" where ContID="&contID_Array(i))
- str_FileName=news_Rs("FileName")
- If Instr(str_FileName,"自动编号ID") Then
- str_FileName = Replace(str_FileName,"自动编号ID",newsID)
- Set TempRsObj=server.CreateObject(G_FS_RS)
- TempRsObj.open "select FileName From [Fs_NS_News] where NewsID='"&news_Rs("NewsID")&"' and ID="&Clng(newsID)&"",Conn,1,3
- if not TempRsObj.eof Then
- TempRsObj("FileName") =str_FileName
- TempRsObj.update
- End If
- TempRsObj.Close
- End IF
- If Instr(str_FileName,"唯一NewsID") Then
- str_FileName = Replace(str_FileName,"唯一NewsID",news_Rs("NewsID"))
- Set TempRsObj_1=server.CreateObject(G_FS_RS)
- TempRsObj_1.open "select FileName From [Fs_NS_News] where NewsID='"&news_Rs("NewsID")&"'",Conn,1,3
- if not TempRsObj_1.eof Then
- TempRsObj_1("FileName") =str_FileName
- TempRsObj_1.update
- End If
- TempRsObj_1.Close
- End if
- User_Conn.execute("Update FS_ME_InfoContribution set NewsID="&newsID)
- User_Conn.execute("Update FS_ME_Users set Integral=Integral+"&Clng(contrAuditPoint)&" , FS_Money=FS_Money+"&Clng(contrAuditMoney)&",ConNumberNews=ConNumberNews+1 where usernumber='"&info_Rs("UserNumber")&"'")
- Else
- Response.Redirect("lib/error.asp?ErrCodes=<li>投稿数据异常</li>")
- Response.End()
- ENd if
- info_Rs.close
- news_Rs.close
- next
- End if
- User_Conn.execute("Update FS_ME_InfoContribution set audittf=1 where ContID in("&values&")")
- '撤消审核
- elseif action="recall" then
- if not MF_Check_Pop_TF("NS030") then Err_Show
- sql_cmd_1="update FS_ME_InfoContribution set AuditTF=0 where ContID in("&values&")"
- User_Conn.execute(sql_cmd)
- '管理员锁定
- elseif action="lock" then
- if not MF_Check_Pop_TF("NS031") then Err_Show
- sql_cmd="update FS_ME_InfoContribution set AdminLock=1 where ContID in("&values&")"
- '解除锁定
- elseif action="unlock" then
- if not MF_Check_Pop_TF("NS030") then Err_Show
- sql_cmd="update FS_ME_InfoContribution set AdminLock=0 where ContID in("&values&")"
- User_Conn.execute(sql_cmd)
- '设为推荐
- elseif action="tf" then
- sql_cmd="update FS_ME_InfoContribution set isTF=1 where ContID in("&values&")"
- User_Conn.execute(sql_cmd)
- '取消推荐
- elseif action="untf" then
- if not MF_Check_Pop_TF("NS_Constr") then Err_Show
- sql_cmd="update FS_ME_InfoContribution set isTF=0 where ContID in("&values&")"
- User_Conn.execute(sql_cmd)
- '删除
- ElseIf action="delete" Then
- if not MF_Check_Pop_TF("NS032") then Err_Show
- sql_cmd="delete From FS_ME_InfoContribution where ContID in ("&values&")"
- User_Conn.execute(sql_cmd)
- ElseIf action="deleteAll" Then
- if not MF_Check_Pop_TF("NS032") then Err_Show
- sql_cmd="delete From FS_ME_InfoContribution where isLock=0"
- User_Conn.execute(sql_cmd)
- '退稿
- elseif action="untread" then
- if not MF_Check_Pop_TF("NS033") then Err_Show
- sql_cmd="update FS_ME_InfoContribution Set untread=1 where ContID in("&values&")"
- User_Conn.execute("Update FS_ME_Users set Integral=Integral-"&Clng(contrAuditPoint)&" , FS_Money=FS_Money-"&Clng(contrAuditMoney)&" where usernumber in (select usernumber from FS_ME_InfoContribution where ContID in ("&values&"))")
- User_Conn.execute(sql_cmd)
- '编辑审核
- elseif action="editaudit" then
- if not MF_Check_Pop_TF("NS030") then Err_Show
- Dim ContID,NewsTitle,CurtTitle,Content,Keywords,Author,ClassID
- ContID=Request.Form("hid_contID")
- NewsTitle=Request.Form("txt_newsTitle")
- CurtTitle=Request.Form("txt_curtTitle")
- Content=Request.Form("txt_content")
- Keywords=Request.Form("txt_keywords")
- Author=Request.Form("hid_Author")
- ClassID=Request.Form("hid_ClassID")
- sql_news_cmd="select ID,NewsID,NewsTitle,CurtTitle,Content,Keywords,Author,classID,isPicNews,NewsPicFile,SaveNewsPath,FileName,FileExtName,addtime,Templet,NewsProperty,Editor from FS_NS_News"
- sql_cmd="select audittf,PicFile,UserNumber,MainID from FS_ME_InfoContribution where ContID="&ContID
- news_Rs.open sql_news_cmd,Conn,1,3
- info_Rs.open sql_cmd,User_Conn,1,3
- news_Rs.addNew
- news_Rs("NewsID")=FS_News.GetRamCode(15)
- news_Rs("NewsTitle")=NewsTitle
- news_Rs("CurtTitle")=CurtTitle
- news_Rs("Content")=Content
- news_Rs("Keywords")=Keywords
- news_Rs("Author")=Author
- news_Rs("Editor")=session("Admin_Name")
- news_Rs("NewsProperty")="0,1,1,1,0,0,0,0,1,0,0"
- news_Rs("Templet")=request.Form("NewsTemplet")
- news_Rs("classID")=classid
- if trim(info_Rs("PicFile"))<>"" then
- news_Rs("NewsPicFile")=info_Rs("PicFile")
- news_Rs("isPicNews")=1
- ENd if
- news_Rs("Author")=FS_News.GetUserName(info_Rs("UserNumber"))
- if trim(ClassID)="" then
- Response.Redirect("lib/error.asp?ErrCodes=<li>请选择栏目</li>")
- Response.End()
- End if
- news_Rs("classID")=ClassID
- news_Rs("SaveNewsPath") = Fs_news.SaveNewsPath(Fs_news.fileDirRule)
- news_Rs("FileName")=Fs_news.strFileNameRule(Fs_news.fileNameRule,0,0)
- select case Fs_news.fileExtName
- case 1 fileExtName="htm"
- case 2 fileExtName="shtml"
- case 3 fileExtName="shtml"
- case 4 fileExtName="shtm"
- case else fileExtName="html"
- End select
- news_Rs("FileExtName")=fileExtName
- news_Rs("AddTime")=Now()
- news_Rs.update
- if G_IS_SQL_DB = 0 then'是否是sqlserver
- newsID = news_Rs("ID")
- Else
- 'select ident_current('FS_NS_News') 有待修正
- newsID = ""
- End if
- str_FileName=news_Rs("FileName")
- If Instr(str_FileName,"自动编号ID") Then
- str_FileName = Replace(str_FileName,"自动编号ID",newsID)
- Set TempRsObj=server.CreateObject(G_FS_RS)
- TempRsObj.open "select FileName From [Fs_NS_News] where NewsID='"&news_Rs("NewsID")&"' and ID="&Clng(newsID)&"",Conn,1,3
- if not TempRsObj.eof Then
- TempRsObj("FileName") = str_FileName
- TempRsObj.update
- End If
- TempRsObj.Close
- End IF
- If Instr(str_FileName,"唯一NewsID") Then
- str_FileName = Replace(str_FileName,"唯一NewsID",news_Rs("NewsID"))
- Set TempRsObj_1=server.CreateObject(G_FS_RS)
- TempRsObj_1.open "select FileName From [Fs_NS_News] where NewsID='"&news_Rs("NewsID")&"'",Conn,1,3
- if not TempRsObj_1.eof Then
- TempRsObj_1("FileName") = str_FileName
- TempRsObj_1.update
- End If
- TempRsObj_1.Close
- End IF
- news_Rs.close
- info_Rs("audittf")=1
- info_Rs.update
- info_Rs.close
- '删除投稿
- elseif action="delete" then
- if not MF_Check_Pop_TF("NS032") then Err_Show
- Dim Temp_Rs,NewsID
- Set Temp_Rs=User_Conn.execute("Select NewsID From FS_ME_InfoContribution where ContID in("&values&")")
- while not Temp_Rs.eof
- NewsID=Temp_Rs("NewsID")&","&NewsID
- Temp_Rs.movenext
- wend
- NewsID=DelHeadAndEndDot(NewsID)
- User_Conn.Execute("Delete * From FS_ME_InfoContribution where ContID in("&values&")")
- Conn.Execute("Delete * From FS_NS_News where ID in("&NewsID&")")
- Set Temp_Rs=nothing
- End if
- if err.number=0 then
- Response.Redirect("lib/success.asp?ErrCodes=<li>操作成功</li>&ErrorURL=../Constr_List.asp")
- Response.End()
- else
- Response.Redirect("lib/error.asp?ErrCodes=<li>请检查输入是否合法</li>")
- Response.End()
- end if
- %>
- <%
- Conn.close
- User_Conn.close
- Set Conn=nothing
- Set User_Conn=nothing
- Set info_Rs=nothing
- %>
- <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->