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 + ' + + 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:+" + + + $td${time:----} + EOF + done + cat <<-EOF +
メンバーuname最終閲覧時刻
"} # If the variable time is set, td= + td=${td:-""} # else td= + cat <<-EOF +
`echo "$hexge"|unhexize|htmlescape``echo ${u%%@*}|htmlescape`
+

[$title]に戻る

+ + EOF +} lsmyfile() { # $1(optional)=SortBy case "$1" in ""|CTIME-DESC) diff --git a/s4.cgi b/s4.cgi index 71c607b..41e5875 100755 --- a/s4.cgi +++ b/s4.cgi @@ -79,9 +79,9 @@ echo "Refresh: 0; $newurl"; echo exit 0 ;; - lshandout|lshandoutall|gethandout|gethandoutcsv|gethandoutcsv2) + lshandout|lshandoutall|gethandout|gethandoutcsv|gethandoutcsv2|blogseen) case "$stage" in - lshandout*) contenttype; echo ;; + lshandout*|blogseen*) contenttype; echo ;; esac rowid=${2%%[!A-Z0-9a-z_]*} if [ -z "$rowid" ]; then