X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND.pm;h=b5aee8646a9466ef103fe415b69b22fa71ce5725;hb=291bee7f7954b0362c5b58d6d05ff55bbc1eec12;hp=c3391f2bcc2ddf74781cfd62e2de3a4ca49f488c;hpb=2d7464077ae805a1923bb4e2024afeb769f30e02;p=ndwebbie.git diff --git a/ND.pm b/ND.pm index c3391f2..b5aee86 100755 --- a/ND.pm +++ b/ND.pm @@ -30,7 +30,9 @@ use ND::Include; use Tie::File; use Fcntl 'O_RDONLY'; use strict; -use warnings FATAL => 'all'; +use warnings; + +$SIG{__WARN__} = sub {$ND::ERROR .= p $_[0]}; chdir '/var/www/ndawn/code'; our %PAGES; @@ -111,9 +113,13 @@ sub page { $fleetupdate = 0 unless defined $fleetupdate; - my ($unread,$lastv) = $DBH->selectrow_array(unread_query,undef,$UID) or $ERROR .= p($DBH->errstr); + my ($last_forum_visit) = $DBH->selectrow_array(q{SELECT last_forum_visit FROM users WHERE uid = $1} + ,undef,$UID) or $ERROR .= p($DBH->errstr); + my ($unread,$newposts) = $DBH->selectrow_array(unread_query,undef,$UID,$last_forum_visit) + or $ERROR .= p($DBH->errstr); $TEMPLATE->param(UnreadPosts => $unread); + $TEMPLATE->param(NewPosts => $newposts); $TEMPLATE->param(Tick => $TICK); $TEMPLATE->param(isMember => (($TICK - $fleetupdate < 24) || isScanner()) && $PLANET && isMember()); $TEMPLATE->param(isHC => isHC()); @@ -125,6 +131,8 @@ sub page { $ND::TEMPLATE->param(Targets => listTargets()); } $TEMPLATE->param(Coords => param('coords') ? param('coords') : '1:1:1'); + my ($css) = $DBH->selectrow_array(q{SELECT css FROM users WHERE uid = $1},undef,$ND::UID); + $TEMPLATE->param(CSS => $css); } $TEMPLATE->param(Error => $ERROR);