Welcome to WebmasterWorld Guest from 220.127.116.11
Now, he's asking me for a few extra bells and whistles. He's willing to pay extra $$ for it but the problem is that I have NO idea how to even begin writing this.
Basically, when he's editing/creating content for pages he wants more control over fonts, colors, text styles, etc. His idea is to be able to highlight a portion of text with his mouse, click a button and have the highlighted section change color or become bold.
Is there any way for PHP to be able to recognize if text inside of a textarea is highlighted?
joined:Apr 13, 2002
That may not help you, but you may want to take a look at how they did it.
I like Nick's idea.
When clients have the options to change front properties like they are used to do when using Word they will just start playing around, make the pages look inconsistent and unprofessional.
Give them the option to do some finely grained logical markup if need be and charge for that, but try as best a you can to convince them to not want the visual layout options.
Thanks for the help!
Give them the option to do some finely grained logical markup if need be and charge for that, but try as best a you can to convince them to not want the visual layout options. "
I agree. What I plan to do is limit his editing ability to the long descriptions and only allow him the option to use bold, underline, italics, and a small selection of colors that coordinate with the site's design. I want to keep all of the titles and fonts looking the same.
I know that if I give him the amount of freedom that he wants the site will end up looking like a nightmare. (The first thing I thought of when he asked me for this was the entire site being in neon green 72px bold underlined text using some horrible font.)
What I did is show them how to use the bold tags and br, and I leave the instruction on their editing page. Still, one of them even messed up bold once.
I would like to come up with a simple way for them to make links, but I'm afraid that showing them the html for that would be asking for trouble.
I think Nicks idea would be good for certain types of formatting. Getting a client to decide upon a certain set of spans though, the exact colors and font sizes, could be hard though. My experience tells me that they would keep changing their minds about what they want, and end up wanting 'neon green 72px bold' as you mentioned. Each client is different though, some could handle it.
I've seen message board software that has buttons to click, like when you want to create a link. Click it, and a popup appears asking for the link text, then another appears asking for the url. I'd love to have something like that, but I have no idea of how to code it. Something similar could be set up with buttons for, bold red, 16px black, etc., but again I wish I knew how to do it, but don't and I don't have a lot of time to work on it either.
I don't know of a good, easy way for them to add images either, but thankfully they have not asked yet!
When I made it, I was thinking of purely a solution to the problem.
On further reflection, I'm with Andreas on this: Clients should not be encouraged to mess with styles. I mean, if he wants to mess it up, buy him a copy of FP, show him where he can get free spinning logos and charge him for FP+ a tutorial!
Trisha, I actually have a book that covers this topic pretty well. PHP and MySQL Web Development by Luke Welling and Laura Thomson. There is a CMS tutorial that includes an image uploading feature and a php script that checks the image size and resizes it if necessary (because you just know that eventually a client will try to upload a 1280 x 1024 jpeg).
This book has become my bible for PHP related stuff...and there's a 2nd edition on the way :)
I based the simple CMS for those clients and one more complex for a site of my own, on what was in that book too. It was a challenge for me though. One thing I wish they would have included is a way to preview the page before it goes onto the site. I came up with something like that for one client, but it doesn't work as well as I would like. I could probably come up with something better if I had the time to work on it though.
I believe I am entitled to paraphrase DLadybug since she published her post so that I could have even quoted from it under the fair usage clause. Having published something the publisher cannot remove it from the world and is not entitled to do so. Now since I could have even quoted her (which I choose not to do to respect her whishes as far as I was able to do) I can paraphrase her as well.
Itīs not so much the prospect that a client may add huge[/6] and colorful text to a page that is bad. It is the suggested approach to mangle structure and style. I couldnīt care less whether a client added new copy that is nicely structured and then changed the style sheets to display it in wierd and ugly colors.
I guess as far as this is concerned I operate under a sort of separation thesis. As long as structure and style are separated I can go ahead and use my own user style sheets if the content is good and I want to view it in a way that I like. Just like any legal positivist will go berserk when the separation thesis is violated I really dislike pages that go against the strict separation of style and structure.
BTW I do believe the is no such thing as a separation thesis when it comes to law and morality ;-).
[edited by: andreasfriedrich at 5:32 pm (utc) on April 1, 2003]
> a simple way for them to make links (without) showing them the html...
This script was written by someone here at WebmasterWorld. Didn't keep the thread url or note the author (was it you Andreas?) and can't find it in a Site Search.
It forms hyper links and mailto links of any full url or email address in the input text.
It's not the pop-up solution on your wish list, but a nice bit of work none the less.
$text = "The url to this site is http://www.yubbadubbadoo.ca, if you'd like to visit.<br>Or mail them at firstname.lastname@example.org";
// scan for hyper links...
$scan1 = ereg_replace("[A-Za-z]+://[^ <>\n]*[A-Za-z0-9/]", '<a href="\\0">\\0</a>', $text);
// scan for email addresses...
$scan2 = ereg_replace('[A-Za-z0-9]([A-Za-z0-9._]*[A-Za-z0-9]Ķ())@[A-Za-z0-9]([A-Za-z0-9.\-]*[A-Za-z0-9]Ķ())\.[A-Za-z]+', [/1]'<a href="mailto:\\0">\\0</a>', $scan1);
[edited by: jatar_k at 6:47 pm (utc) on April 1, 2003]
That code uses 'pipes', vertical lines (uppercase of the backslash key on my keyboard), in a few places. You'll have to replace them after you copy the code and paste it to your editor in order for the code to work properly.
A 'pipe' shows up as two short vertical lines in this forum - They should be unbroken.