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:
forming a SKU (1999)
U&P IIS concept (1998)
Hiding a subsection of text (2002)
Nesting format tags (1997)
Bug or syntax error on my part? (1997)
Searching multiple fields from one form field (1997)
more on my bbs (1997)
Server slowing down. (1997)
SKU Question (1999)
dates and hex formatting (1997)
Re:Problem displaying search result (1997)
Help name our technology! I found it (1997)
Getting Total Quantity (1997)
possible, WebCat2.0 and checkboxes-restated (1997)
multiple selected Checkboxes (1998)
MacAuthorize order data fields WAS:How To question... (1997)
ooops...WebCatalog [FoundItems] Problem - LONG - (1997)
New public beta available (1997)
Product Name in AdminResults.inc (2001)
webcat (2000)