]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb/Controller/Intel.pm
Support for planet tags
[ndwebbie.git] / lib / NDWeb / Controller / Intel.pm
index bafea58ea8be45ad64da1f5450990e5b3193ad52..990b2225e9f07fef9b1afc0ff028b1150f5f955a 100644 (file)
@@ -103,6 +103,17 @@ ORDER BY tick DESC, mission
        $query->execute($id,$ticks);
        $c->stash(outgoing => $query->fetchall_arrayref({}) );
 
+       $query = $dbh->prepare(q{
+SELECT tag, array_to_string(array_agg(username),', ') AS nicks, to_char(max(time),'YYYY-MM-DD HH24:MI') AS time
+FROM planet_tags pt
+       JOIN users u USING (uid)
+WHERE pt.pid = $1
+GROUP BY tag
+ORDER BY time DESC
+               });
+       $query->execute($id);
+       $c->stash(tags => $query->fetchall_arrayref({}) );
+
 }
 
 sub channels : Local {