Mercurial > blahgd
changeset 8:31eafc110fc2
cgi: use xattrs again
this time, on the dir itself
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sat, 31 Jan 2009 18:07:23 -0500 |
parents | 26ae3b8f443d |
children | 24e7c7095045 |
files | archive.cgi cat.cgi common-head.sh index.cgi story.cgi |
diffstat | 5 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/archive.cgi Sat Jan 31 01:06:23 2009 -0500 +++ b/archive.cgi Sat Jan 31 18:07:23 2009 -0500 @@ -9,7 +9,7 @@ cat templates/header.html | sed -e "s|@@TITLE@@|`arch_title_date $catid`|" for postid in `ls data/by-month/$catid/ | sort -nr` ; do - fn="data/posts/$postid/post.txt" + fn="data/posts/$postid/" cat templates/story-top.html | sed -e " s|@@POSTID@@|`basename $postid`|g @@ -27,7 +27,7 @@ s|@@POSTTIME@@|`get_time "$fn"`|g " - cat_post "$fn" + cat_post "$fn/post.txt" cat templates/story-bottom.html done
--- a/cat.cgi Sat Jan 31 01:06:23 2009 -0500 +++ b/cat.cgi Sat Jan 31 18:07:23 2009 -0500 @@ -51,7 +51,7 @@ for postid in `ls data/by-category/$catid/ | sort -r` ; do [ -d "data/by-category/$catid/$postid" ] && continue - fn="data/posts/$postid/post.txt" + fn="data/posts/$postid/" cat templates/story-top.html | sed -e " s|@@POSTID@@|`basename $postid`|g @@ -69,7 +69,7 @@ s|@@POSTTIME@@|`get_time "$fn"`|g " - cat_post "$fn" + cat_post "$fn/post.txt" cat templates/story-bottom.html done
--- a/common-head.sh Sat Jan 31 01:06:23 2009 -0500 +++ b/common-head.sh Sat Jan 31 18:07:23 2009 -0500 @@ -1,7 +1,7 @@ # usage: get_xattr <attrname> <filename> get_xattr() { - cat "$2_xattrs/$1" 2> /dev/null + getfattr --only-values -n "user.$1" "$2" 2> /dev/null } # usage: get_date <filename>
--- a/index.cgi Sat Jan 31 01:06:23 2009 -0500 +++ b/index.cgi Sat Jan 31 18:07:23 2009 -0500 @@ -12,7 +12,7 @@ cnt=$(($cnt + 1)) [ $cnt -gt 10 ] && break - fn="data/posts/$postid/post.txt" + fn="data/posts/$postid/" cat templates/story-top.html | sed -e " s|@@POSTID@@|`basename $postid`|g @@ -30,7 +30,7 @@ s|@@POSTTIME@@|`get_time "$fn"`|g " - cat_post "$fn" + cat_post "$fn/post.txt" cat templates/story-bottom.html done
--- a/story.cgi Sat Jan 31 01:06:23 2009 -0500 +++ b/story.cgi Sat Jan 31 18:07:23 2009 -0500 @@ -6,7 +6,7 @@ postid=`echo "$PATH_INFO" | sed -e 's,^/,,'` -fn="data/posts/$postid/post.txt" +fn="data/posts/$postid/" title=`get_xattr post_title "$fn"` postdate=`get_date "$fn"` @@ -31,7 +31,7 @@ s|@@POSTTIME@@|$posttime|g " -cat_post "$fn" +cat_post "$fn/post.txt" cat templates/story-bottom.html cat templates/story-comment-head.html | sed -e "