]> ruin.nu Git - ndwebbie.git/blobdiff - ND/Web/Pages/Forum.pm
keep track of last forum visit, so we can check if posts are really new, or just...
[ndwebbie.git] / ND / Web / Pages / Forum.pm
index a166b64ad823e0f134b7b6c6e38dc4b80e2c103d..2b287a9d1193828485eef2d7f556e0d54f7f4afe 100644 (file)
@@ -19,8 +19,7 @@
 
 package ND::Web::Pages::Forum;
 use strict;
-use warnings FATAL => 'all';
-no warnings 'uninitialized';
+use warnings;
 use ND::Web::Forum;
 use CGI qw/:standard/;
 use ND::Web::Include;
@@ -43,6 +42,8 @@ sub render {
 
        $ND::TEMPLATE->param(TITLE => 'Forum');
 
+       $DBH->do(q{UPDATE users SET last_forum_visit = NOW() WHERE uid = $1},undef,$ND::UID) or $ND::ERROR .= p($DBH->errstr);
+
        my $board;
        if(param('b')){
                my $boards = $DBH->prepare(q{SELECT fb.fbid AS id,fb.board, bool_or(fa.post) AS post
@@ -79,7 +80,7 @@ sub render {
                $thread = $DBH->selectrow_hashref($findThread,undef,param('t'),$ND::UID) or $ND::ERROR .= p($DBH->errstr);
        }
 
-       if (defined param('cmd') && param('cmd') eq 'forumpost'){
+       if (defined param('cmd') && param('cmd') eq 'Submit'){
                $DBH->begin_work;
                if ($board && $board->{post}){
                        $thread = addForumThread $DBH,$board,$ND::UID,param('subject');