s4

view s4.cgi @ 154:75598f2d3118

TEST: blog_showentry2 - constructing loop by output from single SQL
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 29 Dec 2015 09:50:35 +0859
parents ae68666b6949
children daf3f670b5c2
line source
1 #!/bin/sh
2 # 愛
3 mydir=`dirname $0`
4 . $mydir/s4-funcs.sh
6 cgiinit
7 if [ -z "$guestonlymode" ]; then
8 if [ x"$1" = x"reg" ]; then
9 contenttype; echo
10 regist $2
11 putfooter
12 exit
13 fi
15 dologin
16 fi
18 case ${SERVER_SOFTWARE} in
19 bozohttp*) # Ugly workaround for bozohttpd, which can't send
20 # two or more arguments.
21 set -- `echo "$@"|(IFS=+ read a b c d e f g; echo $a $b $c $d $e $f $g)`
22 ;;
23 esac
25 # err 1=$1 2=$2 3=$3 4=$4
26 stage=`getpar stage`
27 stage=${stage:-$1}
28 case ${stage} in
29 home|"")
30 contenttype; echo
31 err HOME: just in rowid=`getpar rowid`
32 [ -n "`getpar rowid`" ] && par2table $formdir/user.def
33 showhome ${2:-$user}
34 ;;
35 login)
36 contenttype; echo
37 myargs=""
38 showlogin
39 ;;
40 # "edittable")
41 # contenttype; echo
42 # m4 -D_TITLE_="グループ編集/削除" $layout/html.m4.html
43 # edittable "$formdir/$2.def" "$2" "$3"
44 # ;;
45 "showattc")
46 shift
47 showattc "$@"
48 exit 0 # Do not output further chunks
49 ;;
50 invite|groupman|userconf|groupconf|mems|grps|grp|groupupdate|grpaction|joingrpadmit|commission|editheading|editart|showattc|send2mem)
51 contenttype; echo
52 [ -n "$1" ] && shift
53 $stage "$@"
54 ;;
55 "blog") # $2=grpID
56 contenttype; echo
57 . ./s4-blog.sh
58 blog_addentry $2
59 ;;
60 "replyblog")
61 contenttype; echo
62 rowid=${2%%[!A-Z0-9a-z_]*}
63 ## err ROWid=$rowid, '$2'=$2
64 . ./s4-blog.sh
65 err blog_reply2 $rowid
66 BLOG_SHOW=blog_showentry2 blog_reply $rowid
67 ;;
68 lshandout|gethandout)
69 if [ x"$stage" = x"lshandout" ]; then
70 contenttype; echo
71 fi
72 rowid=${2%%[!A-Z0-9a-z_]*}
73 if [ -z "$rowid" ]; then
74 echo "話題番号が未指定です。" | html p
75 return
76 fi
77 . ./s4-blog.sh
78 $stage $rowid
79 ;;
80 lsmyfile)
81 contenttype; echo
82 . ./s4-blog.sh
83 shift
84 $stage "$@"
85 ;;
86 "searchart") # $2=blogowner
87 contenttype; echo
88 m4 -D_TITLE_="検索結果" $layout/html.m4.html
89 . ./s4-blog.sh
90 searchart $2
91 ;;
92 *)
93 exec $0 login
94 ;;
95 esac
97 putfooter