I created a dirty fix to archive chat activity onto mysql ; two file will need to be modified:
file.class.php and pfccontainer.class.php
On file.class.php add this function:
/**
* funtions to log chat activity to db // DeveloperShed Sergio F. Rodriguez
*
**/
function setLog($chan, $today, $hour, $m, $nick, $msg ,$cmd){
$c =& $this->c;
//connect to db//
$con = mysql_connect($hostane= 'xx.xx.xx.xx',$username= 'xxx', $password='xxxx');
//select db//
$sel = mysql_select_db('Db_name');
//set query//
$query = "INSERT INTO `Table`.`chat_log`
( `id` , `chatname` ,`date` , `time` ,`m` , `nick` ,`log`, `cmd`)
VALUES
(NULL , '$chan' , '$today', '$hour', '$m', '$nick', '$msg' ,'$cmd' )";
//run query//
$sql = mysql_query($query) or die('error'. mysql_error());
}
On pfccontainer.class.php add the following:
//this call goes WITHIN the funtion write//
//right after
//write message "$this->setMeta("channelid-to-msg", $this->encode($chan), $msgid, $data);"
//write log into db developershed sergio f. rodriguez//
$today = date("d/m/Y");
$hour = date("H:i:s");
$m = date('A');
//this will call to do the db insertion //
$this->setLog($this->encode($chan),$today, $hour, $m, $nick, $param, $cmd);
In the same file pfccontainer.class.php at the end of the class add:
/*
*log system developer shed // sergio f. rodriguez
*
*/
function setLog($group, $subgroup, $leaf, $leafvalue = NULL)
{ die(_pfc("%s must be implemented", get_class($this)."::".__FUNCTION__)); }
Now lets create the db table:
Now your phpfreechat has a DB driven activity log.
Cheers!