-
Notifications
You must be signed in to change notification settings - Fork 1
/
irc.php
83 lines (67 loc) · 2.13 KB
/
irc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
require 'lib/function.php';
if (!$config['irc-servers'] || !$config['irc-channels']) {
header("Location: index.php");
die;
}
pageheader("IRC Chat");
// Pick a server, 0 to show server selection
$_GET['server'] = filter_int($_GET['server']);
if (!isset($config['irc-servers'][$_GET['server']])) $_GET['server'] = 0;
?> <table class='table'>
<tr><td class='tdbgh center b'>
IRC Chat - <?=$config['irc-server-title']?>, <?=implode(",", $config['irc-channels'])?>
</td></tr>
<tr>
<td class='tdbg1 center'>
Server List:
<?php
foreach ($config['irc-servers'] as $num => $name) {
if ($num != 1) print " | ";
if ($_GET['server'] == $num) print "<u>";
print "<a href='irc.php?server={$num}'>{$name}</a>";
if ($_GET['server'] == $num) print "</u>";
if ($num == 1) print " (preferred)";
}
?> </td>
</tr>
<tr>
<td class='tdbg2 center' <?= $_GET['server'] ? "style=\"background: #FFF\"" : "" ?>>
<?php
if ($_GET['server']) {
$badchars = array("~", "&", "@", "?", "!", ".", ",", "=", "+", "%", "*");
$name = str_replace(" ", "", $loguser['name']);
$name = str_replace($badchars, "_", $name);
if (!$name) {
$name = "J-Guest";
$guestmsg = "<br>Welcome, guest. When you connect to the IRC network, please use the command <tt>/nick NICKNAME</tt>.<br> <br>";
}
?>
<iframe src="https://kiwiirc.com/client/<?=$config['irc-servers'][$_GET['server']]?>/?nick=<?=$name?>|?<?=implode(",", $config['irc-channels'])?>" style="border:0;width:100%;height:500px;"></iframe>
<?php
} else {
?> <br>
Please choose a server to connect to.<br>
<?php
}
?> </td>
</tr>
</table>
<br>
<table class='table'>
<tr><td class='tdbgh center b'>Quick Help</td></tr>
<tr>
<td class='tdbg1'>
Commands:
<br><tt>/nick [name]</tt> - changes your name
<br><tt>/me [action]</tt> - does an action (try it)
<br><tt>/msg [name] [message]</tt> - send a private message to another user
<br><tt>/join [#channel]</tt> - joins a channel
<br><tt>/part [#channel]</tt> - leaves a channel
<br><tt>/quit [message]</tt> - obvious
</td>
</tr>
</table>
<?php
pagefooter();