ニジカもんすたぁ!! トップ・ページ https://nizika.monster
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.
 
 
 
 

42 lines
889 B

  1. <?php
  2. if ($_SERVER['HTTP_HOST'] === 'nizika.monster')
  3. header ('location: //nizika.tv');
  4. const LOG_PATH = './log.txt';
  5. $log_data = [];
  6. $page = (int) ($_GET['p'] ?? 1);
  7. $length = (int) ($_GET['max'] ?? 20);
  8. $asc = ($_GET['asc'] ?? 0) != 0;
  9. $f = fopen (LOG_PATH, 'r');
  10. if ($f !== false)
  11. {
  12. while (($dt = fgetcsv ($f, 0, "\t")) !== false)
  13. {
  14. $chat_info = json_decode ($dt[1]);
  15. $log_data[] = ['date_time' => $dt[0],
  16. 'chat_icon' => $chat_info -> author -> imageUrl,
  17. 'chat_name' => $chat_info -> author -> name,
  18. 'chat_message' => $chat_info -> message,
  19. 'answer' => $dt[2]];
  20. }
  21. }
  22. fclose ($f);
  23. unset ($f);
  24. $pages_max = (int) (count ($log_data) / $length);
  25. if (!($asc))
  26. $log_data = array_reverse ($log_data);
  27. require_once './index.frm.php';