%# -*-perl-*- $Id: showthread.html,v 1.5 2000/11/19 00:52:39 xi Exp $
<%doc>
###############################################################################
# Usenet Indexer - A nice and fast usenet indexer
# Copyright (C) 2000 Christian Laursen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
###############################################################################
%doc>
<% $r->hostname %>
%show_hier($top);
<%args>
$id => ''
%args>
<%init>
&deja_init;
if ($id !~ /^\d+$/) {
$m->out("You bastard!");
$m->abort(200);
}
# Find the top article
my $top = $id;
while (my $parent = parent($top)) {
$top = $parent;
}
%init>
<%once>
sub show_hier {
$m->out("
\n");
foreach my $id (@_) {
my ($from, $subject) = get_headers($id);
$m->out("
$from, $subject\n");
my @children = children($id);
show_hier(@children) if (@children > 0);
$m->out("