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

Critical error in regards to $params[\'channel\']

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

Post a reply
6 posts • Page 1 of 1

Postby pearlshark » Thu Jan 06, 2011 6:56 pm

Hi everyone, I just want to bring to everyone's attention the possible issue of a significant bug in regards to channels for 1.3

It seems that unfortunately, the channel params simply don't work the way they did for 1.2. I have been a longtime PFC user, and I recently upgraded-- only to find that channels no longer function normally.

$params = array();
$params['firstisadmin'] = true;
$params["serverid"] = md5($subdomain); // calculate a unique id for this chat
$params["debug"] = false;
$params['skip_proxies'] = array('censor');
$params["data_private_path"] = "/dev/shm/mychat";
$params['frozen_nick'] = true;
$params['channel'] = array($subdomain);

$chat = new phpFreeChat( $params );




Here is the output error message I'm getting:
phpFreeChat cannot be initialized, please correct these errors:
Error: undefined or obsolete parameter 'channel', please correct or remove this parameter

Even when I change "subdomain" to a hard-coded string, like "room1," the error remains. I just wanted to bring this to everyone's attention.
Last edited by pearlshark on Thu Jan 06, 2011 7:01 pm, edited 1 time in total.
pearlshark
Member
 
Posts: 14
Joined: Thu Jan 06, 2011 6:47 pm
Top

Postby pearlshark » Thu Jan 06, 2011 7:24 pm

The code has been tested with both $params['channel'] = array($subdomain);

AND

$params['channels'] = array($subdomain);

Both do not work. The default of the room that's created is still "My Room"
pearlshark
Member
 
Posts: 14
Joined: Thu Jan 06, 2011 6:47 pm
Top

Postby re*s.t.a.r.s.*2 » Thu Jan 06, 2011 8:57 pm

Hi,

First $params['channels'] is the correct parameter, now I have played with the chat and the channels parameter and it works, even using GET array and setting it in session works correctly for me ,
Your code doesn't show how are you getting the channel string!!!.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby pearlshark » Thu Jan 06, 2011 9:44 pm

Hi re-stars. First of all, thanks for the response.

The problem here is that yes, even $params['channels'] = array('phpfreechat'); does not work. It still gives me the room name "My Room"-- which is the default. Is there some kind of special configuration I need to perform with $params['title'] or $params['serverid']? The $params['channels'] is simply not working.

This is the full code I'm using. The idea is very simple. I simply am setting up a separate chatroom for every subdomain. I am not passing in the parameters via "GET."

$urlParts = explode('.', strtolower($_SERVER['HTTP_REFERER']));
$subdomain_unrefined = ($urlParts[0] == 'www') ? $urlParts[1] : $urlParts[0];

$result = explode('http://', strtolower($subdomain_unrefined));
$subdomain = $result[1];
//define("SUBDOMAIN", $result[1]);

//print $subdomain;

$params = array();
$params['nick'] = $session->read('Auth.User.user_name'); // setup the intitial nickname
$params['firstisadmin'] = true;
$params["serverid"] = md5(__FILE__);
$params["title"] = $subdomain;
$params["debug"] = false;
$params['skip_proxies'] = array('censor');
$params["data_private_path"] = "/dev/shm/mychat";
$params['frozen_nick'] = true;
$params['channels'] = array("$subdomain");

//print_r($params['channels']);

$chat = new phpFreeChat($params);
pearlshark
Member
 
Posts: 14
Joined: Thu Jan 06, 2011 6:47 pm
Top

Postby re*s.t.a.r.s.*2 » Fri Jan 07, 2011 1:03 am

perhaps you are forgetting to rehash the chat,

And to log off close the browser and when opening it back delete all your browser cache!!!
then close and then open the chat again.. to see that make any changes..
Because it does work...

and that above put in in the channels array a string and not a variable, if this works then you need to check the code that gets you the room string, take in account that its been told to use sessions in a page before to index.php , so you set it in session before and then land in the chat...
Like this code output set it in session and then pass it to the chat..
Code: Select all
$urlParts = explode('.', strtolower($_SERVER['HTTP_REFERER']));
$subdomain_unrefined = ($urlParts[0] == 'www') ? $urlParts[1] : $urlParts[0];

$result = explode('http://', strtolower($subdomain_unrefined));
$subdomain = $result[1];
//define("SUBDOMAIN", $result[1]);

//print $subdomain;
Last edited by re*s.t.a.r.s.*2 on Fri Jan 07, 2011 1:03 am, edited 1 time in total.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby pearlshark » Fri Jan 07, 2011 7:51 am

This was my faulty code. My mistake. Fixed.

Thanks a lot, Restars. You're a real bro
Last edited by pearlshark on Fri Jan 07, 2011 7:52 am, edited 1 time in total.
pearlshark
Member
 
Posts: 14
Joined: Thu Jan 06, 2011 6:47 pm
Top


Post a reply
6 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

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