Skip navigation.

My pasteblog

This is not my Zettelkasten but a durable .bash_history

Posts tagged with "irc"

Happy new year greetings from freenode

, ,

-- phpMyAdmin SQL Dump
-- version 2.9.0.3-Debian-1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 10. Januar 2007 um 19:48
-- Server Version: 4.1.15
-- PHP-Version: 4.4.4-4~4
--
-- Datenbank: `cpr`
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `hny`
--

CREATE TABLE `hny` (
`gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`nick` varchar(32) character set utf8 NOT NULL default '',
`isocode` varchar(16) character set utf8 NOT NULL default '',
`greeting` varchar(255) character set utf8 NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Daten für Tabelle `hny`
--

INSERT INTO `hny` (`gmt`, `nick`, `isocode`, `greeting`) VALUES
('2005-12-31 01:05:00', 'Jibbler', 'en_GB', 'Happy new year!'),
('2005-12-31 01:05:00', 'numist', 'es_ES', 'feliz ano nuevo!'),
('2005-12-31 01:06:00', 'janne_oksanen', 'fi_FI', 'Hyvää uutta vuotta!'),
('2005-12-31 02:11:00', 'Cippo', 'no_NO', 'God Nytt År'),
('2005-12-31 02:12:00', 'stelki', 'da_DK', 'Godt nytår'),
('2005-12-31 02:17:00', 'nocturnal', 'sv_SE', 'buorre eahket'),
('2005-12-31 02:22:00', 'roel', 'be_NL', 'Gelukkig Nieuwjaar'),
('2005-12-31 04:40:00', 'empoor', 'nl_NL', 'Gelukkig nieuwjaar!'),
('2005-12-31 04:44:00', 'Nirgal', 'zh_CN', '新年好'),
('2005-12-31 04:45:00', 'mur', 'en_C++', 'year++; this.assign(happy);'),
('2005-12-31 04:47:00', 'mur', 'en_CPP', 'year.increase(); this.assign(emotion.happy.get());'),
('2005-12-31 04:48:00', 'StyXman', 'es_AR', 'feliz año nuevo!'),
('2005-12-31 04:50:00', 'mur', 'en_DADAISM', 'True old rotten banana!'),
('2005-12-31 04:51:00', 'Warlord96', 'en_bash', 'if [ $YEAR == "2006" ]; then $HAPPY = "True"; else $YEAR = "2006"; fi'),
('2005-12-31 06:50:00', 'encoded', 'blah_blah', 'padfjajkfbshk fuoasdhf wfhas'),
('2005-12-31 06:50:00', 'paul0', 'pt_BR', 'Feliz ano novo!'),
('2005-12-31 06:51:00', 'decibelle', 'ie_IE', 'Bliain Mhaith Úr.'),
('2005-12-31 06:52:00', 'mateo', 'eo_EO', 'Feliĉan Novjaron!'),
('2005-12-31 06:52:00', 'shastry', 'hi_IN', 'नव वर्ष की शुभकामनाए'),
('2005-12-31 06:53:00', 'phaeton', 'hny_hny', 'HNY!'),
('2005-12-31 06:58:00', 'mur', 'bear_FI', 'murr murrr murr!'),
('2005-12-31 06:58:00', 'mur', 'bear_EN', 'groarrrr groarrr!'),
('2005-12-31 07:06:00', 'decibelle', 'he_IL', 'Shana tova! (transliterated) (wrong time of year for this) (oh well) :)'),
('2005-12-31 07:07:00', 'Wohali', 'en_rot13', 'Unccl arj lrne, sbyxf!'),
('2005-12-31 07:08:00', 'Wohali', 'en_morse', '.... .- .--. .--. -.-- / -. . .-- / -.-- . .- .-. --..-- / ... ..- -.-. -.- . .-. ...'),
('2005-12-31 07:08:00', 'daBlade', 'ba_BA', 'Sretna nova godina'),
('2005-12-31 07:08:00', 'mur', 'fi_binary', '01001 00001 11100 10111 01101 11001 00111 00100 00100 00001 11010 10111 01010 11101 00011 10100 01100 00100 10000 00111 01100 11101 01011 01111 01110 10001 11010 00110 00010 01000 01'),
('2005-12-31 07:09:00', 'mur', 'en_C', 'printf("Happy New Year!")'),
('2005-12-31 07:10:00', 'Wohali', 'vl_vl', 'Seveh uzh tevun!'),
('2005-12-31 07:10:00', 'mur', 'en_BASIC', '10 PRINT "happy new year!"'),
('2005-12-31 07:10:00', 'Peter', 'en_pig', 'appyhay ewnay earyay!'),
('2005-12-31 07:11:00', 'nforbes', 'en_base64', 'aGFwcHkgbmV3IHllYXJzIQ=='),
('2005-12-31 07:11:00', 'Peter', 'en_morse', '. . . . . _ . _ _ . . _ _ . _ . _ _ _ . . . _ _ _ . _ _ . . _ . _ .'),
('2005-12-31 07:11:00', 'Wohali', 'en_B1FF', 'H4PPY ||3// Y34R'),
('2005-12-31 07:12:00', 'ankon', 'en_depressive', 'new year''s eve sucks'),
('2005-12-31 07:17:00', 'shastry', 'kn_IN', 'ಹೊಸ ವರ್ಷದ ಶುಭಾಶಯಗಳು'),
('2005-12-31 07:18:00', 'spyro_boy', 'en_php', 'echo (''Happy New Years!'');'),
('2005-12-31 07:18:00', 'nforbes', 'en_ruby', 'puts ''Happy New Years!'''),
('2005-12-31 07:19:00', 'decibelle', 'he_IL', 'שנה טובה'),
('2005-12-31 07:20:00', 'spyro_boy', 'en_leet', '/-/4/>/>`/ //3// `/34/25'),
('2005-12-31 07:22:00', 'alvarezp', 'es_efe', 'Fefelifiz Afañofo Nuefevofo!'),
('2005-12-31 07:23:00', 'phaeathon', 'en_Shareware', 'Welcome to New Year 2006! Register now for extra features like *Happy* New Year and future upgrades to New Year 2007!'),
('2005-12-31 07:23:00', 'Peter', 'en_Pirate', 'Yarrrr me hearties! Have a happy new year! Avast me swines!'),
('2005-12-31 07:24:00', 'spyro_boy', 'en_gangsta', 'Yo bro! Happy Fucking New Years!'),
('2005-12-31 07:24:00', 'Peter', 'sheep_en', 'meeh meeeh meh!'),
('2005-12-31 07:24:00', 'mur', 'fi_perkele', 'Perkele saatanan hyvää vuotta!'),
('2005-12-31 07:25:00', 'ankon', 'en_explosives', '*BOOM*'),
('2005-12-31 07:26:00', 'reallove', 'ro_RO', 'An Nou Fericit! La multi ani !!'),
('2005-12-31 07:26:00', 'spyro_boy', 'en_godfather', 'Happy New Year from La Famiglia. Now, where''s ma cigar?'),
('2005-12-31 07:27:00', 'nforbes', 'la_LA', 'Laetus novus annus!'),
('2005-12-31 07:28:00', 'ankon', 'en_MichealJackso', 'I love you all!'),
('2005-12-31 07:28:00', 'nforbes', 'en_AOL', 'lolz hny every1 r u gud 2day??'),
('2005-12-31 07:30:00', 'mur', 'en_pessimistic', 'Why bother.. the year wont change anyways...'),
('2005-12-31 07:32:00', 'spyro_boy', 'en_slackware', 'clear ; date ; import happy_new_years.jpeg'),
('2005-12-31 07:32:00', 'ankon', 'en_freebsd', 'cd /usr/ports/misc/hny && make install'),
('2005-12-31 07:34:00', 'alvarezp', 'en_y2k', 'Happy Old Year!'),
('2005-12-31 07:34:00', 'mur', 'en_windows', 'Are you sure you want to change this year 2005 to new year 2006? The action is undoable.'),
('2005-12-31 07:35:00', 'ankon', 'en_arcade', 'Game Over! Insert coin to continue'),
('2005-12-31 07:35:00', 'Peter', 'en_vi', 's/2005/2006/'),
('2005-12-31 07:36:00', 'alvarezp', 'en_y-two-k', 'Happy Old Year!'),
('2005-12-31 07:36:00', 'ankon', 'en_mother', 'Would you please clean your room?'),
('2005-12-31 07:36:00', 'mur', 'en_Y2K', 'Happy new year 1806!!'),
('2005-12-31 07:37:00', 'encoded', 'en_spam', 'happy new year spam!'),
('2005-12-31 07:39:00', 'nforbes', 'en_AOL', '/nick Sexy-Girl-2006'),
('2005-12-31 07:54:00', 'Peter', 'en_warez', 'new.year.party.2006[DVD-RIP[HDTV-LoL]].avi'),
('2005-12-31 07:54:00', 'ankon', 'en_SQL', 'SELECT year FROM century WHERE year > current_year;'),
('2005-12-31 07:56:00', 'spyro_boy', 'en_p2p', 'bathroom_secks_2006_lol_pron_hentai_jap_french.avi'),
('2005-12-31 07:58:00', 'ankon', 'en_PANIC', 'Help! New Year is coming to get me!'),
('2005-12-31 07:58:00', 'chaosite', 'en_IRC', '/set #newyear +happy'),
('2005-12-31 07:59:00', 'alvarezp', 'es_mxfresa', 'O sea, feliz año nuevo, güey!'),
('2005-12-31 07:59:00', 'ankon', 'en_police', 'Nothing to see here folks'),
('2005-12-31 08:00:00', 'Wohali', 'fr_FR', 'bananier et pommes sautées'),
('2005-12-31 08:04:00', 'Madvax', 'en_/.', 'I for one welcome our 2006 time overlords.'),
('2005-12-31 08:05:00', 'ankon', 'en_netcrafttroll', 'the old year is dead! netcraft confirms it!'),
('2005-12-31 08:08:00', 'BHSPitMonkey', 'en_SandwichSign', 'REPENT!'),
('2005-12-31 08:14:00', 'Hortensius', 'la_latin', 'Bonum annum ingrediaris'),
('2005-12-31 08:22:00', 'Hortensius', 'de_yiddish', 'ejn gut rosh'),
('2005-12-31 08:28:00', 'Hortensius', 'de_alsacian', 'E glecklichs Nej Johr!'),
('2005-12-31 08:31:00', 'Hortensius', 'il_hebrew', 'leshana tova tikosevu'),
('2005-12-31 08:35:00', 'Hortensius', 'nl_medieval', 'Een goet, salich jaer'),
('2005-12-31 08:48:00', 'Hortensius', 'greek_classical', 'Kalòn étos isélthois'),
('2005-12-31 08:56:00', 'Hortensius', 'ch_romansch', 'Legreivel niev onn'),
('2005-12-31 08:57:00', 'Hortensius', 'ru_votian', 'Yvää uutta vootta!'),
('2005-12-31 09:13:00', 'roel', 'cz_CZ', 'Stastny novy rok!'),
('2005-12-31 09:18:00', 'Hortensius', 'ie_IE(2)', 'Blian nua faoi mhaise duit'),
('2005-12-31 09:29:00', 'Hortensius', 'is_IS', 'Farsælt komandi ár'),
('2005-12-31 09:39:00', 'cprior', 'comp_gentoo', 'USE="happiness" emerge year-2006.0_rc1 -va #sic'),
('2005-12-31 09:42:00', 'BHSPitMonkey', 'en_Dick-Clark', 'Hi, I''m Dick Clark, and welcome to New Year''s Rockin'' Eve'' 2006!'),
('2005-12-31 10:21:00', 'cprior', 'de_DE', 'Frohes neues Jahr!'),
('2005-12-31 10:21:00', 'Wohali', 'fr_FR', 'Bonne année!'),
('2005-12-31 10:21:00', 'Wohali', 'ja_JP', 'oshogatsu omedetou'),
('2005-12-31 10:22:00', 'Stalwart', 'ru_RU', 'S Novim godom! =]'),
('2005-12-31 10:22:00', 'mateo', 'eo_EO', 'felicxigan novan jaron!'),
('2005-12-31 10:22:00', 'Stalwart', 'lv_LV', 'Laimigu Jauno gadu!'),
('2005-12-31 10:23:00', 'Jax', 'ch_DE', 'Es guets nöis!'),
('2005-12-31 10:23:00', 'mateo', 'en_AU', 'ava bonza new year!'),
('2005-12-31 10:23:00', 'nocturnal', 'sv_SE', 'Gott Nytt År! =D'),
('2005-12-31 10:24:00', 'Wohali', 'elmer_fudd', 'happy new yeaw!'),
('2005-12-31 10:25:00', 'Wohali', 'swedish_chef', 'heppy noo yeer!'),
('2005-12-31 12:18:00', 'juckes', 'cm_CM', 'blwyddyn newydd dda'),
('2006-01-01 03:59:00', 'BHSPitMonkey', 'us_BushAdm.', '"While we now admit the decision to have a new year was made on false information, we feel we have made the right choice."'),
('2006-01-01 08:22:00', 'Adridon', 'de_SN', 'N''Guddes Neus'),
('2006-01-01 08:32:00', 'Warlord96', 'en_md5', '3941ba96958a62622fc4c8c2221b6d91'),
('2006-01-01 08:32:00', 'Warlord96', 'en_sha1', '7d6ce36e9287f8c8339bd10be2440058bc8f5291'),
('2006-01-01 08:33:00', 'Warlord96', 'en_rot13', 'Unccl Arj Lrne'),
('2006-01-01 08:34:00', 'Warlord96', 'comp_slackware', 'upgradepkg year-2006-i486-1.tgz'),
('2006-01-01 08:35:00', '_phate_', 'en_c', 'printf("HAPY NEW YEER!\n");'),
('2006-01-01 08:35:00', 'cprior', 'en_HTML', '<h1>Happy New Year!</h1>'),
('2006-01-01 08:36:00', 'Warlord96', 'en_mute', '. . .'),
('2006-01-01 08:39:00', 'tw3k', 'en_tw3k', '0c5058810d37a8e005a908aca7747a8c'),
('2006-01-01 08:40:00', 'Warlord96', 'en_clueless', 'lol wat did i miss teh new year again?????/'),
('2006-01-01 08:42:00', 'tw3k', 'en_anonymous', 'int i;main(){for(;i["]<i;++i){--i;}"];read(''-''-''-'',i+++"Happy NewYear!\\n",''/''/''/''));}read(j,i,p){write(j/p+p,i---j,i/i);}'),
('2006-01-01 08:45:00', 'shastry', 'en_java', 'public class hny2006 { public static void main (String args[]) { System.out.println("Happy New Year"); } }'),
('2006-01-01 08:46:00', '_phate_', 'jp_babelfish-kan', 'けましておめでとう!'),
('2006-01-01 09:58:00', 'cprior', 'en_hangover', 'Nasty bastard, that surgeon! (replacing the tongue with a rabbit overnight)'),
('2006-01-01 12:22:00', 'mur', 'en_dyslexic', 'Happy new ears!!!'),
('2006-01-01 12:25:00', 'BHSPitMonkey', 'ie_Irish', 'How about a drink, Patty?'),
('2006-01-01 12:33:00', 'BHSPitMonkey', 'jp_haiku', 'And as the year dawns, we hope you a better one, than the one before.'),
('2006-12-31 11:12:31', '_cikgu_', 'es_ES', '¡Feliz Año Nuevo!'),
('2006-12-31 11:13:36', '_cikgu_', 'es_EU', 'Urte Berri On!'),
('2006-12-31 11:19:44', 'bienc', 'en_AU', 'happy new years mate'),
('2006-12-31 11:19:53', 'rob', 'en_au', 'Happy New Year!'),
('2006-12-31 11:22:11', 'kommander-tom', 'fr_FR', 'Bonne année!'),
('2006-12-31 11:31:27', 'Roman', 'pl_PL', 'Szczesliwego Nowego Roku!'),
('2006-12-31 12:23:07', 'Peter', 'en_text', 'hpy nw yrz ppls'),
('2006-12-31 12:23:38', 'Peter', 'en_Ceiling_Cat', 'I''m in your clockz changing your yearz.'),
('2006-12-31 12:36:55', 'vt', 'ru_SU', 'С наступающем Новым Годом'),
('2006-12-31 13:03:46', 'inspired', 'no_NO', 'Godt nyttår!'),
('2006-12-31 13:04:45', 'inspired', 'no_NN', 'Godt nyår!'),
('2006-12-31 14:37:46', 'rob', 'en_DrunkenAussie', 'Crikey happy new year, cobber!'),
('2006-12-31 15:10:40', 'Gamez', 'en_gentoo', 'emerge -uDv world;[ebuild U ] system-extra/year-2007 [2006]'),
('2006-12-31 16:43:57', 'inspired', 'lt_LT', 'laimingų Naujųjų Metų'),
('2006-12-31 16:47:42', 'WindowsUninstall', 'it_IT', 'Felice Anno Nuovo'),
('2006-12-31 17:02:27', 'xyr', 'en_en', 'Happy new year!'),
('2006-12-31 17:03:46', 'ankon|D', 'de_DE', 'Frohes Neues Jahr!'),
('2006-12-31 17:41:37', 'FZ', 'tr_TR', 'Mutlu yeni yıllar!'),
('2006-12-31 17:43:00', 'kojiro', 'en_US', 'Happy New<hic>Yeah!'),
('2006-12-31 17:45:00', 'kojiro', 'zh_HK', 'san nin fai lok'),
('2006-12-31 17:58:31', 'kojiro', 'en_CA', 'Happy New Yeeear, eh?'),
('2006-12-31 18:51:09', 'njsg', 'pt_PT', 'Feliz Ano Novo'),
('2007-01-01 00:56:55', 'riczho', 'zh_CN', '新年快乐!'),
('2007-01-01 01:02:19', 'altoid', 'sr_BA', 'Sretna Nova Godina!'),
('2007-01-01 01:03:32', 'altoid', 'sr_YU', 'Sretna Nova Godina!'),
('2007-01-01 07:42:16', 'StevenBao', 'en_US', 'Foo bar hi'),
('2007-01-02 10:34:00', 'phadthai', 'ca_FR', 'banany, st-cibouaire!');

I am a suit, not a geek! ;)

, ,

19:38 queru * hi all another time
19:39 queru * Anyone can help me on how to internationalize an interface
using MySQL to store the _messages?
19:46 queru * ¡Aleluya!
19:46 queru * http://my.opera.com/cpr/blog/show.dml/120232
19:47 queru * A geek whos pastes the table structure for i18n
19:50 queru * Two days loss for i18n
19:50 queru * Hurra for frameworks!
20:51No new messages in awaylog
20:51[freenode] You are no longer marked as being away
20:52 cprior * heh, that's me!
[20:53] [cprior(+ei)] [3:#symfony(+n)]

An IRC log bot with MySQL and flat-file fallback

, , , ...

A bit hackish, but working.

Usage: ~$ php path/to/followingFile.php

<?php
/**
 * An IRC logbot based on PEAR::NET_SmartIRC
 *
 * Logs an IRC channel to a MySQL database, triggered by "ActionHandler"s
 * as implemented in SmartIRC.
 *
 * ActionHandler values are defined in Net_SmartIRC/SmartIRC/defines.php
 * Normal conversation can be caught by SMARTIRC_TYPE_CHANNEL,
 * a /me is a SMARTIRC_TYPE_ACTION
 *
 * There is currently no logging for joins/quits/etc.
 *
 * This script has been written on a server with PHP Version 4.4.0-4
 * and a MySQL server version 4.1.15
 *
 * @author Chris Prior <public@prior-i.de>
 *
 */

//include the pear class (doesn't need an include_path for that dir)
include_once('php/Net/SmartIRC.php');

class irclogbot extends Net_SmartIRC
{
  var $hasDbConn=false;
  var $mysql_host='localhost';
  var $mysql_user='cpr';
  var $mysql_password='pass';
  var $mysql_db='irc';
  var $mysql_table='irc_log_test';
  var $log_obj;
  var $stats_obj;
  var $loggables=array('nick','ident','host','type','from','channel','message');
  var $logfileIfMysqlError='errorMysqlINSERT.log';

  //function irclogbot(&$log_obj,&$stats_obj2){
  //}

  /*
   * overwriting existing function
   */
  function _nicknameinuse()
  {   
      $newnickname = $this->_nick.'_';
      $this->changeNick($newnickname, SMARTIRC_CRITICAL);
      $this->_register();
  }

  //unused
  function _register()
  {   
      $this->_send('/msg NickServ IDENTIFY sdcy0', SMARTIRC_CRITICAL);
  }

  /*
   * Basic MySQL auth
   */
  function connect_database()
  {
      $link = @mysql_connect($this->mysql_host, $this->mysql_user, $this->mysql_password)
         or die("Keine Verbindung möglich: " . mysql_error());
      $this->hasDbConn = @mysql_select_db("cpr") or die("db select failed.");
  }

  /*
   * the workhorse logging method
   *
   * Checks for content of $data-> object as returned from PEAR class,
   * constructs a SQL statement and inserts with connection check
   *
   * Outputs some stuff to stdout
   * Don't confuse the 2 stdout sources: parent::setDebug also does it!
   *
   * never change the methodname to 'log', incompatible to the PEAR class!
   *
   */
  function my_log(&$irc='',&$data='')
  {
    $doit=true;
    //quick hack to filter out server msg marked S*_TYPE_CHANNEL
    foreach($this->loggables as $v){
      if (!isset($data->$v)) $doit=false;
      //else echo "$v has " . $data->$v."\n"; //debug
    }
    if($doit){
      //there is an 'ACTION' prefix for the message, I strip it.
      //To recognize a type `action` I still have the value 256 in the col `type`
      if(256==$data->type) {
        $data->message = substr($data->message,8);
        $data->message = substr($data->message,0,strlen($data->message)-1);
        }//end if type 256 == action
      /**
       * The following does not work if there is no db link,
       * so I use mysql_real_escape_string selectively.
       * This leaves the error log unescaped!!!
       *
      */
      //split for original debugging as above, could be merged into one foreach
      foreach($this->loggables as $v) {
        //http://php.net/manual/en/function.stripslashes.php#51390
        if (get_magic_quotes_gpc())
          $data->$v = stripslashes($data->$v);
        //can't use it on the ready query as it would return 
        // *VALUES '\'myNickName\',*
        if(!is_numeric($data->$v) AND $this->hasDbConn ) 
          $data->$v = @mysql_real_escape_string($data->$v);
      }
    }//end if $doit
    //no linebreaks or mysql_real_escape_string breaks the statement!
    $sql = sprintf("INSERT INTO %s "
      . "(`nick`, `ident`, `host`, `type`, `from`, `channel`, `message` ) "
      . " VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s');",
      $this->mysql_table,
      $data->nick,
      $data->ident,
      $data->host,
      $data->type,
      $data->from,
      $data->channel,
      $data->message
    );
    //echos to stdout
    echo $sql;

    /**
     * Now we are fighting hard to preserve the log
     */
    //the mysql INSERT query
    if(!$this->hasDbConn){
      $irc->connect_database();
      if(!$this->hasDbConn){
        $this->logInsertIfMysqlError($sql);
      }
    }
    //new if, not elseif, so a success above triggers
    if($this->hasDbConn == true AND $doit)
    {
      //echo "hasDbConn\n";
      $result = @mysql_query($sql);
      if (!$result) {
        echo('invalid query: ' . mysql_error());
        $this->logInsertIfMysqlError($sql);
      }
    }//end if hasDbConn*
    else {
      $this->logInsertIfMysqlError($sql);
      echo "\n WARNING! Has no DB connection! WARNING!\n";
    }
    echo "\n\n";
  }

  /**
   * Fallback if no MySQL conn
   *
   * I got an 'invalid query: MySQL server has gone away' after long a silence.
   * This is to preserve the INSERT statements for later addition to the db.
   */
  function logInsertIfMysqlError($content){

    echo "Trying to log into error logfile ".$this->logfileIfMysqlError."\n";
    if(!file_exists($this->logfileIfMysqlError)){
      if (touch($this->logfileIfMysqlError) === false){
        echo "cannot touch the non-existing file!"."\n";
        continue;
      }
    }
    if (!is_writable($this->logfileIfMysqlError)) {
       if (!chmod($this->logfileIfMysqlError, 0666)) {
         echo "Cannot change the mode of file ($this->logfileIfMysqlError)"."\n";
         continue;
       };
     }
     if (!$fp = @fopen($this->logfileIfMysqlError, "a")) {
       echo "Cannot open file ($this->logfileIfMysqlError)"."\n";
       continue;
     }
     if (fwrite($fp, $content."\n") === FALSE) {
       echo "Cannot write to file ($this->logfileIfMysqlError)"."\n";
       continue;
     } 
     else echo "ERROR LOGGED! Wrote into ".$this->logfileIfMysqlError."\n";
     if (!fclose($fp)) {
       echo "Cannot close file ($this->logfileIfMysqlError)"."\n";
       continue;
     }
      
  }//end function

  /**
   * Calling this at startup might catch the worst scenario and
   * renders the above logInsertIfMysqlError($str) useless in many respects
   */
  function testForErrorLogfile(){
     if (!$fp = @fopen($this->logfileIfMysqlError, "a")) {
       echo "Cannot open file ($this->logfileIfMysqlError)"."\n";
       exit;
     }
  }//end function

  //doesn't work as expected, but I don't care
  function my_quit(&$this, &$ircdata)
  {
    echo 'FooBar';
    $this->quit("The Bot sfLog has quit.");
  }

}//end class ######################################

$irc = &new irclogbot();
$irc->testForErrorLogfile();
//$irc->connect_database();

//pear/Net_SmartIRC/SmartIRC/defines.php
$irc->setDebug(SMARTIRC_DEBUG_NOTICE|SMARTIRC_DEBUG_CONNECTION|SMARTIRC_TYPE_ACTION|SMARTIRC_TYPE_CHANNEL);
$irc->setUseSockets(TRUE);
$irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL, '^sfLog: !quit', $irc, 'my_quit');

//pear/Net_SmartIRC/SmartIRC/defines.php
//SMARTIRC_TYPE_CHANNEL is defined as `2` and this gets inserted into the db
//never change the methodname to 'log', as it is incompatible to the PEAR class
$irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL, '^.?', $irc, 'my_log');

//type channel does not catch /me et al.
$irc->registerActionhandler(SMARTIRC_TYPE_ACTION, '^.?', $irc, 'my_log');

$irc->connect('irc.freenode.de', 6667);

//Usage: login(nick, realname, usermode, username, password);
$irc->login('nick', 'Chris Prior', 8, 'nick','pass');

$irc->join(array('#test'));
$irc->listen();
$irc->disconnect();
?>


So you need the sql schema? Here it is:

DROP TABLE IF EXISTS `irc_log`;
CREATE TABLE IF NOT EXISTS `irc_log` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `datetime` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `nick` varchar(32) NOT NULL default '',
  `ident` varchar(64) NOT NULL default '',
  `host` varchar(254) NOT NULL default '',
  `type` varchar(4) NOT NULL default '',
  `from` varchar(254) NOT NULL default '',
  `channel` varchar(32) NOT NULL default '',
  `message` text NOT NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `nick_msg` (`nick`,`message`)
)DEFAULT CHARSET=utf8;

cpr.in-berlin.de/happyNewYear.php

, ,

Dec 31 10:21 am@@@de_DE@@@Frohes neues Jahr!@@@cprior
Dec 31 10:21 am@@@fr_FR@@@Bonne année!@@@Wohali
Dec 31 10:21 am@@@ja_JP@@@oshogatsu omedetou@@@Wohali
Dec 31 10:22 am@@@ru_RU@@@S Novim godom! =]@@@Stalwart
Dec 31 10:22 am@@@eo_EO@@@felicxigan novan jaron!@@@mateo
Dec 31 10:22 am@@@lv_LV@@@Laimigu Jauno gadu!@@@Stalwart
Dec 31 10:23 am@@@ch_DE@@@Es guets nöis!@@@Jax
Dec 31 10:23 am@@@en_AU@@@ava bonza new year!@@@mateo
Dec 31 10:23 am@@@sv_SE@@@Gott Nytt År! =D@@@nocturnal
Dec 31 10:24 am@@@elmer_fudd@@@happy new yeaw!@@@Wohali
Dec 31 10:25 am@@@swedish_chef@@@heppy noo yeer!@@@Wohali
Dec 31 12:18 pm@@@cm_CM@@@blwyddyn newydd dda@@@juckes
Dec 31 1:05 pm@@@en_GB@@@Happy new year!@@@Jibbler
Dec 31 1:05 pm@@@es_ES@@@feliz ano nuevo!@@@numist
Dec 31 1:06 pm@@@fi_FI@@@Hyvää uutta vuotta!@@@janne_oksanen
Dec 31 2:11 pm@@@no_NO@@@God Nytt År@@@Cippo
Dec 31 2:12 pm@@@da_DK@@@Godt nytår@@@stelki
Dec 31 2:17 pm@@@sv_SE@@@buorre eahket@@@nocturnal
Dec 31 2:22 pm@@@be_NL@@@Gelukkig Nieuwjaar@@@roel
Dec 31 4:40 pm@@@nl_NL@@@Gelukkig nieuwjaar!@@@empoor
Dec 31 4:44 pm@@@zh_CN@@@新年好@@@Nirgal
Dec 31 4:45 pm@@@en_C++@@@year++; this.assign(happy);@@@mur
Dec 31 4:47 pm@@@en_CPP@@@year.increase(); this.assign(emotion.happy.get());@@@mur
Dec 31 4:48 pm@@@es_AR@@@feliz año nuevo!@@@StyXman
Dec 31 4:50 pm@@@en_DADAISM@@@True old rotten banana!@@@mur
Dec 31 4:51 pm@@@en_bash@@@if [ $YEAR == "2006" ]; then $HAPPY = "True"; else $YEAR = "2006"; fi@@@Warlord96
Dec 31 6:50 pm@@@blah_blah@@@padfjajkfbshk fuoasdhf wfhas@@@encoded
Dec 31 6:50 pm@@@pt_BR@@@Feliz ano novo!@@@paul0
Dec 31 6:51 pm@@@ie_IE@@@Bliain Mhaith Úr.@@@decibelle
Dec 31 6:52 pm@@@eo_EO@@@Feliĉan Novjaron!@@@mateo
Dec 31 6:52 pm@@@hi_IN@@@नव वर्ष की शुभकामनाए@@@shastry
Dec 31 6:53 pm@@@hny_hny@@@HNY!@@@phaeton
Dec 31 6:58 pm@@@bear_FI@@@murr murrr murr!@@@mur
Dec 31 6:58 pm@@@bear_EN@@@groarrrr groarrr!@@@mur
Dec 31 7:06 pm@@@he_IL@@@Shana tova! (transliterated) (wrong time of year for this) (oh well) :)@@@decibelle
Dec 31 7:07 pm@@@en_rot13@@@Unccl arj lrne, sbyxf!@@@Wohali
Dec 31 7:08 pm@@@en_morse@@@.... .- .--. .--. -.-- / -. . .-- / -.-- . .- .-. --..-- / ... ..- -.-. -.- . .-. ...@@@Wohali
Dec 31 7:08 pm@@@ba_BA@@@Sretna nova godina@@@daBlade
Dec 31 7:08 pm@@@fi_binary@@@01001 00001 11100 10111 01101 11001 00111 00100 00100 00001 11010 10111 01010 11101 00011 10100 01100 00100 10000 00111 01100 11101 01011 01111 01110 10001 11010 00110 00010 01000 01@@@mur
Dec 31 7:09 pm@@@en_C@@@printf("Happy New Year!")@@@mur
Dec 31 7:10 pm@@@vl_vl@@@Seveh uzh tevun!@@@Wohali
Dec 31 7:10 pm@@@en_BASIC@@@10 PRINT "happy new year!"@@@mur
Dec 31 7:10 pm@@@en_pig@@@appyhay ewnay earyay!@@@Peter
Dec 31 7:11 pm@@@en_base64@@@aGFwcHkgbmV3IHllYXJzIQ==@@@nforbes
Dec 31 7:11 pm@@@en_morse@@@. . . . . _ . _ _ . . _ _ . _ . _ _ _ . . . _ _ _ . _ _ . . _ . _ .@@@Peter
Dec 31 7:11 pm@@@en_B1FF@@@H4PPY |\|3\/\/ Y34R@@@Wohali
Dec 31 7:12 pm@@@en_depressive@@@new year's eve sucks@@@ankon
Dec 31 7:17 pm@@@kn_IN@@@ಹೊಸ ವರ್ಷದ ಶುಭಾಶಯಗಳು @@@shastry
Dec 31 7:18 pm@@@en_php@@@echo ('Happy New Years!');@@@spyro_boy
Dec 31 7:18 pm@@@en_ruby@@@puts 'Happy New Years!'@@@nforbes
Dec 31 7:19 pm@@@he_IL@@@שנה טובה @@@decibelle
Dec 31 7:20 pm@@@en_leet@@@/-/4/>/>`/ /\/3\/\/ `/34/25 @@@spyro_boy
Dec 31 7:22 pm@@@es_efe@@@Fefelifiz Afañofo Nuefevofo! @@@alvarezp
Dec 31 7:23 pm@@@en_Shareware@@@Welcome to New Year 2006! Register now for extra features like *Happy* New Year and future upgrades to New Year 2007! @@@phaeathon
Dec 31 7:23 pm@@@en_Pirate@@@Yarrrr me hearties! Have a happy new year! Avast me swines! @@@Peter
Dec 31 7:24 pm@@@en_gangsta@@@Yo bro! Happy Fucking New Years! @@@spyro_boy
Dec 31 7:24 pm@@@sheep_en@@@meeh meeeh meh! @@@Peter
Dec 31 7:24 pm@@@fi_perkele@@@Perkele saatanan hyvää vuotta! @@@mur
Dec 31 7:25 pm@@@en_explosives@@@*BOOM* @@@ankon
Dec 31 7:26 pm@@@ro_RO@@@An Nou Fericit! La multi ani !! @@@reallove
Dec 31 7:26 pm@@@en_godfather@@@Happy New Year from La Famiglia. Now, where's ma cigar? @@@spyro_boy
Dec 31 7:27 pm@@@la_LA@@@Laetus novus annus! @@@nforbes
Dec 31 7:28 pm@@@en_MichealJackson@@@I love you all! @@@ankon
Dec 31 7:28 pm@@@en_AOL@@@lolz hny every1 r u gud 2day?? @@@nforbes
Dec 31 7:30 pm@@@en_pessimistic@@@Why bother.. the year wont change anyways... @@@mur
Dec 31 7:32 pm@@@en_slackware@@@clear ; date ; import happy_new_years.jpeg @@@spyro_boy
Dec 31 7:32 pm@@@en_freebsd@@@cd /usr/ports/misc/hny && make install @@@ankon
Dec 31 7:34 pm@@@en_y2k@@@Happy Old Year! @@@alvarezp
Dec 31 7:34 pm@@@en_windows@@@Are you sure you want to change this year 2005 to new year 2006? The action is undoable. @@@mur
Dec 31 7:35 pm@@@en_arcade@@@Game Over! Insert coin to continue @@@ankon
Dec 31 7:35 pm@@@en_vi@@@s/2005/2006/ @@@Peter
Dec 31 7:36 pm@@@en_y-two-k@@@Happy Old Year! @@@alvarezp
Dec 31 7:36 pm@@@en_mother@@@Would you please clean your room? @@@ankon
Dec 31 7:36 pm@@@en_Y2K@@@Happy new year 1806!! @@@mur
Dec 31 7:37 pm@@@en_spam@@@happy new year spam! @@@encoded
Dec 31 7:39 pm@@@en_AOL@@@/nick Sexy-Girl-2006 @@@nforbes
Dec 31 7:54 pm@@@en_warez@@@new.year.party.2006[DVD-RIP[HDTV-LoL]].avi@@@Peter
Dec 31 7:54 pm@@@en_SQL@@@SELECT year FROM century WHERE year > current_year; @@@ankon
Dec 31 7:56 pm@@@en_p2p@@@bathroom_secks_2006_lol_pron_hentai_jap_french.avi @@@spyro_boy
Dec 31 7:58 pm@@@en_PANIC@@@Help! New Year is coming to get me! @@@ankon
Dec 31 7:58 pm@@@en_IRC@@@/set #newyear +happy @@@chaosite
Dec 31 7:59 pm@@@es_mxfresa@@@O sea, feliz año nuevo, güey! @@@alvarezp
Dec 31 7:59 pm@@@en_police@@@Nothing to see here folks @@@ankon
Dec 31 8:00 pm@@@fr_FR@@@bananier et pommes sautées @@@Wohali
Dec 31 8:04 pm@@@en_/.@@@I for one welcome our 2006 time overlords. @@@Madvax
Dec 31 8:05 pm@@@en_netcrafttroll@@@the old year is dead! netcraft confirms it! @@@ankon
Dec 31 8:08 pm@@@en_SandwichSign@@@REPENT! @@@BHSPitMonkey
Dec 31 8:14 pm@@@la_latin@@@Bonum annum ingrediaris @@@Hortensius
Dec 31 8:22 pm@@@de_yiddish@@@ejn gut rosh @@@Hortensius
Dec 31 8:28 pm@@@de_alsacian@@@E glecklichs Nej Johr! @@@Hortensius
Dec 31 8:31 pm@@@il_hebrew@@@leshana tova tikosevu @@@Hortensius
Dec 31 8:35 pm@@@nl_medieval@@@Een goet, salich jaer @@@Hortensius
Dec 31 8:48 pm@@@greek_classical@@@Kalòn étos isélthois @@@Hortensius
Dec 31 8:56 pm@@@ch_romansch@@@Legreivel niev onn @@@Hortensius
Dec 31 8:57 pm@@@ru_votian@@@Yvää uutta vootta! @@@Hortensius
Dec 31 9:13 pm@@@cz_CZ@@@Stastny novy rok! @@@roel
Dec 31 9:18 pm@@@ie_IE(2)@@@Blian nua faoi mhaise duit @@@Hortensius
Dec 31 9:29 pm@@@is_IS@@@Farsælt komandi ár @@@Hortensius
Dec 31 9:39 pm@@@comp_gentoo@@@USE="happiness" emerge year-2006.0_rc1 -va #sic@@@cprior
Dec 31 9:42 pm@@@en_Dick-Clark@@@Hi, I'm Dick Clark, and welcome to New Year's Rockin' Eve' 2006! @@@BHSPitMonkey
Jan 01 12:22 am@@@en_dyslexic@@@Happy new ears!!! @@@mur
Jan 01 12:25 am@@@ie_Irish@@@How about a drink, Patty?@@@BHSPitMonkey
Jan 01 12:33 am@@@jp_haiku@@@And as the year dawns, we hope you a better one, than the one before. @@@BHSPitMonkey
Jan 01 3:59 am@@@us_BushAdm.@@@"While we now admit the decision to have a new year was made on false information, we feel we have made the right choice." @@@BHSPitMonkey
Jan 01 8:22 am@@@de_SN@@@N'Guddes Neus@@@Adridon
Jan 01 8:32 am@@@en_md5@@@3941ba96958a62622fc4c8c2221b6d91 @@@Warlord96
Jan 01 8:32 am@@@en_sha1@@@7d6ce36e9287f8c8339bd10be2440058bc8f5291 @@@Warlord96
Jan 01 8:33 am@@@en_rot13@@@Unccl Arj Lrne @@@Warlord96
Jan 01 8:34 am@@@comp_slackware@@@upgradepkg year-2006-i486-1.tgz @@@Warlord96
Jan 01 8:35 am@@@en_c@@@printf("HAPY NEW YEER!\n"); @@@_phate_
Jan 01 8:35 am@@@en_HTML@@@<h1>Happy New Year!</h1>@@@cprior
Jan 01 8:36 am@@@en_mute@@@. . . @@@Warlord96
Jan 01 8:39 am@@@en_tw3k@@@0c5058810d37a8e005a908aca7747a8c @@@tw3k
Jan 01 8:40 am@@@en_clueless@@@lol wat did i miss teh new year again?????/ @@@Warlord96
Jan 01 8:42 am@@@en_anonymous@@@int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"Happy NewYear!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);} @@@tw3k
Jan 01 8:45 am@@@en_java@@@public class hny2006 { public static void main (String args[]) { System.out.println("Happy New Year"); } } @@@shastry
Jan 01 8:46 am@@@jp_babelfish-kanji@@@けましておめでとう! @@@_phate_
Jan 01 9:58 am@@@en_hangover@@@Nasty bastard, that surgeon! (replacing the tongue with a rabbit overnight) @@@cprior
November 2009
S M T W T F S
October 2009December 2009
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30