LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 10-12-2009, 10:15 AM   #1
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Posts: 10
Thanked: 0
Textarea php wysiwyg editors?


[Log in to get rid of this advertisement]
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!
linuxdebian vesperto is offline  
Tag This Post ,
Reply With Quote
Old 10-12-2009, 11:20 AM   #2
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Debris Linux, Ubuntu, Debian
Posts: 447
Thanked: 15
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.
linuxubuntu MoonMind is offline     Reply With Quote
Old 10-12-2009, 11:30 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 8.04 (upgraded from 6.06), Ubuntu Netbook Remix 9.04
Posts: 2,742
Thanked: 87
Maybe you're looking for a solution as used in this thread
linuxubuntu Wim Sturkenboom is offline     Reply With Quote
Old 10-12-2009, 03:53 PM   #4
John VV
Senior Member
 
Registered: Aug 2005
Location: Ann Arbor Mi.
Distribution: Arch Linux ,CentOS 5.4
Posts: 2,148
Thanked: 124
this is one reason i don't use a "wysiwyg" . i use gedit or emacs
linuxfedora John VV is offline     Reply With Quote
Old 10-12-2009, 04:16 PM   #5
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Posts: 10
Thanked: 0

Original Poster
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.
linuxdebian vesperto is offline     Reply With Quote
Old 10-12-2009, 05:05 PM   #6
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Posts: 10
Thanked: 0

Original Poster
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 05:08 PM..
linuxdebian vesperto is offline     Reply With Quote
Old 10-12-2009, 11:38 PM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 8.04 (upgraded from 6.06), Ubuntu Netbook Remix 9.04
Posts: 2,742
Thanked: 87
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.
windows_xp_2003 Wim Sturkenboom is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 03:05 PM
WYSIWYG web editors for linux shortname Linux - General 2 03-16-2005 01:21 PM
PHP editors? hotpepsi Linux - Newbie 7 01-05-2005 05:10 PM
Wysiwyg HTML Editors helenvale Linux - Software 5 09-11-2003 07:05 PM
WYSIWYG PHP editor CyberDrake General 4 12-21-2002 09:11 AM


All times are GMT -5. The time now is 12:30 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration