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 diff
     1.1 --- a/s4-blog.sh	Mon Nov 28 11:05:32 2016 +0859
     1.2 +++ b/s4-blog.sh	Mon Nov 28 12:07:18 2016 +0859
     1.3 @@ -798,7 +798,12 @@
     1.4        case $st in
     1.5  	0|4)
     1.6  	  [ "$st" = "4" ] && act="書込削除"
     1.7 -	  blog_notify_reply $rowid $user "$text" $act ;;
     1.8 +	  blog_notify_reply $rowid $user "$text" $act
     1.9 +	if [ -n "$grprowid" ]; then
    1.10 +	  qgrp=$(sqlquote "$owner")
    1.11 +	  dbsetbyid grp $owner wtime "`date '+%F %T'`"
    1.12 +	fi
    1.13 +	;;
    1.14        esac
    1.15      else
    1.16        title="$title(加入してないので書き込み不可)"
     2.1 --- a/s4-funcs.sh	Mon Nov 28 11:05:32 2016 +0859
     2.2 +++ b/s4-funcs.sh	Mon Nov 28 12:07:18 2016 +0859
     2.3 @@ -934,6 +934,7 @@
     2.4    # $1=tbl $2=id $3=col $4=val/filename - &optional - $5=content-type
     2.5    (t0=$1 t=$1 p=$2 c=$3
     2.6     tsc=$t/$c val=$4
     2.7 +   quotedp=$(sqlquotestr "$p")
     2.8     unset primary update
     2.9     gettblconf
    2.10  #err tsc=$tsc, tconfs="$tconfs"
    2.11 @@ -947,7 +948,7 @@
    2.12       s*)	t=${t}_s;;
    2.13     esac
    2.14  #err t=$t
    2.15 -   type=text fn=""
    2.16 +   type=string fn=""
    2.17     case $conf in
    2.18       */password)
    2.19         type=encoded ### val=`echo $val|encode`
    2.20 @@ -965,12 +966,9 @@
    2.21       ###sq $db "replace into $t values(\"$val\"$nulls)"
    2.22       query "replace into $t values(\"$val\"$nulls);"
    2.23     elif [ "$update" ]; then
    2.24 -     ###sq $db "update $1 set $c=\"$val\" where $pkey=\"$p\""
    2.25 -     query "update $1 set $c=\"$val\" where $pkey=\"$p\";"
    2.26 +     query "update $1 set $c=\"$val\" where $pkey=$quotedp;"
    2.27     else
    2.28 -#err "replace into $t values(\"$p\", \"$c\", \"$type\", \"$val\", \"$bin\")"
    2.29 -     ###sq $db "replace into $t values(\"$p\", \"$c\", \"$type\", \"$val\", \"$bin\")"
    2.30 -     query "replace into $t values(\"$p\", \"$c\", \"$type\", \"$val\", \"$bin\");"
    2.31 +     query "replace into $t values($quotedp, \"$c\", \"$type\", \"$val\", \"$bin\");"
    2.32     fi
    2.33    )
    2.34  }