diff options
Diffstat (limited to 'lib/VNDB/DB/Users.pm')
-rw-r--r-- | lib/VNDB/DB/Users.pm | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm deleted file mode 100644 index 85654180..00000000 --- a/lib/VNDB/DB/Users.pm +++ /dev/null @@ -1,49 +0,0 @@ - -package VNDB::DB::Users; - -use strict; -use warnings; -use Exporter 'import'; - -our @EXPORT = qw| - dbUserGet -|; - - -# %options->{ uid results page what } -# sort: username registered votes changes tags -sub dbUserGet { - my $s = shift; - my %o = ( - page => 1, - results => 10, - what => '', - @_ - ); - - my %where = ( - $o{uid} && !ref($o{uid}) ? ( - 'id = ?' => $o{uid} ) : (), - $o{uid} && ref($o{uid}) ? ( - 'id IN(!l)' => [ $o{uid} ]) : (), - ); - - my @select = ( - qw|id username c_votes c_changes c_tags|, - VNWeb::DB::sql_user(), # XXX: This duplicates id and username, but updating all the code isn't going to be easy - q|extract('epoch' from registered) as registered|, - ); - - my($r, $np) = $s->dbPage(\%o, q| - SELECT !s - FROM users u - !W - ORDER BY id DESC|, - join(', ', @select), \%where - ); - - return wantarray ? ($r, $np) : $r; -} - -1; - |