Re: Linked lists and Recursive searching
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 51196
interpreted = N
texte = Its the same logic we use to draw our page structure in our content manager... Pretty clever the guys that wrote the original store builder code !!>> I have a forum that I built a while back that does this. I can dig it>> up if>> you need me to, but I recommend doing this like the categories in>> storebuilder.>> >> ID / TITLE / TYPE / R_ID / P_DATE / P_TIME>> 1 / one / M / * / 6-19-2003 / 12:00:00>> 2 / two / * / 1 / 6-19-2003 / 12:01:00>> 3 / three / * / 1 / 6-19-2003 / 12:02:00>> 4 / four / * / 2 / 6-19-2003 / 12:05:00>> 5 / five /M / * / 6-19-2003 / 12;06:00>> >> How this works is that the M under TYPE marks it as a MAIN POST or>> TOP>> LEVEL.>> >> When someone replys to a specific post you would take the ID of post>> they>> are replying to and put it under R_ID.>> >> thus the above would look>> >> One>> - two>> - three>> -- four>> Five>> >> You would use the P_TIME and P_DATE times to sort the search.>> >> [search>> db=post.db&eqTYPEdatarq=M&asP_DATEdatarq=1&asP_TIMEsort=2&P_DATEtype=da>> te&P_>> TIMEtype=time]>> [founditems]>>
>> - [TITLE]
>> [include search_loop.inc]>> [/founditems]>> [/search]>> >> >> -- search loop -->> >> [search>> db=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 PM>> Subject: Linked lists and Recursive searching>> >> >> Hello everyone,>> >> I'm hoping that someone can impart some wisdom to me about linked lists>> and recursive searching. I've been struggling to wrap my head around it>> for about a week now.>> >> My goal is to create a simple threaded discussion board (nothing as>> advanced as the Pubb or other professional solution). Right now I'm>> just>> at the level of trying to understand how the data should be set up in>> the database, and how to do a search that will show the threads in>> their>> proper place all at once.>> >> I've been able to create what kind of looks right, but I'm not sure>> where I've gone wrong. The html page I search on shows the first two>> levels the way it's supposed to, like this:>> >> forum level>> >> main1>> >> main2>> >> Forum level2>> >> >> Below the main1 and main2 levels all the records just cascade down, one>> right after another as if they were all replies to the message before>> it. Like this:>> >> Forum level>> main1>> reply to main1>> reply to reply of main1>> A second reply to main1 (this should be in the found items>> of the first reply to main 1 but it's not)>> >> >> Would someone with the proper knowledge look over what I've done and>> let>> me know what I need to do?>> >> I'm using webcat 3 on webstar 4.X>> >> >> Here's the database I'm using with mocked up entries. The field names>> might be technically wrong, so I apologize in advance if they mislead>> anyone. That's one of the things that I'm confused about.>> >> >> Forumid threadid replyid msgid childid subject msgdate>> 1 2 3 mainlevel 06/01/2003>> 1 3 2 5 6 first level 06/05/2003>> 1 5 7 8 2 second level 06/07/2003>> 1 3 9 10 2 first level 2 06/08/2003>> 1 8 12 13 2 third level 06/09/2003>> 1 14 15 mainlevel2 06/08/2003>> 1 10 16 17 9 reply to first level 2>> 06/09/2003>> 1 3 18 19 20 first level3 06/10/2003>> 1 13 21 22 2 fourth level 06/11/2003>> 1 22 23 24 2 fifth level 06/12/2003>> 1 8 25 26 2 third level2 06/10/2003>> 1 13 27 28 2 fourth Level 2 06/15/2003>> >> >> Here's my code on the page that I want to search all the records and>> show the threads in their proper place. I have three searches, but do I>> need more? Less? Am I just not searching for the right stuff? Am I>> searching for the right stuff but my data is off? As you can see I need>> some serious help, so any I could get would be great.>> >> [search>> db=theboard.tab&eqreplyiddatarq=[BLANK]&msgdatesdir=as&msgdatetype=date>> ]>> [founditems]>> [subject] - [name] ([msgdate])
>> [search>> db=theboard.tab&eqthreadiddatarq=[msgid]&msgdatesdir=as&msgdatetype=dat>> e>> &msgdatesort=1]>> [founditems]>> [index]>> [subject] - [name] ([msgdate])
>> [search>> db=theboard.tab&eqchildiddatarq=[replyid]&msgdatesdir=as&msgdatetype=da>> t>> e&msgdatesort=1]>> [founditems]>> [text>> show=f]imagewidth=[math]([index]*20)[/math][/text]> width=20 height=1>> height=1>[index] [subject] - [name] ([msgdate])
>> [/founditems]>> [/search]>> [/founditems]>> [/search]>>
>> [/founditems]>> >> >> Allen Frye>> http://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 to>> >> Web 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/>> >> > Signed: Marc Kaiwi> > > -------------------------------------------------------------> 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/> -------------------------------------------------------------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:
Its the same logic we use to draw our page structure in our content manager... Pretty clever the guys that wrote the original store builder code !!>> I have a forum that I built a while back that does this. I can dig it>> up if>> you need me to, but I recommend doing this like the categories in>> storebuilder.>> >> ID / TITLE / TYPE / R_ID / P_DATE / P_TIME>> 1 / one / M / * / 6-19-2003 / 12:00:00>> 2 / two / * / 1 / 6-19-2003 / 12:01:00>> 3 / three / * / 1 / 6-19-2003 / 12:02:00>> 4 / four / * / 2 / 6-19-2003 / 12:05:00>> 5 / five /M / * / 6-19-2003 / 12;06:00>> >> How this works is that the M under TYPE marks it as a MAIN POST or>> TOP>> LEVEL.>> >> When someone replys to a specific post you would take the ID of post>> they>> are replying to and put it under R_ID.>> >> thus the above would look>> >> One>> - two>> - three>> -- four>> Five>> >> You would use the P_TIME and P_DATE times to sort the search.>> >> [search>> db=post.db&eqTYPEdatarq=M&asP_DATEdatarq=1&asP_TIMEsort=2&P_DATEtype=da>> te&P_>> TIMEtype=time]>> [founditems]>> >> - [TITLE]
>> [include search_loop.inc]>> [/founditems]>> [/search]>> >> >> -- search loop -->> >> [search>> db=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 PM>> Subject: Linked lists and Recursive searching>> >> >> Hello everyone,>> >> I'm hoping that someone can impart some wisdom to me about linked lists>> and recursive searching. I've been struggling to wrap my head around it>> for about a week now.>> >> My goal is to create a simple threaded discussion board (nothing as>> advanced as the Pubb or other professional solution). Right now I'm>> just>> at the level of trying to understand how the data should be set up in>> the database, and how to do a search that will show the threads in>> their>> proper place all at once.>> >> I've been able to create what kind of looks right, but I'm not sure>> where I've gone wrong. The html page I search on shows the first two>> levels the way it's supposed to, like this:>> >> forum level>> >> main1>> >> main2>> >> Forum level2>> >> >> Below the main1 and main2 levels all the records just cascade down, one>> right after another as if they were all replies to the message before>> it. Like this:>> >> Forum level>> main1>> reply to main1>> reply to reply of main1>> A second reply to main1 (this should be in the found items>> of the first reply to main 1 but it's not)>> >> >> Would someone with the proper knowledge look over what I've done and>> let>> me know what I need to do?>> >> I'm using webcat 3 on webstar 4.X>> >> >> Here's the database I'm using with mocked up entries. The field names>> might be technically wrong, so I apologize in advance if they mislead>> anyone. That's one of the things that I'm confused about.>> >> >> Forumid threadid replyid msgid childid subject msgdate>> 1 2 3 mainlevel 06/01/2003>> 1 3 2 5 6 first level 06/05/2003>> 1 5 7 8 2 second level 06/07/2003>> 1 3 9 10 2 first level 2 06/08/2003>> 1 8 12 13 2 third level 06/09/2003>> 1 14 15 mainlevel2 06/08/2003>> 1 10 16 17 9 reply to first level 2>> 06/09/2003>> 1 3 18 19 20 first level3 06/10/2003>> 1 13 21 22 2 fourth level 06/11/2003>> 1 22 23 24 2 fifth level 06/12/2003>> 1 8 25 26 2 third level2 06/10/2003>> 1 13 27 28 2 fourth Level 2 06/15/2003>> >> >> Here's my code on the page that I want to search all the records and>> show the threads in their proper place. I have three searches, but do I>> need more? Less? Am I just not searching for the right stuff? Am I>> searching for the right stuff but my data is off? As you can see I need>> some serious help, so any I could get would be great.>> >> [search>> db=theboard.tab&eqreplyiddatarq=[BLANK]&msgdatesdir=as&msgdatetype=date>> ]>> [founditems]>> [subject] - [name] ([msgdate])
>> [search>> db=theboard.tab&eqthreadiddatarq=[msgid]&msgdatesdir=as&msgdatetype=dat>> e>> &msgdatesort=1]>> [founditems]>> [index]>> [subject] - [name] ([msgdate])
>> [search>> db=theboard.tab&eqchildiddatarq=[replyid]&msgdatesdir=as&msgdatetype=da>> t>> e&msgdatesort=1]>> [founditems]>> [text>> show=f]imagewidth=[math]([index]*20)[/math][/text]> width=20 height=1>> height=1>[index] [subject] - [name] ([msgdate])
>> [/founditems]>> [/search]>> [/founditems]>> [/search]>>
>> [/founditems]>> >> >> Allen Frye>> http://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 to>> >> Web 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/>> >> > Signed: Marc Kaiwi> > > -------------------------------------------------------------> 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/> -------------------------------------------------------------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/
Alain Russell
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:
Extended [ConvertChars] (1997)
Multiple Pulldowns (1997)
[item] appears after 'remove last item' ... (1997)
upload pictures any solution (1999)
search form problem.. (1997)
Somewhat OT: IE issues (2002)
Frames and WebCat (1997)
P3P and IE 6 (2004)
Editor? (2000)
Upgrading from 2.1 to 3.0.7 (2000)
WebCat B13 Mac CGI -- Frames question (1997)
I have troubles to send message out (1998)
Banner DNA (1997)
[WebDNA] Admin Login Required to Serve any TPL Page (2009)
DON'T use old cart file! (1997)
WC2 or 3: Displaying Search Result Relevance (1998)
Zip Code Lookups (1999)
Loss in form (1998)
Unexpected error (1997)
New Command prefs ... (1997)