11-29-2007, 02:01 AM
Hey, I'm making a very simple CMS to practice my PHP and MySQL. Please let me know if you think I am heading in the right direction & give suggestions.
I have tables for: Header, Sidebar, Navigation, Page1 content, Page2 content, ext...
each table stores the output. For example the navigation talbe is made up of 3 fields: ID. URL, Anchor Text.
I then insert PHP into the website that retrieves the info from my database and inserts it into the HTML. I use loops so it will output all rows.
I then made ADMIN area that allows the user to update/delete or add information into the database.
11-29-2007, 02:27 AM
header, sidebar, navigation, pages
... those are your tables
I think you are doing a good job
and hopefully those will work without any future changes in DB
11-29-2007, 04:53 PM
You certainly shouldn't need individual tables for page content, and I'm dubious about individual tables for headers, navigation etc... though it does depend on the applications of the final CMS.
11-29-2007, 11:46 PM
Thanks for the suggestion, I tried to improve my structure.
I put Header/Navigation/Sidebar all in to one table: "staic_element" (because they stay the same on every page)
I then made a table for storing content:"page_content". Store the title, sub title, page to published on, ID. (will add more as my CMS advances)
And I made a "config" table to set up all the basic stuff and constants.
12-01-2007, 03:35 AM
Good Idea, and you make a breakthough, at least I see your desire :thumbsup:.
I see your CMS structure, it's good. But it's only for a small CMS. if you want a stronger CMS, you have to think about a more total solution. Header/Navigation/Sidebar.. is only the HTML Module and it should not be a "physical" module. A suggest, you can learn from a bit from Joomla/Mamboo's CMS Enginerring, and this is my Raaapid CMS (developing) structure:
- a "web page" generated by complex of it's components, modules, bots (just like joomla, it's a very smart way)
- Classify "modules" into 2 types: HTML Block (only HTML codes) and PHP (include phpfile and return HTML codes to combine with global HTML Templates...)
- the "bots" used to render, optimize your HTML Codes generated before..