Extension:CgiIrcLogin
From MediaWiki.org
|
CgiIrcLogin Release status: beta |
|
|---|---|
| Implementation | User interface |
| Description | Provides a small textbox to login automatically in CGI:IRC |
| Version | 0.1 |
| Download | see below |
Contents |
[edit] What can this extension do?
It provides a small textbox to login automatically in CGI:IRC, which is a web-based IRC client.
[edit] Usage
Just add the following line to any page.
<cgiirclogin>http://example.com/cgi-bin/cgiirc/irc.cgi</cgiirclogin>
Make sure you put the right url to your irc.cgi
[edit] Download instructions
Please cut and paste the code found below and place it in $IP/extensions/cgiirclogin.php. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
[edit] Installation
To install this extension, add the following to LocalSettings.php:
require_once("$IP/extensions/cgiirclogin.php");
[edit] Configuration parameters
Don't forget to configure the channel you wish to connect, it's hardcoded in the extension.
[edit] Code
<?php # This is my first extension, it is inspired by the mailman extension. # # To activate the extension add this line to your file LocalSettings.php # require_once("extensions/cgiirclogin.php"); # # To use it insert in a page the following with the correct URL to your # installacion of irc.cgi # <cgiirclogin>http://example.com/cgi-bin/cgiirc/irc.cgi</cgiirclogin> # # Change the Channel in the form below.... $wgExtensionCredits['parserhook'][] = array( 'name' => 'CgiIrcLogin', 'version' => 0.1, 'author' => 'SeBas891', 'url' => 'http://www.mediawiki.org/wiki/Extension:CgiIrcLogin', 'description' => 'Provides a small textbox to login automatically in CGI:IRC.', ); $wgExtensionFunctions[] = "wfCgiIrcLoginExtension"; function wfCgiIrcLoginExtension() { global $wgParser; $wgParser->setHook( "cgiirclogin", "printCgiIrcLoginForm" ); } function printCgiIrcLoginForm( $input, $argv ) { global $wgParser; $wgParser->disableCache(); $output = "<form action=\"$input\" method=\"post\">". "Tu nombre: <input name=\"Nickname\" type=\"text\" value=\"\" />". "<input name=\"Channel\" type=\"hidden\" value=\"#mediawiki\" />". "<input name=\"format\" type=\"hidden\" value=\"default\" />". "<input name=\"interface\" type=\"hidden\" value=\"ie\" />". "<input type=\"submit\" value=\"Chat\">". "</form>"; return $output; }

