use CGI qw/:standard/;
use ND::Web::Include;
-$ND::PAGES{points} = {parse => \&parse, process => \&process, render=> \&render};
+our @ISA = qw/ND::Web::XMLPage/;
-sub parse {
-}
-
-sub process {
+$ND::Web::Page::PAGES{points} = 'ND::Web::Pages::Points';
-}
-sub render {
- my ($DBH,$BODY) = @_;
- $ND::TEMPLATE->param(TITLE => 'Top Members');
+sub render_body {
+ my $self = shift;
+ my ($BODY) = @_;
+ $self->{TITLE} = 'Top Members';
+ my $DBH = $self->{DBH};
- return $ND::NOACCESS unless isMember();
+ return $self->noAccess unless $self->isMember;
my $type = "total";
if (defined param('type') && param('type') =~ /^(defense|attack|total|humor|scan|rank)$/){
$order = 'ASC' if ($type eq 'rank');
my $limit = 'LIMIT 10';
- $limit = '' if isHC();
+ $limit = '' if $self->isHC;
my $query = $DBH->prepare("SELECT username,defense_points,attack_points,scan_points,humor_points, (attack_points+defense_points+scan_points/20) as total_points, rank FROM users WHERE uid IN (SELECT uid FROM groupmembers WHERE gid = 2) ORDER BY $type $order $limit");
$query->execute;