This function is defined but never called.
- Interesting... I wanted to search only titles, when clicking on the Header, so I was looking to hack my way around that... Now it is even more complicated. I wish that could be added. Clicking on the heading will only render "title search". Entering the string on the search box will search both, title and body. Anyone came come up with a patch for that? :-) -- DavidCollantes
The following sub should do it (rough guess, untested, my Perl skills are slim). You also need:
- something to change the HTML link in the title
- Either:
- something in DoOtherRequest to handle a new CGI action, eg "searchtitle=blah", that would call something similar to DoSearch? that calls SearchTitle?
- have DoSearch? check for an extra CGI parameter, such as "titleonly=yes"
-- Tarquin
sub SearchTitle {
my ($string) = @_;
my ($name, $freeName, @found);
foreach $name (&AllPagesList()) {
if ($name =~ /$string/i) {
push(@found, $name);
} elsif ($FreeLinks && ($name =~ m/_/)) {
$freeName = $name;
$freeName =~ s/_/ /g;
if ($freeName =~ /$string/i) {
push(@found, $name);
}
}
}
return @found;
}
I just realized the Backlinks does exactly what I wanted.. Now if I could split the search results page (including the index) on multiple pages with a "Previous 50 - Next 50"... perhaps will come... :-)
- But Baclinks finds strings, not "title only" --JuanmaMP