homepage Welcome to WebmasterWorld Guest from 54.226.213.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Content Management and PHP - can this be done?
Clients ask for the darndest things...
lauren1396




msg:1273179
 3:47 pm on Feb 21, 2003 (gmt 0)

I have a site that I created for a client using PHP/MySQL. I created a nice simple content management system for him that allows him to update existing content and create new pages.

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?

 

hpche




msg:1273180
 3:59 pm on Feb 21, 2003 (gmt 0)

You can't do it with PHP as that is serverside, but you can do it with Javascipt. Just type 'wysiwyg textarea' or 'textarea replacement' into Google to get some scripts specifically made for people to insert into their CMS. Some are free too. I think they all require IE 5.5+ though.

Nick_W




msg:1273181
 4:01 pm on Feb 21, 2003 (gmt 0)

The easiest way of doing this would be to tell him how to use a <span class="blah"></span> set up.

Then create a bunch of styles in your CSS

Nick

martinibuster




msg:1273182
 4:05 pm on Feb 21, 2003 (gmt 0)

Moveable Type does it similarly to how MS Outlook does it when you're formatting an email. Except the style buttons may not show up if you're using a mac.

That may not help you, but you may want to take a look at how they did it.

I like Nick's idea.

andreasfriedrich




msg:1273183
 4:08 pm on Feb 21, 2003 (gmt 0)

As a general rule Iīd stay away from such things and Iīd try to convince any client to do so as well. Next to enabling not html savy people to edit content the one big advantage of a CMS is that it enforces a certain structure on all pages.

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.

Andreas

lauren1396




msg:1273184
 4:10 pm on Feb 21, 2003 (gmt 0)

I offered to just show him how to put in the html tags but he doesn't want anything that's too technical. What he wants is something "just like MS Word"

I'll probably end up using some sort of JavaScript, I don't think the IE 5.5+ requirement will be a problem since he's the only person using it and IE is the only browser he has.

Thanks for the help!

lauren1396




msg:1273185
 4:35 pm on Feb 21, 2003 (gmt 0)

"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. "

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.)

bcolflesh




msg:1273186
 4:47 pm on Feb 21, 2003 (gmt 0)

Dear Lauren,
Take a look at this free solution:

www.dmxzone.com/showDetail.asp?TypeId=3&NewsId=578

Regards,
Brent

[edited by: jatar_k at 7:51 pm (utc) on Feb. 21, 2003]
[edit reason] delinked [/edit]

lauren1396




msg:1273187
 5:36 pm on Feb 21, 2003 (gmt 0)

That sounds like a nice option, thanks Brent.

Trisha




msg:1273188
 7:05 pm on Feb 21, 2003 (gmt 0)

lauren1396 - I have a couple of clients that I made a simple CMS for also. Very simple, they can't add new pages, just edit part of their site. They really like it, and it saves me time, but I'm running into the same problems as you.

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!

Nick_W




msg:1273189
 7:10 pm on Feb 21, 2003 (gmt 0)

I have to update my suggestion ;)

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!

Nick

Knowles




msg:1273190
 7:12 pm on Feb 21, 2003 (gmt 0)

To add to Nicks suggestion and make sure he doesnt have the URL to your site so you dont get a link from him. ;)

lauren1396




msg:1273191
 10:22 pm on Feb 21, 2003 (gmt 0)

"I don't know of a good, easy way for them to add images either, but thankfully they have not asked yet!"

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 :)

Nick_W




msg:1273192
 10:28 pm on Feb 21, 2003 (gmt 0)

I had to do the image thing too.

Even if you don't want to get the book, the manual stuff on this is really straight forward and it's alot easier than it sounds..

Nick

Trisha




msg:1273193
 12:15 am on Feb 22, 2003 (gmt 0)

Actually I have that book, and I like it a lot too. I didn't read that section too closely though. What problem I was anticipating is the quality of the images client tend to send me and want on their pages. They are usually pretty bad and I have to open them in Photoshop and fix them up first. Plus the resizing thing, how well does PHP really do it? Will it make the images look like they do when someone just changes the height and width in HTML? Or is the quality preserved? Because, yes, they will send a '1280 x 1024 jpeg'!

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.

DLadybug




msg:1273194
 4:56 pm on Apr 1, 2003 (gmt 0)

Neveh-mind.

Took a Midol and decided to remove the post. :)

[edited by: DLadybug at 5:09 pm (utc) on April 1, 2003]

Birdman




msg:1273195
 5:04 pm on Apr 1, 2003 (gmt 0)

I think the client should get whatever he wants, whether we think it's a good idea or not. Just so long as they are forewarned of the clean-up costs ;)

Added: Bold and italic seem harmless enough. Maybe even paragraphs and bullet lists.

andreasfriedrich




msg:1273196
 5:18 pm on Apr 1, 2003 (gmt 0)

DLadybug removed her post. My post will not make sense unless you know the basic idea of her post. Let me sumarize what it was about:

  • Why do contractors feel that their clients are basically idiots?
  • Clients will not deliberatly destroy what they paid for.
  • If the are in business they cannot be stupid.
  • Contractors should advise clients about what not do to instead of quietly thinking they are stupid anyway

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 [6]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 ;-).

Andreas

[edited by: andreasfriedrich at 5:32 pm (utc) on April 1, 2003]

toadhall




msg:1273197
 5:25 pm on Apr 1, 2003 (gmt 0)

Trisha,

> 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 info@yubbadubbadoo.ca";
// 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 = [1]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);
echo ("$scan2");
?>

T

[edited by: jatar_k at 6:47 pm (utc) on April 1, 2003]

Trisha




msg:1273198
 3:38 pm on Apr 2, 2003 (gmt 0)

toadhall - Thanks, I'll try that out!

Contractors should advise clients about what not do to instead of quietly thinking they are stupid anyway

Actually, I have tried this, but it doesn't seem to work with some people.

toadhall




msg:1273199
 5:39 pm on Apr 2, 2003 (gmt 0)

BTW Trisha,

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.

T

franklin dematto




msg:1273200
 5:59 am on Apr 3, 2003 (gmt 0)

Macromedia came up with a new product called Contribute which is designed to solve these issues - you can set certain rules, and they can edit, but can't break your rules.

Might be worth it over the time needed to create a PHP based solution.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved