Closed Thread Icon

Topic awaiting preservation: PHP style-based CMS proposal -- please throw stones Pages that link to <a href="https://ozoneasylum.com/backlink?for=12484" title="Pages that link to Topic awaiting preservation: PHP style-based CMS proposal -- please throw stones" rel="nofollow" >Topic awaiting preservation: PHP style-based CMS proposal -- please throw stones\

 
Author Thread
Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 10-21-2002 01:33

I just got a new website contract that'll pay the bills for the next couple of months; trouble is, the client wants the ability to add, delete, and edit his own pages, and I, optimistic soul that I am, told him "no problem, it'll just be an extra $1500." Trouble is, he took me up on it, and now I'm stuck having to build him a full site-building CMS. After applying my head to the problem for a little while, I've come up with a plan, and I'd like to see if you gents can knock some holes in it.

I'm using PHP with MySQL here, and coding to XHTML 1.0 Strict. The site is going to have a flat architecture -- since the client only sells one product, there's no need for a directory hierarchy. The site is not expected to grow beyond a few dozen pages.

The content for the site is contained in a MySQL database. Each page on the site is represented as a table, whose rows are individual HTML page elements. The first row might be a paragraph, the second might be an image, and so forth. The columns map to the relevant attributes of the HTML tags. Col1: base element, Col2: class, Col3: src, Col4: content -- you get the idea.

The site itself will be laid out like this: for each "page" of the site, there's a directory with a unique one-word name. Each of these directories holds an identical index.php script. This script parses the file path to find out the directory name; gets the entire contents of the corresponding table; then reads them out, row by row, constructing a valid XHTML document. (Standard header and footer are included in the index.php.)

The result: a user goes to www.website.com/pagename/ and boom. There's the page. The only database access is two queries (one to get the navigation menu items and one to get the page content) -- this shouldn't affect speed much at all, since each table is going to be the exact size of the content, i.e. a few kb at most.

The site creation interface will work a little something like this. I'll have a specific look and feel planned for the site. There'll be a site stylebook -- a limited number of paragraph styles, heading styles, etc. My objective is to make sure that the client can ONLY add approved stylistic elements to the page. Sort of like giving him safety scissors.

So the client has an interface, which looks like this:

(page element that already exists in table)

edit this element
delete this element
insert an element before this one

(repeat until end of existing page content)

add a new element of type (dropdown menu)

With attributes (form fields)

(submit button)

Each time the client types in the data for a new element and hits Submit, the page reloads, displaying his changes. There's going to be more refinement than this, but you get the idea.

So what I'm asking is, do you see any serious problems with my basic approach? And if not, do you see any potential pitfalls for me to avoid? I've gotten to the point where I feel sort of confident with this type of programming, but in tae kwon do we have a saying... "It's when you first start to think that you know tae kwon do that you're the most dangerous. Most dangerous to yourself." I know for damn sure that I'm not a PHP/MySQL black belt, so I'll greatly appreciate a reality check.

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 10-21-2002 12:42

"No prob, just an extra $1500"... Heh heh
Been there, done that

There usually is a lot of "during development" requests in a project like this, and it's very likely that what the client wants will change in the process.
So, what you really, really need to do is to take the time, sit down with the client and put ALL the clients requirements on paper before you start to build.

I just read through this once, but my first thought was "What happens when (not if) the client says that he wants another layout/structure for three of the pages?"
How much work will that be? Will it affect the admin-iface?

Next, when the client want's a listing of all things posted the last week.
Is that considered?

If he want's to write half the new page today, and the second half tomorrow without the visitors seeing half a page, can that be done?

If he wants to be able to sort the pages in the navigation, can that be done?

And so on...
That's the kind of questions you need to ask before you start to code.
If they pop ut once you've done 60% and started to let the client test it (and they will, believe me!) you stand a real risk that you have to go back and redo a lot of code instead of knowing it from the beginning.

Interesting design idea though, I like that you won't pass tons of parameters in the url.
/Dan



{cell 260}
-{ a vibration is a movement that doesn't know which way to go }-

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 10-21-2002 14:08

Thanks, DmS, excellent questions. They're ones that can be easily answered at this stage in the design, but later on? Yikes. Please keep them coming, friends, I'm going back to bed for now.

jive
Paranoid (IV) Inmate

From: Greenville, SC, USA
Insane since: Jan 2002

posted posted 10-22-2002 21:44

This seems like a good and simple alternative. Clients can update and modify there pages through a wsiwyg editor and re uploaded via ftp. very slick and user friendly. Although I'm also a big fan of databases and content management through them as well. I'm an old coder, but for efficiencys sake went to dreamweaver and am amazed. MX makes creating database driven sites so simple now...



Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 10-22-2002 23:29

I want to keep this guy from making things bright blue Comic Sans MS bold italic 24pt. The idea of only letting him select from predefined CSS styles is central to my peace of mind regarding the design's integrity. Plus, I loathe the entire WYSIWYG web-editing concept for a list of reasons too long and controversial to engage in here. And finally, I can't exactly charge the guy $1500 for me to run some third-party software...

AT
Bipolar (III) Inmate

From: Louisville, KY, USA
Insane since: Aug 2000

posted posted 10-24-2002 13:49

Sure you can

« BackwardsOnwards »

Show Forum Drop Down Menu