Fandom Developers Wiki
Advertisement

There are several ways to place an IRC chat on the wiki itself. As a prerequisite, you should have registered your channel on the Freenode IRC network, ideally with a "wikia-" prepended; e.g. #wikia-wikiname.

FANDOM IRC Gateway extension

Add

<irclogin/>

to a page; once the user logs in, the complete page (including the sidebar etc.) is replaced by a web CGI client.

<irclogin></irclogin>

Embedding FANDOM's IRC gateway

Put the JavaScript below into MediaWiki:Common.js . Then place an element with id="JRChatReplace" anywhere on a wiki page to embed a frame with irc.wikia.com on it. Example:

<div id="JRChatReplace">Enable JavaScript to see the IRC chat interface.</div>

Example:

<div id="chat">Enable JavaScript and Java to see the IRC chat interface.</div>
function onloadhookcustom() {
	var replace = document.getElementById("JRChatReplace");
	if (null != replace) {
		replace.innerHTML='<iframe src="http://webchat.freenode.net/?channels=Kongregate" width="450" height="400"></iframe>';
		if (window.attachEvent) window.attachEvent("onbeforeunload",confirmexitjrchat);
		else window.onbeforeunload = confirmexitjrchat;

	}
	//alert(document.getElementById("JRChatReplace").innerHTML);

}

if (window.addEventListener) window.addEventListener("load",onloadhookcustom,false);
else if (window.attachEvent) window.attachEvent("onload",onloadhookcustom);

This code was written by GreenReaper.

Embedding the Freenode java client

Adjust the following JavaScript and put it on your wiki, then use an element with id="chat" to display the pjirc java irc client.

function onloadhookcustom() {
	var replace = document.getElementById("chat");
	if (null != replace) {

		replace.innerHTML='<applet width="640" height="400" code="IRCApplet.class" archive="irc.jar,pixx.jar"  codebase="http://java.freenode.net/freenode/pjirc"><param name="nick" value="UnGuest"/><param name="alternatenick" value="Guest???"/><param name="name" value="Unmario Chatter"/><param name="host" value="irc2.darkmyst.org"/><param name="gui" value="pixx"/><param name="command1" value="/join #unmario"/><param name="command2" value="/clear"/><param name="quitmessage" value="HEAD ASPLOSION!"/><param name="pixx:timestamp" value="true"/><param name="pixx:nickfield" value="true"/><param name="style:highlightlinks" value="true"/><param name="pixx:setfontonstyle" value="true"/><param name="pixx:styleselector" value="true"/><param name="style:link" value=":link: http://img148.imageshack.us/img148/6707/copyoflinkkm3.png)"> <h1>No java support</h1><p><font color="green">Sorry, but you need a Java 1.4.x-enabled browser to use the Unmario Chatroom.</font></p></applet>';
	}
}

if (window.addEventListener) window.addEventListener("load",onloadhookcustom,false);
else if (window.attachEvent) window.attachEvent("onload",onloadhookcustom);

Code copied from UnMario wiki, where it was placed by SuperLuigi.

Advertisement