[dw-free] remove /tools/friendlist.bml
[commit: http://hg.dwscoalition.org/dw-free/rev/3e0fbecc06b7]
http://bugs.dwscoalition.org/show_bug.cgi?id=1383
Remove page (was never updated; not linked to from anywhere)
Patch by
denise.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1383
Remove page (was never updated; not linked to from anywhere)
Patch by
![[staff profile]](https://www.dreamwidth.org/img/silk/identity/user_staff.png)
Files modified:
- htdocs/tools/friendlist.bml
-------------------------------------------------------------------------------- diff -r 5da5033952ee -r 3e0fbecc06b7 htdocs/tools/friendlist.bml --- a/htdocs/tools/friendlist.bml Wed Jul 08 16:45:09 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -<?page -body<= -<?_code -{ - use strict; - use vars qw(%GET $title); - use LJ::M::ProfilePage; - - my $body = ""; - $title = ""; - - # Deal with bots - my $sep = "**"; - my $pre = "<!-- \n" . ($sep x 40 . "\n") x 2 . "$sep\n" x 10 . $sep; - my $post = "\n" . "$sep\n" x 10 . ($sep x 40 . "\n") x 2 . " -->"; - $body .= LJ::run_hook("bot_director", $pre, $post); - - if ($LJ::SERVER_DOWN) { - $title = $ML{'Sorry'}; - $body = LJ::server_down_html(); - return; - } - - my $remote = LJ::get_remote(); - my $user = $GET{user}; - my $u; - if ($user) { - $u = LJ::load_user_arg($user); - unless ($u) { - $title = $ML{'Sorry'}; - return "Invalid user."; - } - } else { - $u = $remote; - return BML::redirect("$LJ::SITEROOT/login.bml?ret=1") unless $u; - } - - my $type_readable = sub { - my $type = shift; - - return { - r => 'redirect', - i => 'identity', - p => 'personal', - s => 'shared', - y => 'syndicated', - c => 'community', - }->{lc $type}; - }; - - my $of = $GET{mode} eq "of" ? 1 : 0; - my $pics = $GET{nopics} ? 0 : 1; - - my $type = $GET{type}; - $type =~ s/^[^ripsync]+$//i; - my %types = map { $_ => 1 } split(//, $type); - - my %remote_friend_uids = map { $_ => 1 } $remote->friend_uids if $remote; - my $show_mutual_friends = $remote && (!$remote->equals($u) || $of) ? 1 : 0; - - if ($u->is_community) { - $title = $of ? "Watchers of " . $u->display_username : $u->display_username . "'s Members"; - } elsif ($u->is_syndicated) { - $title = $of ? "Subscribers of " . $u->display_username : $u->display_username . "'s Friends"; - } else { - $title = $of ? "Users Who Friend " . $u->display_username : $u->display_username . "'s Friends"; - } - - my $method = $of ? "friendof_uids" : "friend_uids"; - my $friendu = LJ::load_userids($u->$method); - my @initial_friends = values %$friendu; - my @friends; - if (keys %types) { - foreach my $f (@initial_friends) { - my $ftype = $f->journaltype; - foreach my $t (keys %types) { - push @friends, $f if lc $ftype eq lc $t; - } - } - } else { - push @friends, @initial_friends; - } - - my $count = @friends; - - return "There are no users to display." unless $count; - - # sort on display name - { - my %uid_name; # uid -> display name - foreach my $fu (@friends) { - $uid_name{$fu->id} = $fu->display_username; - } - @friends = sort { $uid_name{$a->{userid}} cmp $uid_name{$b->{userid}} } @friends; - } - - my $self_link = sub { - my %params = map { ($_, $GET{$_}) } grep { exists $GET{$_} } qw(user mode nopics type page); - $params{page} = $_[0]; - return "/tools/friendlist.bml?" . join('&', map { LJ::eurl($_) . "=" . LJ::eurl($params{$_}) } keys %params); - }; - - my $page_size; - { - my $default_value = $pics ? 100 : 10_000; - my $max_value = $pics ? 100 : 10_000; - if (!defined($GET{pagesize}) || $max_value < ($page_size = abs(int($GET{pagesize})))) { - $page_size = $default_value; - } - } - - my %items = BML::paging(\@friends, $GET{page}, $page_size); - my $navbar = LJ::paging_bar($items{page}, $items{pages}, { self_link => $self_link }); - @friends = @{$items{items}}; - - LJ::Userpic->preload_default_userpics(@friends) if $pics; - - my @types_names; - foreach my $t (keys %types) { - push @types_names, $type_readable->($t); - } - - if (@types_names) { - $body .= "<h2>Total (" . join(", ", @types_names) . "): $count</h2>\n"; - } else { - $body .= "<h2>Total: $count</h2>\n"; - } - - $body .= $navbar; - - $body .= "<table align='center' border='0' cellspacing='3'>"; - - my $maxcol = 5; - - my $format_userlink = sub { - my ($given_u, $userlink) = @_; - - return "<strike>$userlink</strike>" if $given_u->is_deleted || $given_u->is_expunged || $given_u->is_suspended; - return "<b>$userlink</b>" if $show_mutual_friends && $remote_friend_uids{$given_u->id}; - return $userlink; - }; - - if ($pics) { - ROW: - while (1) { - $body .= " <tr>\n"; - for (1..$maxcol) { - last ROW unless @friends; - my $friend = shift @friends; - my $pic = ""; - if (my $up = $friend->userpic) { - $pic .= $up->imgtag . "<br />\n"; - } elsif ($friend->is_syndicated) { - $pic .= "<img src='$LJ::IMGPREFIX/feed-userpic.gif' width='100' height='100' class='userpic-img' /><br />\n"; - } else { - $pic .= "<img src='$LJ::IMGPREFIX/nouserpic.png' width='100' height='100' class='userpic-img' /><br />\n"; - } - $body .= " <td valign='bottom' align='center' width='100'>$pic" . $friend->ljuser_display . "</td>\n"; - } - $body .= " </tr>\n"; - } - } else { - my @friend_usernames = map { $format_userlink->($_, "<a href='" . $_->journal_base . "'>" . $_->display_username . "</a>") } @friends; - $body .= "<p>" . join(", ", @friend_usernames) . "</p>"; - } - - $body .= "</table>\n"; - $body .= $navbar if $count > $page_size; - return $body; -} -_code?> -<=body -title=><?_code return $title; _code?> -page?> --------------------------------------------------------------------------------