1 |
<?php |
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 |
|
---|
17 |
|
---|
18 |
include("./foltialib.php"); |
---|
19 |
$con = m_connect(); |
---|
20 |
|
---|
21 |
if ($useenvironmentpolicy == 1){ |
---|
22 |
if (!isset($_SERVER['PHP_AUTH_USER'])) { |
---|
23 |
header("WWW-Authenticate: Basic realm=\"foltia\""); |
---|
24 |
header("HTTP/1.0 401 Unauthorized"); |
---|
25 |
redirectlogin(); |
---|
26 |
exit; |
---|
27 |
} else { |
---|
28 |
login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']); |
---|
29 |
} |
---|
30 |
} |
---|
31 |
|
---|
32 |
|
---|
33 |
$pid = getgetform(pid); |
---|
34 |
$filename = getgetform(f); |
---|
35 |
|
---|
36 |
if (($pid == "") ||($filename == "")) { |
---|
37 |
header("Status: 404 Not Found",TRUE,404); |
---|
38 |
} |
---|
39 |
?> |
---|
40 |
|
---|
41 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
---|
42 |
<html lang="ja"> |
---|
43 |
<head> |
---|
44 |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> |
---|
45 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
---|
46 |
<link rel="stylesheet" type="text/css" href="graytable.css"> |
---|
47 |
<title>Starlight Breaker -編集</title> |
---|
48 |
</head> |
---|
49 |
<body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > |
---|
50 |
<div align="center"> |
---|
51 |
|
---|
52 |
<?php |
---|
53 |
printhtmlpageheader(); |
---|
54 |
|
---|
55 |
if (($pid == "") ||($filename == "")) { |
---|
56 |
print "画像がありません。<br></body></html>"; |
---|
57 |
exit; |
---|
58 |
} |
---|
59 |
|
---|
60 |
|
---|
61 |
$query = " |
---|
62 |
SELECT |
---|
63 |
foltia_program.tid, |
---|
64 |
stationname, |
---|
65 |
foltia_program.title, |
---|
66 |
foltia_subtitle.countno, |
---|
67 |
foltia_subtitle.subtitle, |
---|
68 |
foltia_subtitle.startdatetime , |
---|
69 |
foltia_subtitle.lengthmin , |
---|
70 |
foltia_subtitle.pid , |
---|
71 |
foltia_subtitle.m2pfilename , |
---|
72 |
foltia_subtitle.pspfilename |
---|
73 |
FROM foltia_subtitle , foltia_program ,foltia_station |
---|
74 |
WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid |
---|
75 |
AND foltia_subtitle.pid = '$pid' |
---|
76 |
|
---|
77 |
"; |
---|
78 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
79 |
$rows = pg_num_rows($rs); |
---|
80 |
if ($rows == 0){ |
---|
81 |
print " <p align=\"left\"><font color=\"#494949\" size=\"6\">書き込み編集</font></p> |
---|
82 |
<hr size=\"4\"> |
---|
83 |
<p align=\"left\"> |
---|
84 |
録画記録がありません。<br> |
---|
85 |
"; |
---|
86 |
|
---|
87 |
}else{ |
---|
88 |
$rowdata = pg_fetch_row($rs, 0); |
---|
89 |
|
---|
90 |
print " <p align=\"left\"><font color=\"#494949\" size=\"6\">書き込み編集 </font></p> |
---|
91 |
<hr size=\"4\"> |
---|
92 |
<p align=\"left\">"; |
---|
93 |
print "<a href = \"http://cal.syoboi.jp/tid/$rowdata[0]/\" target=\"_blank\">"; |
---|
94 |
$title = htmlspecialchars($rowdata[2]); |
---|
95 |
$countno = htmlspecialchars($rowdata[3]); |
---|
96 |
print "$title</a> $countno " ; |
---|
97 |
|
---|
98 |
$tid = $rowdata[0]; |
---|
99 |
$subtitle = htmlspecialchars($rowdata[4]) ; |
---|
100 |
if ($tid > 0){ |
---|
101 |
print "<a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a> "; |
---|
102 |
}else{ |
---|
103 |
print "$subtitle "; |
---|
104 |
} |
---|
105 |
print htmlspecialchars($rowdata[1]) . " "; |
---|
106 |
print htmlspecialchars($rowdata[6]) . "分 "; |
---|
107 |
print htmlspecialchars(foldate2print($rowdata[5])); |
---|
108 |
print "<br /><br />"; |
---|
109 |
$mp4filename = $rowdata[9]; |
---|
110 |
$serverfqdn = getserverfqdn(); |
---|
111 |
|
---|
112 |
|
---|
113 |
$m2pfilename = $rowdata[8]; |
---|
114 |
|
---|
115 |
list($tid,$countno,$date,$time)= split ("-", $m2pfilename ); |
---|
116 |
$tid = ereg_replace("[^0-9]", "", $tid); |
---|
117 |
|
---|
118 |
$path = ereg_replace("\.m2p$", "", $m2pfilename); |
---|
119 |
$serveruri = getserverfqdn (); |
---|
120 |
|
---|
121 |
print "</div>\n"; |
---|
122 |
|
---|
123 |
|
---|
124 |
|
---|
125 |
print "<img src='http://$serveruri$httpmediamappath/$tid.localized/img/$path/$filename' width='160' height='120' alt='$tid:$countno:$filetid' align=\"left\">\n"; |
---|
126 |
|
---|
127 |
|
---|
128 |
if (getform(preview) == 1){ |
---|
129 |
|
---|
130 |
|
---|
131 |
$subject = getform(subject); |
---|
132 |
$maintext = getform(textarea); |
---|
133 |
|
---|
134 |
$rate = getform(rank4); |
---|
135 |
|
---|
136 |
switch ($rate) { |
---|
137 |
case -2: |
---|
138 |
$ratechara = "× "; |
---|
139 |
break; |
---|
140 |
case -1: |
---|
141 |
$ratechara = "▲ "; |
---|
142 |
break; |
---|
143 |
case 0: |
---|
144 |
$ratechara = "− "; |
---|
145 |
break; |
---|
146 |
case 1: |
---|
147 |
$ratechara = "★ "; |
---|
148 |
break; |
---|
149 |
case 2: |
---|
150 |
$ratechara = "★★ "; |
---|
151 |
break; |
---|
152 |
case 3: |
---|
153 |
$ratechara = "★★★ "; |
---|
154 |
break; |
---|
155 |
case 4: |
---|
156 |
$ratechara = "★★★★ "; |
---|
157 |
break; |
---|
158 |
default: |
---|
159 |
$ratechara = "− "; |
---|
160 |
} |
---|
161 |
$subject = $ratechara . $subject; |
---|
162 |
|
---|
163 |
print "". htmlspecialchars(stripslashes( $subject)) ."\n"; |
---|
164 |
print "". stripslashes( $maintext) ."<br />\n"; |
---|
165 |
print "<br />\n"; |
---|
166 |
print "本文(source view):<br />". htmlspecialchars(stripslashes( $maintext)) ."<hr><br /><br /><br />\n"; |
---|
167 |
|
---|
168 |
print "<form id=\"form2\" name=\"form2\" method=\"post\" action=\"./sb-write.php?tid=$tid&path=$path&f=$filename\"><input type=\"password\" name=\"blogpw\">[ <a href = \"./sb-write.php?tid=$tid&path=$path&f=$filename\" target=\"_blank\">Send Picture Only</a> ] [ <input type=\"hidden\" name=\"subjects\" value=\"" . urlencode(stripslashes($subject)) . "\" /><input type=\"hidden\" name=\"maintext\" value=\"" . urlencode(stripslashes($maintext)) . "\" /><input type=submit value=\" Blog Write \"> ]</form>"; |
---|
169 |
|
---|
170 |
|
---|
171 |
}else{ |
---|
172 |
//タイトル |
---|
173 |
if ($tid == 0){ |
---|
174 |
$subjects = "「".$subtitle."」"; |
---|
175 |
}else{ |
---|
176 |
if ($countno == ""){ |
---|
177 |
$subjects = "$title 「".$subtitle."」"; |
---|
178 |
}else{ |
---|
179 |
$subjects = "$title #". $countno ." 「".$subtitle."」"; |
---|
180 |
} |
---|
181 |
} |
---|
182 |
print "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"./sb-edit.php?pid=$pid&f=$filename\"> |
---|
183 |
<input type=\"text\" name=\"subject\" size=\"70\"value=\"$subjects \"><br /> |
---|
184 |
<select class='hosi' name='rank4' size='1'> |
---|
185 |
<option value='-2'>×見切り |
---|
186 |
<option value='-1'>▲見切り候補 |
---|
187 |
<option value='0'>−見てない |
---|
188 |
<option value='1' selected=\"selected\">★ふつう |
---|
189 |
<option value='2'>★★おもしろい |
---|
190 |
<option value='3'>★★★名作 |
---|
191 |
<option value='4'>★★★★殿堂 |
---|
192 |
</select> |
---|
193 |
<br /> |
---|
194 |
<br /> |
---|
195 |
<input type=\"hidden\" name=\"preview\" value=\"1\" /> |
---|
196 |
|
---|
197 |
<textarea name=\"textarea\" rows=\"40\" cols=\"55\"> |
---|
198 |
"; |
---|
199 |
if ($tid > 0){ |
---|
200 |
print " |
---|
201 |
<br /> |
---|
202 |
参考リンク:<a href = \"http://cal.syoboi.jp/tid/$tid/\" target=\"_blank\"> $title</a> "; |
---|
203 |
if ($countno != ""){ |
---|
204 |
print "第". $countno ."話 "; |
---|
205 |
} |
---|
206 |
print"<a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a> (情報:<a href = \"http://cal.syoboi.jp/\">しょぼいカレンダー</a>)"; |
---|
207 |
} |
---|
208 |
print " </textarea><br /> |
---|
209 |
<input type=submit value=\" ブレビュー \"> |
---|
210 |
</form> |
---|
211 |
|
---|
212 |
"; |
---|
213 |
} |
---|
214 |
/* |
---|
215 |
ToDo |
---|
216 |
・Formプレビュー |
---|
217 |
・パブリッシュボタン |
---|
218 |
・ |
---|
219 |
*/ |
---|
220 |
|
---|
221 |
// タイトル一覧 ここまで |
---|
222 |
} |
---|
223 |
|
---|
224 |
?> |
---|
225 |
|
---|
226 |
</body> |
---|
227 |
</html> |
---|
228 |
|
---|