help/advice on threaded comment system

Results 1 to 3 of 3

Thread: help/advice on threaded comment system

  1. #1
    icewolfz Guest

    Default help/advice on threaded comment system

    Sorry for the misspelling and errors before I wrote it at midnight.<BR><BR>Currently I am working on a news script I have the script made, and I am just working on the comment system and need to fiqure out how to display a threaded board form a database. I have one database with 2 tables : <BR><BR>One named tblNews for news artciles with the fields : fldNID, fldTitle, fldBody, fldAuthor, fldAEmail, fldSource, fldDataTime, fldCat <BR>The Second one is tblComment with these fields : fldCID, fldAuthor, fldEmail, fldTitle, fldDateTime, fld Comment, fldArticle.<BR><BR>The idea I had was to link fldArticle to fldNID and fldCID then display them with a loop/function. The porblem is I can&#039t fiqure out how to display them to look treaded. There relationships are fldArticle is the field that tells what comment/article it was a reply to.<BR>(for example : article 46 is linked to comment 1 and comment 2 is reply to comment 1 and therefore link as a thread to comment 1.)<BR><BR>If any body has a clue on how to help or has advice please add to this thread, or eamil me at If you would like to see a current working copy of the script go to, it has v0.2b for download for free.<BR><BR>Thanks,<BR>Icewolfz<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: help/advice on threaded comment system

    What is an article and how does it relate to a news item? I&#039m a little confused by your terminology. Here&#039s what I think you are looking for:<BR><BR>tblAuthors:<BR>AuthorID<BR>AuthorName< BR>AuthorEmail<BR><BR>tblNewsItems:<BR>NewsItemID< BR>Title<BR>Body<BR>Source<BR>Date<BR>AuthorID[FK to AuthorID]<BR><BR>tblNewsComments:<BR>NewsCommentID<BR>InRef erenceto[FK to NewsItemID]<BR>ParentNCID<BR>FirstChildNCID<BR>OldersiblingNC ID<BR>YoungerSiblingNCID<BR>AuthorID[FK to AuthorID]<BR>Title<BR>Date<BR>Body<BR>Depth<BR><BR>tblCateg ories:<BR>CategoryID<BR>CategoryName<BR><BR>tblNew sItemCategories:<BR>NewsItemId[FK to NewsItemID]<BR>CategoryID[FK to CategoryID]<BR><BR>The category thing is just so that you can have more than one category per article.<BR><BR>The comments tree has an InReferenceTo field which says what article the comment is in reference to. Then you navigate the thread tree by recursively navigating towards the leaf by doing this:<BR><BR>RecursiveDisplayFun:<BR><BR>function RDF(nodeid)<BR>1) First show my info (nodeid-&#062;info)<BR>2) call RDF on my first child<BR>3) call RDF on my younger sibling<BR><BR>You use the depth to format the indentation .. depth 3 = 3 indents, etc. The older sibling and parent information will be useful if you want to have the ability to move the comments around / delete comments at a certain non-leaf spot.

  3. #3
    Icewolfz Guest

    Default RE: help/advice on threaded comment system

    Thanks for the help I will try it and see if it will work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts