• 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

XML error

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

Post a reply
9 posts • Page 1 of 1

Postby bogphanny » Wed Nov 15, 2006 2:10 am

I am have trouble integrating PFC into my SMF forum, where under IE I get the following error returned:

Image

And under Firefox2 it simply doesn't connect to the chat.

It should be noted that the demo works fine

*EDIT: I've removed the integration from my forum until I can figure out the cause of the problem. (Too many people complaining)*

Any help/suggestions are greatly appreciated.
Last edited by bogphanny on Wed Nov 15, 2006 2:17 am, edited 1 time in total.
bogphanny
New member
 
Posts: 5
Joined: Wed Nov 15, 2006 1:48 am
Top

Postby phpfreechat » Wed Nov 15, 2006 8:33 am

could you post the content of your chat script ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bogphanny » Thu Nov 16, 2006 10:42 am

I have the following embedded in my forum index page

Code: Select all
require_once "/usr/local/pem/vhosts/102865/webspace/httpdocs/mywebsitegoeshere/chat/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Chat";
if($context['user']['is_logged'])
   $params["nick"] = $context['user']['name'];
else
   $params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname
$params["isadmin"] = false; // just for debug ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$chat = new phpFreeChat( $params );
echo '<link rel="stylesheet" title="classic" type="text/css" href="http://www.benkilsby.com/chat/style/content.css" />';
$chat->printJavascript();
$chat->printStyle();

and

Code: Select all
echo '<div class="content">';
$chat->printChat();
echo '</div>';

I apologize in advance as my php knowledge is minimal at best.
Last edited by bogphanny on Thu Nov 16, 2006 10:45 am, edited 1 time in total.
bogphanny
New member
 
Posts: 5
Joined: Wed Nov 15, 2006 1:48 am
Top

Postby phpfreechat » Thu Nov 16, 2006 11:04 am

Your chat script must be placed before any other output.
I gues you have html output before the chat script so just move your chat script at the very begining of the page.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bogphanny » Thu Nov 16, 2006 11:08 am

move the
Code: Select all
echo '<div class="content">';
$chat->printChat();
echo '</div>';

or the
Code: Select all
require_once "/usr/local/pem/vhosts/102865/webspace/httpdocs/mywebsitegoeshere/chat/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Chat";

etc.?
bogphanny
New member
 
Posts: 5
Joined: Wed Nov 15, 2006 1:48 am
Top

Postby phpfreechat » Thu Nov 16, 2006 11:58 am

the
Code: Select all
require_once "/usr/local/pem/vhosts/102865/webspace/httpdocs/mywebsitegoeshere/chat/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Chat";
[...]
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bogphanny » Fri Nov 17, 2006 2:10 am

That then gives me:

Code: Select all
Fatal error: Call to a member function on a non-object in /usr/local/pem/vhosts/102865/webspace/httpdocs/websitegoeshere/forum/Sources/Load.php(1702) : eval()'d code on line 384

line 384:
Code: Select all
$chat->printChat();

line 1702 (load.php) :
Code: Select all
$file_found = file_exists($filename) && eval('?' . '>' . rtrim(file_get_contents($filename))) !== false;

I think the way this is going, I might just have to separate the chat from the forum, or opt for a simpler shoutbox.
Last edited by bogphanny on Fri Nov 17, 2006 2:11 am, edited 1 time in total.
bogphanny
New member
 
Posts: 5
Joined: Wed Nov 15, 2006 1:48 am
Top

Postby phpfreechat » Fri Nov 17, 2006 8:43 am

I don't know where the $context variable is defined in your code but you have to place pfc code just after the definition or it will not work because $context['user']['is_logged'] and $context['user']['name'] will not be defined.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bogphanny » Fri Nov 17, 2006 1:28 pm

I have $context defined just before it, but no luck.

Code: Select all
global $context, $settings, $options, $txt;

   //CHAT SCRIPT
   $params = array();
   $params["title"] = "Chat";
   if($context['user']['is_logged'])

By the way, thanks for all your help kerphi.
bogphanny
New member
 
Posts: 5
Joined: Wed Nov 15, 2006 1:48 am
Top


Post a reply
9 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 18 guests

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