Re: Linked lists and Recursive searching
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 51193
interpreted = N
texte = I have a forum that I built a while back that does this. I can dig it up ifyou need me to, but I recommend doing this like the categories instorebuilder.ID / TITLE / TYPE / R_ID / P_DATE / P_TIME1 / one / M / * / 6-19-2003 / 12:00:002 / two / * / 1 / 6-19-2003 / 12:01:003 / three / * / 1 / 6-19-2003 / 12:02:004 / four / * / 2 / 6-19-2003 / 12:05:005 / five /M / * / 6-19-2003 / 12;06:00How this works is that the M under TYPE marks it as a MAIN POST or TOPLEVEL.When someone replys to a specific post you would take the ID of post theyare replying to and put it under R_ID.thus the above would lookOne - two- three -- fourFiveYou would use the P_TIME and P_DATE times to sort the search.[searchdb=post.db&eqTYPEdatarq=M&asP_DATEdatarq=1&asP_TIMEsort=2&P_DATEtype=date&P_TIMEtype=time] [founditems]
- [TITLE]
[include search_loop.inc] [/founditems][/search]-- search loop --[searchdb=post.db&eqR_IDdatarq=[ID]&asP_DATEdatarq=1&asP_TIMEsort=2&P_DATEtype=date&P_TIMEtype=time] [founditems] - [include search_loop.inc]
[/founditems][/search]Hope this helps.Ron----- Original Message ----- From: Allen Frye To: WebDNA Talk Sent: Thursday, June 19, 2003 10:16 PMSubject: Linked lists and Recursive searchingHello everyone,I'm hoping that someone can impart some wisdom to me about linked listsand recursive searching. I've been struggling to wrap my head around itfor about a week now.My goal is to create a simple threaded discussion board (nothing asadvanced as the Pubb or other professional solution). Right now I'm justat the level of trying to understand how the data should be set up inthe database, and how to do a search that will show the threads in theirproper place all at once.I've been able to create what kind of looks right, but I'm not surewhere I've gone wrong. The html page I search on shows the first twolevels the way it's supposed to, like this:forum level main1 main2Forum level2Below the main1 and main2 levels all the records just cascade down, oneright after another as if they were all replies to the message beforeit. Like this:Forum level main1 reply to main1 reply to reply of main1 A second reply to main1 (this should be in the found itemsof the first reply to main 1 but it's not)Would someone with the proper knowledge look over what I've done and letme know what I need to do?I'm using webcat 3 on webstar 4.XHere's the database I'm using with mocked up entries. The field namesmight be technically wrong, so I apologize in advance if they misleadanyone. That's one of the things that I'm confused about.Forumid threadid replyid msgid childid subject msgdate1 2 3 mainlevel 06/01/20031 3 2 5 6 first level 06/05/20031 5 7 8 2 second level 06/07/20031 3 9 10 2 first level 2 06/08/20031 8 12 13 2 third level 06/09/20031 14 15 mainlevel2 06/08/20031 10 16 17 9 reply to first level 206/09/20031 3 18 19 20 first level3 06/10/20031 13 21 22 2 fourth level 06/11/20031 22 23 24 2 fifth level 06/12/20031 8 25 26 2 third level2 06/10/20031 13 27 28 2 fourth Level 2 06/15/2003Here's my code on the page that I want to search all the records andshow the threads in their proper place. I have three searches, but do Ineed more? Less? Am I just not searching for the right stuff? Am Isearching for the right stuff but my data is off? As you can see I needsome serious help, so any I could get would be great.[searchdb=theboard.tab&eqreplyiddatarq=[BLANK]&msgdatesdir=as&msgdatetype=date][founditems][subject] - [name] ([msgdate])
[searchdb=theboard.tab&eqthreadiddatarq=[msgid]&msgdatesdir=as&msgdatetype=date&msgdatesort=1][founditems][index][subject] - [name] ([msgdate])
[searchdb=theboard.tab&eqchildiddatarq=[replyid]&msgdatesdir=as&msgdatetype=date&msgdatesort=1][founditems][textshow=f]imagewidth=[math]([index]*20)[/math][/text][index] [subject] - [name] ([msgdate])
[/founditems][/search][/founditems][/search]
[/founditems]Allen Fryehttp://www.allenfrye.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail toWeb Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
I have a forum that I built a while back that does this. I can dig it up ifyou need me to, but I recommend doing this like the categories instorebuilder.ID / TITLE / TYPE / R_ID / P_DATE / P_TIME1 / one / M / * / 6-19-2003 / 12:00:002 / two / * / 1 / 6-19-2003 / 12:01:003 / three / * / 1 / 6-19-2003 / 12:02:004 / four / * / 2 / 6-19-2003 / 12:05:005 / five /M / * / 6-19-2003 / 12;06:00How this works is that the M under TYPE marks it as a MAIN POST or TOPLEVEL.When someone replys to a specific post you would take the ID of post theyare replying to and put it under R_ID.thus the above would lookOne - two- three -- fourFiveYou would use the P_TIME and P_DATE times to sort the search.[searchdb=post.db&eqTYPEdatarq=M&asP_DATEdatarq=1&asP_TIMEsort=2&P_DATEtype=date&P_TIMEtype=time] [founditems]- [TITLE]
[include search_loop.inc] [/founditems][/search]-- search loop --[searchdb=post.db&eqR_IDdatarq=[ID]&asP_DATEdatarq=1&asP_TIMEsort=2&P_DATEtype=date&P_TIMEtype=time] [founditems] - [include search_loop.inc]
[/founditems][/search]Hope this helps.Ron----- Original Message ----- From: Allen Frye To: WebDNA Talk Sent: Thursday, June 19, 2003 10:16 PMSubject: Linked lists and Recursive searchingHello everyone,I'm hoping that someone can impart some wisdom to me about linked listsand recursive searching. I've been struggling to wrap my head around itfor about a week now.My goal is to create a simple threaded discussion board (nothing asadvanced as the Pubb or other professional solution). Right now I'm justat the level of trying to understand how the data should be set up inthe database, and how to do a search that will show the threads in theirproper place all at once.I've been able to create what kind of looks right, but I'm not surewhere I've gone wrong. The html page I search on shows the first twolevels the way it's supposed to, like this:forum level main1 main2Forum level2Below the main1 and main2 levels all the records just cascade down, oneright after another as if they were all replies to the message beforeit. Like this:Forum level main1 reply to main1 reply to reply of main1 A second reply to main1 (this should be in the found itemsof the first reply to main 1 but it's not)Would someone with the proper knowledge look over what I've done and letme know what I need to do?I'm using webcat 3 on webstar 4.XHere's the database I'm using with mocked up entries. The field namesmight be technically wrong, so I apologize in advance if they misleadanyone. That's one of the things that I'm confused about.Forumid threadid replyid msgid childid subject msgdate1 2 3 mainlevel 06/01/20031 3 2 5 6 first level 06/05/20031 5 7 8 2 second level 06/07/20031 3 9 10 2 first level 2 06/08/20031 8 12 13 2 third level 06/09/20031 14 15 mainlevel2 06/08/20031 10 16 17 9 reply to first level 206/09/20031 3 18 19 20 first level3 06/10/20031 13 21 22 2 fourth level 06/11/20031 22 23 24 2 fifth level 06/12/20031 8 25 26 2 third level2 06/10/20031 13 27 28 2 fourth Level 2 06/15/2003Here's my code on the page that I want to search all the records andshow the threads in their proper place. I have three searches, but do Ineed more? Less? Am I just not searching for the right stuff? Am Isearching for the right stuff but my data is off? As you can see I needsome serious help, so any I could get would be great.[searchdb=theboard.tab&eqreplyiddatarq=[BLANK]&msgdatesdir=as&msgdatetype=date][founditems][subject] - [name] ([msgdate])
[searchdb=theboard.tab&eqthreadiddatarq=[msgid]&msgdatesdir=as&msgdatetype=date&msgdatesort=1][founditems][index][subject] - [name] ([msgdate])
[searchdb=theboard.tab&eqchildiddatarq=[replyid]&msgdatesdir=as&msgdatetype=date&msgdatesort=1][founditems][textshow=f]imagewidth=[math]([index]*20)[/math][/text][index] [subject] - [name] ([msgdate])
[/founditems][/search][/founditems][/search]
[/founditems]Allen Fryehttp://www.allenfrye.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail toWeb Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
WebCat @ Inkblot Media
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[OT] (waaaay OT) (2004)
2.1 Stuff (1998)
Searchable Talklist Archive (1998)
when is date system date or order date? (1997)
RE: [WebDNA] [OT] For Will (2009)
quantity minimum problem (1997)
Generate static pages but link problem (2004)
2.1b3 --> way slow (1997)
CMS - Formatting Content (2004)
Ship Cost Not working (2000)
expired beta (1997)
Requiring that certain fields be completed (1997)
Leap Day Triggers (2000)
Extra equals signs with IE? (More debugging questions...) (1997)
Another IfThenElse question.. (2003)
Snake Bites (1997)
japanese characters (1997)
using showpage and showcart commands (1996)
Multiple Pulldowns (1997)
Pull Down Search (2000)