LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-12-2009, 09:15 AM   #1
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Distribution: gentoo and slackware and other(s)
Posts: 28

Rep: Reputation: Disabled
Textarea php wysiwyg editors?


Hi, i'm not sure where to post this, really, but here goes..

I have a site where i want admin users to edit content, usually through texarea and input tags, like text descriptions, prices, etc. For the textarea, i've been fiddling with TinyMCE, but it's not exactly fulfilling my expectations.

My main concerns are to strip odd stuff from the user text, filter sql injection (although these specific users won't screw around), keep the strings unicode and keep the html format (b and i tags, although i use span with styles). All to eb stored in a MySQL database (already set to utf8_bin). I've searched some php functions (like mysql_real_escape_string) but haven't found the correct combination yet.

TinyMCE - or something similar - seemed to be ideal, but... it uses javascript, which i'd like to avoid (but don't think will be able to); only works on IE and Firefox (i also tried Midori and Opera).

I don't want to use a CMS.

Any suggestions?

Oh, look, i've just typed this in a similar thingy!
 
Old 10-12-2009, 10:20 AM   #2
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
I'd suggest widgEditor - back when it was available as a plugin for my favourite CMS (CMS Made Simple), I made it the default for all editors, and they were as satisfied as I was (I don't normally use WYSIWYG, though - I like my HTML to stay as lean and correct as possible). widgEditor does a pretty neat job overall, I think. And it's Free Software - get it here.

Sadly, I'm no coder to revive the plugin (it's no longer compatible with recent versions of the CMS). I've tried, but I seem to miss important steps. Sicut transit gloria mundi...

M.
 
Old 10-12-2009, 10:30 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Maybe you're looking for a solution as used in this thread
 
Old 10-12-2009, 02:53 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
this is one reason i don't use a "wysiwyg" . i use gedit or emacs
 
Old 10-12-2009, 03:16 PM   #5
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Distribution: gentoo and slackware and other(s)
Posts: 28

Original Poster
Rep: Reputation: Disabled
thank you both for the input.

John VV, the other two posters got what i wanted. Are you gonna suggest gedit or emacs as a webapp to your website users? I wasn't asking for an IDE, but rather a "fancy" way for website users to submit preformatted text i can send/get to/from a database.
 
Old 10-12-2009, 04:05 PM   #6
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Distribution: gentoo and slackware and other(s)
Posts: 28

Original Poster
Rep: Reputation: Disabled
Btw, what's the best approach when handling CRLF? (I've been trying Wim's solution since <b> and <i> (and <br>) are enough for me.)

edit: Hmm... well i could use [ br ], or nl2br or keep on searching...

Last edited by vesperto; 10-12-2009 at 04:08 PM.
 
Old 10-12-2009, 10:38 PM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
nl2br is, in my opinion, the most intuitive for your users; if they put a newline in the textarea, they will get a newline. Using [ br ] requires extra handling that not everybody will understand.
 
  


Reply

Tags
php, wysiwyg



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
My New PHP WYSIWYG PDF library kstan Programming 1 10-02-2009 02:05 PM
WYSIWYG web editors for linux shortname Linux - General 2 03-16-2005 12:21 PM
PHP editors? hotpepsi Linux - Newbie 7 01-05-2005 04:10 PM
Wysiwyg HTML Editors helenvale Linux - Software 5 09-11-2003 06:05 PM
WYSIWYG PHP editor CyberDrake General 4 12-21-2002 08:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration