annotate s4-blog.sh @ 286:1c4f13f0813e

Add newer article flag representing by time string decoration.
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 15 Aug 2016 11:15:20 +0859
parents fe73fb3f9f35
children 422270e94adc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
1 #
17
01f579d2c889 Rename to s4
HIROSE Yuuji <yuuji@gentei.org>
parents: 16
diff changeset
2 type cgiinit >/dev/null 2>&1 || . ./s4-funcs.sh
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
3
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
4 blog_genform() {
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
5 #
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
6 t=$1
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
7 }
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
8
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
9 blog_writable() (
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
10 # $1=articleid $2=user
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
11 blogowner=`getvalbyid blog owner "$1"`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
12 [ x"$blogowner" = x"$2" ] || isuser "$blogowner" || ismember "$2" "$blogowner"
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
13 )
138
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
14 blog_readable() {
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
15 # $1=articleid $2=user
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
16 mode=`getgroupattr $grp regmode`
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
17 }
50
13f9b5e5df85 subshellize blog_notify_reply
HIROSE Yuuji <yuuji@gentei.org>
parents: 48
diff changeset
18 blog_notify_reply() (
222
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
19 # $1=blogid $2=ReplyingUser $3=WrittenText $4(optional)=Action
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
20 blogowner=`getvalbyid blog owner "$1"`
28
7ae119a14613 Do not send comment notification when author is board owner
HIROSE Yuuji <yuuji@gentei.org>
parents: 17
diff changeset
21 [ x"$2" = x"$blogowner" ] && return # If author=blogowner, unnecessary
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
22 blogtitle=`getvalbyid blog title "$1"`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
23 blogurl="$urlbase?replyblog+$1"
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
24 action=${4:-書き込み}
50
13f9b5e5df85 subshellize blog_notify_reply
HIROSE Yuuji <yuuji@gentei.org>
parents: 48
diff changeset
25 mode=`getvalbyid blog notify "$1"`
238
45b7facac49e Do not exclude submitting user from new article notification.
HIROSE Yuuji <yuuji@gentei.org>
parents: 222
diff changeset
26 ### EXCEPT=`sqlquote "$user"` ## User should receive to feal some annoyance
50
13f9b5e5df85 subshellize blog_notify_reply
HIROSE Yuuji <yuuji@gentei.org>
parents: 48
diff changeset
27 case $mode in
48
837c9a6bec02 Add notification modes
HIROSE Yuuji <yuuji@gentei.org>
parents: 42
diff changeset
28 admin)
55
7f9f7e898986 Do not send notification to the person-self
HIROSE Yuuji <yuuji@gentei.org>
parents: 54
diff changeset
29 if isgroup "$blogowner"; then
117
82e215e75468 Add moderated mode to grp
HIROSE Yuuji <yuuji@gentei.org>
parents: 81
diff changeset
30 emails=`getgroupadminmails $blogowner`
48
837c9a6bec02 Add notification modes
HIROSE Yuuji <yuuji@gentei.org>
parents: 42
diff changeset
31 else
837c9a6bec02 Add notification modes
HIROSE Yuuji <yuuji@gentei.org>
parents: 42
diff changeset
32 emails=`collectemail $blogowner`
837c9a6bec02 Add notification modes
HIROSE Yuuji <yuuji@gentei.org>
parents: 42
diff changeset
33 fi
170
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
34 notifyto=`getpar notifyto`
191
24e0f2b4d51b Variable name mistake fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 189
diff changeset
35 if [ -n "$notifyto" ]; then
170
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
36 emails=$emails" `email4groupbyuid \"$blogowner\" $notifyto`"
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
37 fi
48
837c9a6bec02 Add notification modes
HIROSE Yuuji <yuuji@gentei.org>
parents: 42
diff changeset
38 ;;
837c9a6bec02 Add notification modes
HIROSE Yuuji <yuuji@gentei.org>
parents: 42
diff changeset
39 no) return ;;
222
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
40 *) team=`query "SELECT val FROM blog_s
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
41 WHERE id=(SELECT id FROM blog WHERE rowid=$1)
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
42 AND key='team';"`
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
43 # team cannot get `getvalbyid blog team "$1"` because it's not
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
44 # defined in blog.def. Yes, it is Illegal USE!!
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
45 emails=`TEAM=$team collectemail $blogowner` ;;
48
837c9a6bec02 Add notification modes
HIROSE Yuuji <yuuji@gentei.org>
parents: 42
diff changeset
46 esac
165
4040bb8b2038 quote search kwd. $SMAIL_TO controls To: header value.
HIROSE Yuuji <yuuji@gentei.org>
parents: 162
diff changeset
47 err notify: user=$user Admins=`getgroupadmins $blogowner` Mode=$mode Emails="[$emails]"
168
1dea78110c79 remove newline in to:
HIROSE Yuuji <yuuji@gentei.org>
parents: 167
diff changeset
48 SMAIL_TO="`echo "$blogowner" | nkf -jM | tr -d '\n'` readers <$admin>" \
165
4040bb8b2038 quote search kwd. $SMAIL_TO controls To: header value.
HIROSE Yuuji <yuuji@gentei.org>
parents: 162
diff changeset
49 smail "$emails" "${action}通知 $urlbase"<<EOF
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
50 [$blogtitle]板に${action}がありました。
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
51 場所: $blogurl
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
52 題目: $blogtitle
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
53 筆者: `gecos $2`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
54 内容:
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
55 `echo "$3"|sed 's/^/> /'`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
56 EOF
50
13f9b5e5df85 subshellize blog_notify_reply
HIROSE Yuuji <yuuji@gentei.org>
parents: 48
diff changeset
57 )
192
50e6195130b3 blog_showentry2() is now blog_showentry() (Old code removed)
HIROSE Yuuji <yuuji@gentei.org>
parents: 191
diff changeset
58
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
59 blog_showentry() {
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
60 # $1=table $2=rowid
69
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
61 # if [ -n "$2" ]; then
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
62 # if [ -n "$imgcached" ]; then
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
63 # bstmpdir=$tmpdir/$imgcached/$thumbxy
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
64 # else
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
65 # bstmpdir=$tmpd
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
66 # # tmpd=`mktempd`
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
67 # # tmpfiles=$tmpfiles" $tmpd"
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
68 # fi
d10f98c2b192 form+dump
HIROSE Yuuji <yuuji@gentei.org>
parents: 68
diff changeset
69 # fi
72
3dc3ddd2d3e5 getcachedir argument contains rowid
HIROSE Yuuji <yuuji@gentei.org>
parents: 69
diff changeset
70 td=`getcachedir "article/$2"`
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
71 tbl=${1%%[!A-Z0-9a-z_]*} rowid=${2%%[!A-Z0-9a-z_]*}
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
72 err rowid=$rowid, '$2'=$2
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
73 ts=${tbl}_s tm=${tbl}_m
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
74 at=article as=article_s am=article_m
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
75 serial=$(($(date +%s)-1420038000))s$$
64
54bbd7ce3766 Inhibit non-group-member from *handout
HIROSE Yuuji <yuuji@gentei.org>
parents: 63
diff changeset
76 blog_writable $rowid $user && iswritable=true || iswritable=false
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
77 # This function grasps blog entry definiton directly.
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
78 # blog: id
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
79 # blog_s: title,ctime,heading
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
80 # blog_m: *article
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
81
138
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
82 # 2015-10-05 check readable
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
83 if ! $iswritable; then
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
84 blogowner=`getvalbyid blog owner "$2"`
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
85 # err blogowner=$blogowner
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
86 if isgroup $blogowner; then
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
87 regmode=`getgroupattr $blogowner regmode`
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
88 # err regmode=$regmode
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
89 if [ x"$regmode" = x"moderated" ]; then
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
90 if ! ismember $user $blogowner; then
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
91 echo "加入してからどうぞ" | html p
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
92 return
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
93 fi
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
94 fi
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
95 fi
130114486d8c Blog of moderated group cannot be read by outsider.
HIROSE Yuuji <yuuji@gentei.org>
parents: 134
diff changeset
96 fi
170
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
97 case `getvalbyid blog notify "$2"` in # "all", "admin" or "no" (or NULL)
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
98 admin) notifyto=1 ;;
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
99 *) notifyto="" ;;
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
100 esac
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
101
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
102 err "SELECT id from $tbl where rowid=$rowid"
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
103 id=`query "select id from $tbl where rowid=$rowid;"`
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
104 err id=$id
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
105 err "select val from $ts where key='title' and id='$id';"
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
106
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
107
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
108 #(1)Display root article
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
109 cat<<EOF
239
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
110 <form class="replyblog" action="$myname?replyblog+${rowid}#bottom" method="POST" enctype="multipart/form-data">
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
111 <table class="bloghead">
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
112 EOF
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
113
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
114 href="<a href=\"?editheading+$rowid\"> 編集 </a>"
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
115 if $iswritable; then
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
116 href2="<a href=\"?lshandout+$rowid\"> 提出状況 </a>"
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
117 href3="(<a href=\"?gethandout+$rowid\">ファイル取得</a>)"
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
118 fi
156
d46bce9072cd Add link to '#bottom', recover function of auto href at the
HIROSE Yuuji <yuuji@gentei.org>
parents: 155
diff changeset
119 href4='<a href="#bottom"> 末尾へ</a>'
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
120 cat<<EOF | sq -html $db \
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
121 | sed -e "s|\(<TR><TD>\),e,|\1 $href |" \
161
1b9c98fe0a31 ,s, pattern can be safely replaced
HIROSE Yuuji <yuuji@gentei.org>
parents: 160
diff changeset
122 -e "s|,s,|$href2$href3|" \
204
71a2c840cfd7 fix 1byte transpose bug
HIROSE Yuuji <yuuji@gentei.org>
parents: 193
diff changeset
123 -e "s|,t,\(</TD>\)|$href4\1|"
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
124 -- select val from $ts where key="title" and id="$id";
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
125 select
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
126 coalesce((select ",e," from blog where rowid=$rowid and author='$user'),'')
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
127 ||val||" "
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
128 ||case (select val from $ts where key="mode" and id="$id")
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
129 when 'report-closed' then "レポート提出用(自身のファイルのみ参照可),s,"
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
130 when 'report-open' then "レポート提出用,s,"
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
131 else ""
158
cad3915d4c74 Add mark of #bottom link position
HIROSE Yuuji <yuuji@gentei.org>
parents: 157
diff changeset
132 end || ',t,'
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
133 from $ts where key="ctime" and id="$id";
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
134 select val from $ts where key="heading" and id="$id";
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
135 EOF
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
136 cat<<EOF
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
137 </table>
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
138 <table class="blog_replies">
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
139 EOF
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
140
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
141 lkhome="<a href=\"$myname?home" lke='">'
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
142 lkedit="<a href=\"$myname?editart"
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
143 hlink="$myname?home" elink="$myname?editart"
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
144 catlink="$myname?showattc+article_m"
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
145 deficon="img/file-icon.png"
286
1c4f13f0813e Add newer article flag representing by time string decoration.
HIROSE Yuuji <yuuji@gentei.org>
parents: 283
diff changeset
146 # 2016-08-15 Newer flag introduced
1c4f13f0813e Add newer article flag representing by time string decoration.
HIROSE Yuuji <yuuji@gentei.org>
parents: 283
diff changeset
147 atime=`query "SELECT time FROM acclog
1c4f13f0813e Add newer article flag representing by time string decoration.
HIROSE Yuuji <yuuji@gentei.org>
parents: 283
diff changeset
148 WHERE tbl='blog' AND tblrowid=$rowid AND user='$user';"`
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
149 sq $db<<EOF |
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
150 WITH a_s AS (
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
151 SELECT id,
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
152 max(CASE key WHEN 'ctime' THEN val END) TIME,
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
153 max(CASE key WHEN 'text' THEN val END) TEXT
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
154 FROM article_s
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
155 GROUP by id
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
156 )
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
157 SELECT a.id,
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
158 CASE author
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
159 WHEN '$user' THEN a.rowid||'+'||$rowid
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
160 ELSE ''
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
161 END edit,
170
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
162 CASE -- 「通知送信」ボタンの有無
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
163 WHEN '$notifyto' = '' THEN '' -- 不要モードならなし
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
164 WHEN '$user' = author THEN '' -- 筆者自身ならなし
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
165 ELSE "yes"
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
166 END notify,
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
167 (SELECT rowid FROM user WHERE name=author) user_rid,
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
168 coalesce((SELECT val FROM user_s
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
169 WHERE name=author AND key='gecos'),
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
170 author) uname,
183
b641b5393c40 TEST: Put rowid of article for convenience to reference
HIROSE Yuuji <yuuji@gentei.org>
parents: 170
diff changeset
171 a.rowid,
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
172 s.TIME,
286
1c4f13f0813e Add newer article flag representing by time string decoration.
HIROSE Yuuji <yuuji@gentei.org>
parents: 283
diff changeset
173 CASE WHEN s.TIME > '$atime' THEN 'new' ELSE '' END newer,
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
174 hex(s.TEXT),
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
175 (SELECT group_concat(rowid||':'||length(bin)||':'||hex(val), ' ')
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
176 FROM article_m
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
177 WHERE id=a.id AND key='image') imxgids
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
178 FROM (select rowid,id,author from article where blogid in
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
179 (select id from blog where rowid=$rowid)) a
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
180 LEFT JOIN
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
181 a_s s
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
182 ON a.id=s.id;
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
183 EOF
286
1c4f13f0813e Add newer article flag representing by time string decoration.
HIROSE Yuuji <yuuji@gentei.org>
parents: 283
diff changeset
184 while IFS='|' read id edit notify uid uname aid tm new hte imgids; do
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
185 nt="<label style=\"font-size: 70%;\"><input type=\"checkbox\"
170
45d6954af516 TEST: notifyto button added for evaluation
HIROSE Yuuji <yuuji@gentei.org>
parents: 168
diff changeset
186 name=\"notifyto\" value=\"$uid\">返信通知送信</label>"
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
187 cat<<EOF |
283
fe73fb3f9f35 Duplicated id, fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 282
diff changeset
188 <tr id="$id">
184
6f4fd4fadcfe Move #$aid to the first line of left column
HIROSE Yuuji <yuuji@gentei.org>
parents: 183
diff changeset
189 <td>${edit:+<a href="$elink+$edit">編集</a> }#$aid
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
190 <a href="$hlink+$uid">$uname</a>
286
1c4f13f0813e Add newer article flag representing by time string decoration.
HIROSE Yuuji <yuuji@gentei.org>
parents: 283
diff changeset
191 <span${new:+ class="new"}>$tm</span>
283
fe73fb3f9f35 Duplicated id, fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 282
diff changeset
192 ${notify:+$nt}</td><td id="$aid">`echo "$hte"|unhexize|htmlescape`
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
193 EOF
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
194 hreflink
264
9131c7e09112 Use cache file for article images.
HIROSE Yuuji <yuuji@gentei.org>
parents: 263
diff changeset
195 usecache='' tsfile=$td/$id.stamp
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
196 for i in $imgids; do
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
197 mrid=${i%%:*}; i=${i#*:}; sz=`size_h ${i%%:*}`
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
198 fn=`echo "${i#*:}"|unhexize`
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
199 fnb=$fn"(${sz})"
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
200 # echo r=$mrid fn=$fn
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
201 case "$fn" in
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
202 *.[Pp][Nn][Gg]|*.[Jj][Pp][Gg]|*.[Jj][Pp][Ee][Gg]|*.[Gg][Ii][Ff])
268
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
203 # fmt=${fn##*.} # convert - jpg:- is slow...why
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
204 case "$fn" in
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
205 *.[Pp][Nn][Gg]) fmt=png ;;
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
206 *.[Gg][Ii][Ff]) fmt=gif ;;
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
207 *) fmt=jpeg ;;
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
208 esac
268
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
209 outfile=$td/$mrid-${fn%.*}.$fmt
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
210 #err fn=$fn outfile=$outfile
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
211 #err "usecache=$usecache `ls -l $outfile`"
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
212 #err tm=$tm
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
213 #err tsfile=$tsfile=`cat $tsfile`
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
214 if [ -s $outfile ] && # $outfile should be > 0
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
215 { [ "$usecache" ] || # And usecache flag is true, or...
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
216 { [ -s "$tsfile" ] && [ x"`cat $tsfile`" = x"$tm" ]
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
217 };}; then
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
218 # err Set usecache=1
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
219 usecache=1 # Set usecache flag on
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
220 cat<<-EOF
264
9131c7e09112 Use cache file for article images.
HIROSE Yuuji <yuuji@gentei.org>
parents: 263
diff changeset
221 <a href="$catlink+$mrid"><img src="$outfile">
9131c7e09112 Use cache file for article images.
HIROSE Yuuji <yuuji@gentei.org>
parents: 263
diff changeset
222 $fnb</a>
9131c7e09112 Use cache file for article images.
HIROSE Yuuji <yuuji@gentei.org>
parents: 263
diff changeset
223 EOF
268
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
224 else
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
225 query "SELECT hex(bin) FROM article_m WHERE rowid=$mrid;" \
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
226 | unhexize \
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
227 | convert -define ${fmt}:size=100x100 -resize 100x100'>' \
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
228 - ${fmt}:- \
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
229 | tee "$outfile" \
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
230 | hexize \
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
231 | sed -e 's/\(..\)/%\1/g' \
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
232 -e "s|^|<a href=\"$catlink+$mrid\"><img src=\"data:image/$fmt,|" \
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
233 -e "s|\$|\">$fnb</a>|"
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
234 [ -d $td ] || mkdir -p "$td"
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
235 echo $tm > $tsfile
264
9131c7e09112 Use cache file for article images.
HIROSE Yuuji <yuuji@gentei.org>
parents: 263
diff changeset
236 fi
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
237 ;;
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
238 *)
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
239 echo "<a href=\"$catlink+$mrid\"><img src=\"$deficon\">$fnb</a>"
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
240 ;;
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
241 esac
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
242 done
263
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
243 echo "</td></tr>"
ebd4af16c493 Old blog dumping code based on sq -html, removed entirely
HIROSE Yuuji <yuuji@gentei.org>
parents: 261
diff changeset
244 done
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
245
193
5d83ff0bbd40 Comment area modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 192
diff changeset
246 textform='<div class="fold">
5d83ff0bbd40 Comment area modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 192
diff changeset
247 <input type="checkbox" id="cmt" checked><label for="cmt"
5d83ff0bbd40 Comment area modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 192
diff changeset
248 >コメントする</label><div>
5d83ff0bbd40 Comment area modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 192
diff changeset
249 <table class="b">
5d83ff0bbd40 Comment area modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 192
diff changeset
250 <tr><td><textarea name="text" cols="72" rows="4"></textarea></td></tr>
205
6c63ea1b65d5 Add "accept" attribute to input:type="file"
HIROSE Yuuji <yuuji@gentei.org>
parents: 204
diff changeset
251 <tr><td>添付ファイル:
206
c761ce8ff963 Quoting changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 205
diff changeset
252 <input type="file" name="image"'" $file_accept multiple></td></tr>"'
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
253 </table>
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
254 <input type="submit" value="送信">
193
5d83ff0bbd40 Comment area modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 192
diff changeset
255 <input type="reset" value="リセット"></div></div>
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
256 '
219
e2dea2f63a69 Duplicate posting by reload avoided
HIROSE Yuuji <yuuji@gentei.org>
parents: 208
diff changeset
257 cat<<-EOF
239
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
258 </table> <!-- end of s4-blog:blog_showentry() main table -->
219
e2dea2f63a69 Duplicate posting by reload avoided
HIROSE Yuuji <yuuji@gentei.org>
parents: 208
diff changeset
259 <p class="update_link"><a
e2dea2f63a69 Duplicate posting by reload avoided
HIROSE Yuuji <yuuji@gentei.org>
parents: 208
diff changeset
260 href="?reload/$rowid">再読込</a></p>
e2dea2f63a69 Duplicate posting by reload avoided
HIROSE Yuuji <yuuji@gentei.org>
parents: 208
diff changeset
261 EOF
282
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
262 query<<-EOF
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
263 WITH mrt AS (
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
264 SELECT max(val) maxtime FROM article_s
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
265 WHERE key='ctime' AND id IN
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
266 (SELECT id FROM article
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
267 WHERE blogid=(select id from blog where rowid=$id))
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
268 )
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
269 SELECT 'A:'||
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
270 (SELECT count(*) FROM tblaccesses
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
271 WHERE tbl='blog' AND tblrowid=$id) access,
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
272 'C:'||
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
273 (SELECT count(distinct user) FROM acclog
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
274 WHERE tbl='blog' AND tblrowid=$id
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
275 AND time > (SELECT maxtime from mrt)
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
276 AND user IN
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
277 (SELECT user FROM grp_mem
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
278 WHERE gname = $(sqlquote "$blogowner")))
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
279 ;
e6c1cbe4ffcc Add article-rowid to id of tr(article list)
HIROSE Yuuji <yuuji@gentei.org>
parents: 269
diff changeset
280 EOF
219
e2dea2f63a69 Duplicate posting by reload avoided
HIROSE Yuuji <yuuji@gentei.org>
parents: 208
diff changeset
281 $iswritable && cat<<-EOF
e2dea2f63a69 Duplicate posting by reload avoided
HIROSE Yuuji <yuuji@gentei.org>
parents: 208
diff changeset
282 <div class="blogcomment">
239
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
283 <input type="hidden" name="blogid" value="$id">
268
138da0f3a2e5 Duplicate post by reloading or back+submit, dissolved
HIROSE Yuuji <yuuji@gentei.org>
parents: 264
diff changeset
284 <input type="hidden" name="id" value="`genserial`">
239
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
285 <input type="hidden" name="stage" value="replyblog">
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
286 $textform
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
287 </div>
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
288 </form> <!-- End of s4-blog:blog_showentry() main form -->
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
289 <p id="bottom"> </p>
25e0b1eaf04d Degrade fixed: Explicit notify works again.
HIROSE Yuuji <yuuji@gentei.org>
parents: 238
diff changeset
290 EOF
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
291 # Record access log
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
292 acclog blog $rowid
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
293 }
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
294
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
295 lshandout() {
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
296 # $1=rowid of blog
64
54bbd7ce3766 Inhibit non-group-member from *handout
HIROSE Yuuji <yuuji@gentei.org>
parents: 63
diff changeset
297 if ! blog_writable $1 $user; then
54bbd7ce3766 Inhibit non-group-member from *handout
HIROSE Yuuji <yuuji@gentei.org>
parents: 63
diff changeset
298 echo "メンバー以外は利用できません。" | html p; return
54bbd7ce3766 Inhibit non-group-member from *handout
HIROSE Yuuji <yuuji@gentei.org>
parents: 63
diff changeset
299 fi
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
300 time=`getvalbyid blog ctime $1|colrm 11`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
301 owner=`getvalbyid blog owner $1`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
302 title=`getvalbyid blog title $1`
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
303 ge=`gecos $owner`
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
304 lshandoutsub $owner "$@" \
189
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
305 |_m4 -D_TITLE_="提出状況" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
306 -D_FORMHEAD_="$time [$title]@${ge:-$owner}" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
307 -D_FORM_="syscmd(cat)" -D_DUMPHEAD_= -D_DUMPTABLE_= \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
308 $layout/html.m4.html $layout/form+dump-whead.m4.html
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
309 }
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
310 lshandoutsub() {
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
311 # $1=owner $2=rowid of blog
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
312 if isgroup $1; then
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
313 sample="(select user from grp_mem where gname='$1')"
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
314 else
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
315 sample="(select distinct author as user from arts)"
67
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
316 echo "(集計は板への投稿者のみ)" | html p
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
317 fi
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
318 sql="with arts as (select id,author from article \
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
319 where blogid=(select id from blog where rowid=$2))\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
320 select (select rowid from user where name=c0.user)||' '|| \
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
321 coalesce((select val from user_s where name=c0.user \
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
322 and key='gecos'),\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
323 c0.user) as 'メンバー',\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
324 sum(case when c1.key is not null then 1 else 0 end)\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
325 as 'コメント記入',\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
326 sum(case when c2.key is not null then 1 else 0 end)\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
327 as 'ファイルの提出'\
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
328 from $sample c0 \
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
329 left join (select id,author from arts) a\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
330 on c0.user=a.author\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
331 left join (select id,key from article_s where key='text') c1\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
332 on a.id=c1.id left join (select id,key from article_m ) c2\
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
333 on c1.id=c2.id group by c0.user order by c0.user;"
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
334 err ishandoutsub: sql="$sql"
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
335 echo '<table class="b td2r td3r">'
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
336 hrb="<a href=\"?home+"
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
337 echo "$sql" | sq -header -html $db \
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
338 | sed -e "s,\(<TR><TD>\)\([^ ]*\) \(.*\)</TD>,\1$hrb\2\">\3</TD>," -e 's,<TD>0</TD>,<TD class="warn">0</TD>,'
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
339 echo '</table>'
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
340 }
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
341 gethandout() {
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
342 # $1=rowid of blog
64
54bbd7ce3766 Inhibit non-group-member from *handout
HIROSE Yuuji <yuuji@gentei.org>
parents: 63
diff changeset
343 if ! blog_writable $1 $user; then
54bbd7ce3766 Inhibit non-group-member from *handout
HIROSE Yuuji <yuuji@gentei.org>
parents: 63
diff changeset
344 echo "メンバー以外は利用できません。" | html p; return
54bbd7ce3766 Inhibit non-group-member from *handout
HIROSE Yuuji <yuuji@gentei.org>
parents: 63
diff changeset
345 fi
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
346 i=0
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
347 bd=$tmpd/archive.$$
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
348 mkdir $bd
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
349 query "select m.rowid,author,m.val from article a join article_m m\
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
350 on a.id=m.id where blogid=(select id from blog where rowid=$1)\
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
351 and m.key in ('image', 'document', 'binary');" \
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
352 | while IFS='|' read rowid author filename; do
63
da23cad20e4a Permission check fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 59
diff changeset
353 # err isfilereadable $user article_m $rowid
da23cad20e4a Permission check fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 59
diff changeset
354 isfilereadable $user article_m $rowid || continue
da23cad20e4a Permission check fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 59
diff changeset
355 # err ok
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
356 i=$((i+1))
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
357 dir=`printf $bd/%03d $i`
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
358 mkdir $dir
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
359 query "select quote(bin) from article_m where rowid=$rowid;" \
8
3db7524d3dea Add default images
HIROSE Yuuji <yuuji@gentei.org>
parents: 4
diff changeset
360 | unhexize > $dir/$filename
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
361 done
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
362 if [ ! -d $bd/001 ]; then
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
363 contenttype; echo
67
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
364 echo "取得できるファイルがありませんでした。" | html p
2
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
365 return
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
366 fi
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
367 (cd $bd
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
368 err cdto$bd; (pwd; ls -lFa) 1>&3
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
369 tar zcf .archive.tar.gz * && mv .archive.tar.gz archive.tar.gz
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
370 )
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
371 arc=$bd/archive.tar.gz
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
372 echo "Content-type: application/x-gzip"
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
373 echo "Content-Length: `cat $arc|wc -c`"
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
374 echo "Content-Disposition: filename=\"archive.tar.gz\""
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
375 echo
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
376 cat $arc
7aa52f9874ae .hgignore added
HIROSE Yuuji <yuuji@gentei.org>
parents: 0
diff changeset
377 }
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
378 lsmyfile() { # $1(optional)=SortBy
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
379 case "$1" in
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
380 ""|CTIME-DESC)
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
381 by="CTIME" ord="DESC" ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
382 CTIME*) by="CTIME" ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
383 FILE*) by="FILE" ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
384 OWNER*) by="OWNER" ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
385 TITLE*) by="TITLE" ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
386 esac
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
387 case "$1" in
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
388 *DESC) ord="DESC" ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
389 esac
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
390 case "$ord" in
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
391 DESC) lkod="" jord="降順" ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
392 *) lkod="-DESC" jord="昇順" ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
393 esac
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
394 sql="select m.val||'/'||m.rowid FILE,
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
395 coalesce(
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
396 case when (select name from user where name=bs.owner)
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
397 is not null
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
398 then (select val from user_s where name=bs.owner
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
399 and key='gecos')
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
400 when (select gname from grp where gname=bs.owner)
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
401 is not null
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
402 then (select val from grp_s where gname=bs.owner
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
403 and key='gecos')
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
404 else
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
405 null
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
406 end,
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
407 bs.owner
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
408 ) OWNER,
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
409 a_s.val CTIME,
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
410 ',t,'||bs.title||':'||b.rowid||'#'||a.id TITLE
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
411 from (select rowid,id,val from article_m where id
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
412 in (select id from article where author='$user')
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
413 and type like 'file:%')
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
414 m left join article a on m.id=a.id
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
415 left join article_s a_s on a.id=a_s.id and a_s.key='ctime'
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
416 left join (select id,
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
417 max(case key when 'owner' then val end) as owner,
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
418 max(case key when 'title' then val end) as title
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
419 from blog_s group by id)
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
420 bs on a.blogid=bs.id
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
421 left join blog b on bs.id=b.id
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
422 where m.val is not null order by $by $ord;"
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
423 err lshandoutbyauthor: sql=`echo "$sql"`
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
424 title="個人提出ファイル"
189
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
425 _m4 -D_TITLE_=$title $layout/html.m4.html
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
426 hra="<a href=\"?lsmyfile+"
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
427 hrb="<a href=\"?showattc+article_m+"
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
428 hrc="<a href=\"?replyblog+"
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
429 (echo '<table class="b">'
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
430 echo "$sql"|sq -html -header $db ) \
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
431 | sed -e "s|\(<TR><TD>\)\([^/]*\)/\([0-9]*\)|\1$hrb\3\">\2</a>|" \
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
432 -e "s|,t,\(.*\):\([^<]*\)\(</TD>\)|$hrc\2\">\1</a>\3|" \
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
433 -e "s|\(<TH>\)\([A-Z]*\)\(</TH>\)|\1$hra\2$lkod\">\2</a>|" \
189
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
434 | _m4 -D_TITLE_=$title -D_FORM_="<p>($by$jord)</p>" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
435 -D_DUMPTABLE_="syscmd(cat)" $layout/form+dump.m4.html
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
436 echo '</table>'
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
437 }
78
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
438 searchart() {
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
439 kwd=`getpar kwd`
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
440 if [ -z "$kwd" ]; then
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
441 echo "検索語を指定してください" | html p; return
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
442 fi
165
4040bb8b2038 quote search kwd. $SMAIL_TO controls To: header value.
HIROSE Yuuji <yuuji@gentei.org>
parents: 162
diff changeset
443 for k in `echo "$kwd" | sed "s/'/''/g"`; do
245
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
444 kc=$kc${kc:+" AND "}"s.text LIKE '%$k%'"
165
4040bb8b2038 quote search kwd. $SMAIL_TO controls To: header value.
HIROSE Yuuji <yuuji@gentei.org>
parents: 162
diff changeset
445 done
4040bb8b2038 quote search kwd. $SMAIL_TO controls To: header value.
HIROSE Yuuji <yuuji@gentei.org>
parents: 162
diff changeset
446 kwd=`echo "$kwd"|htmlescape`
78
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
447 owner=`getpar owner`
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
448 owner=${owner:-$1}
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
449 echo "「$kwd」による検索結果" | html p
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
450 if [ -n "$owner" ]; then
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
451 cond="where key='owner' and val='$owner'"
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
452 if isuser $owner; then
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
453 echo "(`linkhome $owner` さんの記録からの検索)" | html p
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
454 else
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
455 linkhome $owner 1>&3
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
456 echo "(`linkhome $owner` グループからの検索)" | html p
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
457 fi
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
458 fi
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
459 # article_s: id=article-id, key='text', val='TEXT'
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
460 # article: id=article-id, blogid=blogkd
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
461 # blog: id=blog-id, author=LeaderAuthor
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
462 # blog_s: id=blog-id, key='title', val='BLOG-TITLE'
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
463 # WANT: blog-ROWid,article-id,val(TEXT)
245
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
464 sql="`sql4readableblogs` -- Extract user-readable blogs
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
465 SELECT b.rid||'#'||x.id as '',
78
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
466 b.title as TITLE,
245
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
467 substr(x.ctime, 0, 11) as DATE,
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
468 substr(x.text, 0, 78) as TEXT
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
469 FROM (SELECT blg.rid,blg.*,bs.val as title
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
470 FROM readableblogs blg join blog_s bs
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
471 ON blg.id=bs.id and bs.key='title') b
78
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
472 join
245
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
473 (SELECT a.id,
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
474 a.blogid,
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
475 s.ctime,
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
476 s.text
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
477 FROM article a
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
478 JOIN
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
479 (SELECT id, /* Create [id, ctime, text] from article_s */
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
480 max(CASE key WHEN 'ctime' THEN val END) ctime,
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
481 max(CASE key WHEN 'text' THEN val END) text
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
482 FROM article_s GROUP BY id) s
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
483 ON a.id=s.id where $kc)
78
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
484 x on b.id=x.blogid
245
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
485 where b.id in (select id from blog_s $cond)
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
486 ORDER by x.ctime DESC;"
78
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
487 sedopt="s,<TR><TD>\([^<]*\)</TD>,<TR><TD><a\
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
488 href=\"?replyblog+\1\">VIEW</a></TD>,"
245
b915381669d6 Do not search from unreadable blogs
HIROSE Yuuji <yuuji@gentei.org>
parents: 239
diff changeset
489
78
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
490 cat<<EOF
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
491 <table class="b searchart">
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
492 `sq -header -html $db "$sql"|sed "$sedopt"`
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
493 </table>
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
494 EOF
0cbbb0874eb5 Code cleaning
HIROSE Yuuji <yuuji@gentei.org>
parents: 72
diff changeset
495 }
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
496 listblog() (
67
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
497 # $1={user,group}
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
498 qow=`sqlquote $1`
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
499 cond="where a.id in (select id from blog_s where key='owner' and val=$qow) order by ctime desc"
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
500 DT_CHLD=article:blogid
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
501 cgi_form searchart<<EOF
128
42234d2d6e9c Add Full-Range search
HIROSE Yuuji <yuuji@gentei.org>
parents: 122
diff changeset
502 <label>`cgi_text kwd`という語を含む記事をこの一覧から検索</label>
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
503 `cgi_hidden owner $user`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
504 EOF
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
505 dumptable html blog 'ctime title heading' "$cond"
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
506 )
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
507
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
508 blog_addentry() {
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
509 # $1=GRPname(if it is a group)
16
636df1c1bdf2 Track group by rowid in URLs
HIROSE Yuuji <yuuji@gentei.org>
parents: 13
diff changeset
510 grprowid=$1
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
511 rowid=`getpar rowid`
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
512 err blog_addentry0: rowid=$rowid
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
513 if [ -n "$grprowid" ]; then
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
514 owner=`getgroupbyid $grprowid`
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
515 else
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
516 owner=`getpar owner`
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
517 fi
122
0681534f9451 When deleting group, remove all blos that belong it.
HIROSE Yuuji <yuuji@gentei.org>
parents: 117
diff changeset
518 err blog-add: \$1=$1 rowid=$rowid owner=$owner
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
519 if isgroup $owner; then
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
520 groupmode=1 listing=$owner guide="[${owner}]" GF_OWNER=$owner
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
521 else
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
522 usermode=1 listing=$user guide="[個人]"
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
523 fi
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
524
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
525 if [ -n "`getpar title`" ]; then
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
526 if [ "$usermode" ]; then
122
0681534f9451 When deleting group, remove all blos that belong it.
HIROSE Yuuji <yuuji@gentei.org>
parents: 117
diff changeset
527 err usermode: user=$user owner=$owner
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
528 if [ x"$user" != x"$owner" ]; then
67
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
529 echo "他人の日記は書けません" | html p
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
530 return 2
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
531 fi
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
532 elif [ "$groupmode" ]; then # if write to group log
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
533 grp=$owner #\`getpar grp\`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
534 err ismember: $user $grp
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
535 if ! ismember "$user" "$grp"; then
67
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
536 echo "(話題作成はこのグループに加入してから)" | html p
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
537 return 3
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
538 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
539 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
540 par2table $formdir/blog.def
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
541 serial=`getpar serial`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
542 err SERIAL: $serial ROWID=$rowid listing=$listing
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
543 id=""
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
544 if [ -n "$rowid" ]; then
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
545 # Here, id becomes NULL when removal of entries at par2table
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
546 id=`query "select rowid from blog where rowid=$rowid;"`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
547 elif [ -n "$serial" ]; then
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
548 # If new blog leader created, traverse to its head.
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
549 id=`query "select rowid from blog where id='$serial';"`
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
550 err new-Leader: "select rowid from blog where id='$serial';" id=$id
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
551 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
552 if [ -n "$id" ]; then
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
553 ## If new aritcle is entered, JUMP to blog_reply
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
554 blog_reply $id
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
555 return
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
556 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
557 fi
81
ddc8a4c0b8d9 All macro-expanding by m4 bypassed via syscmd or spaste
HIROSE Yuuji <yuuji@gentei.org>
parents: 80
diff changeset
558 echo "${guide}新規話題作成" > $tmpd/title.$$
ddc8a4c0b8d9 All macro-expanding by m4 bypassed via syscmd or spaste
HIROSE Yuuji <yuuji@gentei.org>
parents: 80
diff changeset
559 listblog $listing > $tmpd/listblog.$$
ddc8a4c0b8d9 All macro-expanding by m4 bypassed via syscmd or spaste
HIROSE Yuuji <yuuji@gentei.org>
parents: 80
diff changeset
560 genform $formdir/blog.def \
189
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
561 | _m4 -D_TITLE_="spaste(\`$tmpd/title.$$')" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
562 -D_FORMHEAD_="序文は簡単に詳しくはコメントに" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
563 -D_DUMPHEAD_="これまでの蓄積" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
564 -D_FORM_="syscmd(\`cat')" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
565 -D_DUMPTABLE_="spaste(\`$tmpd/listblog.$$')" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
566 $layout/html.m4.html \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
567 $layout/form+dump-whead.m4.html
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
568 }
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
569
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
570 blog_reply() {
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
571 rowid=$1
222
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
572 err rowid=$1
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
573
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
574 if [ -z "$rowid" ]; then
67
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
575 echo "表示する日記番号が未指定です。" | html p
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
576 return
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
577 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
578 title=`getvalbyid blog title $rowid`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
579 owner=`getvalbyid blog owner $rowid`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
580 if isuser "$owner"; then
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
581 subtitle="`gecos $owner` さんの話題"
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
582 else
16
636df1c1bdf2 Track group by rowid in URLs
HIROSE Yuuji <yuuji@gentei.org>
parents: 13
diff changeset
583 grprowid=`query "select rowid from grp where gname=\"$owner\";"`
222
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
584 subtitle="グループ <a href=\"?grp+$grprowid\">$owner</a> での話題
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
585 `query \"SELECT printf('(チーム:%s)', val)\
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
586 FROM blog_s
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
587 WHERE id=(SELECT id FROM blog WHERE rowid=$rowid)
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
588 AND key='team';
d320c73bf16f Add "team" attributes in groups.
HIROSE Yuuji <yuuji@gentei.org>
parents: 219
diff changeset
589 \"|htmlescape`"
259
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
590 qgrp=`sqlquote "$owner"`
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
591 sql="SELECT coalesce(
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
592 (SELECT val FROM grp_s WHERE gname=$qgrp AND key='regmode'),
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
593 'open')
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
594 ||
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
595 CASE WHEN '$user'
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
596 IN (SELECT user FROM grp_mem WHERE gname=$qgrp)
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
597 THEN ' ismember'
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
598 ELSE ''
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
599 END"
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
600 memclass=`query "$sql;"`
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
601 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
602 if [ -z "$title" ]; then
67
3b70f847277e Rearrangement
HIROSE Yuuji <yuuji@gentei.org>
parents: 64
diff changeset
603 echo "日記番号指定が無効です。" | html p
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
604 return
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
605 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
606
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
607 text=`getpar text`
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
608 if [ -n "$text" ]; then
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
609 if blog_writable $rowid $user; then
80
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
610 par2table $formdir/article.def
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
611 st=$? # ; err par2t-st=$st
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
612 case $st in
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
613 0|4)
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
614 [ "$st" = "4" ] && act="書込削除"
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
615 blog_notify_reply $rowid $user "$text" $act ;;
39e69daa2071 New feature "lsmyfile" added
HIROSE Yuuji <yuuji@gentei.org>
parents: 78
diff changeset
616 esac
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
617 else
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
618 title="$title(加入してないので書き込み不可)"
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
619 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
620 fi
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
621 def=$formdir/article.def
81
ddc8a4c0b8d9 All macro-expanding by m4 bypassed via syscmd or spaste
HIROSE Yuuji <yuuji@gentei.org>
parents: 80
diff changeset
622 echo "$title" > $tmpd/title.$$
ddc8a4c0b8d9 All macro-expanding by m4 bypassed via syscmd or spaste
HIROSE Yuuji <yuuji@gentei.org>
parents: 80
diff changeset
623 echo "$subtitle" > $tmpd/subtitle.$$
154
75598f2d3118 TEST: blog_showentry2 - constructing loop by output from single SQL
HIROSE Yuuji <yuuji@gentei.org>
parents: 138
diff changeset
624 ${BLOG_SHOW:-blog_showentry} blog $rowid \
259
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
625 | _m4 -D_TITLE_="spaste(\`$tmpd/title.$$')" \
85a001a9c7c5 Make it visible: the group is moderated; the user is a member of the group
HIROSE Yuuji <yuuji@gentei.org>
parents: 250
diff changeset
626 -D_BODYCLASS_=general"${memclass:+ $memclass}" \
189
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
627 -D_FORMHEAD_="spaste(\`$tmpd/subtitle.$$')" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
628 -D_FORM_='' \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
629 -D_DUMPTABLE_="syscmd(cat)" -D_DUMPHEAD_="" \
972cb5ab0c5f Rename m4 to _m4
HIROSE Yuuji <yuuji@gentei.org>
parents: 184
diff changeset
630 $layout/html.m4.html $layout/form+dump-whead.m4.html
0
b8a890828283 add se-blog.sh se-cgi.sh se-funcs.sh se-init.sh mpsplit.rb
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
631 }

yatex.org