Committer: henrylyneMade a bunch of changes based on user feedback, still more work to do though.
Moved journaltype icon watermark to the left.
Moved contact info into top box.
Changed layout from two to one column.
U trunk/htdocs/userinfo2.bml
Modified: trunk/htdocs/userinfo2.bml
===================================================================
--- trunk/htdocs/userinfo2.bml 2006-06-19 18:37:03 UTC (rev 7723)
+++ trunk/htdocs/userinfo2.bml 2006-06-19 19:03:13 UTC (rev 7724)
@@ -250,7 +250,7 @@
$head .= "#actionbar #actionitem { margin: 1px 10px 1px 5px; white-space: nowrap }\n";
$head .= "#actionitem a { text-decoration: none }\n";
$head .= "#actionitem img { vertical-align: bottom}\n";
- $head .= "#ID_box { margin-top: 10px; padding: 8px; BORDER-RIGHT: #999 2px solid; BORDER-TOP: #999 1px solid; BORDER-LEFT: #999 1px solid; BORDER-BOTTOM: #999 2px solid; }\n";
+ $head .= "#ID_box { margin-top: 10px; padding: 12px; BORDER-RIGHT: #999 2px solid; BORDER-TOP: #999 1px solid; BORDER-LEFT: #999 1px solid; BORDER-BOTTOM: #999 2px solid; }\n";
$head .= "#ID_pic { float: left; width: 116px; }\n";
$head .= "#maininfo .data { font-weight: bold }\n";
$head .= "p { line-height: 1.3em; }\n";
@@ -391,7 +391,6 @@
# - Show if user set to show to friends and remote is a friend
# - Show if remote is using viewall
my $schoollist;
- my %currentschools;
if ($u->{'journaltype'} ne 'Y' &&
!$LJ::DISABLED{'schools'} &&
(($u->{'opt_showschools'} eq '' || $u->{'opt_showschools'} eq 'Y') ||
@@ -434,7 +433,6 @@
my $link .= $schoolname . " - " . $schoolinfo . $schooldates . "
\n";
push @links, $link;
- $currentschools{$schoolname} = $schoolinfo unless ($schools->{$sid}->{year_end});
}
$schoollist .= join('', @links);
} else {
@@ -451,6 +449,101 @@
}
# /Schools
+ # Mangle email address
+ my $mangleaddress = sub {
+ my $email = shift;
+ my $mret;
+ if ( $email =~ m/(.*)@(.*)/ ) {
+ $mret = "$1@$2";
+ } else {
+ $mret = $email;
+ }
+ return $mret;
+ };
+ # /Mangle
+
+ # Contact Info
+ my $contactinfo = sub {
+ my $body;
+ # Divide email address across 3 table cells
+ my @emails = $u->email($remote);
+ if (@emails) {
+ $body .= "$ML{'.label.email'} ";
+ foreach my $email (@emails) {
+ $body .= ($u->{'opt_mangleemail'} eq "Y" || $email =~ /\@livejournal\.com$/)
+ ? $mangleaddress->($email)
+ : "
$email";
+ }
+ $body .= "";
+ }
+
+ foreach my $k (qw(aolim icq yahoo msn jabber google_talk skype gizmo)) {
+ $u->{$k} = LJ::ehtml($u->{$k});
+ }
+
+ if ($u->{'aolim'}) {
+ my $qim = $u->{'aolim'};
+ $qim =~ s/ //g;
+ $body .= "$ML{'.label.aolim'} ";
+ $body .= "
$u->{'aolim'} \n";
+ $body .= "(
$ML{'.label.addbuddy'},";
+ $body .= "
$ML{'.label.sendmessage'})\n";
+ }
+ if ($u->{'icq'}) {
+ $body .= "$ML{'.label.icquin'}";
+ $body .= "
";
+ $body .= "$u->{'icq'} (
";
+ $body .= "$ML{'.label.userprofile'})";
+ $body .= "\n";
+ }
+ if ($u->{'yahoo'}) {
+ $body .= "$ML{'.label.yahooid'}";
+ $body .= "
$u->{'yahoo'} \n";
+ $body .= "(
$ML{'.label.adduser'},
$ML{'.label.sendmessage'}) \n";
+ }
+ if ($u->{'msn'}) {
+ my $msnname = ($u->{'opt_mangleemail'} eq "Y") ? $mangleaddress->($u->{'msn'}) : $u->{'msn'};
+ $body .= "$ML{'.label.msnusername'}$msnname\n";
+ }
+ if ($u->{'jabber'}) {
+ my $jabber = $mangleaddress->($u->{'jabber'});
+ $body .= "$ML{'.label.jabber'}$jabber\n";
+ }
+ if ($u->{'google_talk'}) {
+ my $google = $mangleaddress->($u->{'google_talk'});
+ $body .= "$ML{'.label.googletalk'}$google\n";
+ }
+ if ($u->{'skype'}) {
+ my $skype = $mangleaddress->($u->{'skype'});
+ $body .= "$ML{'.label.skype'}$skype\n";
+ }
+ if (my $gizmo = $u->gizmo_account) {
+ $gizmo = $mangleaddress->( $gizmo );
+ $body .= "$ML{'.label.gizmo'}$gizmo\n";
+ }
+
+ # website
+ if ( ! $synd && $u->{'url'}) {
+ my $url = LJ::ehtml($u->{'url'});
+ unless ($url =~ /^https?:\/\//) {
+ $url =~ s/^http\W*//;
+ $url = "
http://$url";
+ }
+ my $urlname = LJ::ehtml($u->{'urlname'} || $url);
+ $url = "
$urlname";
+ $body .= "$ML{'.label.website'}$url\n" if ($u->{'url'});
+ }
+
+ # text message
+ if ($u->{'txtmsg_status'} eq "on" && LJ::get_cap($u, "textmessaging")) {
+ $body .= "$ML{'.label.textmessage'}" .
+ BML::ml('.sendmessage.body2', {'user' => "$u->{'user'}", 'aopts' => "href='$LJ::SITEROOT/tools/textmessage.bml?user=$u->{'user'}'"}) . "";
+ }
+ return $body;
+ };
+ # /Contact Info
+
+
# Prints out a list of users with links to their
# userinfo pages. Apply strikethru and bolding
# for deleted journals and friends of user.
@@ -548,13 +641,13 @@
## ID Box
my $watermark;
if ($u->{'journaltype'} eq "P") {
- $watermark = "style='background: url($LJ::IMGPREFIX/user_160.gif) no-repeat bottom right;'";
+ $watermark = "style='background: url($LJ::IMGPREFIX/user_160.gif) no-repeat bottom left;'";
} elsif ($u->{'journaltype'} eq "C") {
- $watermark = "style='background: url($LJ::IMGPREFIX/comm_160.gif) no-repeat bottom right;'";
+ $watermark = "style='background: url($LJ::IMGPREFIX/comm_160.gif) no-repeat bottom left;'";
} elsif ($u->{'journaltype'} eq "Y") {
- $watermark = "style='background: url($LJ::IMGPREFIX/feed_160.gif) no-repeat bottom right;'";
+ $watermark = "style='background: url($LJ::IMGPREFIX/feed_160.gif) no-repeat bottom left;'";
} elsif ($u->{'journaltype'} eq "I") {
- $watermark = "style='background: url($LJ::IMGPREFIX/openid_160.gif) no-repeat bottom right;'";
+ $watermark = "style='background: url($LJ::IMGPREFIX/openid_160.gif) no-repeat bottom left;'";
}
$body .= "
";
@@ -598,7 +691,7 @@
$body .= " $num_com_post Posted Comments
\n";
$body .= "
\n";
- $body .= "
\n";
+ $body .= "
\n";
$body .= " \n";
$body .= " $ML{'.label.name'} $u->{'name'}\n";
@@ -659,15 +752,8 @@
}
}
- # Current Schools
- if (%currentschools) {
- $body .= "Current School: ";
- foreach my $key ( keys %currentschools) {
- $body .= "
" .
- $currentschools{$key} . "
\n";
- }
- $body .= "\n";
- }
+ # Contact Info
+ $body .= $contactinfo->();
# Support Points
my $points = $dbr->selectrow_array("SELECT SUM(points) AS 'points' FROM supportpoints WHERE userid=$userid");
@@ -748,8 +834,105 @@
# Left Column
$body .= " \n";
- $body .= LJ::ads( type => 'journal', orient => 'App-Confirm', force => '0' );
+ # Journal Info
+ $body .= "
";
+ $body .= "
Journal
\n";
+ if ($u->{'journaltitle'}) {
+ $body .= "
" . LJ::ehtml($u->{'journaltitle'}) . "";
+ if ($u->{'journalsubtitle'}) {
+ $body .= "
" . LJ::ehtml($u->{'journalsubtitle'}) . "";
+ }
+ $body .= "
";
+ }
+ $body .= "
";
+ $body .= "Last updated $lastupdated
" if $lastupdated;
+ $body .= $journalentry_count->() . " entries and $num_com_got comments since creation";
+ $body .= "
\n";
+ # /Journal Info
+
+ my $hook_extra;
+ LJ::run_hooks("userinfo_html_by_journal", {
+ 'u' => $u,
+ 'ret' => \$hook_extra,
+ });
+ $body .= $hook_extra;
+ $body .= "
\n";
+ $body .= "
\n";
+
+
+ # Bio
+ if ($u->{'has_bio'} eq "Y") {
+ my $label = $com ? $ML{'.about.comm'} : "Biography";
+
+ if ($u->{journaltype} eq 'I' && $LJ::ONLY_USER_VHOSTS) {
+ $u->{'bio'} = LJ::ehtml($u->{'bio'}); # XXXXX FIXME: TEMP FIX
+ $u->{'bio'} =~ s!\n!
!g;
+ } else {
+ LJ::CleanHTML::clean_userbio(\$u->{'bio'});
+ }
+
+ $body .= "
$label
\n";
+ $body .= "
$u->{'bio'}
\n";
+ $body .= "
\n";
+ }
+ # Bio
+
+
+ # Schools
+ if ($schoollist) {
+ $body .= "
$ML{'.label.schools'}
\n";
+ $body .= "
$schoollist
\n";
+ $body .= "
\n";
+ }
+ # /Schools
+
+ # Interests
+ if (@$intu) {
+ $body .= "
$ML{'.label.interests'}
\n";
+ my $intcount = 0;
+ my $countcommon = 0;
+ my $intlist = "";
+ foreach my $int (@$intu) {
+ next if $intcount++ > 150;
+ LJ::text_out(\$int->[1]); # 1==interest
+ my $eint = LJ::eurl($int->[1]);
+ if ($int->[2] > 1) { # 2==intcount
+ if ($remote_interest{$int->[0]}) { # 0==intid
+ $intlist .= "
$int->[1], ";
+ $countcommon++;
+ } else {
+ $intlist .= "
$int->[1], ";
+ }
+ } else {
+ $intlist .= "$int->[1], ";
+ }
+ }
+ chop $intlist; chop $intlist; # remove trailing ", "
+ if ($intcount > 150) {
+ my $notshown = $intcount - 150;
+ $intlist .= BML::ml('.label.intsnotshown',{'intnotshown'=>$notshown});
+ }
+
+ $body .= "
($intcount";
+ unless ($remote_isowner) {
+ $body .= $countcommon ? ", $countcommon in common" : ", $countcommon in common";
+ }
+ $body .= ")
" . $intlist;
+ if ($remote) {
+ my $link = "$LJ::SITEROOT/interests.bml?mode=enmasse";
+ $link .= "&fromuser=$user" unless ($remote->{'userid'} == $userid);
+ $body .= ". ";
+ my $mlcode = ($remote_isowner) ? '.label.interests.removesome'
+ : '.label.interests.modifyyours';
+ $body .= BML::ml('Actionlink', { 'link' => "
$ML{$mlcode}" });
+ $body .= "";
+ }
+ $body .= "
\n";
+ $body .= "
\n";
+ }
+ # /Interests
+
## Friends, Communities and Feeds
@@ -900,215 +1083,7 @@
## /Friends, Communities and Feeds
- # Set a minimum width of 300px
- $body .= "
\n";
- $body .= " \n";
- # /Left Column
- # Middle Column Divider
- $body .= " \n";
- # /Middle Column Divider
-
- # Right Column
- $body .= " \n";
-
- # Journal Info
- $body .= "
";
- $body .= "
Journal
\n";
- if ($u->{'journaltitle'}) {
- $body .= "
" . LJ::ehtml($u->{'journaltitle'}) . "";
- if ($u->{'journalsubtitle'}) {
- $body .= "
" . LJ::ehtml($u->{'journalsubtitle'}) . "";
- }
- $body .= "
";
- }
- $body .= "
";
- $body .= "Last updated $lastupdated
" if $lastupdated;
- $body .= $journalentry_count->() . " entries and $num_com_got comments since creation";
- $body .= "
\n";
- # /Journal Info
-
- my $hook_extra;
- LJ::run_hooks("userinfo_html_by_journal", {
- 'u' => $u,
- 'ret' => \$hook_extra,
- });
- $body .= $hook_extra;
- $body .= "
\n";
- $body .= "
\n";
-
-
- # Bio
- if ($u->{'has_bio'} eq "Y") {
- my $label = $com ? $ML{'.about.comm'} : "Biography";
-
- if ($u->{journaltype} eq 'I' && $LJ::ONLY_USER_VHOSTS) {
- $u->{'bio'} = LJ::ehtml($u->{'bio'}); # XXXXX FIXME: TEMP FIX
- $u->{'bio'} =~ s!\n!
!g;
- } else {
- LJ::CleanHTML::clean_userbio(\$u->{'bio'});
- }
-
- $body .= "
$label
\n";
- $body .= "
$u->{'bio'}
\n";
- $body .= "
\n";
- }
- # Bio
-
-
- # Contact Info
- if ($u->share_contactinfo($remote) || $viewall) {
- $body .= "
Contact Information
\n";
- $body .= "
";
-
- # Divide email address across 3 table cells
- my $mangleaddress = sub {
- my $email = shift;
- my $mret;
- if ( $email =~ m/(.*)@(.*)/ ) {
- $mret = "$1@$2";
- } else {
- $mret = $email;
- }
- return $mret;
- };
-
- my @emails = $u->email($remote);
- if (@emails) {
- $body .= "$ML{'.label.email'} ";
- foreach my $email (@emails) {
- $body .= ($u->{'opt_mangleemail'} eq "Y" || $email =~ /\@livejournal\.com$/)
- ? $mangleaddress->($email)
- : "
$email";
- }
- $body .= "";
- }
-
- foreach my $k (qw(aolim icq yahoo msn jabber google_talk skype gizmo)) {
- $u->{$k} = LJ::ehtml($u->{$k});
- }
-
- if ($u->{'aolim'}) {
- my $qim = $u->{'aolim'};
- $qim =~ s/ //g;
- $body .= "$ML{'.label.aolim'} ";
- $body .= "
$u->{'aolim'}
\n";
- $body .= "(
$ML{'.label.addbuddy'},";
- $body .= "
$ML{'.label.sendmessage'})\n";
- }
- if ($u->{'icq'}) {
- $body .= "$ML{'.label.icquin'}";
- $body .= "
";
- $body .= "$u->{'icq'}
(
";
- $body .= "$ML{'.label.userprofile'})";
- $body .= "\n";
- }
- if ($u->{'yahoo'}) {
- $body .= "$ML{'.label.yahooid'}";
- $body .= "
$u->{'yahoo'}\n";
- $body .= "(
$ML{'.label.adduser'},
$ML{'.label.sendmessage'}) \n";
- }
- if ($u->{'msn'}) {
- my $msnname = ($u->{'opt_mangleemail'} eq "Y") ? $mangleaddress->($u->{'msn'}) : $u->{'msn'};
- $body .= "$ML{'.label.msnusername'}$msnname\n";
- }
- if ($u->{'jabber'}) {
- my $jabber = $mangleaddress->($u->{'jabber'});
- $body .= "$ML{'.label.jabber'}$jabber\n";
- }
- if ($u->{'google_talk'}) {
- my $google = $mangleaddress->($u->{'google_talk'});
- $body .= "$ML{'.label.googletalk'}$google\n";
- }
- if ($u->{'skype'}) {
- my $skype = $mangleaddress->($u->{'skype'});
- $body .= "$ML{'.label.skype'}$skype\n";
- }
- if (my $gizmo = $u->gizmo_account) {
- $gizmo = $mangleaddress->( $gizmo );
- $body .= "$ML{'.label.gizmo'}$gizmo\n";
- }
-
- # website
- if ( ! $synd && $u->{'url'}) {
- my $url = LJ::ehtml($u->{'url'});
- unless ($url =~ /^https?:\/\//) {
- $url =~ s/^http\W*//;
- $url = "
http://$url";
- }
- my $urlname = LJ::ehtml($u->{'urlname'} || $url);
- $url = "
$urlname";
- $body .= "$ML{'.label.website'}$url\n" if ($u->{'url'});
- }
-
- # text message
- if ($u->{'txtmsg_status'} eq "on" && LJ::get_cap($u, "textmessaging")) {
- $body .= "$ML{'.label.textmessage'}" .
- BML::ml('.sendmessage.body2', {'user' => "$u->{'user'}", 'aopts' => "href='$LJ::SITEROOT/tools/textmessage.bml?user=$u->{'user'}'"}) . "";
- }
-
-
- $body .= "
\n";
- }
- # Contact Info
-
-
-
- # Schools
- if ($schoollist) {
- $body .= "
$ML{'.label.schools'}
\n";
- $body .= "
$schoollist
\n";
- $body .= "
\n";
- }
- # /Schools
-
- # Interests
- if (@$intu) {
- $body .= "
$ML{'.label.interests'}
\n";
- my $intcount = 0;
- my $countcommon = 0;
- my $intlist = "";
- foreach my $int (@$intu) {
- next if $intcount++ > 150;
- LJ::text_out(\$int->[1]); # 1==interest
- my $eint = LJ::eurl($int->[1]);
- if ($int->[2] > 1) { # 2==intcount
- if ($remote_interest{$int->[0]}) { # 0==intid
- $intlist .= "
$int->[1], ";
- $countcommon++;
- } else {
- $intlist .= "
$int->[1], ";
- }
- } else {
- $intlist .= "$int->[1], ";
- }
- }
- chop $intlist; chop $intlist; # remove trailing ", "
- if ($intcount > 150) {
- my $notshown = $intcount - 150;
- $intlist .= BML::ml('.label.intsnotshown',{'intnotshown'=>$notshown});
- }
-
- $body .= "
($intcount";
- unless ($remote_isowner) {
- $body .= $countcommon ? ", $countcommon in common" : ", $countcommon in common";
- }
- $body .= ")
" . $intlist;
- if ($remote) {
- my $link = "$LJ::SITEROOT/interests.bml?mode=enmasse";
- $link .= "&fromuser=$user" unless ($remote->{'userid'} == $userid);
- $body .= ". ";
- my $mlcode = ($remote_isowner) ? '.label.interests.removesome'
- : '.label.interests.modifyyours';
- $body .= BML::ml('Actionlink', { 'link' => "
$ML{$mlcode}" });
- $body .= "";
- }
- $body .= "
\n";
- $body .= "
\n";
- }
- # /Interests
-
-
# Set a minimum width of 300px
$body .= "
\n";
$body .= " \n";