Index: trunk/extensions/WebIRC/WebIRC.i18n.php |
— | — | @@ -0,0 +1,32 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * WebIRC |
| 5 | + * |
| 6 | + * make a web irc client in to a special page |
| 7 | + * |
| 8 | + * @link http://www.mediawiki.org/wiki/Extension:WebIRC |
| 9 | + * |
| 10 | + * @author Devunt <devunt@devunt.kr> |
| 11 | + * @authorlink http://www.mediawiki.org/wiki/User:Devunt |
| 12 | + * @copyright Copyright © 2010 Devunt (Bae June Hyeon). |
| 13 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 14 | + */ |
| 15 | +$messages = array(); |
| 16 | + |
| 17 | +/** English |
| 18 | + */ |
| 19 | +$messages['en'] = array( |
| 20 | + 'webirc' => 'Web IRC', |
| 21 | + 'webirc-desc' => 'Add [[Special:WebIRC|Special page]] to do [[IRC]] on the web', |
| 22 | + 'right-webirc' => 'Use web IRC', |
| 23 | +); |
| 24 | + |
| 25 | +/** Korean (한국어) |
| 26 | + * @author Devunt |
| 27 | + * @author Kwj2772 |
| 28 | + */ |
| 29 | +$messages['ko'] = array( |
| 30 | + 'webirc' => '웹 IRC', |
| 31 | + 'webirc-desc' => '웹에서 [[IRC]]를 할 수 있는 [[Special:WebIRC|특수문서]]를 추가합니다.', |
| 32 | + 'right-webirc' => '웹 IRC를 사용하기', |
| 33 | +); |
Property changes on: trunk/extensions/WebIRC/WebIRC.i18n.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 34 | + native |
Index: trunk/extensions/WebIRC/WebIRC.php |
— | — | @@ -0,0 +1,36 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * WebIRC |
| 5 | + * |
| 6 | + * make a web irc client in to a special page |
| 7 | + * |
| 8 | + * @link http://www.mediawiki.org/wiki/Extension:WebIRC |
| 9 | + * |
| 10 | + * @author Devunt <devunt@devunt.kr> |
| 11 | + * @authorlink http://www.mediawiki.org/wiki/User:Devunt |
| 12 | + * @copyright Copyright © 2010 Devunt (Bae June Hyeon). |
| 13 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 14 | + */ |
| 15 | + |
| 16 | +// If this is run directly from the web die as this is not a valid entry point. |
| 17 | +if ( !defined( 'MEDIAWIKI' ) ) die('define error!'); |
| 18 | + |
| 19 | +// Extension credits. |
| 20 | +$wgExtensionCredits[ 'specialpage' ][] = array( |
| 21 | + 'name' => 'WebIRC', |
| 22 | + 'author' => 'Devunt (Bae June Hyeon)', |
| 23 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:WebIRC', |
| 24 | + 'description' => 'webirc-desc', |
| 25 | + 'descriptionmsg' => 'webirc-desc', |
| 26 | + 'version' => '0.7.1', |
| 27 | +); |
| 28 | + |
| 29 | +$dir = dirname( __FILE__ ) . '/'; |
| 30 | + |
| 31 | +$wgSpecialPages['WebIRC'] = 'WebIRC'; |
| 32 | +$wgSpecialPageGroups['WebIRC'] = 'wiki'; |
| 33 | +$wgAutoloadClasses['WebIRC'] = $dir.'WebIRC_body.php'; |
| 34 | +$wgExtensionMessagesFiles['WebIRC'] = $dir.'WebIRC.i18n.php'; |
| 35 | +$wgExtensionAliasesFiles['WebIRC'] = $dir.'WebIRC.alias.php'; |
| 36 | + |
| 37 | +$wgAvailableRights[] = 'webirc'; |
Property changes on: trunk/extensions/WebIRC/WebIRC.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 38 | + native |
Index: trunk/extensions/WebIRC/WebIRC.alias.php |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * WebIRC |
| 5 | + * |
| 6 | + * make a web irc client in to a special page |
| 7 | + * |
| 8 | + * @link http://www.mediawiki.org/wiki/Extension:WebIRC |
| 9 | + * |
| 10 | + * @author Devunt <devunt@devunt.kr> |
| 11 | + * @authorlink http://www.mediawiki.org/wiki/User:Devunt |
| 12 | + * @copyright Copyright © 2010 Devunt (Bae June Hyeon). |
| 13 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 14 | + */ |
| 15 | +$aliases = array(); |
| 16 | + |
| 17 | +/** English */ |
| 18 | +$aliases['en'] = array( |
| 19 | + 'WebIRC' => array( 'WebIRC', 'IRC' ), |
| 20 | +); |
| 21 | + |
| 22 | +$messages['ko'] = array( |
| 23 | + 'WebIRC' => array( 'WebIRC', 'IRC' ), |
| 24 | +); |
Property changes on: trunk/extensions/WebIRC/WebIRC.alias.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 25 | + native |
Index: trunk/extensions/WebIRC/WebIRC_body.php |
— | — | @@ -0,0 +1,58 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * WebIRC |
| 5 | + * |
| 6 | + * make a web irc client in to a special page |
| 7 | + * |
| 8 | + * @link http://www.mediawiki.org/wiki/Extension:WebIRC |
| 9 | + * |
| 10 | + * @author Devunt <devunt@devunt.kr> |
| 11 | + * @authorlink http://www.mediawiki.org/wiki/User:Devunt |
| 12 | + * @copyright Copyright © 2010 Devunt (Bae June Hyeon). |
| 13 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 14 | + */ |
| 15 | +class WebIRC extends SpecialPage { |
| 16 | + |
| 17 | + function __construct() { |
| 18 | + SpecialPage::SpecialPage( 'WebIRC', 'webirc' ); |
| 19 | + } |
| 20 | + |
| 21 | + function execute( $par ) { |
| 22 | + global $wgOut, $wgUser, $wgIRCServer, $wgIRCChannel, $wgIRCSettings; |
| 23 | + wfLoadExtensionMessages( 'WebIRC' ); |
| 24 | + $this->setHeaders(); |
| 25 | + |
| 26 | + if( !$this->userCanExecute( $wgUser ) ){ |
| 27 | + $this->displayRestrictionError(); |
| 28 | + return; |
| 29 | + } |
| 30 | + |
| 31 | + $wgIRCServer = urlencode( strstr($wgIRCServer, "irc://") ? substr($wgIRCServer, 6) : $wgIRCServer ); |
| 32 | + $wgIRCChannel = urlencode( strstr($wgIRCChannel, "#") ? $wgIRCChannel : "#".$wgIRCChannel ); |
| 33 | + $wgIRCSettings = urlencode( $wgIRCSettings ); |
| 34 | + |
| 35 | + $username = strtolower($wgUser->mName); |
| 36 | + $webirc_url = ""; |
| 37 | + $serverport = explode(':', $wgIRCServer); |
| 38 | + if (strstr($serverport[0], "freenode.org")) |
| 39 | + $webirc_url = |
| 40 | + "http://webchat.freenode.net/?". |
| 41 | + "channels=$wgIRCChannel&". |
| 42 | + "nick=$username"; |
| 43 | + else |
| 44 | + $webirc_url = |
| 45 | + "http://widget.mibbit.com/?". |
| 46 | + "server=$wgIRCServer&". |
| 47 | + "channel=$wgIRCChannel&". |
| 48 | + "settings=$wgIRCSettings&". |
| 49 | + "showmotd=0&". |
| 50 | + "nick=$username"; |
| 51 | + $wgOut->addHTML( Xml::openElement( 'iframe', array( |
| 52 | + 'width' => '100%', |
| 53 | + 'height' => '500px', |
| 54 | + 'scrolling' => 'no', |
| 55 | + 'style' => 'border:solid black 1px', |
| 56 | + 'src' => $webirc_url, |
| 57 | + ) ) . Xml::closeElement( 'iframe' ) ); |
| 58 | + } |
| 59 | +} |
Property changes on: trunk/extensions/WebIRC/WebIRC_body.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 60 | + native |