Jump to content

Recommended Posts

I am trying to display the number of people in the (phpfreechat) chat room on another webpage.

Chat page:  www.nzmotorhome.co.nz/NZMotorhomeChat/chat.php.

Other page: www.nzmotorhome.co.nz/directory/directory.php.

In chat.php I have

//next 7 lines of code from phpBB "Sessions Integration"
    define('IN_PHPBB', true);
    $phpbb_root_path = '../NZMotorhomeForum/';
//    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);

    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
.
.
.
.
$params["serverid"] = md5("ForumChat"); // calculate a unique id for this chat

In directory.php I have

        <?php
            require_once dirname(__FILE__)."/chat/src/pfcinfo.class.php";
            $info  = new pfcInfo( md5("ForumChat") );
            // NULL is used to get all the connected users, but you can specify
            // a channel name to get only the connected user on a specific channel
            $users = $info->getOnlineNick(NULL);
            echo '<div align="center">';
            $info = "";
            $nb_users = count($users);
            if ($nb_users <= 0)
              $info = "<center>%d users in the Chat Room</center>";
            echo "</div>";
            echo "<div>";
            echo "<p>".sprintf($info, $nb_users)."</p>";
            echo "<ol>";
            foreach($users as $u)
            {
              echo "<li>".$u."</li>";
            }
            echo "</ol>";
            echo "</div>";
           ?>

When I log in on chat.php and then open directory.php (note: the directory link on the chat page opens directory.html, not directroy.php), I get the following error

 

Warning: require_once(/home/nzmotorh/public_html/directory/chat/src/pfcinfo.class.php)

[function.require-once]: failed to open stream: No such file or directory in /home/nzmotorh/public_html/directory/directory.php on line 76

 

Fatal error: require_once() [function.require]: Failed opening required '/home/nzmotorh/public_html/directory/chat/src/pfcinfo.class.php'

(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/nzmotorh/public_html/directory/directory.php on line 76

 

I've been trying to get this sorted. on and off, for weeks now.  I feel it must be something really simple about defining paths that I don't understand.

 

Please can someone help me, or tell me what other information I need to provide.

This is just a test and eventually, when I get it going, I want to implement it in a phpBB3 overall-footer.php file.

Link to comment
https://forums.phpfreaks.com/topic/182568-newbie-path-error-probably/
Share on other sites

Well where is the chat file located? It seems to me to be under:

 

/home/nzmotorh/public_html/NZMotorhomeChat/src/pfcinfo.class.php

 

Now that may not be the correct path, as you will have to actually go into your ftp client and see where it is. If there is no file there that is the wrong path go up some directories and continue looking.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.