Pagina 1 di 1

Ajax Chat 0.8.3 configurazione

Inviato: 20/03/2010, 22:55
da andreinoroma
Ciao a tutti, ho installato ieri questa fantastica chat sul mio forum. Ho trovato su sourceforge a il modo per dare dei comandi al bot, cosa molto interessante, ma pure seguendo alla lettera quello che scrivono mi da l'errore:
Parse error: syntax error, unexpected '}', expecting '{' in /membri/petmaniaitalia/chat/lib/class/AJAXChat.php on line 660
e non parte la chat, sicuramente sbaglio qualcosa vi riporto di seguido quello che dicono di fare.

To make your chatbot respond to certain keywords, follow these steps.
Remeber that you should not use windows notepad to edit PHP code. Get an editor like Notepad++ to edit php code or you may encounter problems.
Open lib/class/AJAXChat.php and do a search for this:

Codice: Seleziona tutto

function insertParsedMessage($text)
At the end of this function (about line 762 or so) is this:

Codice: Seleziona tutto

} else {
			// No command found, just insert the plain message:
			$this->insertCustomMessage(
				$this->getUserID(),
				$this->getUserName(),
				$this->getUserRole(),
				$this->getChannel(),
				$text
			);

		}

          }
Right ABOVE the last } paste this:

Codice: Seleziona tutto

include("chatbot.php");
Save, then create a new php page called chatbot.php in the lib/class/ folder (or you can create the chatbot.php first if you want to avoid any interruption in ajax chat).
enter this code into the chatbot.php page

Codice: Seleziona tutto

<?php

// Chat bot messages
if(stristr($text, 'help me'))
	  {
// KEYWORDS TRIGGER START
    $this->insertChatBotMessage(
					$this->getPrivateMessageID(),
"\nHow may I help you?\n" //This is what the chatbot says when the visitor enters help me anywhere in a sentence!
 );
}
// KEYWORD TRIGGER END

?>

Re: Ajax Chat 0.8.3 configurazione

Inviato: 21/03/2010, 9:49
da Carlo
Puoi allegarmi il file AJAXChat.php da te modificato?

Re: Ajax Chat 0.8.3 configurazione

Inviato: 21/03/2010, 13:56
da andreinoroma
ecco il file modificato. questa è una delle tante combinazioni che ho provato... secondo me non capisco bene quello che mi dicono di fare... spero possiate aiutarmi :geek:

Re: Ajax Chat 0.8.3 configurazione

Inviato: 22/03/2010, 17:41
da Carlo
C'è un pò di casino nel file. Allegami anche la versione originale di quello stesso file, così provvedo a farti io le modifiche.

Re: Ajax Chat 0.8.3 configurazione

Inviato: 22/03/2010, 17:57
da andreinoroma
questo è quello che ho caricato sul forum ed'è funzionante.