Gossamer Forum
Quote Reply
XMLResults
Hi,

I am using XMLResults and it looks to me that the header is not properly changed with the plugin hook. The source code sais:

Code:
sub pre_search_results {
# -------------------------------------------------------------------
# This is run before the actual search, and is just used to print
# a proper text/xml header (as long as we do it before the text/html
# we are ok).
#
my @args = @_;
if ($IN->param('xml_feed')) {
print $IN->header('text/xml');
GT::Plugins->action ( STOP );
return Links::user_page ('search_results.xml', @_);

}
return @_;
}
It seems that this part has no effect.
Probably the plugin has to be done some way like that. In this case there would be only one hook for search_results.
Code:
sub search_results {
# ------------------------------------------------------------------
# Do the search and print out the results.
#
my $results = &Links::User::Search::query;
return $results unless ($IN->param('xml_feed'));
# if (defined $results->{error}) {
# print $IN->header();
# $results->{main_title_loop} = Links::Build::build('title', Links::language('LINKS_SEARCH'), "$CFG->{db_cgi_url}/search.cgi");
# GT::Plugins->action ( STOP );
# print Links::SiteHTML::display('search', $results);
# }
# else {
print $IN->header('text/xml');
GT::Plugins->action ( STOP );
print Links::user_page ('xml_search_results.xml', $results);
# }
exit;
}
Maybe I am wrong or certainly there is a better way to do it. I would like to hear more comments on this issue.

Regards

Niko

Last edited by:

el noe: Jun 18, 2009, 1:20 PM