Code:
function check_html ($string, $allowed_html = "", $allowed_protocols = array('http', 'https', 'ftp', 'news', 'nntp', 'gopher', 'mailto'))
{
$stop = FALSE;
if(!function_exists(kses_no_null))
{
@include_once(INCLUDE_PATH."includes/kses/kses.php");
}
if (get_magic_quotes_gpc() == 1 )
{
$string = stripslashes($string );
}
$hotHtml = "nohtml";
$Zstrip = stripos_clone($allowed_html, $hotHtml);
if ($Zstrip === false)
{
global $AllowableHTML;
$allowed_html = $AllowableHTML;
} else {
$allowed_html = array('<null>');
}
$string = kses_no_null($string);
$string = kses_js_entities($string);
$string = kses_normalize_entities($string);
$string = kses_hook($string);
$allowed_html_fixed = kses_array_lc($allowed_html);
return kses_split($string, $allowed_html_fixed, $allowed_protocols);
}
function wysiwyg_textarea($name, $value, $config = "NukeUser", $cols = 50, $rows = 10)
{
global $advanced_editor;
# Don't waste bandwidth by loading WYSIWYG editor for crawlers
if ($advanced_editor == 0 or !isset($_COOKIE))
{
echo "<textarea name=\"$name\" cols=\"$cols\" rows=\"$rows\">$value</textarea>";
} else {
@include_once(INCLUDE_PATH."includes/FCKeditor/fckeditor.php");
$oFCKeditor = new FCKeditor($name) ;
$oFCKheight = $rows * 20;
$oFCKeditor->Height = "$oFCKheight";
$oFCKeditor->ToolbarSet = "$config" ;
$oFCKeditor->InstanceName = "$name" ;
$oFCKeditor->Value = "$value" ;
$oFCKeditor->Create() ;
}
}
function wysiwyg_textarea_html($name, $value, $config = "NukeUser", $cols = 50, $rows = 10)
{
global $advanced_editor;
# Don't waste bandwidth by loading WYSIWYG editor for crawlers
if ($advanced_editor == 0 or !isset($_COOKIE))
{
echo "<textarea name=\"$name\" cols=\"$cols\" rows=\"$rows\">$value</textarea>";
} else {
@include_once(INCLUDE_PATH."includes/FCKeditor/fckeditor.php");
$oFCKeditor = new FCKeditor($name) ;
$oFCKheight = $rows * 20;
$oFCKeditor->Height = "$oFCKheight";
$oFCKeditor->ToolbarSet = "$config" ;
$oFCKeditor->InstanceName = "$name" ;
$oFCKeditor->Value = "$value" ;
$wysiwygHTML = $oFCKeditor->CreateHtml() ;
return $wysiwygHTML;
}
}
function filter_text($Message, $strip="") {
global $EditedMessage;
$EditedMessage = check_words($Message);
$EditedMessage=check_html($EditedMessage, $strip);
return $EditedMessage;
}
/*********************************************************/
/* formatting stories */
/*********************************************************/
|