[PHP and HTML]Making a forum
OK. I want to try to make a forum. A simple one. Where you make a topic then someone can post about your topic. Problem is I have no idea how to start.
Well things I have accomplished
(check) as in accomplished
1.Getting webhost (check)
2.Making a log in page(check)
3.Inside the log in page link to forum(chech)
4.Make a forum.
Now I am reading the book Learning PHP and Mysql by Orelly
They say i need this thing called "smarty" and it has templates any one know where to get it? And btw I need some tips how to make a forum intresting.
Re: [PHP and HTML]Making a forum
Smarty, it's a template _engine_ which is handy if you'd use multiple templates/styles on your forum. Probably not the case with a simple forum.
Make a registry page, set up the database tables, make a front forum page listing all forums and their posts. If you click it, you see all topics arranged reverse by date, inside a topic you'd have posts. Can be very easy, or difficult, depends on what you want to be in.
Smarty: http://www.smarty.net/
Re: [PHP and HTML]Making a forum
Quote:
Originally Posted by
Daevius
Smarty, it's a template _engine_ which is handy if you'd use multiple templates/styles on your forum. Probably not the case with a simple forum.
Make a registry page, set up the database tables, make a front forum page listing all forums and their posts. If you click it, you see all topics arranged reverse by date, inside a topic you'd have posts. Can be very easy, or difficult, depends on what you want to be in.
Smarty:
http://www.smarty.net/
If smarty makes things harder then nevermind. But really all I need the forum to do is to submit a topic and post in the topic. Thats all really. And as for a registry page I'll manually do that. This is for my class of 08 so we can keep talking to each other on a forum if their tired of Aim. So I should just go
Create database forum;
then
Use database forum
Then
Create table ....
Still a little lost. And the book uses smarty so I have no idea what to do.
Re: [PHP and HTML]Making a forum
Well. Smarty is supposed to make life easy, but yes, you'll have to learn to work with it first, but in the end, if you make a multi-templated forum, it is very handy.
What Smarty does, is that you have a PHP file and a HTML file. In the PHP file you process the information that comes from the user (page request, form submit), get the needed data from MySQL and send values over to Smarty. In the HTML file (which you make a .tpl file, a template file) you can then use PHP code, and put the values you sent to Smarty into the layout at places you need it.
For instance, in PHP you figure what username has logged in. You send this to Smarty, in the template you put this username at the position you want it in THAT template. A second template might put the username on a totally different position, and have a complete redesign of the layout.
This way you can very flexible have multiple layouts without too much effort, also, template makers and PHP scripters can work on different pages at once, since PHP and HTML is not mixed up.
You'd want to create a DB indeed, called after your project. There you make a topics and a posts table.
Topic table columns: id, userid, title, post, date
Posts table columns: id, topicid, userid, title, post, date
User table colums: id, username, password
This is a very simple setup of the table's. userid would link to id in the user table, topicid would link to the id in the topic table.
For you to figure out the rest ;)