From: Michael Andreen Date: Wed, 28 Mar 2007 11:24:12 +0000 (+0000) Subject: forum threads got uid linked to them X-Git-Url: https://ruin.nu/git/?a=commitdiff_plain;ds=sidebyside;h=b5d002fd4f16920751700247a06853369f7fe27a;p=ndwebbie.git forum threads got uid linked to them --- diff --git a/ND/Web/Forum.pm b/ND/Web/Forum.pm index cbeb747..6551518 100644 --- a/ND/Web/Forum.pm +++ b/ND/Web/Forum.pm @@ -83,9 +83,9 @@ sub addForumPost { sub addForumThread { my ($dbh,$board,$uid,$subject) = @_; - my $insert = $dbh->prepare(q{INSERT INTO forum_threads (fbid,subject) VALUES($1,$2)}); + my $insert = $dbh->prepare(q{INSERT INTO forum_threads (fbid,subject,uid) VALUES($1,$2,$3)}); - if ($insert->execute($board->{id},escapeHTML($subject))){ + if ($insert->execute($board->{id},escapeHTML($subject),$ND::UID)){ my $id = $dbh->last_insert_id(undef,undef,undef,undef,"forum_threads_ftid_seq"); return $dbh->selectrow_hashref(q{SELECT ftid AS id, subject, $2::boolean AS post FROM forum_threads WHERE ftid = $1} ,undef,$id,$board->{post}) diff --git a/ND/Web/Pages/Forum.pm b/ND/Web/Pages/Forum.pm index b18bc35..55cbe96 100644 --- a/ND/Web/Pages/Forum.pm +++ b/ND/Web/Pages/Forum.pm @@ -131,13 +131,15 @@ sub render_body { GROUP BY fb.fbid,fb.board ORDER BY fb.fbid }); - my $threads = $DBH->prepare(q{SELECT ft.ftid AS id,ft.subject, + my $threads = $DBH->prepare(q{SELECT ft.ftid AS id,u.username,ft.subject, count(NULLIF(COALESCE(fp.time > ftv.time,TRUE),FALSE)) AS unread,count(fp.fpid) AS posts, date_trunc('seconds',max(fp.time)::timestamp) as last_post, min(fp.time)::date as posting_date, ft.sticky - FROM forum_threads ft JOIN forum_posts fp USING (ftid) LEFT OUTER JOIN (SELECT * FROM forum_thread_visits WHERE uid = $2) ftv ON ftv.ftid = ft.ftid + FROM forum_threads ft JOIN forum_posts fp USING (ftid) + JOIN users u ON u.uid = ft.uid + LEFT OUTER JOIN (SELECT * FROM forum_thread_visits WHERE uid = $2) ftv ON ftv.ftid = ft.ftid WHERE ft.fbid = $1 - GROUP BY ft.ftid, ft.subject,ft.sticky + GROUP BY ft.ftid, ft.subject,ft.sticky,u.username HAVING count(NULLIF(COALESCE(fp.time > ftv.time,TRUE),FALSE)) >= $3 ORDER BY sticky DESC,last_post DESC}); diff --git a/stylesheets/black.css b/stylesheets/black.css index 94e2ce3..1466b8e 100644 --- a/stylesheets/black.css +++ b/stylesheets/black.css @@ -8,7 +8,7 @@ a { color: white; text-decoration:underline; } -a:hover { +a:hover, td.NAP a:hover { color: black; background: white; } @@ -151,14 +151,7 @@ td.Hostile{ background: red; color: black; } -td.NAP{ - background: blue; - color: white; -} -td.NAP a{ - color: yellow; - background: blue; -} + table.old{ border: outset 1pt; border-collapse: separate; diff --git a/templates/forum.tmpl b/templates/forum.tmpl index 380f276..9b74b2d 100644 --- a/templates/forum.tmpl +++ b/templates/forum.tmpl @@ -22,6 +22,7 @@ Total Subject Posted + Creator Last post @@ -29,8 +30,9 @@ class="sticky">   - - + + +