I modified /freichat/index.php to generate the correct session and hash data and then redirect the user to the relevant file with the data added to the URL. I then added a link to the menu pointing to this file. In this way the mobile template is always called with the correct session and hash data. It also gets rid of the splash screen that shows the install and admin links - not something that I want my users to see.
I still have some issues related to my iPhone 5 as the mobile template does not display correctly, and without the code above forcing the mobile template to display freichat does not show at all.
It appears that freichat does not detect iPhone correctly - well at least not on my site.
define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/..' ));
require_once ( JPATH_BASE .'/includes/defines.php' );
require_once ( JPATH_BASE .'/includes/framework.php' );
$mainframe = JFactory::getApplication('site');
$host = JURI::root();
$document = JFactory::getDocument();
$session = JSession::getInstance("none",array());
$ses=$session->getId();
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file(JPATH_SITE."/freichat/hardcode.php")){
require(JPATH_SITE.'/freichat/hardcode.php');
$temp_id = $ses . $uid;
return md5($temp_id);
} else {
echo "<script>alert('chat module says: arg.php file not found!');</script>";
}
}
}
$chatURL = 'https://mysite.com/freichat/client/chat.php?id='.$ses.'&xhash='.freichatx_get_hash($ses).'&mobile=1';
header('Location: '.$chatURL);
exit;
I modified /freichat/index.php to generate the correct session and hash data and then redirect the user to the relevant file with the data added to the URL. I then added a link to the menu pointing to this file. In this way the mobile template is always called with the correct session and hash data. It also gets rid of the splash screen that shows the install and admin links - not something that I want my users to see.
I still have some issues related to my iPhone 5 as the mobile template does not display correctly, and without the code above forcing the mobile template to display freichat does not show at all.
It appears that freichat does not detect iPhone correctly - well at least not on my site.
````
define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/..' ));
require_once ( JPATH_BASE .'/includes/defines.php' );
require_once ( JPATH_BASE .'/includes/framework.php' );
$mainframe = JFactory::getApplication('site');
$host = JURI::root();
$document = JFactory::getDocument();
$session = JSession::getInstance("none",array());
$ses=$session-&gt;getId();
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file(JPATH_SITE."/freichat/hardcode.php")){
require(JPATH_SITE.'/freichat/hardcode.php');
$temp_id = $ses . $uid;
return md5($temp_id);
} else {
echo "&lt;script&gt;alert('chat module says: arg.php file not found!');&lt;/script&gt;";
}
// return 0;
}
}
$chatURL = 'https://mysite.com/freichat/client/chat.php?id='.$ses.'&xhash='.freichatx_get_hash($ses).'&mobile=1';
header('Location: '.$chatURL);
exit;
````