Author Topic: [MOD] Buddy List || Friend List  (Read 151206 times)

0 Members and 1 Guest are viewing this topic.

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD] Buddy List || Friend List
« Reply #90 on: August 14, 2007, 12:01:58 AM »
Hi great mod!

Is there a way to show user friends listed directly in his profile?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #91 on: August 14, 2007, 12:07:05 AM »
Quote
Is there a way to show user friends listed directly in his profile?

Is URL link to point at friends from profile ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD] Buddy List || Friend List
« Reply #92 on: August 14, 2007, 12:20:22 AM »
I manage to add friends id in profile but I don't have time to change id to name:

In member.php before //--- END FRIENDSLIST MOD --- ADD:

Code: [Select]
$sql = "SELECT *
        FROM ".USERS_TABLE."
        WHERE user_id = ".$user_row['user_id']."";
    $user_friends_info = $site_db->query_firstrow($sql);
    $num_rows_all = 0;
    if (!empty($user_friends_info['user_friend_ids'])) {
    $friends_id_sql = str_replace(" ", "<br>", trim($user_friends_info['user_friend_ids']));
//here you need to make while and if sentece to get user name

}else{
$friends_id_sql=0;
}

    $site_template->register_vars(array(
          "lang_friendslist_add", $lang['lang_friendslist_add'],
  "user_friends" => $friends_id_sql
    ));

then in your profile template add:
Code: [Select]
{user_friends}

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #93 on: August 14, 2007, 01:29:38 PM »
Can no while with query_firstrow - only query.

Quote
change id to name

Quote
$sql = "SELECT *
        FROM ".USERS_TABLE."
        WHERE user_id = ".$user_row['user_id']."";
    $result = $site_db->query_firstrow($sql);

for:

Quote
if (empty($user_select_row_cache)) {
$sql = "SELECT " . get_user_table_field("", "user_id") . get_user_table_field(", ", "user_name") . "
           FROM ".USERS_TABLE."
           WHERE " . get_user_table_field("", "user_id") . " = ".$user_row['user_id'];
$user_friends_info = $site_db->query($sql);
$user_select_row_cache = array();
while ($row = $site_db->fetch_array($result)) {
    // Change ID to name.
    $user_select_row_cache[$row[$user_table_fields['user_id']]] = $row[$user_table_fields['user_name']];
}
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD] Buddy List || Friend List
« Reply #94 on: August 15, 2007, 12:04:42 AM »
I made it work with this code:

Code: [Select]
$sql_friends = "SELECT *
        FROM ".USERS_TABLE."
        WHERE user_id = ".$user_row['user_id']."";
$friends_row = $site_db->query_firstrow($sql_friends);

  if (!empty($friends_row['user_friend_ids'])) {
    $split_keywords = explode(" ", $friends_row['user_friend_ids']);
    $friends_id = "";
    foreach ($split_keywords as $key => $val) {
$sql1 = "SELECT user_name
        FROM ".USERS_TABLE."
        WHERE user_id = $val";
$friends_name = $site_db->query_firstrow($sql1);
$fname = $friends_name['user_name'];

      $friends_id .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url("/portfolio/".urlencode($fname))."\">$fname</a><br>";
    }
  }
  else {
    $friends_id = REPLACE_EMPTY;
  }


    $site_template->register_vars(array(
      "lang_friendslist_add", $lang['lang_friendslist_add'],
  "user_friends" => $friends_id
    ));

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #95 on: August 15, 2007, 12:08:14 AM »
Ah ! so this was you want.

Quote
$sql_friends = "SELECT *
        FROM ".USERS_TABLE."
        WHERE " . get_user_table_field("", "user_id") . " = ".$user_row[$user_table_fields['user_id']];
   $friends_row = $site_db->query_firstrow($sql_friends);
   
  if (!empty($friends_row['user_friend_ids'])) {
    $split_keywords = explode(" ", $friends_row['user_friend_ids']);
    $friends_id = "";
    foreach ($split_keywords as $key => $val) {
      $sql1 = "SELECT " . get_user_table_field("", "user_name") . "
        FROM ".USERS_TABLE."
        WHERE " . get_user_table_field("", "user_id") . " = " . $val;
   $friends_name = $site_db->query_firstrow($sql1);
   $fname = $friends_name[$user_table_fields['user_name']];

      $friends_id .= ((isset($keywords) && strlen(trim($keywords)) > 0) ? ", " : "")."<a href=\"".$site_sess->url("/portfolio/".urlencode($fname))."\">$fname</a><br>";
    }
  }
  else {
    $friends_id = REPLACE_EMPTY;
  }


       $site_template->register_vars(array(
      "lang_friendslist_add", $lang['lang_friendslist_add'],
     "user_friends" => (int)$friends_id
    ));   

;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline fast

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #96 on: October 28, 2007, 10:36:53 AM »
the mod limit displaying 20 users on one site, there is no way to switch to the next site when you have more than 20 friends. how do i implement this?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #97 on: October 28, 2007, 12:40:10 PM »
I no find 20 for limit in MOD ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline fast

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #98 on: October 28, 2007, 12:43:16 PM »
do you have paging with this mod? i dont...  :cry:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #99 on: October 28, 2007, 01:31:41 PM »
Sorry, I no have.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [MOD] Buddy List || Friend List
« Reply #100 on: October 28, 2007, 05:06:18 PM »
Hi,

how i have to change the line

  $friends_id .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url("/portfolio/".urlencode($fname))."\">$fname</a><br>";

that it link to the members profile?

"Porfolio" is not a right link.

another question:
In the Download is a second install with "install_friendslist2.php".

do i need to also install this?

Please help,
thanks,
Glitzer
« Last Edit: October 28, 2007, 05:46:36 PM by glitzer »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #101 on: October 28, 2007, 06:03:00 PM »
Quote
$friends_id .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url("/portfolio/".urlencode($fname))."\">$fname</a><br>";

I check in friendslist.php file and I think is this:

Code: [Select]
$friends_id .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url($friendslist_url)."\">$fname</a><br>";

Quote
In the Download is a second install with "install_friendslist2.php".

Yes.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [MOD] Buddy List || Friend List
« Reply #102 on: October 28, 2007, 06:10:45 PM »
Hi Thunderstrike,

thank you for trying help me, but $friends_id .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url($friendslist_url)."\">$fname</a><br>";
is not the correct one.

I donīt have "portfolio" on my site.

I need the correct Url to the Members profile.

has anybody a idea?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #103 on: October 28, 2007, 06:12:34 PM »
Quote
I need the correct Url to the Members profile.

And which page this from for put this link ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [MOD] Buddy List || Friend List
« Reply #104 on: October 28, 2007, 06:21:23 PM »
Hi Thunderstrike..

on the Members profile.html

i attach you my problem..i hope this helps ..to understand me