Jump to content

Simple threaded discussion list


This topic is 7359 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I don't know if the following is possible, or, if possible, it would be easier to use a canned service to provide what I want. It seems simple to me, but....

I would like to create a threaded discussion list online using FMP 6. I already have a guestbook up and running, and it seems to me that creating a discussion list (where visitors can read a post, add their comments, and have those comments "attached" to the original) would require setting up some sort of field/script determining whether a new record (entered online) was an original topic, or a reply to an existing one. I'm thinking of something like auto-enter a record number for an original, and if it's a reply, use the record number . auto-enter record number. So an original posting might have the record number 23, and a replies to it would be 23.1, 23.2, etc. (and, I suppose, replies to those would be 23.1.1, 23.2.1, 23.2.2, etc.)

The idea is to allow a threaded conversation to develop, and to permit the records to be served sequentially (indented, perhaps, based on their level of reply) in the same way that I've seen done in other environments with other software. It dawned on me that FileMaker might be able to do this (to a certain level) but I'm not sure.

Any ideas? Or, if this is pushing FM too far, any other sources for such a thing? I'd appreciate all offers of help/advice.

FYI: I'm a teacher in a small school that would like to manage online discussions in a threaded environment. The scope of the discussion and the number of students participating would be pretty small.

Thanks in advance.

Peter Knowles

White Salmon, Washington

Link to comment
Share on other sites

I did this years ago with FMP 4.0 (it's long gone now, so don't bother asking for a copy I aint got it). It's done with a self-join and a portal, and it's pretty straight forward.

Each record needs a PostID field with an auto-entered serial number and an "OriginalID" field that records what the original post was (the user need not see either of these fields). Make a self-join relationship with PostID on the left side and OriginalID on the right.

Creating a new thread is easy: it's a new record, and the OriginalID field will be empty. (Tip: this is how you later make a list of all threads in the database.) Replies to the original post will also have their own PostID, but during their creation the web form inserts the PostID of the original into the OriginalID field of the reply. Instant relationship!

Listing threads is as easy as finding all the records with empty OriginalID fields.

Reading a tread is done by displaying a record and all of its related records, based on the self-join relationship. (A find could also probably be used instead of the portal, it might also be a bit faster and give you more control over the number of replies displayed at a time.)

You can design it so that replies can have their own replies (multi-level like FM Forums) or limit a thread to have one level of reply (flat).

Link to comment
Share on other sites

Hi, I use two files, one for the threads and one for the messages connected to that thread. The thread gets a record number which is added to each reply and used to make the relationship.

Here's how the display/add reply page works. As Vaughn says, it's an easy one to crack.

The threads in my messageboard 'die" after either one or five days, so the display page is called by:

http://mydomain.com/messageboardf/FMPro?-db=messageboard&-lay=layout1&-format=messages.htm&-error=messages.htm&-sortfield=enterdate&-sortorder=descend&-sortfield=thread&-sortorder=ascend&-op=eq&datetodie=yes&-Find

or the thread headings get embedded in the home page with this inline action:

[FMP-InlineAction: -DB=messageboard, datetodie="yes", -max="10", -Find][FMP-RECORD]

<A HREF="mydomain.com/messageboardf/FMPro?-db=messageboard&-lay=layout1&-format=messages.htm&-op=eq&thread=[FMP-Field:thread]&-Find">

<IMG SRC="/images/openfold.gif">[FMP-FIELD: title]</A>

([FMP-FIELD: messagetotal])..

[/FMP-RECORD][/FMP-InlineAction]

-----------------------------------------------------------------------------

Here's the page code:

<HTML>

<HEAD>

</HEAD>

<BODY BGCOLOR="#FFFFFF">

<P><TABLE BORDER=0 CELLSPACING=0 WIDTH=450>

<TR>

<TD VALIGN=bottom WIDTH=325>

<P<IMG SRC="images/openfold.gif" WIDTH=20 HEIGHT=16<A HREF="http://mydomain.com/messageboardf/FMPro?-db=message&-lay=layout1&-format=threadnew.htm&-View">Create

a new topic</A></P>

</TD>

</TR>

<TR>

<TD VALIGN=top ROWSPAN=2 WIDTH=325>

<P>[FMP-RECORD]

<P ALIGN=right><FONT SIZE="+1" COLOR="#FF3333"><B><TABLE BORDER=0 CELLSPACING=0 WIDTH=440>

<TR>

<TD WIDTH=30>

<CENTER><IMG SRC="images/openfold.gif" WIDTH=20 HEIGHT=16 ALIGN=bottom></CENTER>

</TD>

<TD COLSPAN=2 BACKGROUND="images/blue_bg.jpg" WIDTH=398>

<P><B>[FMP-FIELD: title]</P>

</TD>

</TR>

<TR>

<TD WIDTH=30>

<P></P>

</TD>

<TD COLSPAN=2 WIDTH=398>

<P[FMP-FIELD: message]</P>

</TD>

</TR>

<TR>

<TD WIDTH=30>

<P></P>

</TD>

<TD WIDTH=199>

<P>[FMP-FIELD: required_username]</P>

</TD>

<TD WIDTH=199>

<P<FONT SIZE="-1">[FMP-FIELD: enterdate]

[FMP-FIELD: entertime]</P>

</TD>

</TR>

<TR>

<TD COLSPAN=3 WIDTH=428>

<P>[FMP-PORTAL: thread]

<P><TABLE BORDER=0 CELLSPACING=0 WIDTH=400>

<TR>

<TD VALIGN=top WIDTH=25>

<CENTER><IMG SRC="images/closedfold.gif" WIDTH=20 HEIGHT=16 ALIGN=bottom></CENTER>

</TD>

<TD COLSPAN=2>

<P>[FMP-FIELD: thread::message]</P>

</TD>

</TR>

<TR>

<TD WIDTH=25>

<P></P>

</TD>

<TD>

<P>[FMP-FIELD: thread::required_username]</P>

</TD>

<TD>

<P>[FMP-FIELD: thread::enterdate]

[FMP-FIELD: thread::entertime]</P>

</TD>

</TR>

</TABLE>

[/FMP-PORTAL]</P>

</TD>

</TR>

</TABLE>

</B></FONT><TABLE BORDER=0 CELLSPACING=0 WIDTH=440>

<TR>

<TD>

<P><FORM ACTION="FMPro" METHOD="post">

<P><INPUT TYPE="hidden" NAME="-DB" VALUE="message">

<INPUT TYPE="hidden" NAME="-Lay" VALUE="Layout1">

<INPUT TYPE="hidden" NAME="-format" VALUE="newmessage.htm">

<INPUT TYPE="hidden" NAME="-error" VALUE="new_error.htm">

<INPUT TYPE="submit" NAME="-New" VALUE="add reply"><INPUT TYPE=hidden NAME=thread VALUE="[FMP-Field:thread]">

</FORM></P>

</TD>

</TR>

</TABLE>

[/FMP-RECORD]</P>

</TD>

</TR>

<TR></TR>

</TABLE>

</P>

</BODY>

</HTML>

------------------------------------------------------------------------------------------------

(I've deleted font info etc. to simplify it)

regards, jeff

r

Link to comment
Share on other sites

This topic is 7359 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.