32 lines
865 B
PHP
32 lines
865 B
PHP
<?php
|
|
require(__DIR__ . "/../libs/header.php");
|
|
|
|
page_header();
|
|
$msgs = json_decode(file_get_contents('https://mcp.dervland.net/messages'), true);
|
|
?>
|
|
<h2>Scraftia (<a href='/' class='link'>Home</a>)</h2>
|
|
<?php
|
|
foreach ($msgs as $msg) {
|
|
$sys = ($msg['username'] == ':system');
|
|
$classes = '';
|
|
if ($sys && str_contains($msg['content'],'joined ')) $classes = 'joiner';
|
|
if ($sys && str_contains($msg['content'],'left ')) $classes = 'leaver';
|
|
?>
|
|
<div class="comment <?php echo $classes ?>">
|
|
<div class="avatar">
|
|
<div>
|
|
<div><b>
|
|
<?php echo htmlspecialchars($sys ? 'System User' : $msg['username']); ?>
|
|
</b></div>
|
|
<div><b>
|
|
<?php echo date(DATE_RFC2822, $msg['date'] * 0.001); ?>
|
|
</b></div>
|
|
</div>
|
|
</div>
|
|
<?php echo htmlspecialchars($msg['content']); ?>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
page_footer();
|
|
?>
|