Show Buddies In User Profile

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Show Buddies In User Profile
Arfton
CZ Newbie
Arfton has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Designer / Promoter / DJ
Age: 42
Gender: Male
Website:
Status: Offline
Joined: Sep 24, 2004
0.00 posts per day
Posts: 18
Points: 2,827
AIM Address Yahoo Messenger MSN Messenger 
I'm using buddylist mod v095 I was wondering if anyone have a way to let buddies show in user profile?



Back to top Reply with quote
#2   
pnclthnmstsh
CZ Active Member
pnclthnmstsh has been a member for over 20 year's 20 Year Member
usa.gif nevada.gif
Age: 53
Gender: Male
Website:
Status: Offline
Joined: Sep 17, 2004
0.04 posts per day
Posts: 267
Points: 13,641
   
I've got this installed and just copied some of the code out of it and put it in places where I wanted it to show my buddies online. I didn't put it in profile view but it wouldn't be hard too if you know a little about coding. If you have Who Is Where installed you can also have it pull from that table instead of the bbsessions table so your buddies show online anytime they are on your site and not just when they are in forums or forum hacks.
[ Register or login to view links on this board. ]

Click on my sig if you want to see it in action.




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#3   re: Show Buddies In User Profile
Arfton
CZ Newbie
Arfton has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Designer / Promoter / DJ
Age: 42
Gender: Male
Website:
Status: Offline
Joined: Sep 24, 2004
0.00 posts per day
Posts: 18
Points: 2,827
AIM Address Yahoo Messenger MSN Messenger 
Thanks alot pnclthnmstsh

I also found this code that add your buddies in your profile, It works great no errors, I was wonder if there is someone out there that can help me add avatar & gender to go with buddy name.

<?php

/***************************************************************************
*                             functions_buddylist.php
*                            -------------------------
*   copyright            : ©2003 Freakin' Booty ;-P
*   version              : 1.1.1
*
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

if(!defined('IN_PHPBB'))
{
   die('Hacking attempt');
}

//
// Obtain buddies in a string
// Instead of having the normal buddylist, this function simply creates a string with all buddies in.
// Online buddies are being listed bold
//
function get_buddies_list(&$data, $mode = '')
{
   global $db, $lang, $template, $theme, $images, $phpEx;

   $current_time = time();
   $session_time = 60;
   $end_session = $current_time - $session_time;

   $sql = "SELECT b.buddy_id, u.username AS buddy_name, u.user_allow_viewonline, u.user_session_time
         FROM " . BUDDIES_TABLE . " b, " . USERS_TABLE . " u
         WHERE b.user_id = " . $data['user_id'] . "
            AND u.user_id = b.buddy_id
         ORDER BY u.username ASC";
   if( !$result = $db->sql_query($sql) )
   {
      message_die(GENERAL_ERROR, 'Could not query buddies information', '', __LINE__, __FILE__, $sql);
   }

   $buddies = array();
   while( $row = $db->sql_fetchrow($result) )
   {
      $buddies[] = $row;
   }
   $db->sql_freeresult($result);

   //
   // Dump vars to template
   //
   $template->assign_vars(array(
      'L_BUDDYLIST' => $lang['Buddylist']
      )
   );


   //
   // Okay, let's build the online buddies list
   //
   $s_buddies = '';
   if( count($buddies) == 0 )
   {
      $s_buddies = $lang['No_buddies'];
   }
   else
   {
      for( $i = 0; $i < count($buddies); $i++ )
      {
         $buddy_id = $buddies[$i]['buddy_id'];

         if( ($buddies[$i]['user_allow_viewonline'] || $data['user_level'] == ADMIN) && ($buddies[$i]['user_session_time'] >= $end_session) )
         {
            $buddy_name = '<b><font color="#008500">' . $buddies[$i]['buddy_name'] . '</font></b>';
         }
         else
         {
            $buddy_name = '<i>' . $buddies[$i]['buddy_name'] . '</i>';
         }

         $temp_url = append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$buddy_id");
         $buddy_profile = '<a href="' . $temp_url . '">' . $buddy_name . '</a>';

         $temp_url = append_sid("privmsg.$phpEx?mode=post&amp;" . POST_USERS_URL . "=$buddy_id");
         $buddy_pm = '<a href="' . $temp_url . '">' . $buddy_name . '</a>';

         $s_buddies .= ( ( $s_buddies != '' ) ? ', ' : '' ) . ( ( $mode == 'pm' ) ? $buddy_pm : $buddy_profile );
      }
   }

   $template->assign_vars(array(
      'S_BUDDIES' => $s_buddies
      )
   );

   return;
}

?>


This is the main part of the Script the other part is for your theme


Back to top Reply with quote
#4   re: Show Buddies In User Profile
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
Nice, I have never installed the mod. Let us know if this works out and what it took to get it in place.



Back to top Reply with quote
#5   re: Show Buddies In User Profile
Arfton
CZ Newbie
Arfton has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Designer / Promoter / DJ
Age: 42
Gender: Male
Website:
Status: Offline
Joined: Sep 24, 2004
0.00 posts per day
Posts: 18
Points: 2,827
AIM Address Yahoo Messenger MSN Messenger 
What's up floppydrivez it works fine .. I have no problem with it .... But what I'm trying to do now is add the avatar & gender to go with user name ... I wish Telli or someone else can give me a hand I'm willing to pay.

floppydrivez I got the code from buddylist mod 1.1.1 .. and got it to work with buddylist mod 0.9.5 which have less bugs & work fine for me.



Back to top Reply with quote
#6   re: Show Buddies In User Profile
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
I think I can help. We want gender and avatar per user correct?

Also can I look at what you got so far?



Back to top Reply with quote
#7   re: Show Buddies In User Profile
Arfton
CZ Newbie
Arfton has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Designer / Promoter / DJ
Age: 42
Gender: Male
Website:
Status: Offline
Joined: Sep 24, 2004
0.00 posts per day
Posts: 18
Points: 2,827
AIM Address Yahoo Messenger MSN Messenger 
You want me to send you the code?

I'm doing over my website ... but I also have it install on this other website I help worked on and it works fine on there too.
[ Register or login to view links on this board. ]



Back to top Reply with quote
#8   re: Show Buddies In User Profile
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
Yeah you can attach it in a zip or pm it to me. I have a booked up weekend so no ideah if I will be able to get to it before next week.



Back to top Reply with quote
#9   re: Show Buddies In User Profile
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
I am not sure I have ever seen a site with so many mods and still look stylish besides here.

Nice Work

You should get all the sentinel patches and update it.



Back to top Reply with quote
#10   re: Show Buddies In User Profile
Arfton
CZ Newbie
Arfton has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Designer / Promoter / DJ
Age: 42
Gender: Male
Website:
Status: Offline
Joined: Sep 24, 2004
0.00 posts per day
Posts: 18
Points: 2,827
AIM Address Yahoo Messenger MSN Messenger 
Floppy I'm not in a rush ... I think I have until end of the month.

Thanks for the compliment on the site .... the website is for the country I'm from, we made it so friends and family can keep in touch .... most of the mods I install was so I can learn more about the codes, all of them seem to be working fine so far only thing giving me problem is the blogger module I have install I keep getting a SQL error but its not major it still work I'll try and fix that in the future.

Everything for the buddylist is included in the attach zip
The main code for the profile buddy list is in: includes/functions_buddylist.php

If you need any of the mods on the site just let me know.


Thanks In Advance
- Arfton



Attached Files
buddylist_095.zip (22.05 KB, Downloaded: 5235 Time(s))


Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum