<% intLevel=0 intRootMsg=GetRoot(Request.QueryString("messageid")) Function ShowMessages(intParent,intMsg) %> <% intLevel = intLevel + 1 strSQL = "SELECT MessageID, ParentID, ForumID, Subject, Username, DateOfPost " strSQL = strSQL & "FROM tblMessages WHERE tblMessages.ForumID = " strSQL = strSQL & Request.QueryString("forumid") & " AND tblMessages.ParentID = " strSQL = strSQL & intParent If intParent=0 Then strSQL=strSQL & " AND MessageID=" &intMsg End If strSQL=strSQL& " ORDER BY DateOfPost DESC;" Set rstForumMessages = ConnObj.Execute(strSQL) strCommand = "SELECT LastLogin FROM tblUser WHERE UserID=" &Session("UserID") Set rstLastLogin=ConnObj.Execute(strCommand) strLastLogin=rstLastLogin("LastLogin") Set rstLastLogin=Nothing %> <% Do Until rstForumMessages.EOF %>
<% If intLevel>1 Then Response.Write "" End If If Request.QueryString("messageid")=Cstr(rstForumMessages("MessageID")) Then 'Current Message, highlight this message, and do not display link Response.Write " " Else %> <% End If %> <% If CDate(strLastLogin)<=CDate(rstForumMessages("DateOfPost")) Then Response.Write "" End If %> <%=rstForumMessages("Subject")%> <%=rstForumMessages("Username")%> <%=rstForumMessages("DateOfPost")%>
" style="display:'';"> <% ShowMessages rstForumMessages("MessageID"),intMsg%>
<% rstForumMessages.MoveNext intLevel = intLevel - 1 %> <% Loop End Function Function GetRoot(intMsg) Dim strSQL, rstMsg strSQL="SELECT parentid,messageid from tblMessages where messageid=" &intMsg Set rstMsg=connObj.Execute(strSQL) If Not rstMsg.EOF Then If rstMsg("parentid")=0 Then GetRoot=rstMsg("messageid") Else GetRoot=GetRoot(rstMsg("parentid")) End If End If End Function %> Emental-health.com discussion boards
Home
 


  This page is currently in development