Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Thread Tools Display Modes
Share |
Old 05-01-2011, 03:21 PM
RockStrongo RockStrongo is offline
Junior Member
Join Date: 05-01-11
Posts: 6
iTrader: 0 / 0%
A tricky CSS question.

Hello everyone. I have searched the internet looking for a solution but honestly, I don't even know what I should be searching as keywords. I develop websites and by using a file manager, grant access to certain directories so my clients can make modifications. The problem I am running into is that some people don't know basic CSS and are completely lost.

I want to create a PHP form that translates the CSS rules into plain English. For example, there will be options such as: background. Then they can either upload an image or change the color within the form. It will then edit the stylesheet and update the background. Another example would be header text. They can have the option to select the font family, size, color, decoration, weight, and background.

Does anyone have any idea where to even start looking for something like this? What keywords should I use? It will be done in PHP and Mysql. Are there any scripts out there available for this function? I am more of a designer (CSS & XHTML) therefore I'm the type of person that needs something to follow while I'm developing code in PHP.

Thanks in advance for your help.
Reply With Quote



Old 05-01-2011, 04:48 PM
cbsmth's Avatar
cbsmth cbsmth is offline
v7n Mentor
Join Date: 08-17-10
Location: Mexico
Posts: 175
iTrader: 0 / 0%
You could probably approach this problem in several manners. One that sprung to mind while reading your question (which I would not label as a CSS one, really), is to play around with the PHP SimpleXML extension, creating a class that reads a .css-file, correctly parsing it into XML objects for your "easy-to-use" processing interface, then saving it back to correctly structured CSS.

Naturally there are several other plausible solutions of varying complexity.

Best of luck!
Reply With Quote
Old 05-02-2011, 12:20 AM
nemrod's Avatar
nemrod nemrod is offline
v7n Mentor
Join Date: 12-21-10
Location: Sweden
Posts: 463
iTrader: 0 / 0%
The easiest thing to do if you just want them to be able to edit the CSS attributes you've set is probably to simply read in the whole file into a multidimensional key-value list (["tag" => ["attribute" => "value"]]) to loop through and print.

Depending on the type of attribute you print an appropriate form, for the "color" attribute that could either be a <select> with some predetermined values or an <input> if you want them to be able to choose any color. For "font-family" you probably want a <select> with predetermined values, and so on.

When they're done changing attributes you can just save it as a file again with the values from the modified array.

cbsmth's suggestion of parsing the CSS into XML is another way, but I feel it would just add unneeded complexity to the problem. CSS is a language with a very flat structure and known depth, why convert it to another language with the only benefit of multi-level nesting?
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
tricky requirements Ola Web Design Lobby 1 06-24-2008 09:30 AM
Very Tricky jright Google Forum 15 11-28-2003 07:31 PM

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 06:23 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC