]> git.mxchange.org Git - friendica-addons.git/blob - irc/irc.php
Merge remote-tracking branch 'upstream/master'
[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
40 /* add the chatroom frame and some html
41  * by altering the "channels=friendica" part of the URL, you can add/remove channels.  
42  * At free-haven.org, I have "?channels=friendica,free-haven", for instance, to open #friendica and #free-haven
43  */
44   $o .= <<< EOT
45 <h2>IRC chat</h2>
46 <p><a href="http://tldp.org/HOWTO/IRC/beginners.html" target="_blank">a beginner's guide to using IRC.</a></p>
47 <iframe src="http://webchat.freenode.net?channels=friendica" width="600" height="600"></iframe>
48 EOT;
49
50 return $o;
51     
52 }
53
54