Hi,
when activating the "Who is chatting"-Block an error occurs, because the function "_phpfreechat_check_install" is not known. (phpfreechat.inc seems not to be included at that point).
After I commented linw 227-230 out,
$info = new pfcInfo(md5($base_url), $params['data_private_path']);
returns an error:
pfcInfo Object ( [c] => [errors] => Array ( [0] => _Error: the cached config file doesn't exists_ ) )
When I look into the ....private/cache directory, there are two php-files, but none of them has the name of md5($base_url).
Any ideas
Thansk in advance
Markus
Comments
Comment #1
NewToDruballer commentedFinally I managed to track it down myself. The problem is, that server_id is not really md5(base_url) but md5("node{nid}"). Where {nid} of course is the id of the node, where the chat exists. So if I want the usernames in all chats on the site, I have to extract all nodes with chats from the {phpfreechat} table and iterate over them manually. So the build-in "pfcInfo::getOnlineNick(NULL);" only returns the users on one node.
Markus
Comment #2
permutations commentedI made this change, but it doesn't help because the node information is not being saved in the phpfreechat table. I don't know why this is. I've tried it on a new installation of Drupal 5.7, and I still had the problem. But no one else is reporting it.
I'm running phpfreechat 1.1 instead of phpfreechat 1.0-final. Now I'm wondering if that's why. I'm trying 1.0 now.
Comment #3
permutations commentedNope - doesn't work with 1.0, either, so I'm going back to 1.1.
Comment #4
permutations commentedI haven't fixed this problem, but I've done some investigations and can add some information.
It's true that the server-id in the code is wrong. It should be based on the node, not the base_url. I hardcoded the information and it came back correct. I don't know why the module author ever initialized the server-id based on the base_url since it's never correct.
I'm trying to figure out how to get the node id from within the block hook (without hardcoding). It will take a database call, I think. But I fixed the database bug so at least there is data in the database!
Comment #5
permutations commentedI fixed it. Here's the code. Look for these three lines in the phpfreechat_block function in phpfreechat.module (lines 231-233 in 5.x-1.0-rc4):
Replace that with this:
Note that this will only work if you first fix the database bug. You can't get the node id without a database call. I posted the fix for the database bug here:
http://drupal.org/node/250069
Comment #6
permutations commentedI fixed all the bugs in the phpfreechat module (a few more than are listed above), updated the module version to 5.x-1.1, and posted the full package on my Web site here:
http://permutations.com/drupal/phpfreechat.php
I emailed the original author of the module about creating a new download, but he never answered me. There were too many changes to track of as individual patches.
Comment #7
owahab commentedFixed, thanks permutations for your effort.
Comment #8
permutations commentedThere's a new version with two additional fixes on my Web site (along with many other fixes):
http://permutations.com/drupal/phpfreechat.php
Comment #9
permutations commentedI have a version of the phpFreeChat module on my Web site that fixes many different bugs. I just updated it today. If owahab makes me a module maintainer here on Drupal, I'll integrate the changes here and stop posting them separately:
http://permutations.com/drupal/phpfreechat.php
owahab - please stop deleting this link. It is not helpful to the community.
Comment #10
permutations commentedI just uploaded a new version (http://permutations.com/drupal/phpfreechat.php).
I backed out setting the default timeout to 35000 in the module. It's not working because the "negative number" error is still happening after clearing the cache (/rehash). The timeout needs to be changed to avoid disconnects, and the easiest way to do this is to change it directly in pfcglobalconfig.class.php. phpFreeChat has an integer check in there, and Drupal's form API doesn't have an integer type. I tried to identify the integer strings and change them and it worked in a test file, but not in the module.
pfcglobalconfig.class.php is in the phpFreeChat src directory (it's not a module file).
To change the default timeout, find this variable assignment and change the 20000 to 35000:
To get rid of the negative number error, comment out this code in pfcglobalconfig.class.php: