[livejournal] r10833: Support for overriding the profile and/o...

Mar 22, 2007 21:56


Committer: janineSupport for overriding the profile and/or journal URLs when calling ljuser/ljuser_display.

U branches/r4/cgi-bin/LJ/User.pm

Modified: branches/r4/cgi-bin/LJ/User.pm
===================================================================
--- branches/r4/cgi-bin/LJ/User.pm 2007-03-22 16:41:33 UTC (rev 10832)
+++ branches/r4/cgi-bin/LJ/User.pm 2007-03-22 21:56:13 UTC (rev 10833)
@@ -964,11 +964,13 @@
my $andfull = $opts->{'full'} ? "&mode=full" : "";
my $img = $opts->{'imgroot'} || $LJ::IMGPREFIX;
my $strike = $opts->{'del'} ? ' text-decoration: line-through;' : '';
+ my $profile_url = $opts->{'profile_url'} || '';
+ my $journal_url = $opts->{'journal_url'} || '';

my ($url, $name);

if ($id->typeid == 0) {
- $url = $id->value;
+ $url = $journal_url ne '' ? $journal_url : $id->value;
$name = $u->display_name;

$url ||= "about:blank";
@@ -982,8 +984,10 @@
$imgurl = $site->icon_url;
}

- return "
$name";
+ my $profile = $profile_url ne '' ? $profile_url : "$LJ::SITEROOT/userinfo.bml?userid=$u->{userid}&t=I$andfull";

+ return "
$name";
+
} else {
return "????";
}
@@ -4583,6 +4587,8 @@

my $andfull = $opts->{'full'} ? "?mode=full" : "";
my $img = $opts->{'imgroot'} || $LJ::IMGPREFIX;
+ my $profile_url = $opts->{'profile_url'} || '';
+ my $journal_url = $opts->{'journal_url'} || '';
my $profile;

my $make_tag = sub {
@@ -4600,7 +4606,10 @@
$link_color = " style='color: " . $opts->{'link_color'} . ";'";
}

- return "
$ljusername";
+ $profile = $profile_url ne '' ? $profile_url : $profile . $andfull;
+ $url = $journal_url ne '' ? $journal_url : $url;
+
+ return "
$ljusername";
};

my $u = isu($user) ? $user : LJ::load_user($user);

Previous post Next post
Up