Thread: Chat Modifications - MGC Chatbox Evo
View Single Post
  #6733  
Old 08-18-2010, 09:25 AM
VBDev's Avatar
VBDev VBDev is offline
 
Join Date: Jan 2004
Location: France
Posts: 2,570
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by exyuteam View Post
In VB 4.xx if you want to point on specific post, link must be:


http://DOMEN-COM/showthread.php?p=XXXXX#postXXXXX

In Chatbox, we have notification when new post are entered, and if we click on that link, we see that page, and not post itself!

Clement, please correct this in next version....


Thanks in advance!
Fixed in the next version.

Quote:
Originally Posted by Lifesupporters View Post
I'm using this on a 3.8.x install and it's working for the most part. There are a few minor issues such as not remembering user preference when it comes to collapsed or open state of smilies, bbcode, etc., but that's not much of a concern.

The one question I do have however is in regards to bot configuration. I know how to use the bot and have it configured to answer specific questions but I don't know how to configure the bot for wildcard questions?

Essentially, the bot will only answer specific questions if they are input exactly as programmed, including punctuation for example:

Question: Is anyone here?
Bot: Yes I'm here, how are you {username}

...however, any changes to the original question will not yield results so for example:

Question: Is Anyone Here?
Bot: No response.

Question: Is Anyone Here
Bot: No response.

Question: anyone here?
Bot: No response.

...

Is there a way to configure the bot to reply to wildcard queries that have a portion of text that matches what's been programed in the ACP?

Thanks.
Well I don't have the time before the end of the week to run a test but here is a little test of code change we could try.

Edit the includes/class_dm_mgccbchat.php file.

Search for :
PHP Code:
                        if (strcasecmp($bot['question'],$this->raw_chat) == 0)
                        {      
                            
// Do some replacements
                            
$bot['answer'] = str_replace('{username}',htmlspecialchars($this->registry->userinfo['username']), $bot['answer']);
                            
$bot['answer'] = str_replace('{time}',vbdate($this->registry->options['timeformat'],TIMENOW,true,false), $bot['answer']);            
                            
$bot['answer'] = str_replace('{date}',vbdate($this->registry->options['dateformat'],TIMENOW,false,false), $bot['answer']);
                            
// Save the bot answer for sending
                               
$this->bot_answer $bot['answer'];
                            
$notfound    0;
                        } 
Replace this by :

PHP Code:
$found 0;
if (
strlen($bot['question']) == strlen($this->raw_chat))
{
    if (
strncasecmp($bot['question'],$this->raw_chat) == 0)
    {
        
$found 1// Same length string and string equals
    
}
}
else if (
strlen(stristr($this->raw_chat,$bot['question']))>0)
{
    
$found 1// Bot question included in part of the chat
}
    
if (
$found)
{
    
// Do some replacements
    
$bot['answer'] = str_replace('{username}',htmlspecialchars($this->registry->userinfo['username']), $bot['answer']);
    
$bot['answer'] = str_replace('{time}',vbdate($this->registry->options['timeformat'],TIMENOW,true,false), $bot['answer']);            
    
$bot['answer'] = str_replace('{date}',vbdate($this->registry->options['dateformat'],TIMENOW,false,false), $bot['answer']);
    
// Save the bot answer for sending
    
$this->bot_answer $bot['answer'];
    
$notfound    0;

I haven't tested the code and did it quickly @work but if you can try it that would be nice
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03572 seconds
  • Memory Usage 1,829KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete