]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - channels/index.php
2 require_once "../inc/common.php";
3 require_once "../inc/connection.php";
4 require_once "../inc/header.php";
10 /* Nothing being posted yet */
14 $channels = $rpc->channel()->getAll();
17 <h4
>Channels Overview
</h4
><br
>
18 <table
class="container-xxl table table-sm table-responsive caption-top table-striped">
19 <thead
class="table-primary">
22 <th
class="modescol">Modes
</th
>
23 <th
class="topiccol">Topic
</th
>
24 <th
class="createdcol">Created
</th
>
28 $columns = array_column($channels, 'num_users');
29 array_multisort($columns, SORT_DESC
, $channels);
31 foreach($channels as $channel)
34 echo "<td><a href=\"details.php?chan=".urlencode(htmlspecialchars($channel->name
))."\">".htmlspecialchars($channel->name
)."</a></td>";
35 $s = ($channel->num_users
) ? "success" : "danger";
36 echo "<td><span class=\"badge rounded-pill badge-$s\">".$channel->num_users
."</span></td>";
37 $modes = (isset($channel->modes
)) ? "+" . explode(" ",$channel->modes
)[0] : "<none>";
38 echo "<td class=\"modescol\">".
39 "<span data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"+".htmlspecialchars($channel->modes
)."\">".
40 htmlspecialchars($modes)."</span></td>";
41 $topic = (isset($channel->topic
)) ? htmlspecialchars($channel->topic
) : "";
42 echo "<td class=\"topiccol\" style=\"overflow:hidden;\">".$topic."</td>";
43 $date = explode("T", $channel->creation_time
)[0];
44 echo "<td class=\"createdcol\" style=\"white-space:nowrap\">".
45 "<span data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"".$channel->creation_time
."\">".
50 require_once("../inc/footer.php");
55 function resize_check()
57 var width
= window
.innerWidth
;
58 var show_elements
= '';
59 var hide_elements
= '';
62 show_elements
= '.createdcol';
63 hide_elements
= '.modescol, .topiccol';
67 show_elements
= '.createdcol, .topiccol';
68 hide_elements
= '.modescol';
71 show_elements
= '.createdcol, .modescol, .topiccol';
75 if (show_elements
!= '')
77 show_elements
=document
.querySelectorAll(show_elements
);
78 for (let i
= 0; i
< show_elements
.length
; i++
)
79 show_elements
[i
].style
.display
= '';
82 if (hide_elements
!= '')
84 hide_elements
=document
.querySelectorAll(hide_elements
);
85 for (let i
= 0; i
< hide_elements
.length
; i++
)
86 hide_elements
[i
].style
.display
= 'none';
90 window
.addEventListener('resize', function() {