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

39 lines
804 B

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