[dw-free] /mobile/friends.bml needs to be renamed /mobile/read.bml
[commit: http://hg.dwscoalition.org/dw-free/rev/bbe8245e97be]
http://bugs.dwscoalition.org/show_bug.cgi?id=960
Move mobile/friends.bml to mobile/read.bml
Patch by
afuna.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=960
Move mobile/friends.bml to mobile/read.bml
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/redirect.dat
- htdocs/mobile/friends.bml
- htdocs/mobile/read.bml
-------------------------------------------------------------------------------- diff -r 3e2a4f3113ea -r bbe8245e97be cgi-bin/redirect.dat --- a/cgi-bin/redirect.dat Sat Apr 25 06:06:49 2009 +0000 +++ b/cgi-bin/redirect.dat Sat Apr 25 07:09:23 2009 +0000 @@ -42,3 +42,4 @@ /manage/subscriptions /manage/settings/?cat=notifications /manage/subscriptions/ /manage/settings/?cat=notifications /manage/subscriptions/index.bml /manage/settings/?cat=notifications +/mobile/friends.bml /mobile/read diff -r 3e2a4f3113ea -r bbe8245e97be htdocs/mobile/friends.bml --- a/htdocs/mobile/friends.bml Sat Apr 25 06:06:49 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -<html> -<head> -<title>Friends Page</title> -<meta name="viewport" content="width = 320" /> -</head> -<body> -<p><?_code -{ - use vars qw (%GET); - - my $u = LJ::User->remote - or return "You must <a href='login.bml'>log in</a> to read your friends page."; - - my $itemsperpage = 50; - - my $ret; - - my $skip = $GET{skip}+0 || 0; - - my $prevcount = $skip + $itemsperpage; - my $nextcount = $skip ? $skip - $itemsperpage : -1; - my $nextlink = $nextcount != -1 ? " | <a href='?skip=$nextcount'>Next $itemsperpage >></a>" : ''; - my $prevlink = "<a href='?skip=$prevcount'><< Previous $itemsperpage</a>"; - - # Filter first to a "Mobile View" friends group if they have one, - # then fall back to "Default View", and then just show them everything -# my $filter; - my $groupname = "All friends"; - -# foreach ("Mobile View", "Default View") { -# if (my $grp = LJ::get_friend_group($u, { 'name' => $_ })) { -# $groupname = $_; -# $filter = 1 << $grp->{'groupnum'}; -# last; -# } -# } - - $ret = qq { - <a href='./'><< Back</a> to LiveJournal Mobile. - <div style="font-size: 16pt; font-weight: bold; margin: 0.8em;">Friends Page</div> - <div style="margin: 1em;"> - <div style="font-weight: bold;">Viewing: $groupname</div> - <div>$prevlink$nextlink</div><br/> - </div> - }; - - - my @entries = $u->watch_items( - 'remote' => $u->{'userid'}, - 'itemshow' => $itemsperpage, - 'skip' => $skip, - 'showtypes' => 'PYC', - 'u' => $u, - 'userid' => $u->{'userid'}, -# 'filter' => $filter, - ); - - # how many characters to truncate entry at - my $max_entry_length = 400; - - foreach my $ei (@entries) { - next unless $ei; - my $entry; - if ($ei->{'ditemid'}) { - $entry = LJ::Entry->new($ei->{'journalid'}, - ditemid => $ei->{'ditemid'}); - } elsif ($ei->{'jitemid'} && $ei->{'anum'}) { - $entry = LJ::Entry->new($ei->{'journalid'}, - jitemid => $ei->{'jitemid'}, - anum => $ei->{'anum'}); - } - next unless $entry; - - my $pu = $entry->poster; - my $ju = $entry->journal; - my $url = $entry->url; - $url .= "?format=light"; - - my $who = "<a href='" . $pu->journal_base . "/'><b>$pu->{user}</b></a>"; - if ($pu->{userid} != $ju->{userid}) { - $who .= " in " . "<a href='" . $ju->journal_base . "/'><b>$ju->{user}</b></a>"; - } - - $ret .= "$who: " . "<a href='$url'>" . ($entry->subject_text || "(no subject)") . "</a><br />"; - } - - return $ret; -} -_code?> - -</body> -</html> diff -r 3e2a4f3113ea -r bbe8245e97be htdocs/mobile/read.bml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/htdocs/mobile/read.bml Sat Apr 25 07:09:23 2009 +0000 @@ -0,0 +1,92 @@ +<html> +<head> +<title>Friends Page</title> +<meta name="viewport" content="width = 320" /> +</head> +<body> +<p><?_code +{ + use vars qw (%GET); + + my $u = LJ::User->remote + or return "You must <a href='login.bml'>log in</a> to read your friends page."; + + my $itemsperpage = 50; + + my $ret; + + my $skip = $GET{skip}+0 || 0; + + my $prevcount = $skip + $itemsperpage; + my $nextcount = $skip ? $skip - $itemsperpage : -1; + my $nextlink = $nextcount != -1 ? " | <a href='?skip=$nextcount'>Next $itemsperpage >></a>" : ''; + my $prevlink = "<a href='?skip=$prevcount'><< Previous $itemsperpage</a>"; + + # Filter first to a "Mobile View" friends group if they have one, + # then fall back to "Default View", and then just show them everything +# my $filter; + my $groupname = "All friends"; + +# foreach ("Mobile View", "Default View") { +# if (my $grp = LJ::get_friend_group($u, { 'name' => $_ })) { +# $groupname = $_; +# $filter = 1 << $grp->{'groupnum'}; +# last; +# } +# } + + $ret = qq { + <a href='./'><< Back</a> to LiveJournal Mobile. + <div style="font-size: 16pt; font-weight: bold; margin: 0.8em;">Friends Page</div> + <div style="margin: 1em;"> + <div style="font-weight: bold;">Viewing: $groupname</div> + <div>$prevlink$nextlink</div><br/> + </div> + }; + + + my @entries = $u->watch_items( + 'remote' => $u->{'userid'}, + 'itemshow' => $itemsperpage, + 'skip' => $skip, + 'showtypes' => 'PYC', + 'u' => $u, + 'userid' => $u->{'userid'}, +# 'filter' => $filter, + ); + + # how many characters to truncate entry at + my $max_entry_length = 400; + + foreach my $ei (@entries) { + next unless $ei; + my $entry; + if ($ei->{'ditemid'}) { + $entry = LJ::Entry->new($ei->{'journalid'}, + ditemid => $ei->{'ditemid'}); + } elsif ($ei->{'jitemid'} && $ei->{'anum'}) { + $entry = LJ::Entry->new($ei->{'journalid'}, + jitemid => $ei->{'jitemid'}, + anum => $ei->{'anum'}); + } + next unless $entry; + + my $pu = $entry->poster; + my $ju = $entry->journal; + my $url = $entry->url; + $url .= "?format=light"; + + my $who = "<a href='" . $pu->journal_base . "/'><b>$pu->{user}</b></a>"; + if ($pu->{userid} != $ju->{userid}) { + $who .= " in " . "<a href='" . $ju->journal_base . "/'><b>$ju->{user}</b></a>"; + } + + $ret .= "$who: " . "<a href='$url'>" . ($entry->subject_text || "(no subject)") . "</a><br />"; + } + + return $ret; +} +_code?> + +</body> +</html> --------------------------------------------------------------------------------