• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

SMF 2.0.2 - I am almost there!

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

Post a reply
6 posts • Page 1 of 1

Postby PureLoneWolf » Thu Jul 05, 2012 8:04 am

PFC Version: 1.4
PHP Version:5.2
Shared or Dedicated Hosting: Shared (JustHost, cPanel based)
Link to your website:www.resurrectionremix.com
Are you able to reproduce the issue on the official demo (http://www.phpfreechat.net/demo)?:
No, chat works fine via direct link (www.resurrectionremix.com/chat/index.php)
Issue is with SMF 2.0.2 integration

Have you set any parameters?:
Yes, code listed below

What is the issue you are experiencing in detail?:
Chat Loading message won't go away. Chat appears to load, as the cache folder gets an entry. Also, view/source on the page shows a lot of PFC variables in the HTML

Are you seeing any error messages, such as javascript errors?: No


Hi all

I have been searching and reading pretty much everything I can find on integrating with SMF and I have gotten pretty close...

When I goto index.php?action=chat now, I just get the "Chat Loading" message.

However, I think it is loading...it just doesn't display (the cache folder gets an entry...suggesting chat is up). Also, when I View Source on the page from my browser..the username etc seems to have been passed successfully along with a load of other var pfc statements.

I just can't figure out how to get it to display.

My files

Chat.php (in Sources folder)
Code: Select all
<?php
// If not called by SMF, it's bad!
if (!defined('SMF'))
   die('Hacking attempt...');

function Chat()
{
   global $context, $user_info, $boarddir, $chat;
   
   // They're a guest? Don't let them in!
   is_not_guest('Sorry, you can not enter the chat room!');
   
   require_once($boarddir . '/chat/src/phpfreechat.class.php');

   $params = array();
   $params['serverid'] = md5(__FILE__);
   $params['title'] = 'Resurrection Remix Chat';
   $params['nick'] = $user_info['name'];
   $params['admins'] = array('USERNAME' => 'PASSWORD');
   $params['frozen_nick'] = true;
   $params['height'] = '300';
   $params['clock'] = false;
   $params['btn_sh_whosonline'] = false;
   $params['nickname_colorlist'] = array('#f00','#0f0','#00f','#909','#099');
   $params['channels'] = array('Chat','Support');
   $params["data_private_path"] = ($boarddir . '/chat/data/private');
   $params["data_public_path"] = ($boarddir . '/chat/data/public');
   $params["data_public_url"] = ($boarddir . '/chat/data/public');
   $params["prototypejs_url"] = ($boarddir . '/chat/data/js/prototype.js');
   $params["server_script_path"] = ($boarddir . '/Sources/Chat.php');
   $params["server_script_url"] = ($boarddir . '/Sources/Chat.php');
   
   $chat = new phpFreeChat($params);

   $context['html_headers'] .= $chat->printJavascript(true);
   $context['html_headers'] .= $chat->printStyle(true);

   $context['sub_template'] = 'chat';
   $context['page_title'] = 'Chat - '.$context['forum_name'];
   
   loadTemplate('Chat');
}

?>

Chat.template.php (in Themes/default folder):
Code: Select all
<?php

function template_chat()
{
   global $user_info, $context, $boarddir, $chat;

   $chat->printChat();
}
?>

index.php (edit)
Code: Select all
Search for:  'calendar' => array('Calendar.php', 'CalendarMain'),
add after:  'chat' => array('Chat.php', 'Chat'),

URL is www.resurrectionremix.com/index.php?action=chat

I haven't linked to the chat anywhere yet...so you would need to login to the board before using that URL
username: plwtest
pass: phpfreechat

It would be great if someone could point me in the right direction.

Many thanks
PureLoneWolf
New member
 
Posts: 2
Joined: Thu Jul 05, 2012 7:04 am
Location: Frankfurt am Main
  • Website
  • ICQ
Top

Postby OldWolf » Fri Jul 06, 2012 1:00 am

Admittedly, I did not look real intently at the code and demo, but I suspect the trouble is that you're using a GET query to point to the chat. The chat does not maintain GET/POST data when it queries it's data, so it's pointing to a different URL and not getting what it needs. If you put it at a static URL, even just using a .htaccess redirect, it should work for you.

Also make sure to rehash after any URL changes.
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

Postby PureLoneWolf » Fri Jul 06, 2012 8:09 am

OldWolf wrote:Admittedly, I did not look real intently at the code and demo, but I suspect the trouble is that you're using a GET query to point to the chat. The chat does not maintain GET/POST data when it queries it's data, so it's pointing to a different URL and not getting what it needs. If you put it at a static URL, even just using a .htaccess redirect, it should work for you.

Also make sure to rehash after any URL changes.

Hi

Thanks for the response. I am doing a manual rehash, each time I try something to get it working.

Are you saying that SMF is performing a GET query? This is not something I have setup myself. Do you think it would make a difference if I made the chat popup? As opposed to loading in an SMF window. All I really want, is the nickname to be taken from SMF.

Thanks.
PureLoneWolf
New member
 
Posts: 2
Joined: Thu Jul 05, 2012 7:04 am
Location: Frankfurt am Main
  • Website
  • ICQ
Top

Postby OldWolf » Sat Jul 07, 2012 12:41 am

When you load the page, you access www.resurrectionremix.com/index.php?action=chat

The problem is that PFC loses GET data most of the time, so when it performs queries it's aiming at www.resurrectionremix.com/index.php

Now, you can either make it so the path to PFC is a 'hard' address (sorry, I just can't think of a better term), or you can set the configurations to override PFC's default behavior and aim at a specific address. You can find various path parameters in the wiki.

Now it's also possible that you are loading it from it's static address instead of GET address on the first attempt, then trying to load the chat from the other one. Realize that after a rehash, PFC takes the first load of the chat and caches many unset parameters (so as not to calculate them again later). Make sure that you've tried at least once to rehash manually, then access the chat from the dynamic "www.resurrectionremix.com/index.php?action=chat" address immediately, without visiting the other.
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

Postby capady » Thu Aug 16, 2012 8:10 am

Is there somebody who have solved this problem ?

I have the same.
capady
New member
 
Posts: 4
Joined: Sun Jul 15, 2007 9:32 pm
Location: Netherlands
  • Website
Top

Postby OldWolf » Tue Aug 21, 2012 12:29 am

capady wrote:Is there somebody who have solved this problem ?

I have the same.

I provided the solution for his unique situation, but there's no blanket answer. Any number of problems can occur, post it as your own thread with the same template he used and we can try to help
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


Post a reply
6 posts • Page 1 of 1

Return to phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)

Who is online

Users browsing this forum: No registered users and 0 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