Description:
Displays a short message on the front page if the user hasn't visited the newest site news story yet. Can be tailored to any section, and ad_box is just a block with only |content| in it.
Box Code:
return unless ($S->{UID} > 0);
my ($rv, $sth) = $S->db_select({
WHAT => 'sid',
FROM => 'stories',
WHERE => 'section = "sitenews"',
LIMIT => 1,
ORDER_BY => 'time DESC'});
my $sid = $sth->fetchrow();
$sth->finish();
return unless $sid;
$S->story_last_seen($sid);
return if (defined($S->{LAST_SEEN}->{$sid}->{lastseen}));
return {content => qq{<table cellpadding=3 cellspacing=0 border=0><tr><td width="12" align="center"><IMG SRC="|imagedir|/alert.gif" width=12 height=16 alt="!" border=0></td><td><b>There is <A HREF="/story/$sid">New Site News</A>.</b></td></tr></table>}};
|