<%@ Language=VBScript%>
<%
Response.Buffer=false
Response.Expires=0
%>
<!-- #include file="./dsnroot.asp" -->
<!-- #include file="./links.asp" -->
<%
set cn=Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject("ADODB.Recordset")
set rs1=Server.CreateObject("ADODB.Recordset")
cn.Open mycnstr
xx=1
menu="0000100"
id=Request.QueryString ("id")
if id="" then
	  id=0
   else
	  id=cint(id)
end if

if id=0 then 
	Response.Write ("<table width=778 align=center><tr><td bgcolor=dddddd height=500 width=100% align=center>参数错误！您没有选择要查看的话题</td></tr></table>")		
	Response.End 
end if		
if session("userflag")=1 and session("username")<>"" then
	sqltext="select flag from userls where enable=1 and username='"+session("username")+"' and flag=1"
	rs.Open sqltext,cn,1,1
	if not rs.EOF then
		adminqx=1
	else
		adminqx=0	
	end if
	rs.Close 
elseif session("adminusername")<>"" then
	adminqx=1
else	
	adminqx=0
end if				
sqltext="select top 1 classid,count from bbs where enable=1 and id="&id
rs.Open sqltext,cn,1,2
if not rs.EOF then
	rs("count")=rs("count")+1
	classid=rs("classid")
	rs.Update 
end if	
rs.Close 
if classid<>0 then
	sqltext="select id,title from bbs_class where enable=1 and id="&classid
	rs.Open sqltext,cn,1,1
	if not rs.EOF then
		class_titletxt=trim(rs("title"))
	end if
	rs.Close 
end if
if flag=1 then
	if session("userflag")<>1 then
		err=1
	end if
end if

sqltext="select top 1 body from classes where enable=1 and id=55" 
rs.Open sqltext,cn,1,1
if not rs.EOF then
		glstr=trim(rs("body"))
end if      
rs.Close

function checkstr3(str,ins,n)
	if ins<>"" then
		Dim arr
		arr=split(ins,"|",-1,1)
		for i=0 to ubound(arr)
			str=replace(str,arr(i),"**",1,-1,1)
		next
	end if
	str=checkstr(str,1)
	checkstr3=str
end function

%>
<!-- #include file="./func.inc" -->
<!-- #include file="./begin.asp" -->
      <table width="778" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="170" bgcolor="#079C07" valign="top" align="center"> 
            <!-- #include file="./bbs_left.asp" -->
          </td>
          <td bgcolor="#FFFFEC" valign="top" align="center"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="70">&nbsp;</td>
              </tr>
            </table>
            <table width="95%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="20" height="36"><img src="images/company/title_sign.gif" width="14" height="18"></td>
                <td class="font2"><font color="#996600"><b><%=class_titletxt%></b></font></td>
              </tr>
            </table>
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#B78900">
              <tr> &nbsp; 
                <td class="font1" height="22">&nbsp;<img src="images/arrow_news.gif" width="12" height="12">&nbsp;<font color="#000000"><b><font color="#FFFFFF">主题</font></b></font></td>
                <td width="75" align=right><a href="forum_write.asp?classid=<%=classid%>&id=<%=id%>" class="a02"><font color="#ffffff">[回复话题]</font></a>&nbsp;</td>
                <td width="75" align=right><a href="forum.asp?classid=<%=classid%>" class="a02"><font color="#ffffff">[返回论坛]</font></a>&nbsp;</td>
              </tr>
            </table>
            <%if err<>1 then%>
            <%sqltext="select top 1 * from bbs where enable=1 and id="&id
             rs.Open sqltext,cn,1,1
              if not rs.EOF then
            %>
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#ffffec">
              <tr> 
                <td align="right" class="font1"><a href="Javascript:userinfo('<%=rs("username")%>','<%=rs("userflag")%>')" class=anews2><font color="#000000"><%=server.HTMLEncode(trim(rs("username")))%></font></a>&nbsp;发表于<%=rs("creatdate")%>&nbsp;</td>
              </tr>
            </table>
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td width="5"></td>
                <td class="font1" width="30" align=right><img src="bbs/mood<%=rs("face")%>.gif" width="20" height="20" border="0"></td>
                <td width="3"></td>
                <td class="font2"><%=server.HTMLEncode(trim(rs("title")))%></td>
              </tr>
            </table>
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td class="font">
					<%=checkstr3(trim(rs("content")),glstr,1)%>
                </td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
            </table>
            <%end if
            rs.Close %>
            <%sqltext="select * from bbs where enable=1 and pid="&id&" order by creatdate desc"
              rs.Open sqltext,cn,1,1
              do while not rs.EOF 
           %>
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#996600">
              <tr> &nbsp; 
                <td class="font1" height="22">&nbsp;<img src="images/arrow_news.gif" width="12" height="12">&nbsp;<font color="#000000"><b><font color="#FFFFFF">回复</font></b></font></td>
              </tr>
            </table>
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td>&nbsp;</td><td>&nbsp;</td>
              </tr>
              <tr> 
                <%if rs("face")<>0 then%>
						<td height="26" class="font3" width="35" align=right><img src="bbs/mood<%=rs("face")%>.gif" width="20" height="20" border="0"></td>
				<%end if%>
                <td class="font2" height="26">&nbsp;<a href="Javascript:userinfo('<%=rs("username")%>','<%=rs("userflag")%>')" class=anews2><font color="#000000"><%=trim(rs("username"))%></font></a>&nbsp;回复于<%=rs("creatdate")%>&nbsp;</td>
              </tr>
            </table>
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td class="font1"><%=checkstr3(trim(rs("content")),glstr,1)%></td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
            </table>
            <%rs.MoveNext 
              loop
              rs.Close %>
              
            <table width="95%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="50">&nbsp;</td>
              </tr>
            </table>
            <table width="95%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="20" height="36"><img src="images/company/title_sign.gif" width="14" height="18"></td>
                <td class="font2"><font color="#996600"><b>快速回复</b></font></td>
              </tr>
              <tr> 
                <td background="images/company/point_line.gif" height="1"></td><td background="images/company/point_line.gif" height="1"></td>
              </tr>
            </table>
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <form action="forum_write.asp?id=<%=id%>&classid=<%=classid%>" method=post name=form1 autocomplete = "off">
              <tr> 
                <td width="50" class="font1" align=right>内容:</td>
                <td> 
                  <textarea name="content" rows="8" cols="50" class="input1"></textarea>
                </td>
              </tr>
              <tr> 
                <td width="60" class="font2" valign="top">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td width="60" class="font2" valign="top">&nbsp;</td>
                <td> 
                  <input type="submit" name="Submit" value="提交" style="font-size: 12px; color: white; border: 1px; width: 43px; background-color: #996600">
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                  <input type="reset" name="Submit2" value="重填" style="font-size: 12px; color: white; border: 1px; width: 43px; background-color: #996600">
                  <input type="hidden" value="<%=now()%>回复<%=id%>" name="titlename">
                </td>
              </tr>
              </form>
            </table>
           <%else%> 
            <table width="95%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align=center><br><font color=red>本版面为内部员工交流区，您无权限进入！</font></td>
              </tr>
            </table>
          <%end if%>  
            <table width="95%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td width="170" bgcolor="#079C07" valign="top" align="center">&nbsp;</td>
          <td bgcolor="#FFFFEC" valign="top" align="center">
            <table width="95%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr> 
                <td background="images/company/point_line.gif" height="1" colspan="2"></td>
              </tr>
              <tr> 
                <td height="36" align="right"><img src="images/company/icon_top.gif" width="14" height="14"></td>
                <td height="36" width="30" align="center"><a href="#" class="a02">向上</a></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
<!-- #include file="./end.asp" -->