FreiChat related discussions
Placing freichat on one page

Is there a way to have chat only appear on certain pages in my simple machines installation?

Is there a way to have chat only appear on certain pages in my simple machines installation?

Yes, there is a way to conditionally load freichat based on the page.

When you install freichat in SMF, it adds its code to the file Sources/Load.php .

So open that file, and in the function loadTemplate() .

You can do something like this :

   $pageList = array(PUT_YOUR_PAGES_HERE) 
   if(in_array(CURRENT_PAGE, $pageList)) {

    $context['html_headers'] .= '<script type="text/javascript" language="javascipt"src="'.$boardurl.'/freichat/client/main.php?id='.$ses.'&xhash='.$xhash.'"></script>
    <link rel="stylesheet" href="'.$boardurl.'/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css" />';

   }

You need to modify above according to your needs..

Yes, there is a way to conditionally load freichat based on the page. When you install freichat in SMF, it adds its code to the file `Sources/Load.php` . So open that file, and in the function loadTemplate() . You can do something like this : ``` $pageList = array(PUT_YOUR_PAGES_HERE) if(in_array(CURRENT_PAGE, $pageList)) { $context[&#039;html_headers&#039;] .= &#039;&amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot;src=&quot;&#039;.$boardurl.&#039;/freichat/client/main.php?id=&#039;.$ses.&#039;&amp;xhash=&#039;.$xhash.&#039;&quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;&#039;.$boardurl.&#039;/freichat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot; /&amp;gt;&#039;; } ``` You need to modify above according to your needs..
edited Oct 17 '14 at 3:15 pm

$pageList = array(PUT_YOUR_PAGES_HERE)

Would the "put pages here" be something like "http://website.com/index.php?action...."

and would it be right after loadTemplate() or within the ()?

$pageList = array(PUT_YOUR_PAGES_HERE) Would the &quot;put pages here&quot; be something like &quot;http://website.com/index.php?action....&quot; and would it be right after loadTemplate() or within the ()?

Can you specifically tell us on which pages do you want freichat to load ?

This may help us to think of a easier/better solution.

Can you specifically tell us on which pages do you want freichat to load ? This may help us to think of a easier/better solution.

On certain boards within simple machines. And is it possible to have different chats going on different pages?

On certain boards within simple machines. And is it possible to have different chats going on different pages?

And is it possible to have different chats going on different pages?

How can different chats run on different pages ?
Or did you mean the chatrooms ?

&amp;gt; And is it possible to have different chats going on different pages? How can different chats run on different pages ? Or did you mean the chatrooms ?

It is possible to have different chats on different pages but it will require some javascript modification.

If you want the chat to be loaded only on certain boards and not in any other(profile,home, etc) pages, then it becomes easy.
Let us know your requirements.

It is possible to have different chats on different pages but it will require some javascript modification. If you want the chat to be loaded only on certain boards and not in any **other**(profile,home, etc) pages, then it becomes easy. Let us know your requirements.
220
7
2
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