<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conndb.asa"-->
<!--#include file="inc/function.asp"-->
<%
call checkuser()
id=cInt(Request.QueryString("id"))
tn=Request.QueryString("tn")'判断是哪个表 TableName
If tn="bbs" Then'判断是哪个表 TableName=bbs
tname="主题"
	Set rs1 = Server.CreateObject("ADODB.Recordset") 
	rs1.Open "Select * From "&bbstable&" where id="&id, conn,1,1 
		nowhits=rs1("hits") 
		title=rs1("title")
		recount=rs1("recount")
		istop=rs1("istop")
		isgood=rs1("isgood")
		username=rs1("username")
		addtime=rs1("addtime")
		content=rs1("content")
		lou=rs1("lou")
		re=rs1("re")
		boardid=rs1("boardid")
		recount=rs1("recount")
		titlecolor=rs1("titlecolor")
		picurl=rs1("picurl")
		titleBold = CInt(rs1("titleBold"))
		hits=rs1("hits")
		IsFee = rs1("IsFee") '是否需要积分才能浏览 Add For V1.5
		IsRe = rs1("IsRe") '是否允许回复 Add For V1.5
	rs1.close
	set rs1=nothing
Else'判断是哪个表 TableName=rebbs
tname="回复"
	Set rs1 = Server.CreateObject("ADODB.Recordset") 
	rs1.Open "Select "&rebbstable&".*, "&bbstable&".boardid as boardid from "&rebbstable&","&bbstable&" where "&rebbstable&".re="&bbstable&".id and "&rebbstable&".id="&id, conn,1,1 
		title=rs1("title")
		username=rs1("username")
		addtime=rs1("addtime")
		content=rs1("content")
		boardid=rs1("boardid")
		lou=rs1("lou")
		re=rs1("re")
	rs1.close
	set rs1=nothing
End If 
'response.write boardid
'判断思路：如果不是作者本人，则判断是否最高管理员，如果不是最高管理员，则判断是否版主
If username<>Dreamsun_name And CInt(IsAdmin)<>9 Then Call checkbanzhu()
If isadmin<>9 Then u="u"
navdh="编辑"&tname&"帖子"
webtitle=title&"-"&bbsname
Call showpage()'调用公用页面，显示界面
Sub pagecontent()
%>
<form name="save" method="post" action="tzsave.asp?cz=<%=u%>editsave&tn=<%=tn%>">
<table width="700" align="center" cellSpacing=1 cellPadding=0  border=0>
		<input name="ycid" type="hidden" id="ycid" value="<%=id%>">
		<input name="comurl" type="hidden" id="comurl" value="<%=Cstr(Request.ServerVariables("HTTP_REFERER"))%>">
            <tr>
              <td width="10%" align="right" height="24"><strong>标 题：</strong></td>
              <td><input name="title" type="text" id="title" size="50" value="<%=title%>"><%If tn="bbs" And isadmin=9 Then %>  颜色：<input name="titlecolor" type="text" id="titlecolor" size=10 value="<%=titlecolor%>"> 
				<input type="radio" name="titleBold" value="0" <%If titleBold<>1 Then %>checked<%End If%> id="titleBold1"><label for="titleBold1">正常</label>
				<input type="radio" name="titleBold" value="1" <%If titleBold=1 Then %>checked<%End If%> id="titleBold2"><label for="titleBold2">粗体</label>
			  <%End If%></td>
            </tr>
			<%If tn="bbs" And isadmin=9 Then %>
			<tr  height="24">			
              <td width="10%" align="right"><strong>标题色：</strong></td>
              <td><script language=JavaScript src="images/title_color.js"></script>
                <TABLE id=ColorPanel cellSpacing=0 cellPadding=0 border=0>
                  <TBODY>
                    <TR>
                      <TD id=ColorUsed 
                     onclick="if(this.bgColor.length > 0) insertTag(this.bgColor)" 
                     vAlign=center align=middle> </TD>
                      <SCRIPT language=JavaScript>rgb(pas,width1,height1)</SCRIPT>
                    </TR>
                  </TBODY>
              </TABLE></td>
            </tr>
			<% End If %>
			<tr>
              <td width="10%" align="right" valign="top"><strong>内容：</strong></td>
              <td>
			  
			<textarea name="content" id="contents" cols="60" rows="13" onSelect="javascript: storeCaret(this);" onClick="javascript: storeCaret(this);" onKeyUp="javascript: storeCaret(this);"><%=content%></textarea></td>
            </tr>
			<tr  height="24">
              <td align="right"><strong>UBB</strong></td>
              <td><!--#include file="inc/ubb.asp" --></td>
            </tr>
			<%If ispicurl=1 And tn="bbs" Then%>
 			<tr>
              <td width="10%" align="right" valign="top"><strong>幻灯图：</strong></td>
              <td><input name="picurl" type="text" id="picurl" size="50" value="<%=picurl%>"></td>
            </tr>
            <tr  height="24">
              <td align="right"><strong>回 复：</strong></td>
              <td>
                    <input name="isRe" type="radio" id="isRe1" value="1" <%if CInt(IsRe)=1 then Response.Write("checked")%>>
                    <label for="isRe1">允许</label> 
                    <input name="isRe" type="radio" id="isRe2" value="0" <%if CInt(IsRe)=0 then Response.Write("checked")%> >
                    <label for="isRe2">不允许</label>
              </td>
            </tr>
		<%
			End If 
			If isadmin=9 Then 
		%>
            <tr  height="24">
              <td align="right"><strong>作 者：</strong></td>
              <td><input name="username" type="text" id="username" size="50" value="<%=username%>"></td>
            </tr>
            <tr height="24">
              <td align="right"><strong>注意：</strong></td>
              <td><font color=red>如果不知道以下参数的作用，请不要修改。</font></td>
            </tr>
            <tr height="26">
              <td align="right"><strong>参 数：</strong></td>
              <td>
			  <%If tn="bbs" Then'判断是哪个表 %>
			  点击：<input name="hits" type="text" id="hits" size="6" value="<%=hits%>"> 回数：<input name="recount" type="text" id="re" size="6" value="<%=recount%>"> 吧：<select name="boardid">
      <%
sql_board = "SELECT * FROM "&boardtable&" ORDER BY board_order DESC,board_id DESC"
Set rs_board = Server.CreateObject("ADODB.Recordset")
rs_board.OPEN sql_board,Conn,1,1
if rs_board.eof and rs_board.bof then
Response.Write"<option>还没有任何分类</option>"
else
do while not rs_board.eof
Response.Write"<option value='"&rs_board("board_id")&"'"
if boardid=rs_board("board_id") then Response.Write" selected"
Response.Write">"&rs_board("board_Name")&"</option>"
rs_board.movenext
loop
end if
rs_board.close
set rs_board=nothing
%></select>置顶：
			<select name="istop">
	  <option value='0'<%If istop=0 Then response.write " selected"%>>不置顶</option>
      <option value='1'<%If istop=1 Then response.write " selected"%>>板置顶</option>
	  <option value='2'<%If istop=2 Then response.write " selected"%>>总置顶</option>
			</select>
			  <% End If %>
			   关联：<input name="re" type="text" id="re" size="10" value="<%=re%>"> 楼层：<input name="lou" type="text" id="lou" size="6" value="<%=lou%>">
			</td>
            </tr>
			<%End If %>
			<tr  height="24">
              <td align="right">&nbsp;</td>
              <td><input type="submit" name="Submit" value="编辑">&nbsp;&nbsp;<input type="reset" name="Submit" value="重新填写"></td>
            </tr>
        </table></form> 
<%End Sub %>
