• 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

Codes to display PHPBB3 Avatar and View profile link

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

Post a reply
5 posts • Page 1 of 1

Postby hp_solomon » Tue Jun 24, 2008 10:11 pm

Hi,

Anyone has the codes to view user avatar and view profile link within the chatroom?

thank!
hp_solomon
New member
 
Posts: 9
Joined: Tue Jun 24, 2008 9:06 pm
Top

Postby hp_solomon » Tue Jun 24, 2008 10:31 pm

Ok.. got it working using these codes

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);
}
Last edited by hp_solomon on Tue Jun 24, 2008 10:32 pm, edited 1 time in total.
hp_solomon
New member
 
Posts: 9
Joined: Tue Jun 24, 2008 9:06 pm
Top

Postby zagor256 » Thu Jul 17, 2008 6:13 pm

Hello. Here is listing of my chat.
I can get usernames from PHPBB3č
But how to I integrate this code to show avatars and profiles?

Thanx.


-----------
<?php

define('IN_PHPBB', true);
$phpbb_root_path = '../'; // See phpbb_root_path documentation
$phpEx = substr(strrchr(__FILE__, '.'), 1); // Set the File extension for page-wide usage.
include($phpbb_root_path . 'common.' . $phpEx); // include the common.php file, this is important, especially for database connects.



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

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



// redirect to phpBB logon page if the user is not logged in
if ($oog == "Anonymous")
{
header("Location: http://............./ucp.php?mode=login");
}

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["nick"] = $user->data["username"];
$params["frozen_nick"] = true; // do not allow to change the nickname
$params["isadmin"] = false; // just for debug wink
$params["serverid"] = md5(__FILE__);

$params["title"] = ".klepetanje.";
$params["theme"] = "msn";
$params["timeout"] = 600000;
$params["channels"] = array('Javni klepet');

$params['admins'] = array('........' => '......',
'admin' => '.........');
$params['time_offset'] = 60*60*22; // offset in seconds
$chat = new phpFreeChat( $params );



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>klepetanje</title>

<?php $chat->printJavascript(); ?>
<?php $chat->printStyle(); ?>

</head>

<body>


<?php $chat->printChat(); ?>

<?php
// print the current file
?>

</body>
</html>
Last edited by zagor256 on Fri Jul 25, 2008 6:12 pm, edited 1 time in total.
my site: zasebni stiki
zagor256
Member
 
Posts: 23
Joined: Thu Jul 17, 2008 5:59 pm
Location: Slovenia
  • Website
Top

Postby zagor256 » Sun Aug 03, 2008 12:13 pm

Ok. I solve the problem. Now I will also add age and location to nicmeta. And then i will write complete code. I'm new in PHP :)
my site: zasebni stiki
zagor256
Member
 
Posts: 23
Joined: Thu Jul 17, 2008 5:59 pm
Location: Slovenia
  • Website
Top

Postby DreadPirateVane » Thu Aug 12, 2010 3:24 pm

if anyone has this working correctly to see the profile link AND the avatar pic please post the correct code,, as all the ones in this forum i have tried and even went in and tried my own,, to no avail,, please help,,, thank you
Station Built by the Bands,, For the Fans!!
DreadPirateVane
Member
 
Posts: 47
Joined: Tue Dec 23, 2008 10:44 pm
Location: Kansas City, Mo.
  • Website
  • YIM
Top


Post a reply
5 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 2 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