I wanted to call phpfreechat with different configurations depending on a parameter
for example
http://...../index.php?custom_conf=21
http://...../index.php?custom_conf=22
the index.php looks like this
require_once "src/phpfreechat.class.php"; // adjust to your own path
$params["serverid"] = md5(__FILE__); // used to identify the chat
if ( array_key_exists( 'custom_conf', $_REQUEST ) )
{
$cust = $_REQUEST[ 'custom_conf' ];
}else{
$cust = '-1';
}
switch( $cust )
{
case ( 1 ):
{
$params['title'] = 'Chile Lindo';
$params["channels"][] = "Chile";
break;
}
case ( 22 ):
{
$params['title'] = 'Viva México';
$params["channels"][] = "México";
break;
}
default:
{
$params['title'] = 'me gusta el tango';
$params["channels"][] = "Tangueras";
break;
}
}
$params["channels"][] = "Amigos";
$params["channels"][] = "Amigas";
$params["channels"][] = "El Bar";
$params["channels"][] = "La Playa";
$params["channels"][] = "Mayorcitos";
so i needed to support different configuration files on the cache directory
then i modify the method _GetCacheFile on the class file pfcglobalconfig.class.php
the new code now looks like this
function _GetCacheFile($serverid = "", $data_private_path = "")
{
if ($data_private_path == '')
{
$data_private_path = $this->data_private_path;
}
if ($serverid == '')
{
$serverid = $this->getId();
}
if ( array_key_exists( 'custom_conf', $_REQUEST ) )
{
return( $data_private_path.'/cache/cust_'.$serverid.'_'.md5($_REQUEST['custom_conf']).'.php' );
}
return $data_private_path.'/cache/'.$serverid.'.php';
}
please check it and consider to add it or some similar feature to the next releases of phpfreechat