Già, dimenticavo... La mod!
La incollo qui perché ora come ora sono troppo pigro per fare un archivio
file index.php, dopo
'.xml' => array('News.php', 'ShowXmlFeed'),
aggiungere:
'chat' => array('Chat.php', 'Chat'),
'irc' => array('Chat.php', 'Chat'),
file Sources/Chat.php<?php
/********************************************************************************
* Chat.php *
*********************************************************************************
* SMF IRC Chat - A Mibbit Embedder Script *
* ============================================================================= *
* Software Version: 0.0.1 *
* Software by: Treviño *
* Support, News, Updates at: http://www.3v1n0.net *
*********************************************************************************
* This program is free software; you may redistribute it and/or modify it *
* under the terms of the provided license as published by Lewis Media. *
* *
* This program is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Simple Machines license. *
*********************************************************************************/
global $context;
if (!defined('SMF'))
die('Hacking attempt...');
Function Chat()
{
global $settings, $txt, $scripturl, $db_prefix, $context, $user_info, $ID_MEMBER;
LoadTemplate('Chat');
// Loadlanguage('Chat');
$context['page_title'] = "La Chat di Telefoninux.org - Il Canale IRC #telefoninux";
$context['linktree'] = array();
$context['linktree'][] = array('url' => $scripturl, 'name' => $context['forum_name']);
$context['linktree'][] = array('url' => "index.php?action=chat", 'name' => "Chat");
$context['irc_server'] = "chat.freenode.net".urlencode(":")."6667";
$context['irc_channel'] = urlencode("#")."telefoninux";
$context['irc_nick'] = urlencode(special_chars_clean($user_info['name'], 31));
$txt['irc_welcome'] = str_replace("+", " ", urlencode("Benvenuti nel Canale IRC di Telefoninux.org!"));
$txt['irc_loading'] = str_replace("+", " ", urlencode("Connessione in corso al server IRC..."));
if (empty($context['irc_nick']))
$context['irc_nick'] = "Telefoninux_".rand(0, 1024);
$context['irc_chat_settings'] = "server=".$context['irc_server'].
"&channel=".$context['irc_channel'].
"&nick=".$context['irc_nick'].
"&customprompt=".$txt['irc_welcome'].
"&customloading=".$txt['irc_loading'].
"&needSendButton=true".
"&showJoinsParts=true";
$context['irc_embedded_chat'] = "http://embed.mibbit.com/"."?".$context['irc_chat_settings'];
$context['irc_chat_url'] = "https://www.mibbit.com/"."?".$context['irc_chat_settings'];
}
function special_chars_clean($string, $maxlength = 0) {
$chars = array(
" " => "_",
"~" => "-",
"À" => "A",
"Â" => "A",
"Ä" => "A",
"Æ" => "AE",
"È" => "E",
"Ê" => "E",
"Ì" => "I",
"Î" => "I",
"Ð" => "D",
"Ò" => "O",
"Ô" => "O",
"Ö" => "O",
"Ø" => "O",
"Ú" => "U",
"Ü" => "U",
"à" => "a",
"â" => "a",
"ä" => "a",
"æ" => "ae",
"è" => "e",
"ê" => "e",
"ì" => "i",
"î" => "i",
"ð" => "o",
"ò" => "o",
"ô" => "o",
"ö" => "o",
"ø" => "o",
"ú" => "u",
"ü" => "u",
"Á" => "A",
"Ã" => "A",
"Å" => "A",
"Ç" => "C",
"É" => "E",
"?" => "E",
"Ë" => "E",
"Í" => "I",
"Ï" => "I",
"Ñ" => "N",
"Ó" => "O",
"Õ" => "O",
"Ù" => "U",
"Û" => "U",
"Ý" => "Y",
"ß" => "B",
"á" => "a",
"ã" => "a",
"å" => "a",
"ç" => "c",
"é" => "e",
"ë" => "e",
"í" => "i",
"ï" => "i",
"ñ" => "n",
"ó" => "o",
"õ" => "o",
"ù" => "u",
"û" => "u",
"ý" => "y",
"ÿ" => "y"
);
$string = str_replace(array_keys($chars), array_values($chars), $string);
$string = preg_replace('/[^A-Za-z0-9\[\]^\\-_`|{}]/', "", $string);
if ($maxlength != 0)
$string = substr($string, 0, $maxlength);
return $string;
}
?>
file Themes/default/Chat.template.php<?php
// Chat.template.php : Chat 0.1
function template_main()
{
global $context, $scripturl, $txt, $user_info, $ID_MEMBER, $settings;
theme_linktree();
echo '<div class="tborder">
<table class="bordercolor" border="0" cellpadding="4" cellspacing="1" width="100%">
<tbody>
<tr>
<td class="catbg3" nowrap="nowrap" align="center">
<iframe src="'.$context['irc_embedded_chat'].'" frameborder="0" width="100%" height="600px">
</iframe>
<br />
<a href="'.$context['irc_embedded_chat'].'">Apri la Chat a schermo intero</a> o <a href="'.$context['irc_chat_url'].'">in Mibbit.com</a>.
<h4>Digita <code>/help</code> per visualizzare i comandi</h4>
</td>
</tr>
</tbody>
</table>
</div>';
}
?>
Adeguare poi il file Themes/<theme>/index.template.php per aggiungere il pulsante apposito

.