Italian SMF

Tutto su SMF => Tips and Tricks => Discussione aperta da: Darknico il Venerdì - 17 Ottobre 2014 - 10:13

Titolo: [SMF 2.0] Integrazione AjaxChat
Inserito da: Darknico il Venerdì - 17 Ottobre 2014 - 10:13
Avete installato la Ajaxchat (http://frug.github.io/AJAX-Chat/) e volete integrarlo nel vostro forum SMF?

Dopo aver installato la chat per smf (esistono versione già moddate per forum), potete eseguire queste modifiche al vostro forum.

Per prima cosa dovete creare 2 nuovi file: Chat.php (da inserire nella cartella Sources) e Chat.template.php (da inserire nella cartella themes/Default)

Codice (Chat.php) Seleziona
<?php
/**********************************************************************************
* Chat.php                                                                        *
**********************************************************************************/

// If not called by SMF, it's bad!
if (!defined('SMF'))
die('Hacking attempt...');

function 
Chat()
{
global $boarddir$context$txt$modSettings;

loadTemplate('Chat');
}

?>





Codice (Chat.template.php) Seleziona
<?php
/**********************************************************************************
* Chat.template                                                                       *
**********************************************************************************/

function template_main()
{
global $txt$boardurl$context$modSettings;
// Wrap this in a table (for the nice-looking heading).
echo '
<iframe frameborder="0" src="LINKCHAT" width="100%" height="550px" style="width: 100%; margin: 1; padding: 0; border: 0;" scrolling="auto" border="0" allowtransparency="true">
</iframe> '
;
}

?>



AL posto di LINKCHAT, mettete l'url della chat


e poi infine questa modifica:


index.php (nella root del forum)

Cercare:
$actionArray = array(

Aggiungere una nuova riga all'array:
'chat' => array('Chat.php', 'Chat'),


Ora potete puntare alla pagina tuosito/forum/index.php?action=chat per vedere la chat integrata :)