3 * Name: IRC Chat Plugin
4 * Description: add an Internet Relay Chat chatroom
6 * Author: tony baldwin <https://free-haven.org/profile/tony>
9 /* enable in admin->plugins
10 * you will then have "irc chatroom" listed at yoursite/apps
11 * and the app will run at yoursite/irc
12 * documentation at http://tonybaldwin.me/hax/doku.php?id=friendica:irc
15 function irc_install() {
16 register_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
19 function irc_uninstall() {
20 unregister_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
24 function irc_app_menu($a,&$b) {
25 $b['app_menu'][] = '<div class="app-title"><a href="irc">' . t('IRC Chatroom') . '</a></div>';
29 function irc_module() {
34 function irc_content(&$a) {
36 $baseurl = $a->get_baseurl() . '/addon/irc';
39 $chats = array('friendica','chat','chatback','hottub','ircbar','dateroom','teentalk');
42 $a->page['aside'] .= '<div class="widget"><h3>' . t('Popular Channels') . '</h3><ul>';
43 foreach($chats as $chat) {
44 $a->page['aside'] .= '<li><a href="' . $a->get_baseurl() . '/irc?channels=' . $chat . '" >' . '#' . $chat . '</a></li>';
46 $a->page['aside'] .= '</ul></div>';
52 $channels = ((x($_GET,'channels')) ? $_GET['channels'] : 'friendica');
54 /* add the chatroom frame and some html
55 * by altering the "channels=friendica" part of the URL, you can add/remove channels.
56 * At free-haven.org, I have "?channels=friendica,free-haven", for instance, to open #friendica and #free-haven
60 <p><a href="http://tldp.org/HOWTO/IRC/beginners.html" target="_blank">A beginner's guide to using IRC. [en]</a></p>
61 <iframe src="http://webchat.freenode.net?channels=$channels" width="600" height="600"></iframe>