X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=irc%2Firc.php;h=065e48080d81a4726ead6048b19dcab7327e71ae;hb=d0fa37e8ea7c3ad450d9920ba6224b2e10a5e56a;hp=397844e051f726ad86ae8867ba83865f8bc6bf43;hpb=746a42e4e03af3b0298c125e72d056607c7c43e7;p=friendica-addons.git diff --git a/irc/irc.php b/irc/irc.php index 397844e0..065e4808 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -3,9 +3,14 @@ * Name: IRC Chat Plugin * Description: add an Internet Relay Chat chatroom * Version: 1.0 -* Author: tony baldwin +* Author: tony baldwin */ +/* enable in admin->plugins + * you will then have "irc chatroom" listed at yoursite/apps + * and the app will run at yoursite/irc + * documentation at http://tonybaldwin.me/hax/doku.php?id=friendica:irc + */ function irc_install() { register_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); @@ -17,7 +22,7 @@ unregister_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); } function irc_app_menu($a,&$b) { -$b['app_menu'][] = ''; +$b['app_menu'][] = ''; } @@ -28,14 +33,36 @@ return; function irc_content(&$a) { -$baseurl = $a->get_baseurl() . '/addon/irc'; -$o = ''; + $baseurl = $a->get_baseurl() . '/addon/irc'; + $o = ''; + $sitechats = get_config('irc','channels'); + if($sitechats) + $chats = explode(',',$sitechats); + else + $chats = array('friendica','chat','chatback','hottub','ircbar','dateroom','teentalk'); - // add the chatroom frame and some html + + $a->page['aside'] .= '

' . t('Popular Channels') . '

    '; + foreach($chats as $chat) { + $a->page['aside'] .= '
  • ' . '#' . $chat . '
  • '; + } + $a->page['aside'] .= '
'; + + + + + +$channels = ((x($_GET,'channels')) ? $_GET['channels'] : 'friendica'); + +/* add the chatroom frame and some html + * by altering the "channels=friendica" part of the URL, you can add/remove channels. + * At free-haven.org, I have "?channels=friendica,free-haven", for instance, to open #friendica and #free-haven + */ $o .= <<< EOT

IRC chat

- +

A beginner's guide to using IRC. [en]

+ EOT; return $o;