head<= <=head bodyopts<= /goat-pee.gif')\""; } else { return "onload=\"MM_preloadImages('/goat-hover.gif')\""; } _code?> <=bodyopts pretitle<=

$ML{
$ML{'.frank.logo'}"; } _code?>

$now-600)) { my $db = LJ::get_db_reader(); $LJ::CACHE_STAT_ACCTS = $db->selectrow_array("SELECT statval FROM stats WHERE statcat='size' AND statkey='accounts'")+0; $LJ::CACHE_STAT_ACCTS_ACTIVE = $db->selectrow_array("SELECT statval FROM stats WHERE statcat='size' AND statkey='accounts_active'")+0; $LJ::CACHE_STAT_ACCTS_TIME = $now; } return unless $LJ::CACHE_STAT_ACCTS && $LJ::CACHE_STAT_ACCTS_ACTIVE; return <<"END_BOX";
 
$LJ::CACHE_STAT_ACCTS
$LJ::CACHE_STAT_ACCTS_ACTIVE
END_BOX } _code?> [1] - $stat->[2]; return unless $delta; my $rate_sec = $stat->[0] / $delta; my $rate_min = $rate_sec * 60; my $fmt_min = $rate_min > 10 ? "%.0f" : "%.2f"; my $rate_hour = $rate_min * 60; my $fmt_hour = $rate_hour > 10 ? "%.0f" : "%.2f"; my $post_min = sprintf($fmt_min, $rate_min); my $post_hour = sprintf($fmt_hour, $rate_hour); return <<"END_BOX";
 $ML{'.post'}
$ML{'.post.hour'}$post_hour
$ML{'.post.min'}$post_min
$ML{'.post.latest'} RSS version
END_BOX return $ret; } _code?>
<=pretitle body<= "; $text .= ''href="http://www.livejournal.org"'}).' p?>'; $text .= ''href="/paidaccounts/"', 'aopts2'=>'href="/site/accounts.bml"'}).' p?>'; $text .= ""; $text .= ''href="/site/about.bml"', 'aopts2'=>'href="/create.bml"'}).' p?>'; return $text; _code?> "; $hdr .= "'href="/news.bml"'}) . " p?>"; my $news = LJ::MemCache::get('frontnews'); if (defined $news) { return "$hdr $news" if $news; return ""; } $news = ""; my $set = sub { my $news = shift; LJ::MemCache::set('frontnews', $news||"", 60*5); return $news ? "$hdr $news" : ""; }; my $u = LJ::load_user("news"); return $set->("") unless $u; my @items = LJ::get_recent_items({ 'userid' => $u->{'userid'}, 'clusterid' => $u->{'clusterid'}, 'clustersource' => 'slave', 'order' => 'logtime', 'itemshow' => 1, 'dateformat' => 'S2', 'friendsview' => 1, # so we get rlogtime }); return $set->("") unless @items; my $item = $items[0]; my $delta = time() - ($LJ::EndOfTime - $item->{rlogtime}); return $set->("") unless $delta < 86400 * 7; my $pd = LJ::get_posts_raw([ $u->{'clusterid'}, $u->{'userid'}, $item->{itemid} ]); my $key = "$u->{userid}:$item->{itemid}"; my $text = $pd->{'text'}->{$key}; my $props = $pd->{'prop'}->{$key}; $item->{'replycount'} = int($pd->{'replycount'}->{$key}); return $set->("") unless $text; LJ::CleanHTML::clean_subject(\$text->[0]); LJ::CleanHTML::clean_event(\$text->[1], { 'preformatted' => $props->{'opt_preformatted'}, 'cuturl' => LJ::item_link($u, $item->{itemid}, $item->{'anum'}), }); my $ditemid = $item->{itemid}*256+$item->{anum}; LJ::expand_embedded($u, $ditemid, undef, \$text->[1]); $news .= "
"; my $date = substr($item->{'alldatepart'}, 0, 10); $date =~ s/ /-/g; $news .= "$text->[0]
$date

"; $news .= $text->[1]; my $link = LJ::item_link($u, $item->{itemid}, $item->{anum}); $news .= "
( "; if ($item->{'replycount'}) { $news .= "" . (($item->{'replycount'} == 1) ? "1 comment" : "$item->{'replycount'} comments") . ""; } else { $news .= "Link"; } unless ($props->{'opt_nocomments'}) { $news .= " | Leave a comment"; } $news .= " )
"; $news .= "
"; return $set->($news); } _code?> <=body page?>