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

Standalone PFC WordPress integration howto?

Integration help for Joomla, Drupal, and Wordpress

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

Post a reply
3 posts • Page 1 of 1

Standalone PFC WordPress integration howto?

Postby Craig » Tue Oct 30, 2012 10:51 pm

Is there a guide on how to get the standalone PFC 1.5 running in WordPress?

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
Craig
Member
 
Posts: 14
Joined: Mon Oct 29, 2012 9:48 pm
Top

Re: Standalone PFC WordPress integration howto?

Postby Craig » Wed Oct 31, 2012 4:38 pm

I think I have fixed it. Using a tip in http://www.phpfreechat.net/forum/viewtopic.php?f=3&t=2180, I added

Code: Select all
$params["server_script_url"] = $_SERVER['REQUEST_URI'];


and now the chat loads and I can post messages.
Craig
Member
 
Posts: 14
Joined: Mon Oct 29, 2012 9:48 pm
Top

Re: Standalone PFC WordPress integration howto?

Postby johnson33 » Fri May 24, 2013 8:24 am

They're the same.
Again, the same.
They are the same, maybe a version behind the release one at phpfreechat.net
With the one that goes into wordpress you have the wordpress memory overhead to deal with as well.
johnson33
New member
 
Posts: 2
Joined: Fri May 24, 2013 8:12 am
Top


Post a reply
3 posts • Page 1 of 1

Return to Joomla, Drupal, and Wordpress (v1.x)

Who is online

Users browsing this forum: No registered users and 1 guest

  • 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