I'm trying to integrate phpfreechat into a SMF 2.0RC4 forum but I can't get it to work. I followed the instructions from this topic http://www.simplemachines.org/community ... c=279540.0
both SMF and PFC are plain vanilla installations without any changes. Standalone PFC works fine. pfc files in forum/pfc subdirectory.
PFC Version: 1.3
PHP Version: PHP 5.3.3 with Suhosin-Patch (cli) (built: Dec 18 2010 00:34:58)
Shared or Dedicated Hosting: Own server
Link to your website: http://sledgehammers.at/forum/
Are you able to reproduce the issue on the official demo (http://www.phpfreechat.net/demo)? N/A
Have you set any parameters?
If so, please include your entire code, using the [code ] and[/code ] tags (without the space).
Chat.php in Sources/Chat.php
- Code: Select all
<?php
// If not called by SMF, it's bad!
if (!defined('SMF'))
die('Hacking attempt...');
function Chat()
{
global $context, $user_info, $chat;
// They're a guest? Don't let them in!
is_not_guest('Sorry, you can not enter the chat room!');
require_once (dirname)."/../pfc/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Sledgehammers Chat";
$params["serverid"] = md5(__FILE__);
$params['firstisadmin'] = false;
$params["container_type"] = "Mysql";
$params["container_cfg_mysql_host"] = "localhost";
$params["container_cfg_mysql_database"] = "xxxx";
$params["container_cfg_mysql_username"] = "xxxx";
$params["container_cfg_mysql_password"] = "xxxx";
$params["channels"] = array('Sledgehammers','General');
$params["max_nick_len"] = 30;
$params['nick'] = $user_info['name'];
$params['admins'] = array('USERNAME' => 'PASSWORD');
$params['debug'] = true;
$params['frozen_nick'] = false;
$params['height'] = '300';
$params['clock'] = true;
$params['btn_sh_whosonline'] = false;
$params['nickname_colorlist'] = array('#f00','#0f0','#00f','#909','#099');
$params['channels'] = array('Sledgehammers','General');
$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
- Code: Select all
<?php
function template_Chat()
{
global $user_info, $context, $chat;
$chat->printChat();
}
?>
added to index.php
- Code: Select all
'chat' => array('Chat.php', 'Chat'),
added to Subs.php
- Code: Select all
'chat' => array(
'title' => "Chat",
'href' => $scripturl . '?action=chat',
'show' => !$user_info['is_guest'],
),
What is the issue you are experiencing in detail?
"Chat loading ...
Please wait "
Are you seeing any error messages, such as javascript errors?
None.
Testing can be done with username: Sledge Test and password testing