Mercurial > hgrepos > hgweb.cgi > s4
changeset 312:b8a8e627b376
Remove debugging code. Stay revealed profile image rows.
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 16 Oct 2016 22:38:33 +0859 |
parents | 121b91ee87c1 |
children | bad43ce1ef0f |
files | examples/common/default/default.css s4-funcs.sh |
diffstat | 2 files changed, 10 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/common/default/default.css Sun Oct 16 21:59:43 2016 +0859 +++ b/examples/common/default/default.css Sun Oct 16 22:38:33 2016 +0859 @@ -101,7 +101,8 @@ table.mini {margin-left: 1em; border-left: 2px solid #686;} tr.profimg {visibility: collapse;} -tr:hover + tr.profimg, tr:active + tr.profimg {visibility: visible;} +tr:hover + tr.profimg, tr:active + tr.profimg, tr.profimg:hover { + visibility: visible;} p.profimg {float: left; max-width: 50%; max-height: 400px; overflow: hidden; margin: 0 1em 1ex;
--- a/s4-funcs.sh Sun Oct 16 21:59:43 2016 +0859 +++ b/s4-funcs.sh Sun Oct 16 22:38:33 2016 +0859 @@ -25,6 +25,7 @@ dumpcollen=22 #thumbxy=120x120 thumbxy=96x96 +maxiconxy=400x400 maximagexy=1600x1600 ### maximagexy=400x400 file_accept='accept="image/*,text/*,audio/*,application/vnd.oasis.*,application/pdf,application/x-*"' @@ -1482,36 +1483,30 @@ # $1 = directory for cache'ing # $2 = table # $3 = condition for choosingowner - MAXSIZE=400 - dir="$1" tbl="$2" whos="$3" + dir="$1" tbl="$2" whos="$3 ORDER BY rowid LIMIT 1" [ -d "$dir" ] || mkdir $dir - sql0="SELECT val || '//' || type FROM $tbl WHERE $whos ORDER BY rowid LIMIT 1;" - sql1="SELECT hex(bin) FROM $tbl WHERE $whos ORDER BY rowid LIMIT 1;" + sql0="SELECT val || '//' || type FROM $tbl WHERE $whos;" + sql1="SELECT hex(bin) FROM $tbl WHERE $whos;" valtype=`query "$sql0"` filename=${valtype%%//*} filetype=${valtype##*//file:} - err valtype="$valtype" n="$filename" type="$filetype" cacheimg=$dir/$filename sumfile="$cacheimg.sum" tmpf=$tmpd/imgsrc_cache.$$ sum=`query "$sql1" | tee $tmpf | encode` # encode() is maybe sha1 - err cacheimg=$cacheimg - err tmpf=$tmpf - err sumfile=$sumfile if [ x"`cat $sumfile`" = x"$sum" ]; then - # cache is fresh + # if cache is fresh, echo "<img src=\"$cacheimg\">" else fmt=${filename##*.} cat $tmpf | unhexize \ - | convert -define ${fmt}:size=${MAXSIZE}x${MAXSIZE} \ - -resize ${MAXSIZE}x${MAXSIZE}'>' - $cacheimg & + | convert -define ${fmt}:size=${maxiconxy}x${maxiconxy} \ + -resize ${maxiconxy}x${maxiconxy}'>' - $cacheimg & printf '%s' "<img src=\"data:${filetype}," cat $tmpf | sed 's/\(..\)/%\1/g' echo '">' echo "$sum" > $sumfile fi - # "$td" "SELECT hex(bin) FROM user_m $sqcond LIMIT 1;" ) showhome() { @@ -1536,7 +1531,7 @@ and type like 'file:%';" err nfile-sql=`echo "$sql"` nfile=`query "$sql"` - err nfile=$nfile + # err nfile=$nfile if [ $nfile -gt 0 ]; then conflink="$conflink / <a href=\"?lsmyfile\">過去の提出ファイル</a>" @@ -1937,7 +1932,6 @@ val=`getvalbyid grp profimg $rowid $tmpd` enticond="gname=$qgrp AND key='profimg' AND type LIKE 'file:image%'" img=`query "SELECT type FROM grp_m WHERE $enticond LIMIT 1;"` - err iiiiiiiiiimg=$img enticond="$enticond" if [ -n "$img" ]; then cat<<-EOF <p class="groupimg">