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 diff
     1.1 --- a/examples/common/default/default.css	Sun Oct 16 21:59:43 2016 +0859
     1.2 +++ b/examples/common/default/default.css	Sun Oct 16 22:38:33 2016 +0859
     1.3 @@ -101,7 +101,8 @@
     1.4  table.mini {margin-left: 1em; border-left: 2px solid #686;}
     1.5  
     1.6  tr.profimg {visibility: collapse;}
     1.7 -tr:hover + tr.profimg, tr:active + tr.profimg {visibility: visible;}
     1.8 +tr:hover + tr.profimg, tr:active + tr.profimg, tr.profimg:hover {
     1.9 +    visibility: visible;}
    1.10  
    1.11  p.profimg {float: left; max-width: 50%; max-height: 400px;
    1.12  	   overflow: hidden; margin: 0 1em 1ex;
     2.1 --- a/s4-funcs.sh	Sun Oct 16 21:59:43 2016 +0859
     2.2 +++ b/s4-funcs.sh	Sun Oct 16 22:38:33 2016 +0859
     2.3 @@ -25,6 +25,7 @@
     2.4  dumpcollen=22
     2.5  #thumbxy=120x120
     2.6  thumbxy=96x96
     2.7 +maxiconxy=400x400
     2.8  maximagexy=1600x1600
     2.9  ### maximagexy=400x400
    2.10  file_accept='accept="image/*,text/*,audio/*,application/vnd.oasis.*,application/pdf,application/x-*"'
    2.11 @@ -1482,36 +1483,30 @@
    2.12    # $1 = directory for cache'ing
    2.13    # $2 = table
    2.14    # $3 = condition for choosingowner
    2.15 -  MAXSIZE=400
    2.16 -  dir="$1" tbl="$2" whos="$3"
    2.17 +  dir="$1" tbl="$2" whos="$3 ORDER BY rowid LIMIT 1"
    2.18    [ -d "$dir" ] || mkdir $dir
    2.19 -  sql0="SELECT val || '//' || type FROM $tbl WHERE $whos ORDER BY rowid LIMIT 1;"
    2.20 -  sql1="SELECT hex(bin) FROM $tbl WHERE $whos ORDER BY rowid LIMIT 1;"
    2.21 +  sql0="SELECT val || '//' || type FROM $tbl WHERE $whos;"
    2.22 +  sql1="SELECT hex(bin) FROM $tbl WHERE $whos;"
    2.23    valtype=`query "$sql0"`
    2.24    filename=${valtype%%//*}
    2.25    filetype=${valtype##*//file:}
    2.26 -  err valtype="$valtype" n="$filename" type="$filetype"
    2.27    cacheimg=$dir/$filename
    2.28    sumfile="$cacheimg.sum"
    2.29    tmpf=$tmpd/imgsrc_cache.$$
    2.30    sum=`query "$sql1" | tee $tmpf | encode`	# encode() is maybe sha1
    2.31 -  err cacheimg=$cacheimg
    2.32 -  err tmpf=$tmpf
    2.33 -  err sumfile=$sumfile
    2.34    if [ x"`cat $sumfile`" = x"$sum" ]; then
    2.35 -    # cache is fresh
    2.36 +    # if cache is fresh,
    2.37      echo "<img src=\"$cacheimg\">"
    2.38    else
    2.39      fmt=${filename##*.}
    2.40      cat $tmpf | unhexize \
    2.41 -	| convert -define ${fmt}:size=${MAXSIZE}x${MAXSIZE} \
    2.42 -		  -resize ${MAXSIZE}x${MAXSIZE}'>' - $cacheimg &
    2.43 +	| convert -define ${fmt}:size=${maxiconxy}x${maxiconxy} \
    2.44 +		  -resize ${maxiconxy}x${maxiconxy}'>' - $cacheimg &
    2.45      printf '%s' "<img src=\"data:${filetype},"
    2.46      cat $tmpf | sed 's/\(..\)/%\1/g'
    2.47      echo '">'
    2.48      echo "$sum" > $sumfile
    2.49    fi
    2.50 -  # "$td" "SELECT hex(bin) FROM user_m $sqcond LIMIT 1;"
    2.51  )
    2.52  
    2.53  showhome() {
    2.54 @@ -1536,7 +1531,7 @@
    2.55  		and type like 'file:%';"
    2.56      err nfile-sql=`echo "$sql"`
    2.57      nfile=`query "$sql"`
    2.58 -    err nfile=$nfile
    2.59 +    # err nfile=$nfile
    2.60      if [ $nfile -gt 0 ]; then
    2.61        conflink="$conflink /
    2.62  	<a href=\"?lsmyfile\">過去の提出ファイル</a>"
    2.63 @@ -1937,7 +1932,6 @@
    2.64    val=`getvalbyid grp profimg $rowid $tmpd`
    2.65    enticond="gname=$qgrp AND key='profimg' AND type LIKE 'file:image%'"
    2.66    img=`query "SELECT type FROM grp_m WHERE $enticond LIMIT 1;"`
    2.67 -  err iiiiiiiiiimg=$img enticond="$enticond"
    2.68    if [ -n "$img" ]; then
    2.69      cat<<-EOF
    2.70  	<p class="groupimg">