キケッツ掲示板のリポジトリです. https://bbs.kekec.wiki
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

57 lines
1.0 KiB

  1. <?php
  2. require_once __DIR__ . '/../import.php';
  3. use \Dto;
  4. $db = new SQLite3 ('../db.sqlite3');
  5. if (isset ($_GET['page']))
  6. $page = $_GET['page'];
  7. else
  8. $page = 0;
  9. if (isset ($_GET['thread']))
  10. $thread = $_GET['thread'];
  11. else
  12. $thread = -1;
  13. if (isset ($_GET['sort']))
  14. {
  15. $sort = $_GET['sort'];
  16. if (!(in_array ($sort, array ('td', 'eg', 'ta', 'eb'))))
  17. $sort = 'td';
  18. }
  19. else
  20. $sort = 'td';
  21. // 画像のディレクトリを開く.
  22. $dir = './images/';
  23. $handle = opendir ($dir);
  24. if ($row = \Dao\Thread :: find ($db, $thread))
  25. {
  26. $title = $row -> title;
  27. $explain = $row -> explain;
  28. }
  29. if (isset ($_GET['id']))
  30. {
  31. if (($_GET['evaluate'] ?? '') === 'good')
  32. {
  33. \Dao\Response :: like ($db, (int) $_GET['id']);
  34. header ("Location: ./?thread=$thread&sort=$sort");
  35. }
  36. if (($_GET['evaluate'] ?? '') === 'bad')
  37. {
  38. \Dao\Response :: dislike ($db, (int) $_GET['id']);
  39. header ("Location: ./?thread=$thread&sort=$sort");
  40. }
  41. }
  42. require_once './forms/index.frm.php';