FreiChat related discussions
For Codoforum

@avinash
Can you tell me where to copy paste the friechat generated code in the case of codoforum? I tried creating a plugin for this code but that did not work. The code generated for my client's site is below:

                    <!--===========================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
$ses=null;

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

       if(is_file("/home/community/codoforum/freichat/hardcode.php")){

               require "/home/community/codoforum/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://forum.worldanimeclub.com/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
    <link rel="stylesheet" href="http://forum.worldanimeclub.com/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
<!--===========================FreiChatX=======END=========================-->
@avinash Can you tell me where to copy paste the friechat generated code in the case of codoforum? I tried creating a plugin for this code but that did not work. The code generated for my client&#039;s site is below: ```php &amp;lt;!--===========================FreiChat=======START=========================--&amp;gt; &amp;lt;!-- For uninstalling ME , first remove/comment all FreiChat related code i.e below code Then remove FreiChat tables frei_session &amp; frei_chat if necessary The best/recommended way is using the module for installation --&amp;gt; &amp;lt;?php $ses=null; if(!function_exists(&quot;freichatx_get_hash&quot;)){ function freichatx_get_hash($ses){ if(is_file(&quot;/home/community/codoforum/freichat/hardcode.php&quot;)){ require &quot;/home/community/codoforum/freichat/hardcode.php&quot;; $temp_id = $ses . $uid; return md5($temp_id); } else { echo &quot;&amp;lt;script&amp;gt;alert(&#039;module freichatx says: hardcode.php file not found!&#039;);&amp;lt;/script&amp;gt;&quot;; } return 0; } } ?&amp;gt; &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;http://forum.worldanimeclub.com/freichat/client/main.php?id=&amp;lt;?php echo $ses;?&amp;gt;&amp;xhash=&amp;lt;?php echo freichatx_get_hash($ses); ?&amp;gt;&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://forum.worldanimeclub.com/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&amp;gt; &amp;lt;!--===========================FreiChatX=======END=========================--&amp;gt; ```

It wont just work by copy pasting the freichat code.

You have three options:

  1. Create a Codoforum plugin [we have plans for it]
  2. Make some changes in the copy/paste code so that it works without PHP.
  3. Enable PHP in codoforum templates and add your code.
It wont just work by copy pasting the freichat code. You have three options: 1. Create a Codoforum plugin [we have plans for it] 2. Make some changes in the copy/paste code so that it works without PHP. 3. Enable PHP in codoforum templates and add your code.

@avinash Hmm is there any way you can help with any of the three options you mentioned (3rd option, to enable php in template seems to be the easiest to me) smile

@avinash Hmm is there any way you can help with any of the three options you mentioned (3rd option, to enable php in template seems to be the easiest to me) :S

It wont just work by copy pasting the freichat code.

You have three options:

  1. Create a Codoforum plugin [we have plans for it]
  2. Make some changes in the copy/paste code so that it works without PHP.
  3. Enable PHP in codoforum templates and add your code.

I tried using {php} in layout.tpl, but resulted in error smile lol

&amp;gt;It wont just work by copy pasting the freichat code. &amp;gt;You have three options: &amp;gt;1. Create a Codoforum plugin [we have plans for it] &amp;gt;2. Make some changes in the copy/paste code so that it works without PHP. &amp;gt;3. Enable PHP in codoforum templates and add your code. I tried using {php} in layout.tpl, but resulted in error x( lol

Although it is not recommended to use PHP tags in Smarty templates, you can enable it by making the following changes:

Open codoforum/sys/CODOF/Smarty/Single.php

Around line 10,

replace

require ABSPATH . 'sys/Ext/Smarty/Smarty.class.php';

with

require ABSPATH . 'sys/Ext/Smarty/SmartyBC.class.php';

And around line 19,

replace

self::$smarty = new \Smarty();

with

self::$smarty = new \SmartyBC();
Although it is not recommended to use PHP tags in Smarty templates, you can enable it by making the following changes: Open codoforum/sys/CODOF/Smarty/Single.php Around line 10, replace ``` require ABSPATH . &#039;sys/Ext/Smarty/Smarty.class.php&#039;; ``` with ``` require ABSPATH . &#039;sys/Ext/Smarty/SmartyBC.class.php&#039;; ``` And around line 19, replace ``` self::$smarty = new \Smarty(); ``` with ``` self::$smarty = new \SmartyBC(); ```

Hmm ya I was also reading about Smarty now, most documentations say it is not advisable to enable PHP. I am also deciding to go with that advise because Codoforum is to enable people to post in the forum, so if i enable the chat feature, people will stay in the chatbox instead of making some posts. So both logically and functionality wise, the purpose will be defeated sighh
Thanks @adesh smile

Hmm ya I was also reading about Smarty now, most documentations say it is not advisable to enable PHP. I am also deciding to go with that advise because Codoforum is to enable people to post in the forum, so if i enable the chat feature, people will stay in the chatbox instead of making some posts. So both logically and functionality wise, the purpose will be defeated *sighh* Thanks @adesh :D
280
5
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