Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

threaded forum

Status
Not open for further replies.

nem

Technical User
Joined
Aug 15, 2001
Messages
1
Location
US
hello,

im working on creating the algorithm for a threaded forum, and so far, its been able to display messages until a thread ends, at which point it doesn't 'remember' how to go back to another higher level which may or may not have replies. im not sure how to handle this, since i dont think CF lets u 'return'.
the first page referenced is the index.cfm, which sets a couple basic variables, then passes them on to a file called kfill.cfm, which basically calls itself to populate the forum messages.

//*********** index.cfm ************\
<!--- sets the first post to zero --->
<cfparam name=&quot;parentNode&quot; default=&quot;0&quot;>
<cfparam name=&quot;fosterNode&quot; default=&quot;0&quot;>
<cfparam name=&quot;fToken#fosterNode#&quot; default=&quot;0&quot;>

<!--- sets the level of the first post to zero --->
<cfparam name=&quot;postToken&quot; default=&quot;0&quot;>

<!--- begin to fill the forum --->
<cfinclude template=&quot;kfill.cfm&quot;>
</body>
</html>


//************ kfill.cfm ************\
<!--- get all messages that are replies to the current message --->
<cfquery datasource=&quot;forum&quot; name=&quot;getMes&quot;>
select * from messages
where reply=#parentNode#
</cfquery>

<cfoutput query=&quot;getMes&quot;>
<cfif getMes.recordCount NEQ 0>
<cfset parentNode=#ID#>
<ul><li>#subject#
<cfinclude template=&quot;kfill.cfm&quot;>
<cfelseif getMes.recordCount EQ 0>
</ul>
</cfif>
<cfinclude template=&quot;kfill.cfm&quot;>

<!--- put something here to make code work? --->

</cfoutput>


// ****** end ******\
thanks, any help would be appreciated.

- nem
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top