Ajax Chat 0.8.3 configurazione
Inviato: 20/03/2010, 22:55
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:
At the end of this function (about line 762 or so) is this:
Right ABOVE the last } paste this:
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
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)
Codice: Seleziona tutto
} else {
// No command found, just insert the plain message:
$this->insertCustomMessage(
$this->getUserID(),
$this->getUserName(),
$this->getUserRole(),
$this->getChannel(),
$text
);
}
}
Codice: Seleziona tutto
include("chatbot.php");
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
?>