|
I'm working an a rather large project and I would say that I've completed it to 75%. But now I'm stuck, and have been for about a month :P. The problem is the lack of a good struckture design. I basically just started on a page, wrote some code to get it working and continued on the next one. Obviously that led to problems when different files needed to work together or classes be used by several scripts and I had to make big changes over and over again to make things work. It basically got more and more difficult the further I got. So I need to make up a good plan to follow and start from the beginning. Hopefully I can reuse much code to speed it up.
I have a couple of points on which I need help and guidance, but most of them will be quite long, so I start with just two that I have been thinong on alot and when those have been solved I can post another one :P
1) Is there any "better way" of organasing files and linking them? What I mean is, would it be better to use files like file1.php, file2.php (...) or index.php?page=file1, index.php?page=file2 (...) and including the contents? Is there any "better way" or is it just what a person likes best?
2) The website will have an admin login (no other logins), where I am the admin. When logged in, all pages will be displayed as normal but with some extra options. There will be a small admin menu with options corresponing to the viewed page and most things on the site will be editable.
How would I best do this? That is, what classes would I use and how should I structure them.
For a more concrete example, there will be a news page, consisting of news which all have a date, news text and possibly pictures. I figured I'll have a class 'NewsList' which is a list of news. It holds objects of a class 'News' wich is 1 seperate news (date, text, picture). One class can handle the login sytem for the admin. How would I design this smart, so that when logged in all the classes NewsList, News (etc.) will retrieve and display more information (which should not be visible for regular visitors) and be editable? Can I use lots of if/else statements in the classes or maybe extend them with admin classes (i.e. 'NewsListAdmin').
I appreciate all the help I can get, thanks!
lizciz
|