htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
Help!!!


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


rgraham
Novice

Dec 1, 2004, 10:58 AM

Post #1 of 2 (1527 views)
Shortcut
Help!!! Can't Post

Hi I'm using the htmlArea 2.0 for our company site and well two things are happening that I want resolved. Now for the first problem I'm having you will need to have a understanding oh php. If you go here http://www.power-soft.net you will see that I have a few stories on the home page news and that these stories are limited to so many characters! So the problem is that the code used to limit characters is cutting off the closing tags, which presents a problem!!!! Because now the stories underneath are all messed up! So if anyone has had a similar problem with this and has any suggestions please help! My second problem is now resolved lol I just figured it out so nevermind! But if anyone has a solution to my first problem please help thanks!


rgraham
Novice

Dec 1, 2004, 12:46 PM

Post #2 of 2 (1515 views)
Shortcut
Re: [rgraham] Help!!! [In reply to] Can't Post

Hey you guys I have solved my own problem I figured out a way to just remove the html tags until you get into the actual story! It won't show the color and styles anymore until you are within the story but that is a sacrifise I'm willing to make Smile So if anyone ever runs into this problem here is the code I used to fix my problem

$search = array ("'<script[^>]*?>.*?</script>'si", // Strip out javascript
"'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags
"'([\r\n])[\s]+'", // Strip out white space
"'&(quot|#34);'i", // Replace HTML entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e"); // evaluate as php

$replace = array ("",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\\1)");



So this code is pretty well self explainitory and then the area that you want this code to work in all you have to do is go preg_replace($search, $replace, $displayYourText[here]) and that will work! Of course this doesn't just take out html tags but it takes out javascript and char entities and such you don't need to have all of these things replaced of course.

 
 
 


Search for (options)