<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="Cookies.asp" -->
<%
Call Check_url()


HtmlTIDS = "发帖 - "
%>
<!--#include file="../Public/Features.asp"-->

<script type="text/javascript" src="/Editor/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/Editor/xheditor-zh-cn.min.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
	$('#elmm').xheditor({skin:'default',upLinkUrl:"!{editorRoot}xheditor_plugins/multiupload/multiupload.asp?uploadurl={editorRoot}upload.asp%3Fimmediate%3D1&ext=附件文件(*.zip;*.rar;*.txt)",upImgUrl:'!{editorRoot}xheditor_plugins/multiupload/multiupload.asp?uploadurl={editorRoot}upload.asp%3Fimmediate%3D1&ext=图片文件(*.jpg;*.jpeg;*.gif;*.png)',upFlashUrl:'!{editorRoot}xheditor_plugins/multiupload/multiupload.asp?uploadurl={editorRoot}upload.asp%3Fimmediate%3D1&ext=Flash动画(*.swf)',upMediaUrl:'!{editorRoot}xheditor_plugins/multiupload/multiupload.asp?uploadurl={editorRoot}upload.asp%3Fimmediate%3D1&ext=多媒体文件(*.wmv;*.avi;*.wma;*.mp3;*.mid)',shortcuts:{'ctrl+enter':submitForm}});
}
function submitForm(){$('#frmDemo').submit();}
</script>
<%
Set Rs    = Server.CreateObject("ADODB.Recordset")
set Rs2   = Server.CreateObject("ADODB.Recordset")

tableIDs  = Conidfilename(1)

Ac        = Replace_Text(request("Ac"))
ID        = Replace_Text(request("ID"))
Mn1       = Replace_Text(request("Mn1"))
Mn2       = Replace_Text(request("Mn2"))
Mn3       = Replace_Text(request("Mn3"))
if Mn3="" then Mn3=0



'///////////////////////////////////////////////////////////////////////////////////////////////////
IF Mn2<>"" AND Mn2<>0 AND ID="" THEN
'///////////////////////////////////////////////////////////////////////////////////////////////////
set Rsg = Conn.execute("select * from OUCCS_MenuAll where id="&Mn2&"")
IF NOT Rsg.BOF THEN
GGid       = Rsg("id")
GGnid      = Rsg("nid")
GGuid      = Rsg("uid")
GGppid     = Rsg("ppid")
GGtitle    = Rsg("title")
GGinfo     = Rsg("info")
GGsys      = Rsg("sys")
GGpeo      = Rsg("peo")
GGpic      = Rsg("pic")
GGccc      = Rsg("ccc")
ELSE
 Response.write "<script language=JavaScript>alert('获取参数错误！请重新操作');location.href='"&setHistoryUrl()&"';</script>"
 Response.End()
END IF
Rsg.Close
'///////////////////////////////////////////////////////////////////////////////////////////////////
IF GGpeo="Experience" THEN

  if Cint(Cookies73)<GGccc then
   Response.write "<script language=JavaScript>alert('你的经验不足"&GGccc&"！无权在该板块发帖');location.href='"&setHistoryUrl()&"';</script>"
   Response.End()
  end if

ELSEIF  GGpeo="Rep" THEN

  if Cint(Cookies86)<GGccc then
   Response.write "<script language=JavaScript>alert('你的在线时间不足"&Days(GGccc)&"！无权在该板块发帖');location.href='"&setHistoryUrl()&"';</script>"
   Response.End()
  end if

END IF
'///////////////////////////////////////////////////////////////////////////////////////////////////
END IF
'///////////////////////////////////////////////////////////////////////////////////////////////////



n_title   = Replace_Text(request.Form("n_title"))
n_content = request.Form("n_content")
n_setting = Replace_Text(request.Form("n_setting"))
n_qianming= Replace_Text(request.Form("n_qianming"))
if n_qianming="" then n_qianming=0
n_tongzhi = Replace_Text(request.Form("n_tongzhi"))
if n_tongzhi="" then n_tongzhi=0
TZ        = Replace_Text(request.Form("TZ"))
n_url     = Replace_Text(request.Form("n_url"))
n_from    = Cls_WebName
n_user    = Cookies2
n_brief   = DelHtml(n_content)
tableID   = Replace_Text(request.Form("tableID"))

'///////////////////////////////////////////////////////////////////

if ID<>"" then


sqltext="select * from OUCCS_NewsList where n_id="&ID
rs.Open sqltext,Conn,1,1
	if not rs.EOF then

	n_id1=rs("n_id")
	n_title1=rs("n_title")
	n_content1=rs("n_content")
	n_setting1=rs("n_setting")
	n_qianming1=rs("n_qianming")
	n_tongzhi1=rs("n_tongzhi")
	n_nid1=rs("n_nid")
	n_url1=replace(rs("n_url"),"http://","")
	n11=rs("n1")
	n21=rs("n2")
	n31=rs("n3")
	
	
	end if
rs.Close







if Request.ServerVariables("REQUEST_METHOD")="POST" and Ac="Add" then


IF n_title="" Then
 Response.Write"<script>alert(""请填写标题！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End if


IF n_content="" Then 
 Response.Write"<script>alert(""请填写内容！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End If


sqltext="select * from OUCCS_NewsList where n_id="&ID
rs2.Open sqltext,Conn,1,3

	rs2("n_title")=n_title
	rs2("n_brief")=gotTopic(n_brief,200)
	rs2("n_content")=n_content
	rs2("n_setting")=n_setting
	rs2("n_qianming")=n_qianming
	rs2("n_tongzhi")=n_tongzhi
	
rs2.Update 
rs2.Close 

	
Response.Redirect "Moban.asp?K="&tableID&"&TID="&Mn1&","&Mn2&"&ID="&ID&"&TZ="&TZ&"&Tong="&n_tongzhi&"&S=/Home/i.asp"

end if






else






if Request.ServerVariables("REQUEST_METHOD")="POST" and Ac="Add" then


IF n_title="" Then
 Response.Write"<script>alert(""请填写标题！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End if


IF n_content="" Then 
 Response.Write"<script>alert(""请填写内容！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End If


sqltext="select * from OUCCS_NewsList"
rs2.Open sqltext,Conn,1,2
rs2.AddNew

	rs2("num")=getkeyid("OUCCS_NewsList","num")
	rs2("n_distinction")=1
	rs2("n_title")=n_title
	rs2("n_brief")=gotTopic(n_brief,200)
	rs2("n_content")=n_content
	rs2("n_from")=n_from
	rs2("n_user")=n_user
	rs2("n_pid")=19
	rs2("n_setting")=n_setting
	rs2("n_qianming")=n_qianming
	rs2("n_tongzhi")=n_tongzhi
	rs2("n_url")=n_url
	rs2("n_time")=Now()
	rs2("update_time")=Now()
	rs2("n_nid")=tableID
	rs2("n_uid")=Cookies0
	if Mn3<>0 then
	rs2("n")=Mn3
	else
	rs2("n")=Mn2
	end if
	rs2("n1")=Mn1
	rs2("n2")=Mn2
	rs2("n3")=Mn3
	rs2("n4")=0
	
rs2.Update 
rs2.Close 






   
Response.Redirect "Moban.asp?K="&tableID&"&TID="&Mn1&","&Mn2&"&ID=0&S=/News/"
end if







end if

%>



<script language="JavaScript">
function frmDemo_chk(){
if (document.frmDemo.n_title.value==""){
 alert("-请填写标题-");
 document.frmDemo.n_title.focus();
 return false;
}
}
</script>
<table width="860" border="0" align="center" cellpadding="5" cellspacing="0">
<form name="frmDemo" id="frmDemo" method="post" action="News.ok.asp?Ac=Add" onSubmit="return frmDemo_chk();">
<input type="hidden" name="ID" value="<%=ID%>" />
<%if ID<>"" then%>
<input type="hidden" name="Mn1" value="<%=n11%>" />
<input type="hidden" name="Mn2" value="<%=n21%>" />
<input type="hidden" name="Mn3" value="<%=n31%>" />
<input type="hidden" name="TZ" value="<%=n_tongzhi1%>" />
<%else%>
<input type="hidden" name="Mn1" value="<%=Mn1%>" />
<input type="hidden" name="Mn2" value="<%=Mn2%>" />
<input type="hidden" name="Mn3" value="<%=Mn3%>" />
<input type="hidden" name="TZ" value="0" />
<%end if%>

<%if n_nid1<>"" then%>
<input name="tableID" type="hidden" value="<%=n_nid1%>">
<%else%>
<input name="tableID" type="hidden" value="<%=tableIDs%>">
<%end if%>

<%if n_url1<>"" then%>
<input name="n_url" type="hidden" id="n_url" value="<%=n_url1%>" size="60" />
<%else%>
<input name="n_url" type="hidden" id="n_url" value="/Shtml/<%=tableIDs%>.html" size="60" />
<%end if%>


  <tr>
    <td height="20" align="left" valign="middle" style="font-size:14px; color:#86593E" id="UserDHLinkE"><%if ID<>"" then%><B>发帖：</B><%=WebNewsMenuID3(n11)%> &raquo; <%=WebNewsMenuID3(n21)%> &raquo; <%=WebNewsMenuID3(n31)%><%else%><a href="Javascript:;" onclick="showDiv('AddNews');"><B>发帖：</B><%=WebNewsMenuID3(Mn1)%> &raquo; <%=WebNewsMenuID3(Mn2)%> &raquo; <%=WebNewsMenuID3(Mn3)%></a><%end if%></td>
    </tr>
  <tr>
    <td align="left" valign="middle"><input name="n_title" type="text" class="text1" id="n_title" size="80" value="<%=n_title1%>" onMouseOver="this.focus()" onFocus="this.select()"></td>
    </tr>
  <tr>
    <td align="left" valign="middle"><textarea id="elmm" name="n_content" rows="25" cols="80" style="width:860PX"><%=n_content1%></textarea></td>
    </tr>
  <tr>
    <td align="left" valign="middle" style="font-size:14px; color:#0070B8">浏览权限：<select name="n_setting" style="font-size:12px">
      <option value="0" <%if n_setting1=0 then%>selected="selected"<%end if%>>公开</option>
	  <option value="1" <%if n_setting1=1 then%>selected="selected"<%end if%>>所有用户可看</option>
	  <option value="2" <%if n_setting1=2 then%>selected="selected"<%end if%>>需回复可看</option>
	  <option value="3" <%if n_setting1=3 then%>selected="selected"<%end if%>>仅粉丝可看</option>
    </select>
	&nbsp;&nbsp;&nbsp;
	<input name="n_qianming" type="checkbox" value="1" <%if n_qianming1=1 then%>checked="checked"<%end if%> />
	&nbsp;使用个人签名&nbsp;&nbsp;&nbsp;<input name="n_tongzhi" type="checkbox" value="1" <%if n_tongzhi1=1 then%>checked="checked"<%end if%> />&nbsp;通知粉丝
	</td>
    </tr>
  <tr>
    <td align="left" valign="middle"><input name="submit" type="submit" id="submit" class="submitInput" value="" /></td>
    </tr>
  <tr>
    <td height="20" align="left" valign="middle"></td>
    </tr>
</form>
</table>



<!--#Include file="../Public/Bottom.asp"-->