]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blame - channels/index.php
Probably good idea not to hammer older UnrealIRCd's (adds a usleep..)
[irc/unrealircd/unrealircd-webpanel.git] / channels / index.php
CommitLineData
90dc8f2b 1<?php
a44ced16 2require_once "../common.php";
e77b1514
BM
3require_once "../connection.php";
4require_once "../header.php";
90dc8f2b
VP
5
6if (!empty($_POST))
7{
8 do_log($_POST);
9
10 /* Nothing being posted yet */
11
12}
13
14$channels = $rpc->channel()->getAll();
15
16?>
0d846731 17<h4>Channels Overview</h4><br>
f41baac8 18<table class="container-xxl table table-sm table-responsive caption-top table-striped">
d1d9caa9 19 <thead class="table-primary">
90dc8f2b 20 <th>Name</th>
f2a87326 21 <th>Users</th>
90dc8f2b 22 <th>Modes</th>
f2a87326
BM
23 <th>Topic</th>
24 <th>Created</th>
def32bb1
BM
25</thead>
26<tbody>
90dc8f2b 27 <?php
5a054690
M
28 $columns = array_column($channels, 'num_users');
29 array_multisort($columns, SORT_DESC, $channels);
30
90dc8f2b
VP
31 foreach($channels as $channel)
32 {
33 echo "<tr>";
d9a581b9 34 echo "<td><a href=\"details.php?chan=".urlencode(htmlspecialchars($channel->name))."\">".htmlspecialchars($channel->name)."</a></td>";
973aa0cb
VP
35 $s = ($channel->num_users) ? "success" : "danger";
36 echo "<td><span class=\"badge rounded-pill badge-$s\">".$channel->num_users."</span></td>";
90dc8f2b 37 $modes = (isset($channel->modes)) ? "+" . $channel->modes : "<none>";
11b7f7e4
BM
38 echo "<td>".htmlspecialchars($modes)."</td>";
39 $topic = (isset($channel->topic)) ? htmlspecialchars($channel->topic) : "";
f2a87326
BM
40 echo "<td>".$topic."</td>";
41 echo "<td>".$channel->creation_time."</td>";
f41baac8 42 echo "</tr>";
90dc8f2b 43 }
809f7483
VP
44
45 require_once("../footer.php");
def32bb1
BM
46 ?>
47</tbody>
48</table>