summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Users.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-10-30 15:43:05 +0100
committerYorhel <git@yorhel.nl>2019-10-30 15:43:08 +0100
commit60452526c1c68d55dbde2ded27235dce7649b03a (patch)
treec827a59c4a87484b99e932669caecf23a9b50c8d /lib/VNDB/Handler/Users.pm
parent8a1a72e7a5edd08a69cc7743b228fa402a7c66c7 (diff)
v2rw: Convert /u+/posts
Simple conversion, no real changes other than that the new version has full pagination.
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r--lib/VNDB/Handler/Users.pm69
1 files changed, 0 insertions, 69 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
deleted file mode 100644
index a9c53206..00000000
--- a/lib/VNDB/Handler/Users.pm
+++ /dev/null
@@ -1,69 +0,0 @@
-
-package VNDB::Handler::Users;
-
-use strict;
-use warnings;
-use TUWF ':html';
-use VNDB::Func;
-
-
-TUWF::register(
- qr{u([1-9]\d*)/posts} => \&posts,
-);
-
-
-sub posts {
- my($self, $uid) = @_;
-
- # fetch user info
- my $u = $self->dbUserGet(uid => $uid, what => 'hide_list pubskin')->[0];
- return $self->resNotFound if !$u->{id};
-
- my $f = $self->formValidate(
- { get => 'p', required => 0, default => 1, template => 'page' }
- );
- return $self->resNotFound if $f->{_err};
-
- my($posts, $np) = $self->dbPostGet(uid => $uid, hide => 1, what => 'thread', page => $f->{p}, sort => 'date', reverse => 1);
-
- my $title = 'Posts made by '.VNWeb::HTML::user_displayname($u);
- $self->htmlHeader(title => $title, noindex => 1, pubskin => $u);
- $self->htmlMainTabs(u => $u, 'posts');
- div class => 'mainbox';
- h1 $title;
- if(!@$posts) {
- p VNWeb::HTML::user_displayname($u)." hasn't made any posts yet.";
- }
- end;
-
- $self->htmlBrowse(
- items => $posts,
- class => 'uposts',
- options => $f,
- nextpage => $np,
- pageurl => "/u$uid/posts",
- header => [
- [ '' ],
- [ '' ],
- [ 'Date' ],
- [ 'Title' ],
- ],
- row => sub {
- my($s, $n, $l) = @_;
- Tr;
- td class => 'tc1'; a href => "/t$l->{tid}.$l->{num}", 't'.$l->{tid}; end;
- td class => 'tc2'; a href => "/t$l->{tid}.$l->{num}", '.'.$l->{num}; end;
- td class => 'tc3', fmtdate $l->{date};
- td class => 'tc4';
- a href => "/t$l->{tid}.$l->{num}", $l->{title};
- b class => 'grayedout'; lit bb2html $l->{msg}, 150; end;
- end;
- end;
- },
- ) if @$posts;
- $self->htmlFooter;
-}
-
-
-1;
-