utterooms/index.php

19 lines
1.7 KiB
PHP

<?php include "utset.php";$style="<body style='text-align:center;font-family:sans-serif;padding:10px;'>";$footer="<footer style='font-family:monospace;margin:5px 0 0 0'>Based on <a href='http://ctrl-c.club/~cenalene/comments.php'>Comments</a> (by <a href='http://ctrl-c.club/~cenalene/'>Cenalene</a>)<br>By <a href=''>~lucas</a> - <a href='https://tildegit.org/lucas/utterooms'>Source</a> - <a href='?rules'>Rules</a></footer></body></html>"; if(isset($_GET["room"])){
$a=count($public_boards)-1;$ao=0;$next=$a+1;
while($ao < count($public_boards)){
if($_GET["room"]==$public_boards[$a][0]){ ?>
<!DOCTYPE html><html><head><title><?php echo "#".$_GET["room"]." | Utterooms</title><meta property='og:title' content='".$_GET['room']."'>"; ?></head><?php echo $style ?><h1><?php echo "#".$_GET["room"]; ?></h1><p><?php echo $public_boards[$a][1] ?></p><script src='https://utteranc.es/client.js' repo='<?php echo $utterepo; ?>' issue-term='og:title' theme='github-light' crossorigin='anonymous' async></script></body></html>
<?php $room_y=True;}
$a--; $ao++; $next--;
}
if(isset($room_y)){}else{die("no");}
}elseif(isset($_GET["rules"])){ echo "<!DOCTYPE html><html><head><title>Rules | Utterooms</title></head>$style<h1>Utterules</h1><p>$rules</p>$footer";
}else{ ?>
<!DOCTYPE html><html><head><title>Utterooms</title></head><?php echo $style ?><h1>Utterooms</h1><p><?php
$ao=0;
while($ao < count($public_boards)){
echo "<p><b><a href='?room=".$public_boards[$ao][0]."'>#".$public_boards[$ao][0]."</a></b> ".$public_boards[$ao][1]."</p>";
$ao++;
} echo "</p><script src='https://utteranc.es/client.js' repo='$utterepo' issue-term='og:title' theme='github-light' crossorigin='anonymous' async></script>$footer";
} ?>