fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-06-14 02:36 pm

[dw-free] finish migrating LJ::journal_base to $u->journal_base

[commit: http://hg.dwscoalition.org/dw-free/rev/f8d05013edf5]

http://bugs.dwscoalition.org/show_bug.cgi?id=2656

Code cleanup: modernize the code. Call $u->journal_base, instead of
LJ::journal_base( $u ).

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/Apache/LiveJournal.pm
  • cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm
  • cgi-bin/Apache/LiveJournal/Interface/Blogger.pm
  • cgi-bin/LJ/Entry.pm
  • cgi-bin/LJ/S2.pm
  • cgi-bin/LJ/S2/DayPage.pm
  • cgi-bin/LJ/S2/MonthPage.pm
  • cgi-bin/LJ/S2/RecentPage.pm
  • cgi-bin/LJ/S2/TagsPage.pm
  • cgi-bin/LJ/Talk.pm
  • cgi-bin/LJ/User.pm
  • cgi-bin/ljfeed.pl
  • cgi-bin/weblib.pl
  • htdocs/community/create.bml
  • htdocs/community/members.bml
  • htdocs/customize/advanced/styles.bml
  • htdocs/edittags.bml
  • htdocs/go.bml
  • htdocs/manage/tags.bml
  • htdocs/multisearch.bml
  • htdocs/newuser.bml
  • htdocs/preview/entry.bml
  • htdocs/talkmulti.bml
  • htdocs/talkpost.bml
  • htdocs/talkpost_do.bml
  • htdocs/talkread.bml
  • htdocs/talkscreen.bml
  • htdocs/tools/endpoints/multisearch.bml
  • htdocs/tools/recent_comments.bml
  • htdocs/view/index.bml
--------------------------------------------------------------------------------
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/Apache/LiveJournal.pm
--- a/cgi-bin/Apache/LiveJournal.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/Apache/LiveJournal.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -531,7 +531,7 @@ sub trans
             # so the s/// leaves a leading slash as well so that $newurl is
             # consistent for the concatenation before redirect
             $newurl =~ s!^/(users/|community/|~)\Q$orig_user\E!/!;
-            $newurl = LJ::journal_base($u) . "$newurl$args_wq";
+            $newurl = $u->journal_base . "$newurl$args_wq" if $u;
             return redir($r, $newurl);
         }
 
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm
--- a/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -540,7 +540,7 @@ sub handle {
         $link->title($title);
         $link->type('text/html');
         $link->rel('alternate');
-        $link->href( LJ::journal_base($u) );
+        $link->href( $u->journal_base );
         $feed->add_link($link);
 
         return respond($r, 200, \$feed->as_xml(), 'atom');
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/Apache/LiveJournal/Interface/Blogger.pm
--- a/cgi-bin/Apache/LiveJournal/Interface/Blogger.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/Apache/LiveJournal/Interface/Blogger.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -150,9 +150,9 @@ sub getUsersBlogs {
     }
 
     return [ map { {
-        'url' => LJ::journal_base($_) . "/",
-        'blogid' => $_->{'user'},
-        'blogName' => $_->{'name'},
+        url => $_->journal_base . "/",
+        blogid => $_->user,
+        blogName => $_->name_raw,
     } } @list ];
 }
 
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/LJ/Entry.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -2170,7 +2170,7 @@ sub item_link
     # XXX: should have an option of returning a url with escaped (&)
     #      or non-escaped (&) arguments.  a new link object would be best.
     my $args = @args ? "?" . join("&", @args) : "";
-    return LJ::journal_base($u) . "/$ditemid.html$args";
+    return $u->journal_base . "/$ditemid.html$args";
 }
 
 # <LJFUNC>
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/LJ/S2.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -126,7 +126,7 @@ sub make_journal
 
     foreach ("name", "url", "urlname") { LJ::text_out(\$u->{$_}); }
 
-    $u->{'_journalbase'} = LJ::journal_base($u->{'user'}, $opts->{'vhost'});
+    $u->{'_journalbase'} = $u->journal_base( $opts->{'vhost'} );
 
     my $view2class = {
         lastn    => "RecentPage",
@@ -1731,8 +1731,8 @@ sub Tag
     my $t = {
         _type => 'Tag',
         _id => $kwid,
-        name => LJ::ehtml($kw),
-        url => LJ::journal_base($u) . '/tag/' . LJ::eurl($kw),
+        name => LJ::ehtml( $kw ),
+        url => $u->journal_base . '/tag/' . LJ::eurl( $kw ),
     };
 
     return $t;
@@ -1746,8 +1746,8 @@ sub TagDetail
     my $t = {
         _type => 'TagDetail',
         _id => $kwid,
-        name => LJ::ehtml($tag->{name}),
-        url => LJ::journal_base($u) . '/tag/' . LJ::eurl($tag->{name}),
+        name => LJ::ehtml( $tag->{name} ),
+        url => $u->journal_base . '/tag/' . LJ::eurl( $tag->{name} ),
         use_count => $tag->{uses},
         visibility => $tag->{security_level},
     };
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/LJ/S2/DayPage.pm
--- a/cgi-bin/LJ/S2/DayPage.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/LJ/S2/DayPage.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -26,8 +26,8 @@ sub DayPage
     $p->{'view'} = "day";
     $p->{'entries'} = [];
 
-    my $user = $u->{'user'};
-    my $journalbase = LJ::journal_base($user, $opts->{'vhost'});
+    my $user = $u->user;
+    my $journalbase = $u->journal_base( $opts->{'vhost'} );
 
     if ($u->should_block_robots) {
         $p->{'head_content'} .= LJ::robot_meta_tags();
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/LJ/S2/MonthPage.pm
--- a/cgi-bin/LJ/S2/MonthPage.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/LJ/S2/MonthPage.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -33,8 +33,8 @@ sub MonthPage
 
     my $dbcr = LJ::get_cluster_reader($u);
 
-    my $user = $u->{'user'};
-    my $journalbase = LJ::journal_base($user, $opts->{'vhost'});
+    my $user = $u->user;
+    my $journalbase = $u->journal_base( $opts->{'vhost'} );
 
     if ($u->should_block_robots) {
         $p->{'head_content'} .= LJ::robot_meta_tags();
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/LJ/S2/RecentPage.pm
--- a/cgi-bin/LJ/S2/RecentPage.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/LJ/S2/RecentPage.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -44,8 +44,8 @@ sub RecentPage
         $p->{head_content} .= '<link rel="'.$rel.'" title="'.LJ::ehtml($friendstitle).'" href="'.LJ::ehtml($friendsurl)."\" />\n";
     }
 
-    my $user = $u->{'user'};
-    my $journalbase = LJ::journal_base($user, $opts->{'vhost'});
+    my $user = $u->user;
+    my $journalbase = $u->journal_base( $opts->{'vhost'} );
 
     my $datalink = sub {
         my ($what, $caption) = @_;
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/LJ/S2/TagsPage.pm
--- a/cgi-bin/LJ/S2/TagsPage.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/LJ/S2/TagsPage.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -24,8 +24,8 @@ sub TagsPage
     $p->{'view'} = "tags";
     $p->{'tags'} = [];
 
-    my $user = $u->{'user'};
-    my $journalbase = LJ::journal_base($user, $opts->{'vhost'});
+    my $user = $u->user;
+    my $journalbase = $u->journal_base( $opts->{'vhost'} );
 
     if ($opts->{'pathextra'}) {
         $opts->{'badargs'} = 1;
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/LJ/Talk.pm
--- a/cgi-bin/LJ/Talk.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/LJ/Talk.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -2319,7 +2319,7 @@ sub mail_comments {
     my $itemid = $item->{itemid};
     my $ditemid = $itemid*256 + $item->{anum};
     my $dtalkid = $comment->{talkid}*256 + $item->{anum};
-    my $talkurl = LJ::journal_base($journalu) . "/$ditemid.html";
+    my $talkurl = $journalu->journal_base . "/$ditemid.html";
     my $threadurl = LJ::Talk::talkargs($talkurl, "thread=$dtalkid");
     my $edited = $comment->{editid} ? 1 : 0;
 
@@ -2940,7 +2940,7 @@ sub init {
     my $iprops = $item->{'props'};
     my $ditemid = $init->{'ditemid'}+0;
 
-    my $talkurl = LJ::journal_base($journalu) . "/$ditemid.html";
+    my $talkurl = $journalu->journal_base . "/$ditemid.html";
     $init->{talkurl} = $talkurl;
 
     ### load users
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/LJ/User.pm	Mon Jun 14 22:42:21 2010 +0800
@@ -5240,8 +5240,7 @@ sub revoke_priv_all {
 =cut
 
 sub journal_base {
-    my $u = shift;
-    return LJ::journal_base($u);
+    return LJ::journal_base( @_ );
 }
 
 
@@ -8444,7 +8443,7 @@ sub make_journal
     return unless $styleid;
 
 
-    $u->{'_journalbase'} = LJ::journal_base( $u->user, $opts->{'vhost'} );
+    $u->{'_journalbase'} = $u->journal_base( $opts->{'vhost'} );
 
     my $eff_view = $LJ::viewinfo{$view}->{'styleof'} || $view;
 
@@ -8568,7 +8567,7 @@ sub make_journal
         $opts->{'status'} = $status if $status;
 
         my $head;
-        my $journalbase = LJ::journal_base($user);
+        my $journalbase = $u->journal_base;
 
         # Automatic Discovery of RSS/Atom
         $head .= qq{<link rel="alternate" type="application/rss+xml" title="RSS" href="$journalbase/data/rss" />\n};
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/ljfeed.pl
--- a/cgi-bin/ljfeed.pl	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/ljfeed.pl	Mon Jun 14 22:42:21 2010 +0800
@@ -47,7 +47,7 @@ sub make_feed
 
     my $dbr = LJ::get_db_reader();
 
-    my $user = $u->{'user'};
+    my $user = $u->user;
 
     $u->preload_props( qw/ journaltitle journalsubtitle opt_synlevel / );
 
@@ -61,9 +61,9 @@ sub make_feed
     # some data used throughout the channel
     my $journalinfo = {
         u         => $u,
-        link      => LJ::journal_base($u) . "/",
-        title     => $u->{journaltitle} || $u->{name} || $u->{user},
-        subtitle  => $u->{journalsubtitle} || $u->{name},
+        link      => $u->journal_base . "/",
+        title     => $u->{journaltitle} || $u->name_raw || $u->user,
+        subtitle  => $u->{journalsubtitle} || $u->name_raw,
         builddate => LJ::time_to_http(time()),
     };
 
@@ -718,14 +718,14 @@ sub create_view_foaf {
         my $count = $u->number_of_posts;
         $ret .= "    <ya:blogActivity>\n";
         $ret .= "      <ya:Posts>\n";
-        $ret .= "        <ya:feed rdf:resource=\"" . LJ::journal_base($u) ."/data/foaf\" dc:type=\"application/rss+xml\" />\n";
+        $ret .= "        <ya:feed rdf:resource=\"" . $u->journal_base ."/data/foaf\" dc:type=\"application/rss+xml\" />\n";
         $ret .= "        <ya:posted>$count</ya:posted>\n";
         $ret .= "      </ya:Posts>\n";
         $ret .= "    </ya:blogActivity>\n";
     }
 
     # include a user's journal page and web site info
-    $ret .= "    <foaf:weblog rdf:resource=\"" . LJ::journal_base($u) . "/\"/>\n";
+    $ret .= "    <foaf:weblog rdf:resource=\"" . $u->journal_base . "/\"/>\n";
     if ($u->{url}) {
         $ret .= "    <foaf:homepage rdf:resource=\"" . LJ::eurl($u->{url});
         $ret .= "\" dc:title=\"" . LJ::exml($u->{urlname}) . "\" />\n";
@@ -787,8 +787,8 @@ sub create_view_foaf {
         $ret .= "        <foaf:member_name>$name</foaf:member_name>\n";
         $ret .= "        <foaf:tagLine>$tagline</foaf:tagLine>\n";
         $ret .= "        <foaf:image>$upicurl</foaf:image>\n" if $upicurl;
-        $ret .= "        <rdfs:seeAlso rdf:resource=\"" . LJ::journal_base($fu) ."/data/foaf\" />\n";
-        $ret .= "        <foaf:weblog rdf:resource=\"" . LJ::journal_base($fu) . "/\"/>\n";
+        $ret .= "        <rdfs:seeAlso rdf:resource=\"" . $fu->journal_base ."/data/foaf\" />\n";
+        $ret .= "        <foaf:weblog rdf:resource=\"" . $fu->journal_base . "/\"/>\n";
         $ret .= "      </foaf:Person>\n";
         $ret .= $comm ? "    </foaf:member>\n" : "    </foaf:knows>\n";
     }
diff -r c63e1636530c -r f8d05013edf5 cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Mon Jun 14 18:01:08 2010 +0800
+++ b/cgi-bin/weblib.pl	Mon Jun 14 22:42:21 2010 +0800
@@ -96,9 +96,7 @@ sub date_to_view_links
     return unless $date =~ /^(\d\d\d\d)-(\d\d)-(\d\d)/;
 
     my ($y, $m, $d) = ($1, $2, $3);
-    my ($nm, $nd) = ($m+0, $d+0);   # numeric, without leading zeros
-    my $user = $u->{'user'};
-    my $base = LJ::journal_base($u);
+    my $base = $u->journal_base;
 
     my $ret;
     $ret .= "<a href=\"$base/$y/\">$y</a>-";
@@ -682,7 +680,7 @@ sub create_qr_div {
     $qrhtml .= LJ::form_auth();
 
     my $stylemineuri = $style_opts ? LJ::viewing_style_args( $style_opts ) : "";
-    my $basepath =  LJ::journal_base($u) . "/$ditemid.html?${stylemineuri}";
+    my $basepath =  $u->journal_base . "/$ditemid.html?${stylemineuri}";
     my $usertype = ($remote->openid_identity && $remote->is_validated) ? 'openid_cookie' : 'cookieuser';
     $qrhtml .= LJ::html_hidden({'name' => 'replyto', 'id' => 'replyto', 'value' => ''},
                                {'name' => 'parenttalkid', 'id' => 'parenttalkid', 'value' => ''},
diff -r c63e1636530c -r f8d05013edf5 htdocs/community/create.bml
--- a/htdocs/community/create.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/community/create.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -124,7 +124,7 @@ SUBMIT:
         return $ret if $stop_output;
 
         $ret = "<?h1 $ML{'.success.head'} h1?><?p $ML{'.success.text1'} p?>";
-        my $uri = LJ::journal_base($u);
+        my $uri = $u->journal_base;
         $ret .= "<?p $ML{'.success.text2'} p?>\n";
         $ret .= "<?standout <font size='+1' face='arial'><b><a href='$uri'>$uri/</a></b></font> standout?>\n";
         $ret .= "<?p $ML{'.success.text3'} p?>\n";
diff -r c63e1636530c -r f8d05013edf5 htdocs/community/members.bml
--- a/htdocs/community/members.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/community/members.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -311,9 +311,9 @@ body<=
             next unless $delmaintu;
 
             # send email to the poor maintainer who got removed
-            my $mailusername = $delmaintu->{user};
-            my $mailusercname = $c->{name};
-            my $mailclink = LJ::journal_base($c, ['community']);
+            my $mailusername = $delmaintu->user;
+            my $mailusercname = $c->name_raw;
+            my $mailclink = $c->journal_base( ['community'] );
 
             my $html;
 
@@ -374,9 +374,9 @@ body<=
             next unless $newmaintu;
 
             # send email to the new maintainer
-            my $mailusername = $newmaintu->{user};
-            my $mailusercname = $c->{name};
-            my $mailclink = LJ::journal_base($c, ['community']);
+            my $mailusername = $newmaintu->user;
+            my $mailusercname = $c->name_raw;
+            my $mailclink = $c->journal_base( ['community'] );
             my $mailcommanlink = "$LJ::SITEROOT/community/manage";
 
             my $html;
diff -r c63e1636530c -r f8d05013edf5 htdocs/customize/advanced/styles.bml
--- a/htdocs/customize/advanced/styles.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/customize/advanced/styles.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -304,7 +304,7 @@ _c?>
         # show style listing
         $body .= "<table style='margin-left: 40px'>\n";
         if (%$ustyle) {
-            my $journalbase = LJ::journal_base($u);
+            my $journalbase = $u->journal_base;
             foreach my $styleid (sort { $ustyle->{$a} cmp $ustyle->{$b} || $a <=> $b} keys %$ustyle) {
                 $body .= "<tr><td><form style='display:inline' method='post' action='styles?id=$styleid$getextra_amp'>";
                 $body .= $formauth;
diff -r c63e1636530c -r f8d05013edf5 htdocs/edittags.bml
--- a/htdocs/edittags.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/edittags.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -65,7 +65,7 @@ body<=
         });
         return $err->($tagerr) unless $rv;
 
-        BML::redirect( LJ::journal_base($u) . "/$ditemid.html" );
+        BML::redirect( $u->journal_base . "/$ditemid.html" );
         #$msg = "<div class='update_good'>Tags successfully updated.</div>";
     }
 
@@ -147,7 +147,7 @@ body<=
     $ret .= "<br /><br />";
     $ret .= "$ML{'.permissions.add.yes'}<br />" if $can_add_entry_tags;
     $ret .= "$ML{'.permissions.control.yes'}<br />" if LJ::Tags::can_control_tags($u, $remote);
-    $ret .= BML::ml('.view', { aopts => 'href="' . LJ::journal_base($u) . "/$ditemid.html" . '"' });
+    $ret .= BML::ml('.view', { aopts => 'href="' . $u->journal_base . "/$ditemid.html" . '"' });
     $ret .= "</td></tr>";
     $ret .= '</form>';
 
diff -r c63e1636530c -r f8d05013edf5 htdocs/go.bml
--- a/htdocs/go.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/go.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -77,8 +77,8 @@ _c?>
 
     $body .= "<p>" . BML::ml( '.link.to.journal', { journal => $u->ljuser_display } ) . "</p>";
 
-     if ($jumpid) {
-         return BML::redirect(LJ::journal_base($u) . "/$jumpid.html");
+     if ( $jumpid ) {
+         return BML::redirect( $u->journal_base . "/$jumpid.html" );
      }
  }
 
diff -r c63e1636530c -r f8d05013edf5 htdocs/manage/tags.bml
--- a/htdocs/manage/tags.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/manage/tags.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -105,7 +105,7 @@ HEAD
             # this should do some cute ajax display later.
             my $tags = LJ::Tags::get_usertags( $u ); # we redirect, so we don't double load anyway
             my $taglist = LJ::eurl(join ',', map { $tags->{$_}->{name} } map { /^(\d+)_/; $1; } split /\0/, $POST{tags});
-            BML::redirect( LJ::journal_base($u) . "/tag/$taglist" );
+            BML::redirect( $u->journal_base . "/tag/$taglist" );
         }
 
         if ($POST{'save_levels'}) {
diff -r c63e1636530c -r f8d05013edf5 htdocs/multisearch.bml
--- a/htdocs/multisearch.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/multisearch.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -167,9 +167,9 @@ _c?>
             if (my $u = LJ::load_userid($uid)) {
                 if ($u->opt_whatemailshow eq "A" || $u->opt_whatemailshow eq "B") {
                     if ($output eq "foaf") {
-                        return BML::redirect(LJ::journal_base($u) . '/data/foaf');
+                        return BML::redirect( $u->journal_base . '/data/foaf' );
                     } else {
-                        return BML::redirect($u->profile_url);
+                        return BML::redirect( $u->profile_url );
                     }
                 }
             }
diff -r c63e1636530c -r f8d05013edf5 htdocs/newuser.bml
--- a/htdocs/newuser.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/newuser.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -36,7 +36,7 @@ body<=
     my $ret;
     $ret = "<?h1 $ML{'.success.head'} h1?><?p ".BML::ml(".success.text1", {'email' => $u->email_raw, 'username' => $u->{user}}) ." p?>";
 
-    my $uri = LJ::journal_base($u) . "/";
+    my $uri = $u->journal_base . "/";
     $ret .= "<?p $ML{'.success.text2'} p?>\n";
     $ret .= "<?standout <font size='+1' face='arial'><b><a href='$uri'>$uri</a></b></font> standout?>\n";
     $ret .= "<?p $ML{'.success.text3'} p?>\n";
diff -r c63e1636530c -r f8d05013edf5 htdocs/preview/entry.bml
--- a/htdocs/preview/entry.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/preview/entry.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -251,7 +251,7 @@ _c?>
         $opts->{'r'} = $r;
 
         $u->{'_s2styleid'} = $styleid + 0;
-        $u->{'_journalbase'} = LJ::journal_base($u->{'user'});
+        $u->{'_journalbase'} = $u->journal_base;
 
         $LJ::S2::CURR_CTX = $ctx;
 
diff -r c63e1636530c -r f8d05013edf5 htdocs/talkmulti.bml
--- a/htdocs/talkmulti.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/talkmulti.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -57,9 +57,9 @@ _c?>
 
     my $dbcr = LJ::get_cluster_def_reader($u);
 
-    my $jid = $u->{'userid'};
+    my $jid = $u->userid;
     my $ditemid = $POST{'ditemid'}+0;
-    my $commentlink = LJ::journal_base($u) . "/$ditemid.html";
+    my $commentlink = $u->journal_base . "/$ditemid.html";
     my $itemid = $ditemid >> 8;
     my $log = $dbcr->selectrow_hashref("SELECT * FROM log2 WHERE journalid=? AND jitemid=?",
                                        undef, $jid, $itemid);
diff -r c63e1636530c -r f8d05013edf5 htdocs/talkpost.bml
--- a/htdocs/talkpost.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/talkpost.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -139,8 +139,8 @@ body<=
     my $props = $item->{'props'};
 
     my $ditemid = $init->{'ditemid'};
-    my $talkurl = LJ::journal_base($u) . "/$ditemid.html";
-    my $entry = LJ::Entry->new($u, ditemid => $ditemid);
+    my $talkurl = $u->journal_base . "/$ditemid.html";
+    my $entry = LJ::Entry->new( $u, ditemid => $ditemid );
 
     # canonical link to the entry or comment thread
     $head .= LJ::canonical_link( $entry->url, $GET{replyto} );
diff -r c63e1636530c -r f8d05013edf5 htdocs/talkpost_do.bml
--- a/htdocs/talkpost_do.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/talkpost_do.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -130,7 +130,7 @@ body<=
     if ($POST{'submitpreview'} || ($POST{'qr'} && $POST{'do_spellcheck'})) {
         my $cookie_auth;
         $cookie_auth = 1 if $POST{usertype} eq "cookieuser";
-        my $talkurl = LJ::journal_base($journalu) . "/$POST{itemid}.html";
+        my $talkurl = $journalu->journal_base . "/$POST{itemid}.html";
         $title = $ML{'.title.preview'};
         return LJ::Talk::Post::make_preview($talkurl, $cookie_auth, \%POST);
     }
diff -r c63e1636530c -r f8d05013edf5 htdocs/talkread.bml
--- a/htdocs/talkread.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/talkread.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -137,9 +137,9 @@ body<=
         return "<?h1 $ML{'Error'} h1?><?p $ML{'talk.error.noentry'} p?>";
     }
 
-    my $jarg = "journal=$u->{'user'}&";
-    my $jargent ="journal=$u->{'user'}&amp;";
-    my $talkurl = LJ::journal_base($u) . "/$ditemid.html";
+    my $jarg = "journal=$u->{user}&";
+    my $jargent ="journal=$u->{user}&amp;";
+    my $talkurl = $u->journal_base . "/$ditemid.html";
 
     my $ret = "";
 
@@ -348,7 +348,7 @@ body<=
 
     my $logtags = LJ::Tags::get_logtags($u, $itemid);
     if ($logtags->{$itemid} && %{$logtags->{$itemid}}) {
-        my $base = LJ::journal_base($u);
+        my $base = $u->journal_base;
         $current{'Tags'} = join(', ',
                                map { "<a href='$base/tag/" . LJ::eurl($_) . "'>" . LJ::ehtml($_) . "</a>" }
                                sort values %{$logtags->{$itemid}}
diff -r c63e1636530c -r f8d05013edf5 htdocs/talkscreen.bml
--- a/htdocs/talkscreen.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/talkscreen.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -124,7 +124,7 @@ _info?><?_code
 
     my $ditemid = $qitemid*256 + $anum;
 
-    my $itemlink = LJ::journal_base($u) . "/$ditemid.html";
+    my $itemlink = $u->journal_base . "/$ditemid.html";
     my $linktext = BML::ml( '.link', { aopts => "href='$itemlink'" } );
     my $commentlink = "$itemlink?view=$dtalkid" . LJ::Talk::comment_anchor( $dtalkid );
 
diff -r c63e1636530c -r f8d05013edf5 htdocs/tools/endpoints/multisearch.bml
--- a/htdocs/tools/endpoints/multisearch.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/tools/endpoints/multisearch.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -48,7 +48,7 @@ _c?>
                 if ($what eq "pics") {
                     $url = $u->allpics_base;
                 } elsif ($output eq "foaf") {
-                    $url = LJ::journal_base($user) . '/data/foaf';
+                    $url = $u->journal_base . '/data/foaf';
                 } else {
                     $url = $u->profile_url;
                     $url .= "?mode=full" if $what eq 'full';
@@ -94,7 +94,7 @@ _c?>
             if (my $u = LJ::load_userid($uid)) {
                 next unless $u->opt_findbyemail =~ /Y|H/; # The user has allowed to search for it by email
                 if ($output eq "foaf") {
-                    $ret{result} .= '<a href="' . LJ::journal_base($u) . '/data/foaf">' . $u->{user}. '</a>';
+                    $ret{result} .= '<a href="' . $u->journal_base . '/data/foaf">' . $u->{user}. '</a>';
                 } else {
                     $ret{result} .= '<a href="' . $u->profile_url . '">' . $u->{user}. '</a>';
                 }
diff -r c63e1636530c -r f8d05013edf5 htdocs/tools/recent_comments.bml
--- a/htdocs/tools/recent_comments.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/tools/recent_comments.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -151,9 +151,9 @@ body<=
         push @{$need_logtext->{$ju->{clusterid}} ||= []}, $need;
     }
 
-    my $comment_text = LJ::get_talktext2($u, keys %talkids);
-    my $log_text     = LJ::get_logtext2multi($need_logtext);
-    my $root = LJ::journal_base($u);
+    my $comment_text = LJ::get_talktext2( $u, keys %talkids );
+    my $log_text     = LJ::get_logtext2multi( $need_logtext );
+    my $root = $u->journal_base;
 
     # Begin "latest received" box. We only want to see this if we're a
     # community or personal account, since OpenID accounts can't
diff -r c63e1636530c -r f8d05013edf5 htdocs/view/index.bml
--- a/htdocs/view/index.bml	Mon Jun 14 18:01:08 2010 +0800
+++ b/htdocs/view/index.bml	Mon Jun 14 22:42:21 2010 +0800
@@ -94,7 +94,7 @@ _c?>
         $head .= LJ::robot_meta_tags();
     }
 
-    my $base = LJ::journal_base($u);
+    my $base = $u->journal_base;
 
     if (LJ::did_post()) {
         my $newuri = sprintf("$base/%04d/%02d/", $POST{'y'}, $POST{'m'});
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org