• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Integrate phpfreechat-1.3 to phpBB 3.0.7 PL-1

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

Post a reply
4 posts • Page 1 of 1

Postby Dragonitro » Sat Jun 05, 2010 8:50 pm

Good evening

Could someone help me to integrate phpfreechat-1.3 to phpBB 3.0.7 PL-1?
Assistance in the FAQ is outdated and therefore unsuitable for my version.

Regards, Drago
Dragonitro
New member
 
Posts: 1
Joined: Sat Jun 05, 2010 4:59 pm
Top

Postby todhend » Sat Jun 05, 2010 11:02 pm

http://www.phpfreechat.net/forum/viewtopic.php?id=2651

if the chat file is in the main forum dir, this will work, I used chat.php ,

Code: Select all
define("IN_PHPBB", true);
$phpbb_root_path = "./"; //Root to phpBB

$phpEx = substr(strrchr(__FILE__, "."), 1);
include($phpbb_root_path . "common." . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

get_username_string ;
$oog = $user->data [username];

if ($oog == "Anonymous")
    {
        header("Location: ./ucp.php?mode=login");
    }


if ($user->data['is_registered'])
    {
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    $sql = "SELECT u.user_id, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.username, u.user_rank, u.user_colour
    FROM " . USERS_TABLE . ' AS u
    WHERE u.user_id = ' . $user->data['user_id'];
               
    $result = $db->sql_query($sql,300);

    $row = $db->sql_fetchrow($result);

   
    $avatar_img = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height'], '',true);   
    $username_trim = (strlen($row['username']) > 9) ? substr($row['username'],0,9) . ".." : $row['username'];
    $u_profile    = get_username_string('full', $row['user_id'], $username_trim, $row['user_colour']);
                           
    $params["nickmeta"] = array(
        'avatar'=> '<img src="' . $avatar_img .'">',
        'profile'=> $u_profile,
        //'profile'=>'<a href="memberlist.php?mode=viewprofile&u=2">test</a>',
        ); // additional values
   
   
    $db->sql_freeresult($result);
    }

require_once dirname(__FILE__)."/chat/src/phpfreechat.class.php";

the rest here is your config variables
Last edited by todhend on Sat Jun 05, 2010 11:07 pm, edited 1 time in total.
http://nflpick.net free football picks
http://tdah.us free webmail script
todhend
Member
 
Posts: 83
Joined: Tue Jan 19, 2010 9:03 pm
Location: Missouri
  • Website
Top

Postby ikpoho » Sat Jul 17, 2010 3:19 am

I used the code below and Im still not able to get it working. I use phpbb 3.07 PL1 and phpFreeChat 1.3. I have a mysql database.
my chat website is http://www.redskinsdiehards.com/phpbb/chat/index1.php and the forum is http://www.redskinsdiehards.com/phpbb/
This is the error that I got

----------------------------begin error---------------------------
Warning: include(./common.php) [function.include]: failed to open stream: No such file or directory in /home/ikpoho12/public_html/redskinsdiehards.com/phpbb/chat/index1.php on line 6

Warning: include(./common.php) [function.include]: failed to open stream: No such file or directory in /home/ikpoho12/public_html/redskinsdiehards.com/phpbb/chat/index1.php on line 6

Warning: include() [function.include]: Failed opening './common.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ikpoho12/public_html/redskinsdiehards.com/phpbb/chat/index1.php on line 6

Fatal error: Call to a member function session_begin() on a non-object in /home/ikpoho12/public_html/redskinsdiehards.com/phpbb/chat/index1.php on line 9
--------------------------------end error---------------------------------------------------------------------

Thanks for your help.


todhend wrote:http://www.phpfreechat.net/forum/viewtopic.php?id=2651

if the chat file is in the main forum dir, this will work, I used chat.php ,

Code: Select all
define("IN_PHPBB", true);
$phpbb_root_path = "./"; //Root to phpBB

$phpEx = substr(strrchr(__FILE__, "."), 1);
include($phpbb_root_path . "common." . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

get_username_string ;
$oog = $user->data [username];

if ($oog == "Anonymous")
    {
        header("Location: ./ucp.php?mode=login");
    }


if ($user->data['is_registered'])
    {
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    $sql = "SELECT u.user_id, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.username, u.user_rank, u.user_colour
    FROM " . USERS_TABLE . ' AS u
    WHERE u.user_id = ' . $user->data['user_id'];
               
    $result = $db->sql_query($sql,300);

    $row = $db->sql_fetchrow($result);

   
    $avatar_img = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height'], '',true);   
    $username_trim = (strlen($row['username']) > 9) ? substr($row['username'],0,9) . ".." : $row['username'];
    $u_profile    = get_username_string('full', $row['user_id'], $username_trim, $row['user_colour']);
                           
    $params["nickmeta"] = array(
        'avatar'=> '<img src="' . $avatar_img .'">',
        'profile'=> $u_profile,
        //'profile'=>'<a href="memberlist.php?mode=viewprofile&u=2">test</a>',
        ); // additional values
   
   
    $db->sql_freeresult($result);
    }

require_once dirname(__FILE__)."/chat/src/phpfreechat.class.php";

the rest here is your config variables
ikpoho
New member
 
Posts: 1
Joined: Fri Jul 16, 2010 8:00 am
Top

Postby jimmo » Wed Aug 18, 2010 9:03 pm

Your phpbb_root_path is wrong. It's relative to the directory /home/ikpoho12/public_html/redskinsdiehards.com/phpbb/chat/index1.php so it should be "../" not "./", assuming phpbb is indeed the correct root.
jimmo
Member
 
Posts: 23
Joined: Wed Aug 18, 2010 3:51 pm
Top


Post a reply
4 posts • Page 1 of 1

Return to phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)

Who is online

Users browsing this forum: No registered users and 5 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub