# HG changeset patch # User Dan # Date 1210217616 14400 # Node ID 02e1c3f8f0ef2e8c79169638a3d99da7c4eadf9a # Parent c474904ed7072ca00fdf541f3610283fd5fe2ee2 Hopefully made MySQL reconnection possible diff -r c474904ed707 -r 02e1c3f8f0ef enanobot.php --- 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