• 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

Wordpress integration

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

Postby ioni » Wed Mar 19, 2008 12:24 pm

Hi there,

I am trying to integrate the phpfeechat into wordpress.
It works fine as a standalone - my congrats on that!

But i just cannot figure out how to put it inside WP

So far I have created the template file as follows:

<?php
/*
Template Name: Chat
*/
?>

<?php get_header(); ?>

<div id="content" class="widecolumn">
<?php include (TEMPLATEPATH .'chat.php'); ?>
</div>

<?php get_footer(); ?>

Which allows me to create the chat on Page

Chat.php that I am including is very simple (since all teh necessary styles are read from WP:

<?php

require_once dirname(__FILE__)."/../src/phpfreechat.class.php";

$params["serverid"] = md5(__FILE__);
$params["language"] = "ru_RU";
$chat = new phpFreeChat( $params );

$chat->printJavascript();
$chat->printStyle();
$chat->printChat();

?>
I suppose the problem is with the
require_once dirname(__FILE__)."/../src/phpfreechat.class.php";

Where do i put the installation of PFC? Shall i need to put it into the wp-content or plugins or themes or separate dir altogether?

Would appreciate,
ioni
ioni
New member
 
Posts: 2
Joined: Wed Mar 19, 2008 12:17 pm
Top

Postby poelvord » Wed Jul 16, 2008 1:51 pm

no body have a idea to implement correctly phpfreechat in wordpres???
poelvord
New member
 
Posts: 3
Joined: Mon Jul 14, 2008 7:39 pm
Top

Postby Frumph » Wed Aug 05, 2009 11:05 am

This is the chat.php script that you put inside your /phpfreechat/ directory but then you have to 'include' it into a custom made template file on your wordpress installation.

Code: Select all
<?php
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
require_once('../wp-config.php');
$current_user = wp_get_current_user();
$user_name = addslashes($current_user->display_name);     
$params = array();
$params["title"] = "My Chat";
$params["nick"] = $user_name;
$params["isadmin"] = false; // do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
// setup urls
$params["data_public_url"]   = "/phpfreechat/data/public";
$params["server_script_url"] = "/phpfreechat/chat.php";
$params["theme_default_url"] = "/phpfreechat/themes";
$params["theme"] = "phpbb2";
// admins
$params['admins'] = array('admin'  => 'somepassword','Frumph' => 'mypassword');
// setup paths
$params["container_type"]         = "File";
$params["container_cfg_chat_dir"] = dirname(__FILE__)."/data/private/chat";
// Channels
$params["channels"] = array("General");
$params["quit_on_closedwindow"] = true;
$params["display_ping"] = false;
$params['skip_proxies'] = array('noflood');
//$params["debug"] = true;
$chat = new phpFreeChat( $params );

?>
<div style="text-align:right;color: #FFF;">Please do NOT afk in chat, logoff if you're not around.  </div>
<div style="padding: 5px;">
   <?php $chat->printChat(); ?>
</div>
Last edited by Frumph on Wed Aug 05, 2009 11:06 am, edited 1 time in total.
Frumph
Member
 
Posts: 38
Joined: Wed Aug 05, 2009 10:47 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 3 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