• 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

Joomla 1.5 and pfc 1.6

Integration help for Joomla, Drupal, and Wordpress

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

Post a reply
4 posts • Page 1 of 1

Joomla 1.5 and pfc 1.6

Postby tomlelab » Thu Feb 21, 2013 11:50 am

Hi there !

I have set up pfc and want to auto connect my joomla with their joomla username.
I use pfc 1.6 and Joomla 1.5.23
I have tried to use the same code found in this topic (viewtopic.php?f=8&t=5396) but...

- The user check is working fine, I get the username.
- pfc keeps asking me for a nickname with an invite
- I can't get a username to be admin

What do you think can cause this ?
Here is my code:

Code: Select all
<?php

require_once "../phpfreechat-1.6/src/phpfreechat.class.php";
$params = array();
$params["title"] = "mysite.com";
$params["channels"] = array("my room");


$params = array();
$params["title"] = "my title ";
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;
$chat = new phpFreeChat( $params );

//$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname
// --- start of the user check
define( "_JEXEC", 1 );
define( "DS", "/" );
define("JPATH_BASE", "..");
require_once ( JPATH_BASE.DS."includes".DS."defines.php" );
require_once ( JPATH_BASE.DS."includes".DS."framework.php" );
$uc_maifra =& JFactory::getApplication("site");
$uc_maifra->initialise();
$uc_user = JFactory::getUser();
ECHO "username:".$uc_usenam = $uc_user->get("username");
echo "param:".$params["nick"] = $uc_usenam;
// --- end of the user check

$params['firstisadmin'] = true;
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;
$params["shownotice"] = 4;
$params["max_msg"] = 1000;
$params["max_displayed_lines"] = 1000;
$params['admins'] = array('admin'=>'nimda');
$params["refresh_delay"] = 2000; // 2000ms = 2s
$params["refresh_delay_steps"] = array(3000,20000,4000,60000,5000,120000);
$params["theme"] = "phoenity";
$params["language"] = "fr_FR";

$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>TChat</title>
  <link rel="stylesheet" title="classic" type="text/css" href="style/content.css" />
  <link rel="shortcut icon" href="favicon.ico"> 
 </head>
 <body>
 <img src="../images/logo.png">
<div style="float:left; width:70%">
<div class="content">
  <?php $chat->printChat(); ?>
  <?php if (isset($params["isadmin"]) && $params["isadmin"]) { ?>
    <p style="color:red;font-weight:bold;">Warning: because of "isadmin" parameter, everybody is admin. Please modify this script before using it on production servers !</p>
  <?php } ?>
</div>
tomlelab
New member
 
Posts: 2
Joined: Thu Feb 21, 2013 11:41 am
Top

Re: Joomla 1.5 and pfc 1.6

Postby OldWolf » Fri Feb 22, 2013 5:14 am

Ok so first:
There should only be one of these, at the beginning of your parameters:
Code: Select all
$params = array();


There should only be one of these, at the end of your parameters.
Code: Select all
$chat = new phpFreeChat( $params );


I don't believe this will work (though I can't swear to it, never tried it... it's poor structure either way):
Code: Select all
ECHO "username:".$uc_usenam = $uc_user->get("username");
echo "param:".$params["nick"] = $uc_usenam;

If you want to run an echo to debug, break the lines up:
Code: Select all
$uc_usenam = $uc_user->get("username");
ECHO "username:".$uc_usenam;
$params["nick"] = $uc_usenam
echo "param:".$params["nick"];


Try fixing those spots and then let me know if you're still having issues.
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

Re: Joomla 1.5 and pfc 1.6

Postby tomlelab » Fri Feb 22, 2013 9:45 am

Hello
yes of course, it's working much better with only one call.
Thanks
tomlelab
New member
 
Posts: 2
Joined: Thu Feb 21, 2013 11:41 am
Top

Re: Joomla 1.5 and pfc 1.6

Postby OldWolf » Fri Feb 22, 2013 6:56 pm

Good deal, thanks for letting me know it worked. :)
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
4 posts • Page 1 of 1

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

Who is online

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