Mercurial > hgrepos > hgweb.cgi > s4
changeset 747:42cc0aeaa498
Avoid to pass gname to searchart()
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sat, 06 Jun 2020 16:58:53 +0900 |
parents | 5dff7af7fdce |
children | 1ba114ebcf2c |
files | s4-blog.sh s4-funcs.sh |
diffstat | 2 files changed, 19 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/s4-blog.sh Sat Jun 06 16:56:02 2020 +0900 +++ b/s4-blog.sh Sat Jun 06 16:58:53 2020 +0900 @@ -1058,15 +1058,16 @@ kwd=`echo "$kwd"|htmlescape` owner=`getpar owner` owner=${owner:-$1} + grid=`getpar grid` msg="" - if [ -n "$owner" ]; then + if [ -n "$grid" ]; then + grp=`getgroupbyid "$grid"` + qgrp=`sqlquote "$grp"` + cond="WHERE key='owner' AND val=$qgrp" + msg="(`linkhome $grid` グループから)" + elif [ -n "$owner" ]; then cond="where key='owner' and val='$owner'" - if isuser $owner; then - msg="(`linkhome $owner` さんの記録から)" - else - linkhome $owner 1>&3 - msg="(`linkhome $owner` グループから)" - fi + msg="(`linkhome $owner` さんの記録から)" elif { author=`getpar author`; test -n "$author"; }; then atptn=`sqlquotestr $author` #kc="$kc${kc:+ AND }author=$atptn"
--- a/s4-funcs.sh Sat Jun 06 16:56:02 2020 +0900 +++ b/s4-funcs.sh Sat Jun 06 16:58:53 2020 +0900 @@ -535,15 +535,18 @@ [ -n "`query $sql`" ] || return 2 } linkhome() { - # $1=UserOrGroup - echo -n '<a href="?' + # $1=UserOrGroupRowid + echo -n "<a href=\"$myname?" if isuser $1; then err "select 'home+'||rowid from user where name='$1';" query "select 'home+'||rowid from user where name='$1';" + name=`gecos $1|htmlescape` else + _grid=`numericalize "$1"` echo -n "grp+$1" + name=`query "SELECT gname FROM grp WHERE rowid=$_grid;"|htmlescape` fi - echo "\">`gecos $1`</a>" + echo "\">$name</a>" } hreflink() { # s4 specific notation: @@ -1917,7 +1920,7 @@ } search_form() { - # $1 = { author=<AUTHOR> | grp=<GROUP> } + # $1 = { author=<AUTHOR> | grid=<GroupRowid> } # $2(optional) = pre-input keywords help="(1)空白区切りの単語で本文検索 (2)@YYYY-MM-DD 日付け(シェルパターン可)で日付け検索 @@ -1939,9 +1942,9 @@ placeholder="このユーザの書込検索" help="★★ $g さんの書き込みから検索します$nl$help" ;; - grp=*) - a=`echo "${1#grp=}"` # group name cannot have quoting marks - auth="<input type=\"hidden\" name=\"owner\" value=\"$a\">" + grid=*) + a=`echo "${1#grid=}"`; a=$((0 + $a)) + auth="<input type=\"hidden\" name=\"grid\" value=\"$a\">" placeholder="このグループからの検索" ;; esac @@ -2522,7 +2525,7 @@ ismember="" # bodyclass="group" fi bodyclass="$bodyclass grouphome" - echo "<div class=\"search\">`search_form grp=\"$grp\"`</div>"> $sf + echo "<div class=\"search\">`search_form grid=\"$grid\"`</div>"> $sf echo "グループ $htmlgrp" > $tf showgroupsub $formdir/grp.def "$grid" | \