LJSUP-17669: Login.bml form refactoring
[livejournal.git] / htdocs / alleventrates.bml
blobb7dc22901871e417a6f79d92bbef3dab172872b1
1 <?page
2 body<=
3 <?_code # -*-bml-*-
5     use strict;
6     use LJ::JSON;
7     use vars qw(%GET);
9     my $action = $GET{action};
10     my ($journal, $itemid) = map { $GET{$_} } qw(journal itemid);
11     my $journal_user = LJ::load_user($journal);
12     my $journalid = 0;
13     $journalid = $journal_user->userid() if $journal_user;
15     return '<h2>Missing args</h2>' unless $journalid && $itemid;
17     my $total = LJ::get_eventratescounters($journalid, $itemid);
19     return "<h2>There is no one like this page yet</h2>" unless $total;
21     my @result = LJ::get_eventrates(
22         journalid   => $journalid,
23         itemid      => $itemid,
24         limits      => 500,
25     );
27     return
28         "<h2>Likes this page ($total):</h2> <ul class='likes-list'><li>" .
29             join('</li><li>', map {
30                 my $user = undef;
31                 $_ && ($user = LJ::load_userid($_)) && $user->ljuser_display();
32         } @result)."</ul>";
34 _code?>
35 <=body
36 page?>