Qbasicnews.com

Full Version: A simply basic forum.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is MYSQL actually *needed* to make a simply branching forum that doesn't have an actualy user database? A forum where you just insert your name and stuff, and then post what you have to say?
no you can use a flatfile database. You separate rows by line breaks and columns by a delimiter, usually ||. You use the "split" function to separate a row into an array of cells in that row, and read the data as such.
Well, I know this because it's also how you can make a simple guestbook, but how would you make branching responses, and allow the user to insert comments into past posts without messing things up? Or is that where the "simple forum" line is crossed?
Well, the only tree structure i've ever made works like such:
each post has a numerical id. After that, it has how far its indented. For instance, a reply would have an indent of 1, a reply to that, 2. You start out with a current indent of -1. then scan each thread, and if the indent is greater than the one before it, you print "<ul><li>$message</li>". If it's the same, print "<li>$message</li>" and if it's less, print "</ul><li>$message</li>". For practical purposes, instead of containing the message, the message points to a txt file with the message in it.

But this way requires a lot of effort in the writing of one post. The other way is to create a recursive scan function that identifies a parent thread, the thread it's under. New threads would have zero. I've never done it this way, but it allows you to simply append posts instead of inserting them. Both methods have their advantages and disadvantages.
Uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh?

Well, one more, how do you make it to where you can post in past topics? Because wouldn't that require you to insert data somewhere in the middle of the code? Instead of just stacking it on top and on the bottom?
Download the SephForum 4.3 or whatever. It's at qb45.net I think.
*Download's SephForum

*Clicks Index.php "This program is too large for notepad, would you like to go to wordpad?"

*Clicks Yes

*Word Pad loads along with about 2 miles of code

"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH!"
All of which I wrote, might I add Wink

Anyways look for lines that modify the file "data.txt" I *think*. It's something like that. Who knows, I wrote it ever so long ago.

EDIT: Look for any lines with fopen("data.txt", r) in it.