キケッツ掲示板のリポジトリです. 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.1 KiB

  1. <?php
  2. require_once "${_SERVER['DOCUMENT_ROOT']}/database.php";
  3. if (isset ($_GET['page']))
  4. $page = $_GET['page'];
  5. else
  6. $page = 0;
  7. if (isset ($_GET['thread']))
  8. $thread = $_GET['thread'];
  9. else
  10. $thread = -1;
  11. if (isset ($_GET['sort']))
  12. {
  13. $sort = $_GET['sort'];
  14. if (!(in_array ($sort, array ('td', 'eg', 'ta', 'eb'))))
  15. $sort = 'td';
  16. }
  17. else
  18. $sort = 'td';
  19. // 画像のディレクトリを開く.
  20. $dir = './images/';
  21. $handle = opendir ($dir);
  22. // MySQL 宣言
  23. $mysqli = set_mysql ('miteruzo_bbs');
  24. $mysqli -> set_charset ('utf8');
  25. if ($row = Dao\Thread -> find ($thread))
  26. {
  27. $title = $row -> title;
  28. $explain = $row -> explain;
  29. }
  30. if (isset ($_GET['id'])
  31. && isset ($_GET['evaluate'])
  32. && (($_GET['evaluate'] == 'good') || ($_GET['evaluate'] == 'bad')))
  33. {
  34. $mysqli -> query ("
  35. UPDATE
  36. responses
  37. SET
  38. {$_GET['evaluate']} = {$_GET['evaluate']} + 1
  39. WHERE
  40. (thread_id = $thread) AND (response_id = {$_GET['id']})");
  41. header ("Location: ./?thread=$thread&sort=$sort");
  42. }
  43. require_once './forms/index.frm.php';