FreiChat related discussions
Create menu item to link to mobile layout

Hi I have purchased corporate version of freight with mobile integration. Everything is working fine on desktop version however with the mobile version of my site I have a small issue.

If I force the user agent in my browser I can see the link button and can view the mobile version of freichat with no issues but when viewing from my iPhone the mobile template that I use seems to override this and I cannot see the button.

This is not a problem as I would simply like to add an item to the main menu to link to the mobile chat. This will solve my issue and fit best with my mobile template.

How can I do this?

Thanks in advance.

Mick.

Hi I have purchased corporate version of freight with mobile integration. Everything is working fine on desktop version however with the mobile version of my site I have a small issue. If I force the user agent in my browser I can see the link button and can view the mobile version of freichat with no issues but when viewing from my iPhone the mobile template that I use seems to override this and I cannot see the button. This is not a problem as I would simply like to add an item to the main menu to link to the mobile chat. This will solve my issue and fit best with my mobile template. How can I do this? Thanks in advance. Mick.

This is not a problem as I would simply like to add an item to the main menu to link to the mobile chat

How will you add the menu item ? Will you edit the template ?

Can you give a class to the menu item i.e the link ?
for eg.

  <a href="#" class="frei_mobile_chat" >Open chat</a>
&amp;gt;This is not a problem as I would simply like to add an item to the main menu to link to the mobile chat How will you add the menu item ? Will you edit the template ? Can you give a class to the menu item i.e the link ? for eg. ``` &amp;lt;a href=&quot;#&quot; class=&quot;frei_mobile_chat&quot; &amp;gt;Open chat&amp;lt;/a&amp;gt; ```

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>";
           }

    //       return 0;
    }
}


$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( &#039;_JEXEC&#039;, 1 ); define( &#039;JPATH_BASE&#039;, realpath(dirname(__FILE__).&#039;/..&#039; )); require_once ( JPATH_BASE .&#039;/includes/defines.php&#039; ); require_once ( JPATH_BASE .&#039;/includes/framework.php&#039; ); $mainframe = JFactory::getApplication(&#039;site&#039;); $host = JURI::root(); $document = JFactory::getDocument(); $session = JSession::getInstance(&quot;none&quot;,array()); $ses=$session-&amp;gt;getId(); if(!function_exists(&quot;freichatx_get_hash&quot;)){ function freichatx_get_hash($ses){ if(is_file(JPATH_SITE.&quot;/freichat/hardcode.php&quot;)){ require(JPATH_SITE.&#039;/freichat/hardcode.php&#039;); $temp_id = $ses . $uid; return md5($temp_id); } else { echo &quot;&amp;lt;script&amp;gt;alert(&#039;chat module says: arg.php file not found!&#039;);&amp;lt;/script&amp;gt;&quot;; } // return 0; } } $chatURL = &#039;https://mysite.com/freichat/client/chat.php?id=&#039;.$ses.&#039;&amp;xhash=&#039;.freichatx_get_hash($ses).&#039;&amp;mobile=1&#039;; header(&#039;Location: &#039;.$chatURL); exit; ````

Can you provide us with your website address and a test account ?

Can you provide us with your website address and a test account ?

I have fixed the issue.

The problem was that as I was calling the script outside of Joomla/Jomsocial the query framework was not being loaded. Jquery is a dependent of Jquery mobile.

I added a call to load Jquery and the issue is now resolved.

You should consider adding an option for this. ;)

I have fixed the issue. The problem was that as I was calling the script outside of Joomla/Jomsocial the query framework was not being loaded. Jquery is a dependent of Jquery mobile. I added a call to load Jquery and the issue is now resolved. You should consider adding an option for this. ;)
199
4
0
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft