Bill Bailey's Bulletin Board

Post A New Message
<%=BulletinCate(Request("BulletinCate"))%>
<% intCate = Request("BulletinCate") If intCate = "" Then intCate = "1" MaxMailNo = 5 'The Page Number To Display PageNo=Request("PgNo") if PageNo="" then PageNo=1 else PageNo=cint(PageNo) end if OpenDB con SQL = "SELECT * FROM tblBulletin WHERE fldCateID = " & intCate & " AND fldReplyID = -1 AND fldGroupID > 0 ORDER BY fldAuto DESC" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open SQL,con,3,3 If rs.EOF Then %> <% Else rs.PageSize = MaxMailNo LastPage = rs.PageCount rs.AbsolutePage = PageNo for i = 1 to rs.PageSize If IsNull(rs("fldFace")) OR rs("fldFace") = -1 Then strFace = "-" Else strFace = "" End If %> <% rs.MoveNext if rs.EOF then exit for Next rs.close Set rs = Nothing con.close set con = Nothing %> <%End If%>
Message Title Posted By Replies Last post
No messages posted in this category.
<%=strFace%> &PgNo=<%=Request("PgNo")%>&GID=<%=rs("fldAuto")%>&CID=<%=intCate%>"><%=Server.HTMLEncode(rs("fldTitle"))%> <%=rs("fldName")%> <%=GetReplies(con, rs("fldGroupID"))%> <%=GetLastPostDate(con,rs("fldGroupID"))%>
<% if PageNo > 1 then %>   <% End if %> <% if PageNo < LastPage then %> <% End If %>

> <% Function GetReplies(con, id) SQL = "SELECT COUNT(fldAuto) FROM tblBulletin WHERE fldGroupID = " & id Set gr = con.Execute(SQL) GetReplies = gr(0) - 1 gr.Close Set gr = Nothing End Function Function GetLastPostDate(con, gid) SQL = "SELECT TOP 1 fldAuto, fldDate FROM tblBulletin WHERE fldGroupID = " & gid & " ORDER BY fldAuto DESC" Set glpd = con.Execute(SQL) GetLastPostDate = glpd(1) If GetLastPostDate = Date Then GetLastPostDate = "" & GetLastPostDate & "" End If glpd.close Set glpd = Nothing End Function %>

 

BACK TO REDBILLBAILEY.COM