"; return; } my $sth; my %countries = (); my %states = (); LJ::load_codes($dbr, { "country" => \%countries, "state" => \%states }); my $error = sub { my $e = shift; $body = ""; return; }; my $user = LJ::canonical_username($FORM{'user'}); if ($FORM{'user'} && ! $user) { $body = $ML{'.error.malfname'}; return; } if ($user eq "" && $remote) { $user = $remote->{'user'}; } my $userid = $FORM{'userid'}; my $u; $userid += 0; { return $error->($ML{'.label.reqfinduser'}) if ($userid && ! LJ::check_priv($dbr, $remote, "finduser")); if ($userid) { $u = LJ::load_userid($dbr, $userid); } else { $u = LJ::load_user($dbr, $user); } $user = $u->{'user'} if $u; $userid = $u->{'userid'}+0 if $u; LJ::text_out(\$u->{'name'}) if $u; if ($u && ($FORM{'mode'} eq "full" || $u->{'journaltype'} eq "Y")) { $sth = $dbr->prepare("SELECT timeupdate, timecreate, ". "UNIX_TIMESTAMP()-UNIX_TIMESTAMP(timecheck) ". "AS 'secondscheck', ". "UNIX_TIMESTAMP()-UNIX_TIMESTAMP(timeupdate) ". "AS 'secondsold' FROM userusage ". "WHERE userid=$userid"); $sth->execute; ($u->{'timeupdate'}, $u->{'timecreate'}, $u->{'secondscheck'}, $u->{'secondsold'}) = $sth->fetchrow_array; } } unless ($u) { $title = $ML{'Error'}; $body = "$user}) . " p?>"; return; } $dbcr = LJ::get_cluster_reader($u); my $remote_isowner = $remote && $remote->{'user'} eq $u->{'user'}; my $remote_isfriend = LJ::is_friend($dbr, $u, $remote); my $com = $u->{'journaltype'} eq "C" ? 1 : 0; my $synd; if ($u->{'journaltype'} eq "Y") { $synd = $dbr->selectrow_hashref("SELECT * FROM syndicated WHERE userid=$u->{'userid'}"); } my $dir = "users"; ### load user props. some don't apply to communities { my @props = qw(opt_whatemailshow country state city zip renamedto journaltitle journalsubtitle url urlname opt_hidefriendofs dont_load_members no_mail_alias); unless ($com || $synd) { push @props, qw(aolim icq yahoo msn gender jabber); } if ($synd) { push @props, qw(rssparseerror); } if ($u->{'statusvis'} eq 'V') { push @props, qw(opt_blockrobots); } LJ::load_user_props($u, { 'cache' => 1 }, @props); } if ($u->{'statusvis'} ne 'V' || $u->{'opt_blockrobots'}) { $head .= LJ::robot_meta_tags(); } if ($u->{'journaltype'} eq "R" && $u->{'renamedto'}) { my $extra = $FORM{'mode'} eq 'full' ? "&mode=full" : ''; return BML::redirect("$LJ::SITEROOT/userinfo.bml?user=$u->{'renamedto'}$extra"); } my %friends = ('load'=>1, 'loaded'=>0, 'display'=>1, 'count'=>0); my %friendsof = ('load'=>1, 'loaded'=>0, 'display'=>1, 'count'=>0); if ($com) { $title = $ML{'.title.communityinfo'}; $dir = "community"; } elsif ($synd) { $title = $ML{'.title.syndicated'}; $u->{'opt_whatemailshow'} = "N"; # don't show email $friends{'load'} = $friends{'display'} = 0; } $windowtitle = "$u->{'user'} - $title"; $friends{'load'} = $friendsof{'load'} = 0 if $com && $u->{'dont_load_members'}; if ($u->{'statusvis'} eq "S") { $title = $ML{'error.suspended.title'}; $body = "$LJ::SITENAME,'user'=>$user}) . " p?>"; return; } if ($u->{'statusvis'} eq "D") { $title = $ML{'error.deleted.title'}; $body = "$user}) . " p?>"; return; } if ($u->{'statusvis'} eq "X") { $title = $ML{'error.purged.title'}; $body = ""; return; } $user = $u->{'user'}; $userid = $u->{'userid'}; if ($u->{'has_bio'} eq "Y") { $sth = $dbcr->prepare("SELECT bio FROM userbio WHERE userid=$u->{'userid'}"); $sth->execute; $_ = $sth->fetchrow_hashref; $u->{'bio'} = $_->{'bio'}; LJ::text_out(\$u->{'bio'}); } my $u_uitable = $u->{'journaltype'} eq 'C' ? 'comminterests' : 'userinterests'; $sth = $dbr->prepare("SELECT i.interest, i.intcount, i.intid FROM interests i, $u_uitable ui " . "WHERE i.intid=ui.intid AND ui.userid=?"); $sth->execute($u->{'userid'}); my %interests = (); while ($_ = $sth->fetchrow_hashref) { $interests{$_->{'interest'}} = $_; } my %remote_interest; if ($remote && $remote->{'userid'} != $userid) { my $r_uitable = $remote->{'journaltype'} eq 'C' ? 'comminterests' : 'userinterests'; $sth = $dbr->prepare("SELECT intid FROM $r_uitable WHERE userid=?"); $sth->execute($remote->{'userid'}); $remote_interest{$_} = 1 while $_ = $sth->fetchrow_array; } if ($u->{'opt_hidefriendofs'} && ! $remote_isowner) { $friendsof{'load'} = 0; } my @friends; if ($friends{'load'}) { my $limit = $MAX_FRIENDS_SHOW + 1; my $sth = $dbr->prepare("SELECT u.userid, u.user, u.journaltype, u.statusvis ". "FROM friends f, user u WHERE u.userid=f.friendid AND f.userid=? ". "LIMIT $limit"); $sth->execute($u->{'userid'}); push @friends, $_ while $_ = $sth->fetchrow_hashref; @friends = sort { $a->{'user'} cmp $b->{'user'} } @friends; $friends{'count'} = scalar @friends; $friends{'loaded'} = 1; if ($friends{'count'} > $MAX_FRIENDS_SHOW) { $friends{'count'} = $dbr->selectrow_array("SELECT COUNT(*) FROM friends WHERE userid=$u->{'userid'}"); } } my (@friend_of, @member_of); if ($friendsof{'load'}) { my $limit = $MAX_FRIENDOF_LOAD + 1; my $sth = $dbr->prepare("SELECT u.userid, u.user, u.journaltype ". "FROM friends f, user u WHERE f.userid=u.userid AND f.friendid=? ". "AND u.statusvis='V' LIMIT $limit"); $sth->execute($u->{'userid'}); while ($_ = $sth->fetchrow_hashref) { if ($_->{'journaltype'} eq 'P') { push @friend_of, $_; } else { push @member_of, $_; # 'S' or 'C' (shared or community) } } @friend_of = sort { $a->{'user'} cmp $b->{'user'} } @friend_of; @member_of = sort { $a->{'user'} cmp $b->{'user'} } @member_of; $friendsof{'count'} = scalar @friend_of; $friendsof{'count_m'} = scalar @member_of; $friendsof{'loaded'} = 1; if ($friendsof{'count'} + $friendsof{'count_m'} > $MAX_FRIENDOF_LOAD) { # data is incomplete, count separately $friendsof{'count'} = $dbr->selectrow_array("SELECT COUNT(*) FROM friends f, user u WHERE f.friendid=$u->{'userid'} AND f.userid=u.userid AND u.journaltype='P' AND u.statusvis='V'"); $friendsof{'count_m'} = $dbr->selectrow_array("SELECT COUNT(*) FROM friends f, user u WHERE f.friendid=$u->{'userid'} AND f.userid=u.userid AND u.journaltype<>'P' AND u.statusvis='V'"); $friendsof{'clipped'} = 1; } } $u->{'name'} = LJ::ehtml($u->{'name'}); # who does the remote user list as a friend? my %remote_friendid; if ($remote && $friends{'loaded'}) { if ($remote->{'userid'} == $u->{'userid'}) { foreach (@friends) { $remote_friendid{$_->{'userid'}} = 1; } } else { my $sth = $dbr->prepare("SELECT friendid FROM friends WHERE userid=? LIMIT $MAX_FRIENDS_SHOW"); $sth->execute($remote->{'userid'}); $remote_friendid{$_} = 1 while $_ = $sth->fetchrow_array; } } if ($com) { $body .= "$u->{'name'}}) . " "; $body .= BML::ml('.membership.body',{'commname'=>$u->{'user'}}); $body .= BML::ml('.body.leave',{'commname'=>$u->{'user'}}); $body .= " p?>"; } elsif ($synd) { $body .= ""$LJ::SITEROOT/friends/add.bml?user=$u->{'user'}"}) . " p?>"; } else { $body .= "$u->{'name'},'siteroot'=>$LJ::SITEROOT}) . " p?>"; } ## standout bar { my @linkele; my $label = $com ? $ML{'.monitor.comm'} : $ML{'.monitor.user'}; push @linkele, "$label"; $label = $ML{'.label.todo'}; push @linkele, "$label"; $label = $ML{'.label.memories'}; push @linkele, "$label"; push @linkele, "$ML{"; if (@linkele) { $body .=""; } } $body .= ""; { my $hook_extra; LJ::run_hooks("userinfo_html_by_user", { 'u' => $u, 'ret' => \$hook_extra, }); $body .= "\n"; } ### picture my $narrow_left = 2; ## rows with smaller colspan to 2 $body .= ""; ### /picture $body .= "\n"; ## journal title if ($u->{'journaltitle'}) { my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= "\n"; } ### name or 'syndicated from' unless ($synd) { unless ($u->{'name'} eq $u->{'journaltitle'}) { $narrow_left--; $body .= "\n"; } } else { $narrow_left--; my $link; if (my $url = $u->{'url'}) { $link="$u->{'name'}"; } else { $link=$u->{'name'}; } my $icon="". ""; $body .= "\n". "\n"; # syndication status $body .= "\n"; } ## text message if ($u->{'txtmsg_status'} eq "on" && LJ::get_cap($u, "textmessaging")) { my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= ""; } if ( ! $synd && $u->{'url'}) { my $url = LJ::ehtml($u->{'url'}); my $span = ($narrow_left-- >= 0) ? 1 : 2; unless ($url =~ /^https?:\/\//) { $url =~ s/^http\W*//; $url = "http://$url"; } my $urlname = LJ::ehtml($u->{'urlname'} || $url); $url = "$urlname"; $body .= "\n" if ($u->{'url'}); } if ( ! $synd && $u->{'allow_infoshow'} eq "Y") { if ($u->{'city'} || $u->{'state'} || $u->{'country'}) { my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= ""; } if ($u->{'bdate'} && !$com && $u->{'bdate'} ne "0000-00-00") { my $bdate = $u->{'bdate'}; $bdate =~ s/^0000-//; my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= "\n"; } } if ( ! $synd && ($u->{'allow_contactshow'} eq "Y" || ($u->{'allow_contactshow'} eq "F" && $remote_isfriend))) { my $mangleaddress = sub { my $email = shift; my $mret = "
$ML{'.label.user'}$user ($u->{'userid'}) $hook_extra"; if ($u->{'defaultpicid'}) { my $picid = $u->{'defaultpicid'}; my %pic; LJ::load_userpics($dbr, \%pic, [ $picid ]); $body .= "$user"; } else { $body .= " "; } $body .= "
"; $body .= "" . LJ::ehtml($u->{'journaltitle'}) . ""; if ($u->{'journalsubtitle'}) { $body .= "
" . LJ::ehtml($u->{'journalsubtitle'}) . ""; } $body .= "
$ML{'.label.name'}$u->{'name'}
$ML{'.label.syndicatedfrom'}$link $icon
$ML{'.label.syndicatedstatus'}\n"; $body .= "$ML{'.syn.lastcheck'} "; $body .= $synd->{'lastcheck'} || $ML{'.syn.last.never'}; my $status = { 'parseerror' => "Parse error", 'notmodified' => "Not Modified", 'toobig' => "Too big", 'posterror' => "Posting error", 'ok' => "", # no status line necessary 'nonew' => "", # no status line necessary }->{$synd->{'laststatus'}}; $body .= " ($status)" if $status; if ($synd->{'laststatus'} eq "parseerror") { $body .= "
$ML{'.syn.parseerror'} $u->{'rssparseerror'}"; } $body .= "
$ML{'.syn.nextcheck'} $synd->{'checknext'}"; $body .= "
$ML{'.label.textmessage'}" . BML::ml('.sendmessage.body',{'user'=>$u->{'user'}, 'link'=>"/tools/textmessage.bml?user=$u->{'user'}"}) . "
$ML{'.label.website'}$url
$ML{'.label.location'}"; my $estate = LJ::eurl($u->{'state'}); my $ecity = LJ::eurl($u->{'city'}); my $ecountry = LJ::eurl($u->{'country'}); my ($state, $city, $country); if ($u->{'country'}) { $country = $LJ::DISABLED{'directory'} ? $countries{$u->{'country'}} : "". $countries{$u->{'country'}} . ""; my $estate; if ($u->{'state'}) { $state = $u->{'state'}; if ($u->{'country'} eq "US") { $state = $states{$state}; } $estate = LJ::eurl($state); $state = $LJ::DISABLED{'directory'} ? $state : "$state"; } if ($u->{'city'}) { my $ecity = LJ::eurl($u->{'city'}); $city = LJ::ehtml($u->{'city'}); unless ($LJ::DISABLED{'directory'}) { $city = "$city"; } } } $body .= join(", ", grep { $_ } ($city, $state, $country)); $body .= "
$ML{'.label.birthdate'}$bdate
"; for (my $i = 0; $i < length($email); $i++) { my $letter = substr($email, $i, 1); if ($letter eq "\@") { $letter = "\@"; } $mret .= $letter; } $mret .= "
"; return $mret; }; my $hide_after = LJ::get_cap($u, "hide_email_after"); unless ($u->{'opt_whatemailshow'} eq "N" || $u->{'opt_whatemailshow'} eq "L" && $u->{'no_mail_alias'} || $hide_after && $u->{'secondscheck'} > $hide_after * 86400) { my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= "$ML{'.label.email'}"; my @emails = ($u->{'email'}); if ($u->{'opt_whatemailshow'} eq "L") { @emails = (); } if ($LJ::USER_EMAIL && LJ::get_cap($u, "useremail")) { unless ($u->{'opt_whatemailshow'} eq "A" || $u->{'no_mail_alias'}) { push @emails, "$u->{'user'}\@$LJ::USER_DOMAIN"; } } foreach my $email (@emails) { $body .= ($u->{'opt_mangleemail'} eq "Y" || $email =~ /\@livelogcity\.com$/) ? $mangleaddress->($email) : "$email
"; } $body .= ""; } foreach my $k (qw(aolim icq yahoo msn jabber)) { $u->{$k} = LJ::ehtml($u->{$k}); } if ($u->{'aolim'}) { my $qim = $u->{'aolim'}; $qim =~ s/ /+/g; my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= "$ML{'.label.aolim'}$u->{'aolim'} ($ML{'.label.addbuddy'}, $ML{'.label.sendmessage'})\n"; } if ($u->{'icq'}) { my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= "$ML{'.label.icquin'}ICQ status $u->{'icq'} ($ML{'.label.adduser'}, $ML{'.label.sendmessage'}) \n"; } if ($u->{'yahoo'}) { my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= "$ML{'.label.yahooid'}Yahoo status $u->{'yahoo'} ($ML{'.label.adduser'}, $ML{'.label.sendmessage'}) \n"; } if ($u->{'msn'}) { my $span = ($narrow_left-- >= 0) ? 1 : 2; my $msnname = ($u->{'opt_mangleemail'} eq "Y") ? $mangleaddress->($u->{'msn'}) : $u->{'msn'}; $body .= "$ML{'.label.msnusername'}$msnname\n"; } if ($u->{'jabber'}) { my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= "$ML{'.label.jabber'}$u->{'jabber'}\n"; } } if ($u->{'has_bio'} eq "Y") { my $span = ($narrow_left-- > 0) ? 1 : 2; my $label = $com ? $ML{'.about.comm'} : $ML{'.about.user'}; LJ::CleanHTML::clean(\$u->{'bio'}, { 'wordlength' => 100, 'addbreaks' => 1, 'attrstrip' => [qw[style]], 'eat' => [qw[head title style layer iframe applet]], 'mode' => 'allow', 'deny' => [qw[]], 'remove' => [qw[marquee bgsound embed object caption link]], 'noearlyclose' => 1, 'tablecheck' => 1, 'autoclose' => [qw[table tr th td]], }); $body .= "$label$u->{'bio'}\n"; } ### memories { my $memcount = $dbr->selectrow_array("SELECT COUNT(*) FROM memorable WHERE userid=$userid"); if ($memcount) { my $span = ($narrow_left-- > 0) ? 1 : 2; my $noun_name = $memcount == 1 ? '.memories.entry' : '.memories.entries'; my $count = BML::ml($noun_name, {'count'=>$memcount}); $body .= "$ML{'.label.memories'}$count\n"; } } if (%interests) { my $span = ($narrow_left-- > 0) ? 1 : 2; $body .= "$ML{'.label.interests'}:"; my $intcount = 0; my $intlist = ""; foreach (sort keys %interests) { $intcount++; next if ($intcount > 150); LJ::text_out(\$_); my $eint = LJ::eurl($_); if ($interests{$_}->{'intcount'} > 1) { if ($remote_interest{$interests{$_}->{'intid'}}) { $intlist .= "$_, "; } else { $intlist .= "$_, "; } } else { $intlist .= "$_, "; } } chop $intlist; chop $intlist; # remove trailing ", " if ($intcount > 150) { my $notshown = $intcount - 150; $intlist .= BML::ml('.label.intsnotshown',{'intnotshown'=>$notshown}); } $body .= "$intcount: " . $intlist; if ($remote) { my $link = "/interests.bml?mode=enmasse"; $link .= "&fromuser=$user" unless ($remote->{'userid'} == $userid); $body .= ". "; my $mlcode = ($remote->{'userid'} == $userid) ? '.label.interests.removesome' : '.label.interests.modifyyours'; $body .= BML::ml('Actionlink', { 'link' => "$ML{$mlcode}" }); $body .= ""; } $body .= ""; } ## ## friends ## unless ($synd || $LJ::FORCE_EMPTY_FRIENDS{$userid}) { my $label = $com ? $ML{'.friends.comm'} : $ML{'.friends.user'}; my $span = ($narrow_left-- >= 0) ? 1 : 2; $body .= "$label:"; $friends{'display'} = 0 if $friends{'count'} > $MAX_FRIENDS_SHOW; if ($friends{'count'}) { if (!$friends{'loaded'} || !$friends{'display'}) { $body .= "" . $friends{'count'} . ": "; $body .= " " . ($com ? $ML{'.label.viewmembers'} : $ML{'.label.viewfriends'}) . " ."; } else { $body .= "" . $friends{'count'} . ": "; foreach my $f (@friends) { my $status = $f->{'statusvis'}; my $frlink = "$f->{'user'}"; $frlink = "$frlink" if $status =~ /[DXS]/; $frlink = "$frlink" if $remote_friendid{$f->{'userid'}} && $remote->{'userid'} != $u->{'userid'}; $body .= $frlink; $body .= ", "; } chop $body; chop $body; } } else { $body .= $ML{'.label.nofriends'}; } $body .= "\n"; } ## ## friend of ## unless ($synd) { if ($friendsof{'loaded'} && $friendsof{'display'}) { my $label; if (@friend_of) { $label = $com ? $ML{'.friendof.comm'} : $ML{'.friendof.user'}; $body .= "$label"; if ($u->{'opt_hidefriendofs'}) { $body .= "
$ML{'.friendof.hidden'}"; } $body .= ""; $body .= "" . $friendsof{'count'} . ": "; my $count = 0; foreach (@friend_of) { my $frlink = "{'user'}\">$_->{'user'}"; $frlink = "$frlink" if $remote_friendid{$_->{'userid'}}; $body .= "$frlink, "; if (++$count == $MAX_FRIENDOF_SHOW && $FORM{'mode'} ne "full") { $friendsof{'clipped'} = 1; last; } } chop $body; chop $body; $body .= ", 'full' }) . "'>..." if $friendsof{'clipped'}; $body .= "\n"; }; if (@member_of) { $label = $ML{'.label.memberof'}; $body .= "$label:"; $body .= "" . $friendsof{'count_m'} . ": "; foreach (@member_of) { my $frlink = "$_->{'user'}"; $frlink = "$frlink" if $remote_friendid{$_->{'userid'}}; $body .= "$frlink, "; } chop $body; chop $body; $body .= "\n"; }; } } else { # Syndication journals are special $body .= "$ML{'.friendof.syndreadcount'}:"; $body .= "$friendsof{'count'}\n"; my $label = $LJ::HELPURL{syndcost} ? "$ML{'.syn.cost'}" : "$ML{'.syn.cost'}"; $body .= "$label:"; $body .= sprintf("%.03f\n", LJ::syn_cost($friendsof{'count'})); } ## extra rows generated by hooks foreach my $row (LJ::run_hooks("userinfo_rows", { 'dbr' => $dbr, 'u' => $u, 'remote' => $remote, })) { $body .= ""; $body .= $row->[0]; $body .=":"; $body .= $row->[1]; $body .= "\n"; } unless ($synd || $FORM{'mode'} eq "full") { # Synd accts are always full, but their full ends early (see below) $body .= "\n"; $body .= "

$ML{'.label.moredetails'}

"; return; } ## ## interesting times ## $body .= "$ML{'.label.datecreated'}$u->{'timecreate'}"; $body .= "$ML{'.label.dateupdated'}"; if ($u->{'timeupdate'}) { $body .= "$u->{'timeupdate'}, "; my $secondsold = $u->{'secondsold'}; my $num; if ($secondsold > 60*60*24*7) { $num = int($secondsold / (60*60*24*7)); $body .= $num == 1 ? $ML{'.timeupdate.weekago'} : BML::ml('.timeupdate.weeksago',{'num'=>$num}); } elsif ($secondsold > 60*60*24) { $num = int($secondsold / (60*60*24)); $body .= $num == 1 ? $ML{'.timeupdate.dayago'} : BML::ml('.timeupdate.daysago',{'num'=>$num}); } elsif ($secondsold > 60*60) { $num = int($secondsold / (60*60)); $body .= $num == 1 ? $ML{'.timeupdate.hourago'} : BML::ml('.timeupdate.hoursago',{'num'=>$num}); } elsif ($secondsold > 60) { $num = int($secondsold / (60)); $body .= $num == 1 ? $ML{'.timeupdate.minuteago'} : BML::ml('.timeupdate.minutesago',{'num'=>$num}); } else { $num = $secondsold; $body .= $num == 1 ? $ML{'.timeupdate.secondago'} : BML::ml('.timeupdate.secondsago',{'num'=>$num}); } $body .= ""; } else { $body .= $ML{'.date.never'}; } $body .= ""; if ($synd) { # The rest of the rows are not useful to synd accts $body .= "\n"; return ""; } if (0) { $body .= "" . BML::ml('.label.clientsused',{'siteroot'=>$LJ::SITEROOT}) . ""; $sth = $dbr->prepare("SELECT DISTINCT c.client FROM clients c, clientusage cu ". "WHERE cu.userid=$userid AND cu.clientid=c.clientid ORDER BY c.client"); $sth->execute; my $lastclient = ""; while ($_ = $sth->fetchrow_hashref) { next unless ($_->{'client'} =~ m!(.+)/(.+)!); my ($client, $ver) = ($1, $2); if ($lastclient ne $client) { if ($lastclient) { chop $body; chop $body; $body .= "
"; } else { 1; } $body .= "" . LJ::ehtml($client) .": "; $lastclient = $client; } $body .= LJ::ehtml($ver) . ", "; } if ($lastclient) { chop $body; chop $body; } $body .= ""; } # count journal entries { my $count = $dbcr->selectrow_array("SELECT COUNT(*) FROM log2 WHERE journalid=$userid"); $body .= "$ML{'.label.journalentrs'}" . &comma($count) . ""; } my $points = $dbr->selectrow_array("SELECT SUM(points) AS 'points' FROM supportpoints WHERE userid=$userid"); if ($points) { $body .= "$ML{'.label.supportpoints'}:" . &comma($points) . ""; } sub comma { my $num = shift; if ($num =~ s/(\d)(\d\d\d)$/$1,$2/) { $num =~ s/(\d)(\d\d\d),/$1,$2/g; } return $num; } ## ## journal comments { my ($com_post, $com_got); unless ($LJ::DISABLED{'show-talkleft'}) { $com_post = comma($dbcr->selectrow_array("SELECT COUNT(*) FROM talkleft ". "WHERE userid=$userid")); $com_post = BML::ml('.label.composted', {'num'=>$com_post}); } $com_got = comma($dbcr->selectrow_array("SELECT COUNT(*) FROM talk2 ". "WHERE journalid=$userid")); $com_got = BML::ml('.label.comreceived', {'num'=>$com_got}); $body .= "$ML{'.label.comments'}$com_post" . $com_got . ""; } ### ### shared journal access ### { my $where = "u.userid=r.userid AND r.targetid=?"; if ($com || $u->{'journaltype'} eq 'S') { $where = "u.userid=r.targetid AND r.userid=?"; } my $accesslist = $dbr->selectcol_arrayref("SELECT u.user FROM reluser r, user u " . "WHERE $where " . "AND r.type='P' AND u.statusvis='V'", undef, $u->{'userid'}); if (my $count = @$accesslist) { $body .= "$ML{'.label.shared'}$count: "; $body .= join(", ", map { "$_" } sort @$accesslist); $body .= ""; } } $body .= "\n"; # removed until we run graphviz locally # $body .= "

Graph of friends

"; return; _code?> title=> body=> head=> page?> lib: cgi-bin/ljlib.pl, cgi-bin/cleanhtml.pl link: htdocs/editinfo.bml, htdocs/userinfo.bml, htdocs/users link: htdocs/community/join.bml, htdocs/community/leave.bml, htdocs/friends/add.bml, htdocs/todo/index.bml link: htdocs/tools/memories.bml, htdocs/tools/tellafriend.bml, htdocs/allpics.bml link: htdocs/tools/textmessage.bml, htdocs/interests.bml, htdocs/support/faqbrowse.bml, htdocs/download/index.bml link: htdocs/support/index.bml img: img/btn_addfriend.gif, img/btn_todo.gif, img/btn_memories.gif, img/btn_tellfriend.gif, img/talk/md10_thumbup.gif, img/xml.gif hook: userinfo_html_by_user, userinfo_rows _c?>