سؤال

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.

هل كانت مفيدة؟

المحلول

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/

نصائح أخرى

Clicking "submit thread" would create a Thread object in your database. You could then use this object to create a small a view of it on your homepage, and a full view of it on its own page. Basically, the code behind the homepage would ask the db for a list of Thread object ordered by descending creation date, and limited to a certain amount of object, and fill a template with the data for each record.

Just use google to find some forum tutorials/examples, if you still have questions after examining those you can come back here and ask more specific questions. Also, threads in a programming context are completely different from a forum thread, just fyi.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top