• 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

Channels/Session/Cache problem

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

Post a reply
3 posts • Page 1 of 1

Postby thisisloboq » Mon Oct 22, 2007 8:19 pm

I'm trying to integrate PHPFreeChat with MediaWiki using Firebreather's extension (www.wikichat.org).
Note:- This uses PFC 1.0beta11.

Everything seems to work OK except that every time PFC is initialized, it is supposed to open the new channel (and only that channel) in the container. However, it opens the first (original) channel every time.

I have spent the entire weekend trying to research this and have concluded that the fix lies not with the MediaWiki extension but with PFC.

To see an example, just go to http://wikichat.org/Main_Page and click on the chat tab at the top of the page. It'll take you to the "Main Page" channel. Then go to http://wikichat.org/Sitelist and click on the chat tab at the top of the page. It'll take you again to the "Main Page" channel although it is supposed to take you to the "Sitelist" channel.

To view the calling program code, go to http://wikichat.org/WikiChat.php .

I've been working on this for 48 hours straight. Have narrowed it down to a few suspects:
1. function synchronizeWithCache() in pfcglobalconfig: The server_script_url is forever cached as the URL from the first time PFC is fired up.
2. Function pfcUserConfig(): I fixed synchronizeWithCache() above to ignore the cached value of server_script_url so the problem seems to be with the session in this function.
3. functions pfcContainer() and &Instance() in pfccontainer.class.php: It is possible that everytime it finds that the container exists with that channel open and just displays it, ignoring the new channel that is requested.

Would greatly appreciate any help!
thisisloboq
New member
 
Posts: 2
Joined: Mon Oct 22, 2007 7:29 pm
Top

Postby King Moonraiser » Tue Oct 23, 2007 6:56 pm

Try displaying the channel name (i.e., $wgTitle->getPrefixedText()) in the page to ensure it contains the correct name. I want to make sure that variable is set. If there's something wrong, the channel array will be empty and therefore use the default channel setting.

Also, you should probably use

Code: Select all
$params["serverid"] = md5($wgSitename);

I noticed your page is in UTF-8 format, which is perfect. Are you sure the variables being passed to the parameters are also in UTF-8 format? If not, convert them.

For example:

Code: Select all
$params["nick"] = iconv("ISO-8859-1", "UTF-8", $wgSitename)
King Moonraiser
Member
 
Posts: 98
Joined: Fri Jun 22, 2007 9:42 pm
  • Website
Top

Postby thisisloboq » Tue Oct 23, 2007 7:43 pm

Thanks, King MoonRaiser.

I found some sort of workaround and I posted it here yesterday: http://www.mediawiki.org/w/index.php?ti ... rebreather
(look at Update 3 for the workaround). The fix involves modifications to both PFC as well as WikiChat code.

The issue wasn't that the channel was not being set according to page title. Rather, the channel was being set according to the page title the FIRST time around. And all subsequent calls to launch the chat from other pages led for the container to open the original FIRST channel. The hack that I applied basically terminates the session when you leave the chat page. This is still not the best solution, though. Because if you don't leave the original chat page and open another Wiki page in a new tab and try to launch the chat from this new page, it will take you to the original channel again instead of the new channel.

The true fix will have something to do with fixing the session handling I think.

Btw, you can check out the fix in action at www.diffen.com
thisisloboq
New member
 
Posts: 2
Joined: Mon Oct 22, 2007 7:29 pm
Top


Post a reply
3 posts • Page 1 of 1

Return to General Support (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