Mercurial > hgrepos > hgweb.cgi > s4
changeset 386:606404fbb3d3
Sort group list by posting time(wtime)
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Mon, 28 Nov 2016 12:07:18 +0859 |
parents | cc2a6f631553 |
children | 2c928bb47c90 |
files | s4-blog.sh s4-funcs.sh |
diffstat | 2 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/s4-blog.sh Mon Nov 28 11:05:32 2016 +0859 +++ b/s4-blog.sh Mon Nov 28 12:07:18 2016 +0859 @@ -798,7 +798,12 @@ case $st in 0|4) [ "$st" = "4" ] && act="書込削除" - blog_notify_reply $rowid $user "$text" $act ;; + blog_notify_reply $rowid $user "$text" $act + if [ -n "$grprowid" ]; then + qgrp=$(sqlquote "$owner") + dbsetbyid grp $owner wtime "`date '+%F %T'`" + fi + ;; esac else title="$title(加入してないので書き込み不可)"
--- a/s4-funcs.sh Mon Nov 28 11:05:32 2016 +0859 +++ b/s4-funcs.sh Mon Nov 28 12:07:18 2016 +0859 @@ -934,6 +934,7 @@ # $1=tbl $2=id $3=col $4=val/filename - &optional - $5=content-type (t0=$1 t=$1 p=$2 c=$3 tsc=$t/$c val=$4 + quotedp=$(sqlquotestr "$p") unset primary update gettblconf #err tsc=$tsc, tconfs="$tconfs" @@ -947,7 +948,7 @@ s*) t=${t}_s;; esac #err t=$t - type=text fn="" + type=string fn="" case $conf in */password) type=encoded ### val=`echo $val|encode` @@ -965,12 +966,9 @@ ###sq $db "replace into $t values(\"$val\"$nulls)" query "replace into $t values(\"$val\"$nulls);" elif [ "$update" ]; then - ###sq $db "update $1 set $c=\"$val\" where $pkey=\"$p\"" - query "update $1 set $c=\"$val\" where $pkey=\"$p\";" + query "update $1 set $c=\"$val\" where $pkey=$quotedp;" else -#err "replace into $t values(\"$p\", \"$c\", \"$type\", \"$val\", \"$bin\")" - ###sq $db "replace into $t values(\"$p\", \"$c\", \"$type\", \"$val\", \"$bin\")" - query "replace into $t values(\"$p\", \"$c\", \"$type\", \"$val\", \"$bin\");" + query "replace into $t values($quotedp, \"$c\", \"$type\", \"$val\", \"$bin\");" fi ) }