--- a/enanobot.php Sat Mar 15 20:45:32 2008 -0400
+++ b/enanobot.php Wed May 07 23:33:36 2008 -0400
@@ -39,12 +39,12 @@
if ( !$q )
{
$m_e = mysql_error();
- $m_et = true;
- if ( $m_e == 'MySQL server has gone away' && !$m_et )
+ if ( strpos($m_e, 'gone away') && !$m_et )
{
mysql_reconnect();
continue;
}
+ $m_et = true;
$irc->close("MySQL query error: $m_e");
exit(1);
}
@@ -192,8 +192,11 @@
switch($message['action'])
{
case 'PRIVMSG':
- $sql = "INSERT INTO irclog(channel, day, nick, timestamp, line) VALUES
- ( '$chan_db', '$day', '$nick_db', '$time', '$line_db' );";
+ if ( substr($line_db, 0, 5) != '[off]' )
+ {
+ $sql = "INSERT INTO irclog(channel, day, nick, timestamp, line) VALUES
+ ( '$chan_db', '$day', '$nick_db', '$time', '$line_db' );";
+ }
break;
case 'JOIN':
$sql = "INSERT INTO irclog(channel, day, nick, timestamp, line) VALUES