|
- <?php
-
- require_once __DIR__ . '/../import.php';
-
- use \Dto;
-
-
- $db = new SQLite3 ('../db.sqlite3');
-
- if (isset ($_GET['page']))
- $page = $_GET['page'];
- else
- $page = 0;
-
- if (isset ($_GET['thread']))
- $thread = $_GET['thread'];
- else
- $thread = -1;
-
- if (isset ($_GET['sort']))
- {
- $sort = $_GET['sort'];
-
- if (!(in_array ($sort, array ('td', 'eg', 'ta', 'eb'))))
- $sort = 'td';
- }
- else
- $sort = 'td';
-
- // 画像のディレクトリを開く.
- $dir = './images/';
- $handle = opendir ($dir);
-
- if ($row = \Dao\Thread :: find ($db, $thread))
- {
- $title = $row -> title;
- $explain = $row -> explain;
- }
-
- if (isset ($_GET['id']))
- {
- if (($_GET['evaluate'] ?? '') === 'good')
- {
- \Dao\Response :: like ($db, (int) $_GET['id']);
- header ("Location: ./?thread=$thread&sort=$sort");
- }
-
- if (($_GET['evaluate'] ?? '') === 'bad')
- {
- \Dao\Response :: dislike ($db, (int) $_GET['id']);
- header ("Location: ./?thread=$thread&sort=$sort");
- }
- }
-
- require_once './forms/index.frm.php';
|