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 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:Codice:function insertParsedMessage($text)
Right ABOVE the last } paste this:Codice:} else { // No command found, just insert the plain message: $this->insertCustomMessage( $this->getUserID(), $this->getUserName(), $this->getUserRole(), $this->getChannel(), $text ); } }
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).Codice:include("chatbot.php");
enter this code into the chatbot.php page
Codice:<?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 ?>

LinkBack URL
About LinkBacks
