Is there global that I can use that take the Description and clean it form all html code. I mean if in the Description there are <br><BR> <href></a> <b><u> and more it will not display this code or it change this to < and >.
Apr 20, 2009, 6:22 AM
Veteran / Moderator (18436 posts)
Apr 20, 2009, 6:22 AM
Post #2 of 8
Views: 5117
Try something like this:
http://www.gossamer-threads.com/...%3F_P305257/#p305257
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
http://www.gossamer-threads.com/...%3F_P305257/#p305257
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Apr 20, 2009, 7:16 AM
Veteran / Moderator (18436 posts)
Apr 20, 2009, 7:16 AM
Post #5 of 8
Views: 5130
Try this global:
use HTML::Parse;
use HTML::FormatText;
my $plain_text = HTML::FormatText->new->format(parse_html($_[0]));
return $plain_text;
}
This will require you to have the modules HTML::Parse and HTML::FormatText installed (if they are not, your host should be able to do it easily for you)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
sub { use HTML::Parse;
use HTML::FormatText;
my $plain_text = HTML::FormatText->new->format(parse_html($_[0]));
return $plain_text;
}
This will require you to have the modules HTML::Parse and HTML::FormatText installed (if they are not, your host should be able to do it easily for you)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Apr 20, 2009, 8:36 AM
Veteran / Moderator (18436 posts)
Apr 20, 2009, 8:36 AM
Post #7 of 8
Views: 5084
Sorry, forgot to add:
..after:
...not sure if you added that in? (otherwise it shouldn't have worked =))
If those <p>< tags are still being a problem, just try adding this...
$plain_text =~ s/\Q<\/p>//sig;
... after:
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
return $plain_text;..after:
Code:
my $plain_text = HTML::FormatText->new->format(parse_html($_[0]));...not sure if you added that in? (otherwise it shouldn't have worked =))
If those <p>< tags are still being a problem, just try adding this...
Code:
$plain_text =~ s/\Q<p>//sig; $plain_text =~ s/\Q<\/p>//sig;
... after:
Code:
my $plain_text = HTML::FormatText->new->format(parse_html($_[0]));Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!