• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Unexpected bug in FUDforum integration

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
5 posts • Page 1 of 1

Unexpected bug in FUDforum integration

Postby eldritch1969 » Fri Mar 01, 2013 8:53 am

Hi there !
I have tried to set up phpFreeChat in FUDforum for a while now, and I can't get the Chat to work.
Well, I have also read all the required reading in FAQs and all that.
So my problem is :
I have the latest FUDforum version, 3.0.4.1 and the latest phpFreeChat 1.x version, which is 1.6
After I put the chat code inside my footer and rebuild my theme, I have this error :
Code: Select all
Fatal error: Call to a member function printChat() on a non-object in /web/geekforum/www/theme/default/index.php on line 606

I can't figure out what it is.
Could you help me, please ? That would be awesome to have your wonderful chat working ! :mrgreen:
eldritch1969
New member
 
Posts: 3
Joined: Thu Feb 28, 2013 6:57 pm
Location: South of France
  • Website
Top

Re: Unexpected bug in FUDforum integration

Postby OldWolf » Fri Mar 01, 2013 7:36 pm

It's hard to figure it out without your code, but I'm guessing that you may have forgotten a piece of the required code: $chat = new phpFreeChat( $params );

If you want to post your code I can give you a more specific answer
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Re: Unexpected bug in FUDforum integration

Postby eldritch1969 » Fri Mar 01, 2013 11:23 pm

Wow, what a fast answer ! I'm impressed and very happy that you would take my question into account nearly immediately ! Thanks a lot !
I may not have set up things correctly because I am not really used to dealing with php and code, but this is what I did :
I modified the code by adding the chunk that was mentionned here and on the FUDwiki :
Code: Select all
<?php

require_once dirname("/web/geekforum/www/GLOBALS.php")."/src/phpfreechat.class.php";
fud_use('db.inc');
fud_use('cookies.inc');
$fuduser = ses_get();
if ($fuduser->alias == $ANON_NICK)
      $fuduser->alias = 'guest'.rand(1,1000); // generate random nick for guest
$params = array();
$params["serverid"]             = md5("/web/geekforum/www/GLOBALS.php"); // calculate a unique id for this chat
$params["title"]                = "Geek Forum chat";
$params["language"]             = "en_US";
$params["nick"]                 = $fuduser->alias;  // setup the intitial nickname
$params["start_minimized"]      = true;
$params['firstisadmin'] = false;
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)

$params["debug"] = false;
$chat = new phpFreeChat( $params );

?>


Then, I cut and paste this chunk into my footer template, so that it could print the chat itself :

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>phpFreeChat- Sources Index</title>
  <link rel="stylesheet" title="classic" type="text/css" href="style/generic.css" />
  <link rel="stylesheet" title="classic" type="text/css" href="style/header.css" />
  <link rel="stylesheet" title="classic" type="text/css" href="style/footer.css" />
  <link rel="stylesheet" title="classic" type="text/css" href="style/menu.css" />
  <link rel="stylesheet" title="classic" type="text/css" href="style/content.css" /> 
 </head>
 <body>

<div class="header">
      <img alt="phpFreeChat" src="style/logo.gif" class="logo2" />
</div>

<div class="menu">
      <ul>
        <li class="sub title">General</li>
        <li>
          <ul class="sub">
            <li class="item">
              <a href="demo/">Demos</a>
            </li>
            <?php if (file_exists(dirname("/web/geekforum/www/GLOBALS.php")."/checkmd5.php")) { ?>
            <li>
              <a href="checkmd5.php">Check md5</a>
            </li>
            <?php } ?>
            <!--
            <li class="item">
              <a href="admin/">Administration</a>
            </li>
            -->
          </ul>
        </li>
        <li class="sub title">Documentation</li>
        <li>
          <ul>
            <li class="item">
              <a href="http://www.phpfreechat.net/overview">Overview</a>
            </li>
            <li class="item">
              <a href="http://www.phpfreechat.net/quickstart">Quickstart</a>
            </li>
            <li class="item">
              <a href="http://www.phpfreechat.net/parameters">Parameters list</a>
            </li>
            <li class="item">
              <a href="http://www.phpfreechat.net/faq">FAQ</a>
            </li>
            <li class="item">
              <a href="http://www.phpfreechat.net/advanced-configuration">Advanced configuration</a>
            </li>
            <li class="item">
              <a href="http://www.phpfreechat.net/customize">Customize</a>
            </li>
          </ul>
        </li>
      </ul>
      <p class="partner">
        <a href="http://www.phpfreechat.net"><img alt="phpfreechat.net" src="style/logo_88x31.gif" /></a><br/>
      </p>
</div>

<div class="content">
  <?php $chat->printChat(); ?>
  <?php if (isset($params["isadmin"]) && $params["isadmin"]) { ?>
    <p style="color:red;font-weight:bold;">Warning: because of "isadmin" parameter, everybody is admin. Please modify this script before using it on production servers !</p>
  <?php } ?>
</div>

<div class="footer">
  <span class="partners">phpFreeChat partners:</span>
  <a href="http://www.jeu-gratuit.net">jeux gratuits</a> |
  <a href="http://jeux-flash.jeu-gratuit.net">jeux flash</a> |
  <a href="http://www.pronofun.com">pronofun</a> |
  <a href="http://areno.jeu-gratuit.net">areno</a> |
  <a href="http://www.micropolia.com">micropolia</a> |
  <a href="http://www.zeitoun.net">zeitoun</a> |
  <a href="http://federation.jeu-gratuit.net">federation</a>
</div>
   
</body></html>


This is what I did, I made a mistake somewhere and if you could point it out to me so that I can correct it and make your cool chat work in my actual site (this one is for testing purposes : http://geekforum.fr, it would be really awesome !
Cheers !
Eric
eldritch1969
New member
 
Posts: 3
Joined: Thu Feb 28, 2013 6:57 pm
Location: South of France
  • Website
Top

Re: Unexpected bug in FUDforum integration

Postby OldWolf » Sat Mar 02, 2013 1:25 am

Okay, are you sure that the first part is being loaded before the bottom part? It seems to think that $chat hasn't been set up yet, which indicates that the first chunk of code isn't being executed.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Re: Unexpected bug in FUDforum integration

Postby eldritch1969 » Sat Mar 02, 2013 7:35 am

hI, thanks for looking at the code.
I am not sure on how to check whether the 1st part is loaded or not. How should I check that ?
eldritch1969
New member
 
Posts: 3
Joined: Thu Feb 28, 2013 6:57 pm
Location: South of France
  • Website
Top


Post a reply
5 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 4 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub