X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FPages%2FPoints.pm;h=b17e4b1bba6978a39f9eb0410f6148b776206c19;hb=5e8e40894860b7bab39783a43c32d98d080801c9;hp=30512fbdfe5131be97c3bc0a41173ea4033cac29;hpb=537d7e414faf9caaa0a87667792cab04e6fe2b51;p=ndwebbie.git diff --git a/ND/Web/Pages/Points.pm b/ND/Web/Pages/Points.pm index 30512fb..b17e4b1 100644 --- a/ND/Web/Pages/Points.pm +++ b/ND/Web/Pages/Points.pm @@ -23,20 +23,18 @@ use warnings FATAL => 'all'; 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)$/){ @@ -48,7 +46,7 @@ sub render { $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;