| 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 = ? |
|---|
| 76 |
"; |
|---|
| 77 |
|
|---|
| 78 |
$rs = sql_query($con, $query, "DBクエリに失敗しました",array($pid)); |
|---|
| 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 = $_POST["textarea"]; |
|---|
| 133 |
$maintext = pg_escape_string($maintext); |
|---|
| 134 |
|
|---|
| 135 |
$rate = getform(rank4); |
|---|
| 136 |
|
|---|
| 137 |
switch ($rate) { |
|---|
| 138 |
case -2: |
|---|
| 139 |
$ratechara = "× "; |
|---|
| 140 |
break; |
|---|
| 141 |
case -1: |
|---|
| 142 |
$ratechara = "▲ "; |
|---|
| 143 |
break; |
|---|
| 144 |
case 0: |
|---|
| 145 |
$ratechara = "− "; |
|---|
| 146 |
break; |
|---|
| 147 |
case 1: |
|---|
| 148 |
$ratechara = "★ "; |
|---|
| 149 |
break; |
|---|
| 150 |
case 2: |
|---|
| 151 |
$ratechara = "★★ "; |
|---|
| 152 |
break; |
|---|
| 153 |
case 3: |
|---|
| 154 |
$ratechara = "★★★ "; |
|---|
| 155 |
break; |
|---|
| 156 |
case 4: |
|---|
| 157 |
$ratechara = "★★★★ "; |
|---|
| 158 |
break; |
|---|
| 159 |
default: |
|---|
| 160 |
$ratechara = "− "; |
|---|
| 161 |
} |
|---|
| 162 |
$subject = $ratechara . $subject; |
|---|
| 163 |
|
|---|
| 164 |
print "". htmlspecialchars(stripslashes( $subject)) ."\n"; |
|---|
| 165 |
print "". stripslashes( $maintext) ."<br />\n"; |
|---|
| 166 |
print "<br />\n"; |
|---|
| 167 |
print "本文(source view):<br />". htmlspecialchars(stripslashes( $maintext)) ."<hr><br /><br /><br />\n"; |
|---|
| 168 |
|
|---|
| 169 |
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>"; |
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
}else{ |
|---|
| 173 |
//タイトル |
|---|
| 174 |
if ($tid == 0){ |
|---|
| 175 |
$subjects = "「".$subtitle."」"; |
|---|
| 176 |
}else{ |
|---|
| 177 |
if ($countno == ""){ |
|---|
| 178 |
$subjects = "$title 「".$subtitle."」"; |
|---|
| 179 |
}else{ |
|---|
| 180 |
$subjects = "$title #". $countno ." 「".$subtitle."」"; |
|---|
| 181 |
} |
|---|
| 182 |
} |
|---|
| 183 |
print "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"./sb-edit.php?pid=$pid&f=$filename\"> |
|---|
| 184 |
<input type=\"text\" name=\"subject\" size=\"70\"value=\"$subjects \"><br /> |
|---|
| 185 |
<select class='hosi' name='rank4' size='1'> |
|---|
| 186 |
<option value='-2'>×見切り |
|---|
| 187 |
<option value='-1'>▲見切り候補 |
|---|
| 188 |
<option value='0'>−見てない |
|---|
| 189 |
<option value='1' selected=\"selected\">★ふつう |
|---|
| 190 |
<option value='2'>★★おもしろい |
|---|
| 191 |
<option value='3'>★★★名作 |
|---|
| 192 |
<option value='4'>★★★★殿堂 |
|---|
| 193 |
</select> |
|---|
| 194 |
<br /> |
|---|
| 195 |
<br /> |
|---|
| 196 |
<input type=\"hidden\" name=\"preview\" value=\"1\" /> |
|---|
| 197 |
|
|---|
| 198 |
<textarea name=\"textarea\" rows=\"40\" cols=\"55\"> |
|---|
| 199 |
"; |
|---|
| 200 |
if ($tid > 0){ |
|---|
| 201 |
print " |
|---|
| 202 |
<br /> |
|---|
| 203 |
参考リンク:<a href = \"http://cal.syoboi.jp/tid/$tid/\" target=\"_blank\"> $title</a> "; |
|---|
| 204 |
if ($countno != ""){ |
|---|
| 205 |
print "第". $countno ."話 "; |
|---|
| 206 |
} |
|---|
| 207 |
print"<a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a> (情報:<a href = \"http://cal.syoboi.jp/\">しょぼいカレンダー</a>)"; |
|---|
| 208 |
} |
|---|
| 209 |
print " </textarea><br /> |
|---|
| 210 |
<input type=submit value=\" ブレビュー \"> |
|---|
| 211 |
</form> |
|---|
| 212 |
|
|---|
| 213 |
"; |
|---|
| 214 |
} |
|---|
| 215 |
/* |
|---|
| 216 |
ToDo |
|---|
| 217 |
・Formプレビュー |
|---|
| 218 |
・パブリッシュボタン |
|---|
| 219 |
・ |
|---|
| 220 |
*/ |
|---|
| 221 |
|
|---|
| 222 |
// タイトル一覧 ここまで |
|---|
| 223 |
} |
|---|
| 224 |
|
|---|
| 225 |
?> |
|---|
| 226 |
|
|---|
| 227 |
</body> |
|---|
| 228 |
</html> |
|---|
| 229 |
|
|---|