MyBB Community Forums

Full Version: phpfreechat Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've been trying to use the phpfreechat plugin for some time. I have successfully installed the actual chat:

http://www.themeparkvillage.com/villagelive/

However, when I try and use the plugin I get an error. (Attached image) I've tried putting the link above into the "Root Directory" in Admin CP but no luck.

Any help would be greatly appreciated.

Thanks,
Zonga

EDIT: The current version of phpfreechat is 1.0-beta9, not sure if that's my problem.
I have installed the newest version of the pludin, but the error continues to say:
Quote:Fatal error: Class 'phpFreeChat' not found in /home/virtual/site39/fst/var/www/html/forums/inc/plugins/pfc_mybb.php on line 575

It seems that the class definition of phpFreeChat is not defined, any ideas as to what is wrong?

Thanks a bunch,
Z
What do you have as the address (root directory) for the chat? I got a similar error when I activated the plug in, so I copy and pasted the address it gave me and the error went away. Have you tried to copy and paste the following into your chat root directory:

home/virtual/site39/fst/var/www/html/villagelive
Thanks for helping out Judel, and sorry for my slow response here. Last couple days have been busy.

Anyway, the key with the chat root directory is that it must point to the directory (fully-qualifed starting a '/') where phpFreeChat's "/src/phpfreechat.class.php" can be found. Using a URL for this (as you initially tried) probably won't work, but I guess it was worth a shot.

By default, the plugin assumes you have the following setup:
MyBB's root is in /var/www/forums and phpFreeChat's root is located at /var/www/chat. That's why /var/www/chat is set in the phpFreechat Path in the AdminCP. Since your setup is different, you will need to compensate. Since I don't know your exact directory structure, I can't tell you explicitly what to put in. Judel's thought is a good one though. Something like that (what a '/' in front of home though -- /home/virtual/site39/fst/var/www/html/villagelive) should set you up.

PS - I have a new, KILLER version of the plugin coming out soon! I'm testing it as we speak. It allows you to do everything the current plugin does, plus:
Thank you very, very much. I have been able to activate the plugin. However, once I upgraded to your latest version I cannot get the chat to appear. I believe that it has something to do with not clearing the chat's cache. However I do not know how to do so, and help would be greatly appreciated.

Once again, thank you both for your help.
Clearing caches is a piece of cake:
- If you're using phpFreeChat v1.9-beta, delete everything in {root_chat_dir}/data/private/.  Do NOT delete anything in {root_chat_dir}/data/public/, as it contains a bunch of shared javascript files in the latest version.
- If you're using phpFreeChat v1.8-beta or earlier, delete everything in both {root_chat_dir}/data/private/ AND {root_chat_dir}/data/public/.  While this'll work, you really should upgrade the phpFreeChat client to 1.9-beta.  It seems much more stable to me.

Also, keep in mind that if you've downloaded my latest phpFreeChat v1.9-betaAngel, the default location of the chat has moved from embedded into the header to embedded into your toplinks.  So, you won't see it in the usual location.  Look up by the Search and Member List icons. Smile

Lastly, depending on your themes selections, some of these locations will work appropriately, and some may not.  If you're using a theme of any sort other than the default, this - like almost all other plugins - may not work with your setup.  The sad truth about themes is that many of them modify your default template sets.  This plugin (like most others) also modifies templates; and it does so by looking for expected strings in the default templates.  If these strings have changed, the plugin may not be able to work its magic.  So, if you're having trouble and you are using a custom theme, try disabling it and see if it fixes your issues.  I've done extensive testing on my site using the default templates.  And all my testing shows that my plugin is capable of safely embedding and removing itself as requested.  However, if the default templates are not used, all bets are off.  Since I don't know what your particular template looks like, I can't say for sure what will happen.

Good luck!  I hope this helps.
I just cannot get it to work. I have it set to by a top link, yet it does not appear. I can go to the actual file though, and it does work. I tried using the default theme and no luck. Perhaps if I just added a link to the popup it would work. Any comment on that idea?
Ooops, I forgot to add the slash, but yeah, I have also used that! Smile

But one thing about your instructions on clearing cache, Ichibod?

ichibod Wrote:delete everything in {root_chat_dir}/data/private/. Do NOT delete anything in {root_chat_dir}/data/private/, as it contains a bunch of shared javascript files in the latest version.
Did you mean to put one of those as /data/public? Cause you mention the same directory twice! A bit confusing! Big Grin

I haven't tried the new version of this plugin, so I can't be of help yet, Zonga...I'll have to wait until I can update the code for my custom groups!

edit: OK, I have installed the new version. Didn't show at first until I went into Change and hit save. Then it shows up, and everything looks good!
Judel Wrote:But one thing about your instructions on clearing cache, Ichibod?

ichibod Wrote:delete everything in {root_chat_dir}/data/private/.  Do NOT delete anything in {root_chat_dir}/data/private/, as it contains a bunch of shared javascript files in the latest version.
Did you mean to put one of those as /data/public?  Cause you mention the same directory twice!  A bit confusing!  Big Grin

I haven't tried the new version of this plugin, so I can't be of help yet, Zonga...I'll have to wait until I can update the code for my custom groups!

edit:  OK, I have installed the new version.  Didn't show at first until I went into Change and hit save.  Then it shows up, and everything looks good!

Totally Judel!  I'll fix that in my post now to remove the confusion --- but YES, I meant public on the 2nd one.

Thanks.

Zonga, do me a favor and check a few things out:

1.) Post the exact fully-qualified root addresses for both your forums site and your chat session.
For example, mine are: /var/www/forums and /var/www/chat
Verify that this information is consistent with what's in the PFC path you set in my plugins settings.

2.) If that's ok, go to MyBB's template sets and post the templates for your header and your index here.  (To get to these, go to AdminCP, click on Templates->Modify/Delete, "Expand" the template set you're using (for me Default), and "Diff" header and Index Page Templates->Index.
For example, mine are:
Header:
	<a name="top" id="top"></a>
	<div id="container">
		<div id="header">
			<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" /></a></div>
			<div class="menu">
				<ul>
					<li><a href="{$mybb->settings['bburl']}/search.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/search.gif" alt="" />{$lang->toplinks_search}</a></li>
					<li><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/memberlist.gif" alt="" />{$lang->toplinks_memberlist}</a></li>
					<li><a href="{$mybb->settings['bburl']}/calendar.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/calendar.gif" alt="" />{$lang->toplinks_calendar}</a></li>
					<li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/help.gif" alt="" />{$lang->toplinks_help}</a></li>
{$pfc_mybb__toplink_code}
				</ul>
			</div>
			<hr class="hidden" />
			<div id="panel">
				{$welcomeblock}
			</div>
		</div>
		<hr class="hidden" />
		<br class="clear" />
		<div id="content">
			{$bannedwarning}
			{$bbclosedwarning}
			{$unreadreports}
			{$pfc_mybb_obj__header}
			{$boardmsg}
			<navigation>
			<br class="clear" />
Look for {$pfc_mybb__toplink_code} & {$pfc_mybb_obj__header} in the text above.

Index:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
</head>
<body>
{$header}
{$pfc_mybb_obj__index}
{$forums}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['boardstats']}.gif" id="boardstats_img" class="expander" alt="[-]" /></div>
<div><strong>{$lang->boardstats}</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['boardstats_e']}" id="boardstats_e">
{$whosonline}
{$online_today}
{$birthdays}
{$forumstats}<!-- ASOIP_2_0_I -->
</tbody>
</table>
<br />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
	<tr>
		<td class="trow1">
			<table width="100%">
				<tr>
					<td>
						<img src="{$theme['imgdir']}/on.gif" alt="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /> <span class="smalltext">{$lang->new_posts}</span><br />
						<img src="{$theme['imgdir']}/off.gif" alt="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /> <span class="smalltext">{$lang->no_new_posts}</span><br />
						<img src="{$theme['imgdir']}/offlock.gif" alt="{$lang->forum_locked}" style="vertical-align: middle;" /> <span class="smalltext">{$lang->forum_locked}</span>
					</td>
					<td style="vertical-align: top; text-align: right;"><span class="smalltext">{$logoutlink}<a href="misc.php?action=markread">{$lang->markread}</a> | <a href="showteam.php">{$lang->forumteam}</a> | <a href="stats.php">{$lang->forumstats}</a></span>
						{$loginform}
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
{$footer}
</body>
</html>
Look for {$pfc_mybb_obj__index} in the text above.

These MUST have these entries, if not, your templates are prohibiting the plugin from working.

3.) If all 3 of those are there, then the values must be returning empty strings, and that's why nothing is printing out. Assuming you're using toplinks mode, I would at least expect to see the icon displayed -- even if the chat wasn't working. (The popup should show, but nothing would be in it.)

Let me know how this process goes and where you get on these steps.

Ichi
Thank you very, very much Ichibod. The attention you've paid to my problem is just wonderful! I added the code to the header and sure enough it popped up! That seemed to be the trick.

The only problem I'm having now is to get the plugin to update. I've tried clearing the private cache but no luck.

Thanks for all your help,
Z
Pages: 1 2