s4
changeset 146:3d0de7bdbf40
Profile image
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Mon, 30 Nov 2015 09:02:38 +0859 |
parents | 3b34c52fa4f0 |
children | b3d8a389e7a8 |
files | examples/common/default/default.css examples/common/default/home.m4.html s4-funcs.sh |
diffstat | 3 files changed, 18 insertions(+), 0 deletions(-) [+] |
line diff
1.1 --- a/examples/common/default/default.css Thu Nov 05 21:59:46 2015 +0859 1.2 +++ b/examples/common/default/default.css Mon Nov 30 09:02:38 2015 +0859 1.3 @@ -75,6 +75,11 @@ 1.4 .blog_replies td:nth-child(2) { 1.5 vertical-align: top; min-width: 30em; height: 3em; 1.6 } 1.7 +p.profimg {float: left; max-width: 400px; max-height: 400px; 1.8 + overflow: hidden; margin-right: 1em; 1.9 + padding: 0; border: white 1px solid; box-shadow: 2px 3px 4px 1.10 + } 1.11 +div.home+* {clear: both;} 1.12 1.13 div.fold {margin-top: 1em; border-top: 1px solid black; padding-top: 1em;} 1.14 div.fold > div {
2.1 --- a/examples/common/default/home.m4.html Thu Nov 05 21:59:46 2015 +0859 2.2 +++ b/examples/common/default/home.m4.html Mon Nov 30 09:02:38 2015 +0859 2.3 @@ -1,4 +1,5 @@ 2.4 <h1>_TITLE_</h1> 2.5 +<p class="profimg">_PROFIMG_</p> 2.6 <div class="home"> 2.7 _PROFILE_ 2.8 </div>
3.1 --- a/s4-funcs.sh Thu Nov 05 21:59:46 2015 +0859 3.2 +++ b/s4-funcs.sh Mon Nov 30 09:02:38 2015 +0859 3.3 @@ -1360,10 +1360,22 @@ 3.4 tf=$tmpd/title.$$ pf=$tmpd/profile.$$ bf=$tmpd/blogs.$$ 3.5 echo "$gecos さん" > $tf 3.6 viewtable $formdir/user.def user $1 > $pf 3.7 + 3.8 + sqcond="WHERE name='$user' AND key='profimg' AND type LIKE 'file:image%'" 3.9 + img=`query "SELECT type FROM user_m $sqcond LIMIT 1;"` 3.10 + imf=tmp/profimg; touch $imf 3.11 + if [ -n "$img" ]; then 3.12 + { printf '%s' "<img width=\"400\" src=\"data:${img#file:}," 3.13 + query "SELECT hex(bin) FROM user_m $sqcond LIMIT 1;" \ 3.14 + | sed 's/\(..\)/%\1/g' 3.15 + echo '"' 3.16 + } > $imf 3.17 + fi 3.18 listblog $uname > $bf 3.19 listgroupbytable $formdir/grp.def $cond \ 3.20 | m4 -D_BODYCLASS_=home -D_TITLE_="spaste(\`$tf')" \ 3.21 -D_PROFILE_="spaste(\`$pf')$conflink" \ 3.22 + -D_PROFIMG_="spaste(\`$imf')" \ 3.23 -D_BLOGS_="spaste(\`$bf')" \ 3.24 -D_GROUPS_="syscmd(\`cat')" \ 3.25 $layout/html.m4.html $layout/home.m4.html