Author Topic: freichat integration script god  (Read 16348 times)

csibusz

  • Prime Member
  • ****
  • Posts: 165
  • Karma: +17/-2
freichat integration script god
« on: May 18, 2013, 02:27:31 PM »
Tried working code

1)Firstly you need to download the latest version of this chat http://codologic.com/page/codo_commerce/buy choose the free version.

2) unzip it.

3) move it to the location you want, best place would be www.yoursite.com/freichat

4) Go to www.yoursite.com/freichat

5) Choose Custom Integration

6) at the end copy the code.



7) Open up frame.php and at the bottom after the last line close the php by typing in ?> then after ?> do the following


Code: [Select]
<html>
<head>
<?php
if(isset($_SESSION[_LICENSE_KEY_]['user']['user_id'])==true) {$ses=$_SESSION[_LICENSE_KEY_]['user']['user_id']; } else {$ses=0;}


if(!
function_exists("freichatx_get_hash")){
function 
freichatx_get_hash($ses){

       if(
is_file("[i]LOCATION TO YOUR SITE(THIS SHOULD ALREADY BE FILLED OUT)[/i]/freichat/hardcode.php")){

               require 
"[i]LOCATION TO YOUR SITE(THIS SHOULD ALREADY BE FILLED OUT)[/i]freichat/hardcode.php";

               
$temp_id =  $ses $uid;

               return 
md5($temp_id);

       }
       else
       {

       }

       return 
0;
}
}
?>


<script type="text/javascript" language="javascipt"src="http://LOCATION TO YOUR FOLDER/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>                       

<link rel="stylesheet" href="http://YOURSITE.COM/SITE(SHOULD BE FILLED OUT ALREADY)/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
</head>
<body>

</body>
</html>

hardcode.php change code

Code: [Select]
$usertable='dating_user_accounts'; //specifies the name of the table in which your user information is stored.
$row_username='user'; //specifies the name of the field in which the user's name/display name is stored.
$row_userid='user_id';

So it will look like the frame.php

Code: [Select]
<?php
/******************************************************************************
Etano
===============================================================================
File:                       frame.php
$Revision: 881 $
Software by:                DateMill (http://www.datemill.com)
Copyright by:               DateMill (http://www.datemill.com)
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/

// this file is a simple included file. Most stuff must be defined outside for the main page to function properly.
// you need to include this file in each and every page.

$tpl->set_file('frame','frame.html');
$message=isset($message) ? $message : (isset($topass['message']) ? $topass['message'] : (isset($_SESSION['topass']['message']) ? $_SESSION['topass']['message'] : array()));
if (!empty(
$message)) {
$message['type']=(!isset($message['type']) || $message['type']==MESSAGE_ERROR) ? 'message_error' 'message_info';
if (is_array($message['text'])) {
$message['text']=join('<br>',$message['text']);
}
$tpl->set_var('message',$message);
}
if (empty(
$no_timeout)) {
$_SESSION[_LICENSE_KEY_]['user']['timedout']=array('url'=>(((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https://' 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']),'method'=>$_SERVER['REQUEST_METHOD'],'qs'=>($_SERVER['REQUEST_METHOD']=='GET' $_GET $_POST));
}

if (
is_file(_BASEPATH_.'/events/frame.php')) {
include_once _BASEPATH_.'/events/frame.php';
}
if (isset(
$_on_before_display)) {
for ($i=0;isset($_on_before_display[$i]);++$i) {
call_user_func($_on_before_display[$i]);
}
}

$tpl->set_var('tplvars',$tplvars);
if (!empty(
$page_last_modified_time)) {
header('Cache-Control: private, max-age=0',true);
header('Last-Modified: '.date('D,d M Y H:i:s',$page_last_modified_time).' GMT',true);
}
echo 
$tpl->process('frame','frame',TPL_FINISH TPL_OPTIONAL TPL_INCLUDE);
if (isset(
$_SESSION['topass'])) {
unset($_SESSION['topass']);
}
ob_end_flush();
if (isset(
$_on_after_display)) {
for ($i=0;isset($_on_after_display[$i]);++$i) {
call_user_func($_on_after_display[$i]);
}
}

?>

<html>
<head>
<!--===========================FreiChat=======START=========================-->
<!-- For uninstalling ME , first remove/comment all FreiChat related code i.e below code
Then remove FreiChat tables frei_session & frei_chat if necessary
         The best/recommended way is using the module for installation                         -->

<?php

if(isset($_SESSION[_LICENSE_KEY_]['user']['user_id'])==true) {$ses=$_SESSION[_LICENSE_KEY_]['user']['user_id']; } else {$ses=0;}



if(!
function_exists("freichatx_get_hash")){
function 
freichatx_get_hash($ses){

       if(
is_file("C:/wamp/www/etano/freichat/hardcode.php")){

               require 
"C:/wamp/www/etano/freichat/hardcode.php";

               
$temp_id =  $ses $uid;

               return 
md5($temp_id);

       }
       else
       {
               echo 
"<script>alert('module freichatx says: hardcode.php file not
found!');</script>"
;
       }

       return 
0;
}
}
?>

<script type="text/javascript" language="javascipt"src="http://localhost/etano/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
<link rel="stylesheet" href="http://localhost/etano/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
<!--===========================FreiChatX=======END=========================-->     

</head>
<body>

</body>
</html>

csibusz

  • Prime Member
  • ****
  • Posts: 165
  • Karma: +17/-2
Re: freichat integration script god
« Reply #1 on: May 18, 2013, 02:30:28 PM »
I hope I could help  ;)

Unfortunately, I was sick so I could not share with the entire installation information as soon as possible

good chatting :)

Nash77

  • Prime Member
  • ****
  • Posts: 152
  • Karma: +12/-2
Re: freichat integration script god
« Reply #2 on: May 18, 2013, 03:12:24 PM »
csibusz Thank you for all your help.

It works just fine.

I was wondering if you or anyone else is havig problems with it working on IE 10 or is it just my laptop playing up,

It works on all other browsers.

Thank you once again its really good.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: freichat integration script god
« Reply #3 on: May 19, 2013, 03:30:36 AM »
I also tried it out with all other browsers. It's not working in IE 8 as well
I looked through the codologic forums and found a related topic where they were directing someone to add this code to a template index.php file that I couldn't find. So, I don't know where to put it if it's the answer to the problem.
Code: [Select]
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
here's the forum topic discussion that I was reading
http://codologic.com/page/node/1273
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2988
  • Karma: +210/-7
    • Maverick Webworks
Re: freichat integration script god
« Reply #4 on: May 19, 2013, 08:56:57 AM »
Since it appears that you're integrating the script into the frame.php file, try adding the meta compatibility fix for IE to the frame.html file and see if that corrects you're IE issues.

If that doesn't work try adding the meta tag to the frame.php file just below the <header> tag.

 

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: freichat integration script god
« Reply #5 on: May 19, 2013, 01:12:00 PM »
Since it appears that you're integrating the script into the frame.php file, try adding the meta compatibility fix for IE to the frame.html file and see if that corrects you're IE issues.

If that doesn't work try adding the meta tag to the frame.php file just below the <header> tag.

It didn't work. Perhaps a solution can be found through the FreiChat forum.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: freichat integration script god
« Reply #6 on: May 19, 2013, 03:26:23 PM »
my FreiChat quit working. So, I decided to reinstall it. While going through the reinstall, I get to the part where it says Can You See FreiChat?
Well, I can't see it. It worked the first time though.

If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Nash77

  • Prime Member
  • ****
  • Posts: 152
  • Karma: +12/-2
Re: freichat integration script god
« Reply #7 on: May 19, 2013, 03:50:12 PM »
Does it show up when you log into your site?

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: freichat integration script god
« Reply #8 on: May 19, 2013, 07:08:57 PM »
I was trying it out offline in xampp. I haven't yet tried it out on my live site. Could this be the problem?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Nash77

  • Prime Member
  • ****
  • Posts: 152
  • Karma: +12/-2
Re: freichat integration script god
« Reply #9 on: May 19, 2013, 07:43:22 PM »
Hello Marble,

I am about to go to bed as its the early hours here(2.40am),

My site crashed similar problems to yours, the solution which worked for me was with the code you copy into frame.php.

Well firstly I copied the code from freichat console after the installation is at the end,

I then opened up notepad an copied the code into that, I then just replaced

Code: [Select]
$ses=null;

with

Code: [Select]
if(isset($_SESSION[_LICENSE_KEY_]['user']['user_id'])==true) {$ses=$_SESSION[_LICENSE_KEY_]['user']['user_id']; } else {$ses=0;}

I then rename it chat.php ( i didn't add the <html>, <head> or <body> tags, I copied it as is from the freichat console.

I uploaded chat.php to the same place where frame.php sits,(root or what ever folder the site sits in)

The I linked it at the very end of frame.php just before ?> by using an include tag

Code: [Select]
include('chat.php');

It works fine again still not working on IE though.


so chat.php looks something like this

Code: [Select]

                    <!--===========================FreiChat=======START=========================-->
<!-- For uninstalling ME , first remove/comment all FreiChat related code i.e below code
Then remove FreiChat tables frei_session & frei_chat if necessary
         The best/recommended way is using the module for installation -->

<?php
if(isset($_SESSION['_LICENSE_KEY_']['user']['user_id'])==true
{
$ses=$_SESSION['_LICENSE_KEY_']['user']['user_id']; } else {$ses=0;}

       
if(!
function_exists("freichatx_get_hash")){
function 
freichatx_get_hash($ses){

       if(
is_file("C:/xampp/htdocs/YOURSITE/freichat/hardcode.php")){

               require 
"C:/xampp/htdocs/YOURSITE/freichat/hardcode.php";

              
$temp_id =  $ses $uid;

               return 
md5($temp_id);

       }
       else
       {
               echo 
"<script>alert('module freichatx says: hardcode.php file not
found!');</script>"
;
       }

       return 
0;
}
}
?>

<script type="text/javascript" language="javascipt"src="http://localhost/toomanyfrogs/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>                       
<link rel="stylesheet" href="http://localhost/YOURSITE/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">

<!--===========================FreiChatX=======END=========================-->               



I hope this helps, I think it is due to formatting when you copy the code that is causing everyone problems, and ftp and notepad seems to work fine. ( I did this with a users site in the US and it works fine, he was having similar problems, with it coming up with errors like $ses is undefined etc, but its fine now using the above.)

Sorry if this is coming across as me trying to teach you how to do thing you already know, just saves me typing this again for other less experienced programmers.

I hope it works for others too.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: freichat integration script god
« Reply #10 on: May 20, 2013, 12:59:57 PM »
Thanks Nash77, I'll try it out.
I consider myself as one of the less experienced or low level programmers in here even though I've been messing with Etano for 2 years. So, no worries.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: freichat integration script god
« Reply #11 on: May 20, 2013, 03:30:00 PM »
It's not working.
At first, I was installing with Firefox and it didn't show up. I then opened Chrome and Opera browsers and the chat appeared at first. When I refreshed the window, the chat disappeared. It doesn't work in Safari. Maybe I'll go ahead and install it onto my live site. Maybe it just doesn't like xampp.

When I was originally testing this out, I didn't see their names linking to profiles and I was curious to know if it's possible to do that.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Nash77

  • Prime Member
  • ****
  • Posts: 152
  • Karma: +12/-2
Re: freichat integration script god
« Reply #12 on: May 20, 2013, 03:35:33 PM »
Hello Marble,

Best way to check for errors, is go to localhost/yoursite/chat.php or whatever you have called it.(if it shows a blank page it should work.

If you need a hand with the install on your live site, then let me know, I have successfully installed it on 4 peoples sites.

Also check Freichat admin panel and go to moderation, if you see your members there then you know hardcode.php is working fine.

Let me know how you get on.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: freichat integration script god
« Reply #13 on: May 20, 2013, 03:45:46 PM »
I went directly to localhost/etano/chat.php and this error appears.

Notice: Use of undefined constant _LICENSE_KEY_ - assumed '_LICENSE_KEY_' in D:\xampp\htdocs\etano\chat.php on line 7
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Nash77

  • Prime Member
  • ****
  • Posts: 152
  • Karma: +12/-2
Re: freichat integration script god
« Reply #14 on: May 20, 2013, 04:45:19 PM »
Yeah that is because it is wrapped around [' '] but you don't have to with that bit.

Try it as you said on your live site, if you can't get it to work then I can take a look for you.