Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [afinlr] Making search results look more, um, "searchy"

Quote Reply
Re: [afinlr] Making search results look more, um, "searchy" In reply to
Hi there,

I realize this is an older thread but I'll try to recessitate it. I've got this mod going on my site, but I would like to coordinate it with the search term highlighting plugin.

when I comment out the "strip html" code:

Code:
sub {

use HTML::Entities;

my $post_message = shift;

$post_message=~ s/^\s*//; # leading spaces
$post_message=~ s/\s*$//; # trailing spaces
$post_message=~ s/\s+/ /g; # multiple spaces

#
# Strip HTML tags
#
# $post_message=~ s(<[^>]*>)()g;
# $post_message=~ s(\[url.*\])()g;
# $post_message=~ s(\[\/url\])()g;
# $post_message=~ s(\[signature\])()g;
# $post_message=~ s(\[size*\])()g;
#

return substr($post_message,0,200);

}

I can see the search term highlighting html but the html is encoded so the code renders in the browser, not the html itself. Eg. > is &gt;

I've tried some of the unencoding functions, but nothing works...

Code:
sub {

use HTML::Entities;

my $post_message = shift;

$post_message=~ s/^\s*//; # leading spaces
$post_message=~ s/\s*$//; # trailing spaces
$post_message=~ s/\s+/ /g; # multiple spaces

# Strip HTML tags
#
# $post_message=~ s(<[^>]*>)()g;
# $post_message=~ s(\[url.*\])()g;
# $post_message=~ s(\[\/url\])()g;
# $post_message=~ s(\[signature\])()g;
# $post_message=~ s(\[size*\])()g;

# convert &lt; and &gt; to < and >

#$post_message = GT::CGI::html_unescape($post_message); #

$post_message = decode_entities($post_message);

return substr($post_message,0,200);

}


The html remains encoded so it renders as code.

Can anybody help me here? I'm Going nuts! Pirate


Thanks,
Mike
Subject Author Views Date
Thread Making search results look more, um, "searchy" agaffin 4013 Apr 8, 2004, 2:30 PM
Thread Re: [agaffin] Making search results look more, um, "searchy"
afinlr 3899 Apr 8, 2004, 2:48 PM
Post Re: [afinlr] Making search results look more, um, "searchy"
Swaylock 3688 Feb 12, 2006, 11:25 PM
Post Re: [agaffin] Making search results look more, um, "searchy"
hoefti 3883 Apr 9, 2004, 2:45 AM