I've gone ahead and added code to the ewt_talkerbot.php file that will (1) update the forum counters, (2) put the bot into the "who's online" list and update the bot's user info (3) fix the double quoting
Underneath of
PHP Code:
define ("MY_VERSION", "TALKERBOT v2.2 FOR VBULLETIN 3.5 and 3.6 by eXtremeTim");
add the following function:
PHP Code:
function update_bot_info()
{
global $vbulletin;
require_once('./global.php');
require_once('./includes/functions.php');
$userinfo = fetch_userinfo($vbulletin->options['ewt_talkerbot_botuid']);
// if the bot is already in the session table, update it, otherwise add it
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."session SET lastactivity = '". TIMENOW ."' WHERE (userid = '".$vbulletin->options['ewt_talkerbot_botuid']."')");
if ($vbulletin->db->affected_rows() == 0)
{
$ip = rand(25,160).".".rand(30,250).".".rand(3,250).".".rand(10,250);
$vbulletin->db->query_write("INSERT INTO ".TABLE_PREFIX."session (userid,lastactivity,host) VALUE ('".$vbulletin->options['ewt_talkerbot_botuid']."',".TIMENOW.",'$ip')");
}
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($userinfo);
$userdata->set('lastactivity', TIMENOW);
$userdata->set('lastvisit', TIMENOW - 1);
$userdata->save();
}
Then towards the bottom there are two different if staments that look like:
PHP Code:
if (!$dataman->errors) // should not occur
{
$dataman->save();
}
And make them both look like as follows:
PHP Code:
if (!$dataman->errors) // should not occur
{
$dataman->save();
require_once('./includes/functions_databuild.php');
build_forum_counters($foruminfo["forumid"]);
update_bot_info();
}
To fix the double-quoting, find two lines that look like:
PHP Code:
if ($vbulletin->options['ewt_talkerbot_quotemsg'] == "1")
{
And right below it add the follow code:
PHP Code:
$post['message'] = strip_quotes($post['message']);