diff --git a/s4-blog.sh b/s4-blog.sh
index b6ac96a..eb6527f 100644
--- a/s4-blog.sh
+++ b/s4-blog.sh
@@ -174,6 +174,7 @@
href3="(ファイル取得)"
fi
href4=' 末尾へ'
+ href5=" 読刻"
quizmodefile=$td/quiz; rm -f "$quizmodefile" # XXX: Global state
query<<-EOF |
@@ -192,7 +193,7 @@
EOF
{ IFS='|' read edit ctime hexhead blogtype
cat<<-EOF
-
${edit:+$href }$ctime $blogtype $href2$href3 $href4 |
+ ${edit:+$href }$ctime $blogtype $href2$href3 $href4 $href5 |
`echo "$hexhead"|unhexize|hreflink|minitbl` |
@@ -634,6 +635,66 @@
echo
cat $arc
}
+blogseen() { # $1 = blogid
+ blogid=${1%%[!0-9]*}
+ if [ -z "$blogid" ]; then
+ echo "Invalid blog id" | html p; exit
+ fi
+ blog_writable "$blogid" "$user"
+ rc=$? # =0: writable, $BLOG_NOTMEM bit set => not member
+ if [ $((rc & $BLOG_NOTMEM)) -gt 0 ] ; then
+ echo "メンバー以外は利用できません。" | html p; return
+ fi
+ owner=`getvalbyid blog owner $rowid`
+ #qowner=`sqlquotestr "$owner"`
+ ge=`gecos "$owner"`
+ title=`getvalbyid blog title $rowid`
+ _m4 -D_TITLE_="アクセス時刻" $layout/html.m4.html
+ tmpf=$tmpd/header
+ echo "[title]@${ge:-$owner}" > $tmpf
+ warn=' class="warn"'
+ cat <<-EOF
+ '
+ メンバー | uname | 最終閲覧時刻 |
+ EOF
+ query <<-EOF |
+ WITH grpmem as (
+ SELECT user, (SELECT gecos FROM gecoses WHERE name=user) gecos
+ FROM grp_mem
+ WHERE gname=(SELECT val FROM blog_s
+ WHERE id=(select id from blog where rowid=16)
+ AND key='owner')
+ ), acctime AS (
+ SELECT user, max(time) atime
+ FROM tblaccesses
+ WHERE tbl='blog' AND tblrowid=16
+ GROUP BY user
+ )
+ SELECT g.user,
+ (SELECT rowid FROM user u WHERE u.name=g.user),
+ hex(gecos),
+ atime
+ FROM grpmem g LEFT JOIN acctime t
+ ON g.user = t.user
+ GROUP BY t.user
+ ORDER BY atime DESC;
+ EOF
+ while IFS='|' read u uid hexge time; do
+ td=${time:+""} # If the variable time is set, td= |
+ td=${td:-" | "} # else td= |
+ cat <<-EOF
+ |
+ `echo "$hexge"|unhexize|htmlescape` |
+ `echo ${u%%@*}|htmlescape` |
+ $td${time:----}
+ EOF
+ done
+ cat <<-EOF
+
+ [$title]に戻る
+