Page names only are highlited once per page.
Brought to you by:
rkiesling
The page names that are on pages are only highlited
once per page.
sub words {
$page = $_[0];
foreach my $st (split
/\s|\r?\n|\'|\|\"|\?|\.|\:|,|\*/, $page) {
next if $st !~ /^[A-Z]/ || ! -f "$filedir/$st";
$page =~ s/([^\w"<])$st([^\w"])/<a
href="?$st">$st<\/a>/g
if (filetype ($st) =~ /text/); # <-- was missing
the global flag g and only replaced 1st occurence.
$page =~ s/([^\w"<])$st([^\w"])/<img src="$st"
alt="$st">/g
if (filetype ($st) =~ /png|jpeg/);
}
return $page;
}
--rick
polarzinc@yahoo.com
Logged In: YES
user_id=583453
Originator: NO
Fixed. Also fixes in w_eval for pages that contain Perl templates.