• R/O
  • HTTP
  • SSH
  • HTTPS

openlab: コミット

一般公開のマテリアル保存のためのリポジトリ


コミットメタ情報

リビジョン72a1965819a932bd7e4ce6218695b880677575f9 (tree)
日時2021-02-24 01:09:41
作者Mitsuaki Kawamura <kawamitsuaki@gmai...>
コミッターMitsuaki Kawamura

ログメッセージ

backup

変更サマリ

差分

--- a/http/bbs/index.php
+++ b/http/bbs/index.php
@@ -107,7 +107,7 @@ $(function() {
107107 <h2>コメント</h2>
108108
109109 <?php if (!empty($rows)): ?>
110- <ul>
110+ <ol>
111111 <?php foreach ($rows as $row): ?>
112112 <?php if ($row[2] == 'text'): ?>
113113 <li><?=$row[1]?> (<?=$row[2]?> by <?=$row[0]?> at <?=$row[3]?>)</li>
@@ -119,7 +119,7 @@ $(function() {
119119 <li><a href="<?=$row[1]?>"><?=$row[1]?></a> (<?=$row[2]?> by <?=$row[0]?> at <?=$row[3]?>)</li>
120120 <?php endif; ?>
121121 <?php endforeach; ?>
122- </ul>
122+ </ol>
123123 <?php else: ?>
124124 <p>コメントはまだありません。</p>
125125 <?php endif; ?>
--- a/http/submit/index.php
+++ b/http/submit/index.php
@@ -8,28 +8,30 @@
88 $uploadfile = $submitid . "_" . $_FILES['avatar']['name'];
99 $thisurl = (empty($_SERVER["HTTPS"]) ? "http://" : "https://") . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
1010
11- $rssxml = fopen('rss.xml', 'w');
12- fwrite($rssxml, "<?xml version='1.0' encoding='UTF-8'?>\n");
13- fwrite($rssxml, "<rss version='2.0'>\n");
14- fwrite($rssxml, " <channel>\n");
15- fwrite($rssxml, " <title>身の回りにある結晶を投稿してみよう</title>\n");
16- fwrite($rssxml, " <link>" . $thisurl . "</link>\n");
17- fwrite($rssxml, " <description></description>\n");
18- fwrite($rssxml, " <item>\n");
19- fwrite($rssxml, " <title>" . $_POST['name'] . " がコメントしました。</title>\n");
20- fwrite($rssxml, " <link>" . $thisurl . "</link>\n");
21- fwrite($rssxml, " <guid>" . $thisurl . "#". $submitid . "</guid>\n");
22- fwrite($rssxml, " <description></description>\n");
23- fwrite($rssxml, " <pubDate>" . $submittime . "</pubDate>\n");
24- fwrite($rssxml, " </item>\n");
25- fwrite($rssxml, " </channel>\n");
26- fwrite($rssxml, "</rss>\n");
27- fclose($rssxml);
28-
29- fputcsv($fp, [$_POST['name'], $uploadfile, $_POST['comment'], $submittime, $submitid]);
30- move_uploaded_file($_FILES['avatar']['tmp_name'], $uploadfile);
31- chmod($uploadfile, 0777);
32- rewind($fp);
11+ if($_FILES['avatar']['name'] != '') {
12+ $rssxml = fopen('rss.xml', 'w');
13+ fwrite($rssxml, "<?xml version='1.0' encoding='UTF-8'?>\n");
14+ fwrite($rssxml, "<rss version='2.0'>\n");
15+ fwrite($rssxml, " <channel>\n");
16+ fwrite($rssxml, " <title>身の回りにある結晶を投稿してみよう</title>\n");
17+ fwrite($rssxml, " <link>" . $thisurl . "</link>\n");
18+ fwrite($rssxml, " <description></description>\n");
19+ fwrite($rssxml, " <item>\n");
20+ fwrite($rssxml, " <title>" . $_POST['name'] . " がコメントしました。</title>\n");
21+ fwrite($rssxml, " <link>" . $thisurl . "</link>\n");
22+ fwrite($rssxml, " <guid>" . $thisurl . "#". $submitid . "</guid>\n");
23+ fwrite($rssxml, " <description></description>\n");
24+ fwrite($rssxml, " <pubDate>" . $submittime . "</pubDate>\n");
25+ fwrite($rssxml, " </item>\n");
26+ fwrite($rssxml, " </channel>\n");
27+ fwrite($rssxml, "</rss>\n");
28+ fclose($rssxml);
29+
30+ fputcsv($fp, [$_POST['name'], $uploadfile, $_POST['comment'], $submittime, $submitid]);
31+ move_uploaded_file($_FILES['avatar']['tmp_name'], $uploadfile);
32+ chmod($uploadfile, 0777);
33+ rewind($fp);
34+ }
3335 }
3436
3537 while ($row = fgetcsv($fp)) {
旧リポジトリブラウザで表示