• 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

avatar

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

Post a reply
1 post • Page 1 of 1

Postby highlandermax » Tue Nov 16, 2010 4:28 pm

i have a probleme with phpbb3 integration in my db the user_avatar in an url and it doesn't display the avatar , can you help me to fixe this?


Sorry for my very bad english but i'm french

my index.php:


Code: Select all
<?php


define("IN_PHPBB", true);
$phpbb_root_path = "../forum/"; //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: ../forum/ucp.php?mode=login&redirect=/../chat/index.php");
    }


if ($user->data['is_registered'])
    {
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    $sql = "SELECT u.user_id, u.group_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__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Chat de l'alliance!";
$params["theme"] = "default";
$params["frozen_nick"]    = false;
$params["max_msg"] = 20;
$params["max_nick_len"] = 20;
$params["nick"] = $user->data ['username'];
$params["channels"] = array('Group Gathering');

if ($user->data['group_id'] == 5)
{ $params["isadmin"] = true; }

if ($user->data['group_id'] == 4)
{ $params["isadmin"] = true; }

$params["serverid"] = md5('IRRChat');
$params["skip_proxies"] = array('censor','noflood');
$params["shownotice"] = 4;
$params["debug"] = false;
$params['nickmeta']['avatar']  = sprintf('<img src="%s" alt="" />',$u_profile);
$params['nickmeta']['avatar']  = sprintf('<img src="%s" alt="" />',$_SESSION['user_avatar'].$avatar_img);
$chat = new phpFreeChat( $params );


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
 <head>
 </head>
 <body>


<div class="content">
  <?php $chat->printChat(); ?>
  <?php if (isset($params["isadmin"]) && $params["isadmin"]) { ?>
    <p style="color:red;font-weight:bold;">Warning: because of "isadmin" parameter, everybody is admin. Please modify this script before using it on production servers !</p>
  <?php } ?>
</div>

<!--<div class="footer">
  <span class="partners">phpFreeChat partners:</span>
  <a href="http://www.jeu-gratuit.net">jeux gratuits</a> |
  <a href="http://jeux-flash.jeu-gratuit.net">jeux flash</a> |
  <a href="http://www.pronofun.com">pronofun</a> |
  <a href="http://areno.jeu-gratuit.net">areno</a> |
  <a href="http://www.micropolia.com">micropolia</a> |
  <a href="http://www.zeitoun.net">zeitoun</a> |
  <a href="http://federation.jeu-gratuit.net">federation</a>
</div>


-->   
</body></html>
highlandermax
New member
 
Posts: 1
Joined: Tue Nov 16, 2010 4:16 pm
Top

Post a reply
1 post • 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 6 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