Extension:ChatLogin

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
ChatLogin

Release status: stable

Implementation User interface
Description Provides a small textbox to login automatically in Chat
Author(s) Laximilian scokenTalk
Last version 1.0
License No license specified
Download see below

Check usage (experimental)

ChatLogin provides a small textbox to login automatically in a Chat.

Contents

[edit] Usage

Just add the following line to any page.

<chat>http://example.com/irc</chat>

Make sure you put the right url to your irc

[edit] Download instructions

Please cut and paste the code found below and place it in $IP/extensions/Chat.php. .

[edit] Installation

To install this extension, add the following to LocalSettings.php:

require_once("$IP/extensions/Chat.php");

[edit] Code

[edit] Chat.php

<?php
 
// (c) Laximilian scoken 2010
// Chat Login Extension
// Version 1.0
 
$wgExtensionCredits['parserhook'][] = array(
        'name' => 'ChatLogin',
        'version' => '1.0',
        'author' => 'Laximilian scoken',
        'url' => 'http://de.bakugan.wikia.com/',
        'description' => 'Fuegt den Tag <nowiki><chat></chat></nowiki> hinzu.',
            'descriptionmsg' => 'chat-desc',
);
 
$dir = dirname(__FILE__) . '/';
$wgExtensionMessagesFiles['Chat'] = $dir . 'Chat.i18n.php';
 
$wgExtensionFunctions[] = "wfChatExtension";
 
function wfChatExtension() {
     global $wgParser;
     $wgParser->setHook( "chat", "printchat" );
}
 
function printchat( $input, $argv ) {
 
     global $wgParser;
     $wgParser->disableCache();
 
     $output = "<form action=\"$input\" method=\"post\">".
       "Nickname: <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;
}

[edit] Chat.i18n.php

<?php
 
/* Internationalisation file for ChatLogin extension
*/
 
$messages = array();
 
/** English(Englisch)
 * @author Laximilian scoken
 */
$messages['en'] = array(
        'chat-desc' => 'Add the Tag <nowiki><chat></chat></nowiki>.',
);
 
/** German (Deutsch)
 * @author Laximilian scoken
 */
$messages['de'] = array(
        'chat-desc' => 'Fuegt den Tag <nowiki><chat></chat></nowiki> hinzu.',
);
Language: English  • Deutsch

[edit] See also

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox