I have created a simple WordPress template:
- Code: Select all
<?php
/**
* Template Name: PHP Free Chat 1.5 Template
* Description: PHP Free Chat template
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
global $current_user;
get_currentuserinfo();
require_once dirname(__FILE__)."/../../../phpfreechat-1.5/src/phpfreechat.class.php"; // adjust to your own path
$params["serverid"] = md5(__FILE__);
$params["nick"] = $current_user->user_login; // it can be useful to take nicks from a database
$params["frozen_nick"] = true;
$chat = new phpFreeChat($params);
get_header();
?>
<div id="primary">
<div id="content" role="main">
<br/>
<?php $chat->printChat(); ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
A WordPress page with slug 'chat' created under 'toparea' with this template shows the 'Chat loading...' message and this javascript error:
- Code: Select all
Failed to load resource: the server responded with a status of 404 (Not Found) http://mysite.com/toparea/chat/phpfreechat-15.php?pfc_ajax=1&f=loadChat
Clearly the chat is trying to load something and getting confused. phpfreechat-15.php is the name of the WordPress template file that the page is using. What file should it be trying to load and how do I tell it where it is?
Thanks,
Craig