<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={sql server};server=;uid=sa;pwd=;database=bbs"
  kind="A_1" '只要修这个参就行，这个参数是论坛类别参数
  Sql="SELECT top 8 * FROM BBS_Cate,bbstitle where BBS_Cate.BBS_Cate_ID = bbstitle.BoardID_2 AND BBS_Cate.bbs_cate_PID = '"&kind&"' order by redate desc"
  'Sql="SELECT top 8 * FROM BBS_Cate,bbstitle where BBS_Cate.BBS_Cate_ID = bbstitle.BoardID_2 AND BBS_Cate.bbs_cate_PID = '"&kind&"' and bbstitle.showinhomepage=1 order by redate desc"
  set rs=server.createobject("adodb.recordset")
  rs.open Sql,conn,1,1
  id=rs("id")
  title=rs("title")
  boardid_1=rs("boardid_1")
  boardid_2=rs("boardid_2")
  BBS_Cate_Name=rs("BBS_Cate_Name")
  htmfilename=rs("htmfilename")
  tk1="bbs/default.asp?a="&boardid_1&"&b="&boardid_2
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>首页调用演示</title>
<link href="css/XMWUYE.CSS" rel="stylesheet" type="text/css">
</head>

<body>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="88%" height="25"><font color="#FF0000">方法一</font>、有论坛类型的调用</td>
  </tr>
  <tr>
    <td height="25"><%=rs("BBS_Cate_Name")%></td>
  </tr>
  <tr> 
    <td colspan="2"> 
      <%
	do while not rs.eof
	'response.write "[<a href=bbs/default.asp?a="&rs("boardid_1")&"&b="&rs("boardid_2")&">"&rs("BBS_Cate_Name")&"</a>]<a href=bbs/default.asp?a="&rs("boardid_1")&"&id="&rs("id")&"&htm="&rs("htmfilename")&">"&rs("title")&"</a>--"&rs("redate")&"<br>"
	response.write "[<a href=bbs/default.asp?a="&rs("boardid_1")&"&b="&rs("boardid_2")&">"&rs("BBS_Cate_Name")&"</a>]<a href=html/"&rs("htmfilename")&">"&rs("title")&"</a>--"&rs("redate")&"<br>"
	rs.movenext
	loop
	rs.close
	set rs=nothing
	%>
    </td>
  </tr>
</table>
<%
  Sql="SELECT top 8 * FROM BBS_Cate,bbstitle where BBS_Cate.BBS_Cate_ID = bbstitle.BoardID_2 AND BBS_Cate.bbs_cate_PID = '"&kind&"' order by redate desc"
  'Sql="SELECT top 8 * FROM BBS_Cate,bbstitle where BBS_Cate.BBS_Cate_ID = bbstitle.BoardID_2 AND BBS_Cate.bbs_cate_PID = '"&kind&"' and bbstitle.showinhomepage=1 order by redate desc"
  set rs=server.createobject("adodb.recordset")
  rs.open Sql,conn,1,1
  id=rs("id")
  title=rs("title")
  boardid_1=rs("boardid_1")
  boardid_2=rs("boardid_2")
  BBS_Cate_Name=rs("BBS_Cate_Name")
  htmfilename=rs("htmfilename")
  tk1="bbs/default.asp?a="&boardid_1&"&b="&boardid_2
%>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="88%" height="25"><font color="#FF0000">方法二</font>、没有论坛类型的调用</td>
  </tr>
  <tr> 
    <td height="25"><%=rs("BBS_Cate_Name")%></td>
  </tr>
  <tr> 
    <td colspan="2"> 
      <%
	do while not rs.eof
	response.write "<a href=bbs/default.asp?a="&rs("boardid_1")&"&id="&rs("id")&"&htm="&rs("htmfilename")&">"&rs("title")&"</a>--"&rs("redate")&"<br>"
	rs.movenext
	loop
	rs.close
	set rs=nothing
	%>
    </td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
