body<= " unless $remote; my $u; if ($GET{user}) { $u = LJ::load_user($GET{user}); return BML::ml('.error.invaliduser', { user => LJ::ehtml($GET{user}) }) unless $u; return BML::ml('.error.badstatus', { user => LJ::ljuser($u->{user}) }) if $u->{statusvis} ne 'V'; } my $body; my $lastmon = 0; $body .= ""; $body .= "
"; $body .= LJ::html_text({ name => 'user', maxlength => 15, size => 15 }); $body .= LJ::html_submit(undef, $ML{'.view'}); $body .= "
"; $body .= ' LJ::ljuser($u) }); } else { $body .= $ML{'.description'}; } $body .= ' p?>'; # TAG:fr:bml_birthdays:get_bdays my $dbr = LJ::get_db_reader(); my $sth = $dbr->prepare( qq|SELECT u.user, u.name, MONTH(bdate) AS 'month', DAYOFMONTH(bdate) AS 'day' FROM friends f, user u WHERE f.userid = ? AND f.friendid = u.userid AND u.journaltype = 'P' AND u.statusvis = 'V' AND u.allow_infoshow = 'Y' AND MONTH(bdate) != 0 AND DAYOFMONTH(bdate) != 0 LIMIT 750|); $sth->execute($u ? $u->{userid} : $remote->{userid}); my @bdays; push @bdays, $_ while $_ = $sth->fetchrow_hashref; @bdays = sort { ($a->{'month'} <=> $b->{'month'}) || ($a->{'day'} <=> $b->{'day'}) || ($a->{'user'} cmp $b->{'user'}) } @bdays; foreach my $bday (@bdays) { LJ::text_out(\$bday->{'name'}); if ($bday->{'month'} != $lastmon) { if ($lastmon) { $body .= "\n"; } $lastmon = $bday->{'month'}; $body .= "\n"; } else { $body .= ""; } return $body; } _code?> <=body page?> link: htdocs/login.bml _c?>