|
|
@@ -5,6 +5,8 @@ require_once __DIR__ . '/../import.php'; |
|
|
|
use \Dto; |
|
|
|
|
|
|
|
|
|
|
|
$db = new SQLite3 ('../db.sqlite3'); |
|
|
|
|
|
|
|
if (isset ($_GET['page'])) |
|
|
|
$page = $_GET['page']; |
|
|
|
else |
|
|
@@ -29,7 +31,7 @@ else |
|
|
|
$dir = './images/'; |
|
|
|
$handle = opendir ($dir); |
|
|
|
|
|
|
|
if ($row = \Dao\Thread :: find ($thread)) |
|
|
|
if ($row = \Dao\Thread :: find ($db, $thread)) |
|
|
|
{ |
|
|
|
$title = $row -> title; |
|
|
|
$explain = $row -> explain; |
|
|
@@ -39,13 +41,13 @@ if (isset ($_GET['id'])) |
|
|
|
{ |
|
|
|
if (($_GET['evaluate'] ?? '') === 'good') |
|
|
|
{ |
|
|
|
\Dao\Response :: like ((int) $_GET['id']); |
|
|
|
\Dao\Response :: like ($db, (int) $_GET['id']); |
|
|
|
header ("Location: ./?thread=$thread&sort=$sort"); |
|
|
|
} |
|
|
|
|
|
|
|
if (($_GET['evaluate'] ?? '') === 'bad') |
|
|
|
{ |
|
|
|
\Dao\Response :: dislike ((int) $_GET['id']); |
|
|
|
\Dao\Response :: dislike ($db, (int) $_GET['id']); |
|
|
|
header ("Location: ./?thread=$thread&sort=$sort"); |
|
|
|
} |
|
|
|
} |
|
|
|