Mercurial > blahgd
changeset 50:fc4a2ea20e83
implement @@UNIXDATE@@ replacement
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Wed, 25 Feb 2009 17:18:51 -0500 |
parents | 732f8aa0a5be |
children | 7cdca08469e5 |
files | sar.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/sar.c Wed Feb 25 17:18:27 2009 -0500 +++ b/sar.c Wed Feb 25 17:18:51 2009 -0500 @@ -3,6 +3,7 @@ #include <string.h> #include <sys/types.h> #include <dirent.h> +#include <time.h> #include "post.h" #include "sar.h" @@ -73,12 +74,18 @@ __echo_comment_count(post, data, 1); } +static void echo_unixdate(struct post *post, void *data) +{ + fprintf(post->out, "%lu", time(NULL)); +} + static struct repltab_entry __repltab_story_html[] = { {"POSTID", echo_postid}, {"POSTDATE", echo_postdate}, {"POSTTIME", echo_posttime}, {"TITLE", echo_story_title}, {"COMCOUNT", echo_comment_count}, + {"UNIXDATE", echo_unixdate}, {"", NULL}, };