# HG changeset patch # User HIROSE Yuuji # Date 1555149656 -32400 # Node ID 591838015ac3908158225c7d16496ae78f145f17 # Parent 4a33f5424767e13e04346876055657f2f0be0245 Put inaccessible mark on such attached file icon. diff -r 4a33f5424767 -r 591838015ac3 examples/common/default/default.css --- a/examples/common/default/default.css Sat Apr 13 18:28:20 2019 +0900 +++ b/examples/common/default/default.css Sat Apr 13 19:00:56 2019 +0900 @@ -147,6 +147,9 @@ div.noprofimg tr.profimg:hover, div.noprofimg tr.profimg:active { visibility: visible; display: table-row;} +/* Used for overlapping image */ +img.overlap {position: absolute; top: 40px; left: 50px; z-index: 2;} + /* Used in user's home page */ p.profimg {float: left; max-width: 50%; max-height: 400px; overflow: hidden; margin: 0 1em 1ex; @@ -294,7 +297,7 @@ rgba(242,240,240,0.7); position: relative; } -div.search div.fr {position: relative;} +div.search div.fr, *.relative {position: relative;} div.search p.help, textarea + p.help {display: none;} div.search input:focus + p.help, textarea:focus + p.help { diff -r 4a33f5424767 -r 591838015ac3 s4-blog.sh --- a/s4-blog.sh Sat Apr 13 18:28:20 2019 +0900 +++ b/s4-blog.sh Sat Apr 13 19:00:56 2019 +0900 @@ -119,6 +119,7 @@ ts=${tbl}_s tm=${tbl}_m at=article as=article_s am=article_m serial=$(($(date +%s)-1420038000))s$$ + cannotread='
(読み取り不可)
' blog_writable $rowid $user rc=$? if [ $rc = 0 ]; then @@ -158,17 +159,20 @@ else # if writable isgrpowner "$user" "$blogowner" && isgrpadmin=true # (*1) fi - case `getvalbyid blog notify "$2"` in # "all", "admin" or "no" (or NULL) + case `getvalbyid blog notify "$rowid"` in # "all", "admin" or "no" (or NULL) admin) notifyto=1 ;; *) notifyto="" ;; esac + case `getvalbyid blog mode "$rowid"` in + *quiz*|*close*) f_exclusive=1 ;; + *) f_exclusive='' ;; + esac # err "SELECT id from $tbl where rowid=$rowid" id=`query "select id from $tbl where rowid=$rowid;"` #err id=$id #err "select val from $ts where key='title' and id='$id';" - #(1)Display root article cat< @@ -275,6 +279,12 @@ s.TIME, CASE WHEN s.TIME > '$atime' THEN 'new' ELSE '' END newer, hex(s.TEXT), + CASE -- File Accessibility to attached file + WHEN '$f_exclusive' = '' THEN '' + WHEN '$isgrpadmin' = 'true' THEN '' + WHEN '$user' = author THEN '' + ELSE 'Unreadable' + END cannotread, (SELECT group_concat(rowid||':'||length(bin)||':'||hex(val), ' ') FROM article_m WHERE id=a.id AND key='image') imxgids @@ -286,12 +296,16 @@ a_s s ON a.id=s.id; EOF - while IFS='|' read id edit notify uid uname icon aid tm new hte imgids; do + while IFS='|' read id edit notify uid uname icon aid tm new hte fa imgids + do cachefile="$td/$id.row.html" stampfile="$td/$id.row.stamp" editlink="${edit:+編集 }" nt="" + # Compute file accessibility of attached file + err "----r=$aid fa=[$fa]----" + # First, check the availability of user-icon. # If not existent, clear and reset row cache by rm $stampfile @@ -368,7 +382,7 @@ fi ;; *) - echo "$fnb" + echo "<__UNREADABLE__>$fnb" ;; esac done @@ -380,6 +394,7 @@ sed -e "/^/s,,${notify:+$nt}," \ + -e "/^<__UNREADABLE__>/s,,${fa:+$cannotread}," \ $cachefile done @@ -459,7 +474,7 @@ } gethandoutcsv2() { # contenttype; echo - SQL=$(cat<<-EOF) gethandoutcsv "$1" + SQL=$(cat<<-EOF WITH this_blog_articles AS ( SELECT rtb.id bid, rtb.brid, a.id aid, author, title, ctime FROM report_type_blogs rtb JOIN article a ON rtb.id=a.blogid @@ -487,6 +502,7 @@ cnt "post" FROM count_list cl JOIN gecoses g ON cl.author=g.name; EOF + ) gethandoutcsv "$1" } lshandout_ulink_table() { # NO Args. Read stdin as SQL