Advertisement
craftyoyo

jsonapi console

Jun 1st, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. <?php
  2. header("Content-Type: text/html; charset=utf-8");
  3. require "jsonconnect.php";
  4. $console = $api->call("getLatestConsoleLogsWithLimit", array(43));
  5. $console = $console[0]["success"];
  6.  
  7. //$console = array_reverse($console);
  8.  
  9.  
  10. $console = array_slice($console, 0, 100);
  11. $date = date("Y-m-d");
  12. foreach ($console as $value) {
  13.     $console = $value["line"];
  14.     $console = str_replace($date, '', $console);
  15.     $msg_prefix = array("[INFO]", "[WARNING]", "[SEVERE]", "Disconnecting", "craftyoyo", "No0bak", "[m<", "[m ");
  16.     $color_prefix = array('<span style="color: #537dff;">[INFO]</span>',
  17.     '<span style="background-color: red; color: white; font-weight: bold; ">[WARNING]</span>', '<span style="color: red;">[SEVERE]</span>',
  18.      '<span style="color: magenta;">[Disconnecting]</span>', '<span style="color: yellow;">[craftyoyo]</span>', '<span style="color: rgb(173, 0, 255);">[No0bak]</span>','','');
  19.  
  20.     $console = str_replace($msg_prefix, $color_prefix, $console);
  21.     echo "<div style='line-height:20px'>".$console."<br/></div>";
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement