A few of my members requested the ability to turn on/off auto-inviting on an individual basis. So I added a "auto_invite" field to the members table and changed the following methods in Autoinv.php:
/*
Toggles autoinvite on/off
*/
function switchauto($name, $toggle)
{
if ($this -> bot -> admin -> in_group($name, "superadmin"))
{
$this -> bot -> db -> query("DELETE FROM settings WHERE setting = 'auto_invite'");
$toggle == strtolower($toggle);
$new = (($toggle == "on") ? 1 : 0);
$this -> bot -> db -> query("INSERT INTO settings (setting, value) VALUES ('auto_invite', $new)");
$this -> auto = $new;
return "Auto inviting has been <font color=#ffff00>" .
(($new == 1) ? "enabled" : "disabled") . "</font>.";
}
else
{
$new = (($toggle == "on") ? 1 : 0);
$this-> bot -> db -> query ("UPDATE members SET auto_invite = $new");
return "Auto inviting has been <font color=#ffff00>" .
(($new == 1) ? "enabled" : "disabled") . " for " . $name . "</font>.";
}
}
/*
This gets called if a buddy logs on/off
*/
function buddy($name, $msg)
{
$invite = 0;
$result = $this -> bot -> db -> select("SELECT auto_invite FROM members WHERE nickname = '$name'");
if (empty($result))
$invite = 0;
else
$invite = $result[0][0];
if (($invite == 1) && ($this -> auto == 1) && ($msg == 1) && ($this -> bot -> is_member($name) == 1))
$this -> bot -> aoc -> privategroup_invite($name);
}
Don't know if this is helpful to anyone, but I thought I would post it here.