if (strtolower(substr($msgwithoutident, 0, 4)) == 'join' && $data->host == "unaffiliated/aheartattack/x-000001") { $message = substr($msgwithoutident, 5, strlen($msgwithoutident)-5); $irc->join($message); // array_push($message, $channels); if ($message == '') { $irc->message(SMARTIRC_TYPE_CHANNEL, $recip, 'Incorrect usage. Correct usage: \'?join chan\'.'); return; } $i = 0; global $channels; while ($i != count($channels)) { if ($channels[$i] == 'nothing') { $i++; } if ($channels[$i] == $message) { $irc->message(SMARTIRC_TYPE_CHANNEL, $recip, 'I\'m already on that channel.'); return; } $i++; } $valid_function = true; } if (strtolower(substr($msgwithoutident, 0, 4)) == 'part' && $data->host == "unaffiliated/aheartattack/x-000001") { $message = substr($msgwithoutident, 5, strlen($msgwithoutident)-5); if ($message == '') { $message = $recip; } $irc->part($message); $i = 0; global $channels; while ($i < count($channels)) { if ($channels[$i] == $chan) { $channels[$i] = 'nothing'; return; } $i++; } $valid_function = true; }