Web designing newb. Creating a PHP forum from scratch!

Soldato
Joined
14 Apr 2004
Posts
11,869
Location
UK
Hey guys,

I'm creating this thread as something that I can refer back to and get help in terms of validation and advice in general.

A little big about my web experience, I have next to none and have created rubbish sites in the past, it's what I do best :D

I have however, always wanted to get into it, but I've just never got round to doing so. However, now I'm forced to do it for a Uni assignment which is due in a month. I must create a full PHP forum from scratch with features such as using sessions, registering users, threads with a few options and some extra 'functions' like displaying avatars.

As always, I like to try and get stuff done by myself, however this is one that I feel I will struggle with.

Today I've started reading many tutorials on HTML & CSS, using places such as W3Schools and HTMLDog.

Here is a quick mock-up I designed in ps:

forumwf4.jpg


I've found Uni lectures to be pretty dire, so I'll be reading up on books and websites. My lecturer said that is fine as long as I reference them. I'm not going to rip any code or view other peoples sources.

I would like some advice on the process of my development and any common things to avoid in general. Just some general advice.

I plan on implementing a simple and clean design, using CSS and then start with the PHP side of things and then bringing the two together!

I'd appreciate any advice and I will regularly post my progress as I make some.

Thank you for your time :)
 
Soldato
Joined
16 Dec 2005
Posts
14,443
Location
Manchester
Building a web forum from scratch is no simple task. And you only have a month in which to do it. So first off I recommend you start on the PHP code, and leave the XHTML and CSS until last.

The danger with your approach [CSS first] you will spend far too long trying to get it right.

In regards to your PHP, it is really important you break up your code into manageable chunks. So one script for Registration, one for Posting etc etc. It is also important you take any code you use a lot and put it into functions. Any half decent PHP tutorial will explain this.

Probably the best first step you can take is to draw a diagram of the different parts of your forum. It doesn't have to be amazing, just something to refer to while coding. Since you have only a month, I suggest you keep it REALLY simple. I would only attempt adding bells and whistles if you know you have time to design, implement and test it.
 
Soldato
OP
Joined
14 Apr 2004
Posts
11,869
Location
UK
Thanks for the the input guys.

Sirius, thanks for the advice! I've started on the php and MySQL section of things. Moving very slow atm the moment, getting used to it! I'll leave the bells and whistles for when I'm near completion.

Are you allowed to use an existing PHP framework to work from? It could cut down a lot of your development time.
Unfortunately we can't, I asked if I was allowed to look something like Vanilla open source forum and understand how it's put together. I was given a big no :(

I'm moving a lot slower than I expected!
 
Soldato
Joined
16 Dec 2005
Posts
14,443
Location
Manchester
There is nothing wrong with you looking at open source software and see how it is done. As long as you don't blatantly rip them off.

Have you done ANY PHP/XHTML/CSS for this particular module/course? It would appear not, if so it seems strange you are expected to tackle a very complex assignment with zero experience and NOT able to look at other people's work.
 
Soldato
OP
Joined
14 Apr 2004
Posts
11,869
Location
UK
There is nothing wrong with you looking at open source software and see how it is done. As long as you don't blatantly rip them off.

Have you done ANY PHP/XHTML/CSS for this particular module/course? It would appear not, if so it seems strange you are expected to tackle a very complex assignment with zero experience and NOT able to look at other people's work.
My sentiments with the your first statement!

I'm in my second year of Software Engineering and they love raping us with new material. We started this module in October and all we learnt was to echo, insert a table, images and a few other bits and bobs and now they expect us to create a fully functional forum :confused:

They've given us a booklet, but the notes are dire.

Have you got MSN Sirius? Just want to run an idea past you if you don't mind.
 
Caporegime
Joined
18 Oct 2002
Posts
29,491
Location
Back in East London
Drop any ideas of fancy gubbins. Go for the purest, simplest form of forum possible. Make a list of items you absolutely, positively must have to call your software a "forum." Prioritise that list, and begin working.

Once you have completed that list, start thinking about extras - but absolutely do not start thinking about extras until the core is finished. Extras includes a poncy design.

Functionality comes way before design, so do your design last.
 
Soldato
OP
Joined
14 Apr 2004
Posts
11,869
Location
UK
Thanks Dj_Jestar, I've screwed my head on and that's definitely the way forward. I shall be spending most of the weekend on php.net and other good sites reading up!
 

Sic

Sic

Soldato
Joined
9 Nov 2004
Posts
15,365
Location
SO16
does your brief define the forum? try not to think of it in terms of forums that you might use on a day to day basis. there are many forums that are just a list of threads and don't go into the details of organising into specific sub forums. I'd be interested in how they define a forum
 
Soldato
OP
Joined
14 Apr 2004
Posts
11,869
Location
UK
Here you go Sic:

Code:
Basic task
The forum must include the following functionality:
> Messages are displayed in a single long list.
> Messages are identified by a title, username and time and date when they were created by the user.
> You must provide a form through which users can register to join the site.
> Only registered users can create messages.
> You must provide a form on which registered users can create messages.
> Unregistered visitors can view the message list.
Your code must be neatly formatted with proper indentation, meaningful variable, class and method. Your code must successfully validate as XHTML transitional using the W3C validator.
60 Marks Max

Advanced task
Once you successfully complete the basic task you may add extra functionality from this list:
> Users are able to add an avatar to their messages.
> Messages are grouped into topics with a list of topics displayed and all messages relating
to the topic shown in posting order.
> Users are able to edit their own messages after posting them.
> Users are able to quote other messages in their own.
> Messages are threaded within topics.
> Administrative functionality is provided which lets an identified administrator delete or edit posts.
40 Marks Max
 
Last edited:
Soldato
Joined
16 Dec 2005
Posts
14,443
Location
Manchester
That's a very good point. You should design your database before you do any coding, as what you have in your db and how it is arranged will determine how you code your forum.
 
Caporegime
Joined
18 Oct 2002
Posts
29,491
Location
Back in East London
yes and no.. sometimes application design influences data design.

Though I doubt that in this scenario. Just approach the data design with normalisation and you'll have minimal problems. Keep relevant data together, if it's not key/critical to what it is your table is storing, then move it to it's own table and link it if necessary.
 
Associate
Joined
23 Sep 2006
Posts
263
Location
Lincoln
I'm just working my way through the book 'Foundation PHP for Dreamweaver 8 by David Powers'published 2006 which covers a whole host of PHP issues plus integration with MySQL inc creating a blog and a photo gallery. Pretty impressed so far as it is easy to follow and sample files can be downloaded from the accompanying web site. Might be worth a look.
 
Soldato
OP
Joined
14 Apr 2004
Posts
11,869
Location
UK
An update, I started making great progress but due to personal problems, I've had to put a lot of work on hold. I've managed to spare a few hours to work on the forum and I'm experiencing problems.

So far I've created the layout and I've tried linking my form to the database and I get the following error:

Warning: mysql_connect(): Access denied for user 'nobody'@'localhost' (using password: NO) in 'dir/xyz' on line 9 cannot connect

I have the following opening code:

Code:
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="my_db1"; // Database name
$tbl_name="create_thread"; // Table name

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db(my_db1")or die("cannot select DB");

Basic layout using html:

sofarwn2.jpg
 
Back
Top Bottom