# HG changeset patch # User HIROSE Yuuji # Date 1552475816 -32400 # Node ID 944739c3ac5c29f80750be122aca1fddbd2b4476 # Parent 145fb3cca3fbd8d92736420a5560a43f5a213ec5 Continuous search available diff -r 145fb3cca3fb -r 944739c3ac5c s4-blog.sh --- a/s4-blog.sh Wed Mar 06 14:15:53 2019 +0900 +++ b/s4-blog.sh Wed Mar 13 20:16:56 2019 +0900 @@ -827,23 +827,28 @@ kwd=`echo "$kwd"|htmlescape` owner=`getpar owner` owner=${owner:-$1} - echo "「$kwd」による検索結果" | html p + msg="" if [ -n "$owner" ]; then cond="where key='owner' and val='$owner'" + search_form_args="author=$owner" if isuser $owner; then - echo "(`linkhome $owner` さんの記録からの検索)" | html p + msg="(`linkhome $owner` さんの記録からの検索)" else linkhome $owner 1>&3 - echo "(`linkhome $owner` グループからの検索)" | html p + msg="(`linkhome $owner` グループからの検索)" fi elif { author=`getpar author`; test -n "$author"; }; then atptn=`sqlquotestr $author` #kc="$kc${kc:+ AND }author=$atptn" authcond="WHERE author=$atptn" + search_form_args="author=$author" if isuser $author; then - echo "(`linkhome $author` さんの書き込みからの検索)" | html p + msg="(`linkhome $author` さんの書き込みからの検索)" fi fi + search_form "$search_form_args" "$kwd" + echo "「$kwd」による検索結果" $search_form_args| html p + echo "$msg" | html p # article_s: id=article-id, key='text', val='TEXT' # article: id=article-id, blogid=blogkd # blog: id=blog-id, author=LeaderAuthor diff -r 145fb3cca3fb -r 944739c3ac5c s4-funcs.sh --- a/s4-funcs.sh Wed Mar 06 14:15:53 2019 +0900 +++ b/s4-funcs.sh Wed Mar 13 20:16:56 2019 +0900 @@ -1639,6 +1639,8 @@ } search_form() { + # $1 = { author= | grp= } + # $2(optional) = pre-input keywords help="(1)空白区切りの単語で本文検索 (2)@YYYY-MM-DD 日付け(シェルパターン可)で日付け検索 @2016-0[1-6] → 2016年1月から6月 @@ -1666,10 +1668,11 @@ placeholder="このグループからの検索" ;; esac + inikwd="$2" # no need to htmlescape cat<<-EOF
$auth - ${touchpanel:+

$help

} @@ -1790,7 +1793,7 @@ . ./s4-blog.sh tf=$tmpd/title.$$ pf=$tmpd/profile.$$ bf=$tmpd/blogs.$$ sf=$tmpd/search.$$ - search_form $search_form_args > $sf + search_form "$search_form_args" > $sf echo "$gecos さん" > $tf { echo "
" viewtable $formdir/user.def user $1