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

index.php 1.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 ($result = $mysqli -> query ("SELECT * FROM threads WHERE id = $thread"))
  26. {
  27. $row = $result -> fetch_assoc ();
  28. $title = $row['title'];
  29. $explain = $row['explain'];
  30. $result -> close ();
  31. }
  32. if (isset ($_GET['id'])
  33. && isset ($_GET['evaluate'])
  34. && (($_GET['evaluate'] == 'good') || ($_GET['evaluate'] == 'bad')))
  35. {
  36. $mysqli -> query ("
  37. UPDATE
  38. responses
  39. SET
  40. {$_GET['evaluate']} = {$_GET['evaluate']} + 1
  41. WHERE
  42. (thread_id = $thread) AND (response_id = {$_GET['id']})");
  43. header ("Location: ./?thread=$thread&sort=$sort");
  44. }
  45. require_once './forms/index.frm.php';