Search code examples
phphtmldatabaseforums

how to program threads for a forum?


First off, i'm not looking for actual code; i don't even want code.

I just want to understand what tools i need to use and the logic behind what i'm trying to do because, at the moment i have no idea how to go about this task.

I'm trying to create a forum(not exactly a forum but similar) like stackoverflow. The part i'm confused about is, when a user clicks on "Ask Question" to create a new thread on the forum, after typing in the title and the question itself and clicking "submit thread", how does that thread get placed on the homepage in a new container?

Would i have to create a container using html and save it inside a database somehow and when the user clicks submit, that container would be echoed on to the homepage? I honestly have no idea how it would work. Please help and thanks in advance.

P.S I'm not a highly experienced programmer, i have close to intermediate experience but i need clear explanations.


Solution

  • A mile high view is probably what you need at the moment.

    You'd have in your database a table for threads, it would have a number of relevant pieces of information. Post title, Post owner, Time posted, Category, Tags, Actual content, time updated

    Your homepage would run a query against the database and find questions ordering by Time Posted and time updated.

    This would give you a list of recent threads, either new or recently replied to.

    However, if you're not sure about the coding of this, and can't consider the database components at present, then it might be better to consider getting an off-the-shelf forum, .Net Nuke, PHP Nuke, simple Machines forum and many others are out there and freely customizable.

    You can even use the Stack Overflow API to create your own Q&A board! Here's a url for other usages of the Stack API: https://stackapps.com/