]> git.mxchange.org Git - friendica-addons.git/blob - irc/irc.php
pass IRC channel through url, allows simpler default choice.
[friendica-addons.git] / irc / irc.php
1 <?php
2 /**
3 * Name: IRC Chat Plugin
4 * Description: add an Internet Relay Chat chatroom
5 * Version: 1.0
6 * Author: tony baldwin <https://free-haven.org/profile/tony>
7 */
8
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
13  */
14
15 function irc_install() {
16 register_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
17 }
18
19 function irc_uninstall() {
20 unregister_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
21
22 }
23
24 function irc_app_menu($a,&$b) {
25 $b['app_menu'][] = '<div class="app-title"><a href="irc">' . t('irc Chatroom') . '</a></div>';
26 }
27
28
29 function irc_module() {
30 return;
31 }
32
33
34 function irc_content(&$a) {
35
36 $baseurl = $a->get_baseurl() . '/addon/irc';
37 $o = '';
38
39 $channels = ((x($_GET,'channels')) ? $_GET['channels'] : 'friendica');
40
41 /* add the chatroom frame and some html
42  * by altering the "channels=friendica" part of the URL, you can add/remove channels.  
43  * At free-haven.org, I have "?channels=friendica,free-haven", for instance, to open #friendica and #free-haven
44  */
45   $o .= <<< EOT
46 <h2>IRC chat</h2>
47 <p><a href="http://tldp.org/HOWTO/IRC/beginners.html" target="_blank">a beginner's guide to using IRC.</a></p>
48 <iframe src="http://webchat.freenode.net?channels=$channels" width="600" height="600"></iframe>
49 EOT;
50
51 return $o;
52     
53 }
54
55