colors for jhoin/leave
This commit is contained in:
parent
e55bed4fc9
commit
267282aa81
2 changed files with 14 additions and 2 deletions
|
@ -7,12 +7,16 @@ $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">
|
||||
<div class="comment <?php echo $classes ?>">
|
||||
<div class="avatar">
|
||||
<div>
|
||||
<div><b>
|
||||
<?php echo htmlspecialchars($msg['username']); ?>
|
||||
<?php echo htmlspecialchars($sys ? 'System User' : $msg['username']); ?>
|
||||
</b></div>
|
||||
<div><b>
|
||||
<?php echo date(DATE_RFC2822, $msg['date'] * 0.001); ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue