![]() |
|
|
Published: Tuesday, March 07, 2000 By Zola
You will notice that there is a little extra code here, and that I explicitly closed the sql when the loop was done. This is because, although I am only showing one nested loop for this article, you will see in the full code that there are actually 12 loops nested in that original loop. What I found was that if one post had 3 responses and another only two, the second post would show the third response from the first post because there was an appropriately named variable still floating around out there. Once the nested loops have run, they need to be closed and set to nothing so when the set runs again we are starting fresh. If we traced the steps, they would go something like this:
1.) Display the first main post
This neatly brings us to using that Once it runs through all the nested loops, it goes back to the original loop of main posts and the whole cycle begins anew.
Why did I choose 12 as the number of steps possible? Because we are a talky bunch. :) Actually the
real reason it because that is the point at where the title is about 3/4 of the way across the page, and most
people will start a new thread. In the rare case that someone has more to say, it is a simple matter to go
into the database and change the The thing I like most of all is the adaptability of the script. Right now, my most active bulletin board displays the last 60 days worth of posts. If we become more active and the page starts getting long, it is the work of two seconds to limit the display further. For a big site like ASP Messageboard, which receives in the neighborhood of 250 - 350 posts a day, I would probably limit the display to one or two days! I would also change the archive page so that it displayed according to a date requested rather than having several fixed archive pages. It depends on your needs-I like to keep things simple. And voila! My looks-just-like-a-cgi-script bulletin board is up and running! To see a couple examples of this code in action, visit: http://www.zolaweb.com/heart/heart.asp I look forward to feedback! Zola - zola@zolaweb.com
Attachments: Disclaimer: As with any code, there may be bugs. If you would like to report a bug, please send full details and a correction if at all possible so that we can pass the correction on to everyone. If you would prefer to use another type of database, you would create a table with the following fields:
Don't forget to change the date information and connection properties in accordance with your database. Happy Programming!
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||