shithub: werc

Download patch

ref: b25d1f62a3d2363961ed43bce568dd8d9fa5fa7d
parent: b9b21955968563ae5aca3028f295f39a3cf7bd9d
author: uriel <uriel@engel.se.cat-v.org>
date: Sun Feb 1 15:02:22 EST 2009

Store and display comment posted date/time.

--- a/apps/bridge/app.rc
+++ b/apps/bridge/app.rc
@@ -73,6 +73,7 @@
         dir=$dir'/'`{date -n} # FIXME Obvious race
         mkdir -m 775 -p $dir &&
             echo $u > $dir/user &&
+            echo $current_date_time > $dir/posted &&
             echo $post_arg_comment_text > $dir/body
         _s=$status
         if(! ~ $"_s '') {
@@ -89,8 +90,7 @@
 
     for(c in `{ls $*/}) {
         if(test -s $c/body) {
-            echo '<div>'
-            sed 's!.+!<b>By: <i>&</i></b><br />!' < $c/user
+            ifs=() { echo '<div class="comment"><h5>By: <i>'`{cat $c/user}'</i></b> ('`{cat $c/posted}')</h5>'}
             cat $c/body | escape_html | sed 's,$,<br />,'
             echo '<hr /></div>'
         }