• [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove 5 0 5 1
Currently:  

Poll

Buddy List v1.0 - Buddy Request/Accept/Reject/Remove

I like
11 (84.6%)
I don't like
2 (15.4%)
I don't care
0 (0%)

Total Members Voted: 10

Author Topic: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove  (Read 46500 times)

0 Members and 2 Guests are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #30 on: August 10, 2010, 05:01:55 PM »
1) in details.php find:
	
	
    
$buddy_button "<img src=\"".get_gallery_image("buddy_off.gif")."\" border=\"0\" alt=\"\" />";


Replace it with:
        if ($user_info['user_level'] != GUEST && $user_info['user_id'] == $comment_user_id)
        {
          
$buddy_button "";
        }
        else
        {
          
$buddy_button "<img src=\"".get_gallery_image("buddy_off.gif")."\" border=\"0\" alt=\"\" />";
        }
 



2) try this:
in includes/functions.php find:
  $sql"INSERT INTO ".USERS_FRIENDSHIP_TABLE." (


Insert above :above:
  if (check_buddy($id) != -1) return 1;



3) as usual in such situations it's best have exact error message. refer to An unexpected error occured. Please try again later topic to get exact error message.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #31 on: August 10, 2010, 06:05:44 PM »
@ VANO,

Thank u so so so much for your reply, i went to the link u posted and did exaactly like u said, it tells me the error, its so strange, u r so clever i would have never imagine few simple code can help in making errors more detailed.

First of to re-cap, the problem was when user 1 sends friend request to user 2 and user 2 clicks reject it does not work, i get the error, unexpected error, please try again later,

below is the error u asked for sir in  more detail. This is only flaw left and the buddy list will be perfect, thanks to u

Bad SQL Query: UPDATE 4images_users_friendship
          SET friendship_status = -1,
               friendship_reject_message = 'Sorry, I'm not ready to be your friend yet'
          WHERE friendship_id = 15You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm not ready to be your friend yet'
          WHERE friendship_id = 15' at line 3


when i look at the url link it tells me its in the buddy.php script.
God bless u VANO

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #32 on: August 10, 2010, 06:22:07 PM »
Much better, now it's clear what is the problem.

In includes/functions.php find:
          
	
  
friendship_reject_message '".$user_info['buddy_reject_msg']."'


Replace with:
          
	
  
friendship_reject_message '".addslashes($user_info['buddy_reject_msg'])."'

(IMO author made a mistake by saving messages into database, this method kills any multilanguage compatibilities.)

This should fix the error.


Now if you get backlashes when viewing the request status at buddy.php (example: I\'m not ready..) then in buddy.php find two times $user_row['friendship_request_message'] (part of a line) and replace both with: stripslashes($user_row['friendship_request_message'])
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #33 on: August 10, 2010, 06:54:12 PM »
@VANO

Hello sir, please forgive me for doing this to u, im very sorry. I have tried that method u proposed unfortunately sir the problem is still there ,however this time i went back and i checked what the error was in more detail after i had taken ur steps to try to resolve the issue. Below is the issue in more detail after taking changing 1 line of code in the include/function.php.  As you can see from below sir, the error is different from the first error i put up. Im so sorry for this sir, Any idea why again this problem arrises

Bad SQL Query: UPDATE 4images_users_friendship
          SET friendship_status = -1,
               friendship_reject_message = 'Sorry, I\'m not ready to be your friend yet'
          WHERE friendship_id = 16Unknown column 'friendship_reject_message' in 'field list'


God bless vano and thank u

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #34 on: August 10, 2010, 07:11:09 PM »
Oh, that is a bigger error...

You'll need search in all files that were modified by this mod (including buddy.php) for reject_message (part of a line) and replace all with: response_message
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #35 on: August 10, 2010, 07:38:41 PM »
WOWAWEEEEEEEEEEWA, it works, u r brilliant man. GREAT asset to 4images in everything u do. Just pure amazing. U not only help me but u give me belief that there are honourable people in this world who are 1 in a million. Thank u so much Vano i mean this, i will never forget ur proffesionalism and great work. There is no word in the world to show u my gratitude,

thank u so much vano, god bless u with all my heart

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #36 on: August 10, 2010, 08:32:31 PM »
by reject a buddy
Quote
DB Error: Bad SQL Query: UPDATE 4images_users_friendship SET friendship_status = -1, friendship_reject_message = '' WHERE friendship_id = 4
Unknown column 'friendship_reject_message' in 'field list'

can you help me?
Beste Gre
Benny

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #37 on: August 10, 2010, 08:39:11 PM »
Oh, that is a bigger error...

You'll need search in all files that were modified by this mod (including buddy.php) for reject_message (part of a line) and replace all with: response_message
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #38 on: August 11, 2010, 12:15:11 PM »
Thank you!

But i have replaced
if (!$num_rows)  {
  
$userlist "";
  
$msg $lang['buddy_no_empty'];
}
else {
  
$userlist .="\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tr>\n<td class=\"bordercolor\">\n";  
	
	

  
$userlist .="<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\">\n";
  
$userlist .="<tr>\n<td class=\"head2\" align=\"center\">".$lang['user_name']."</td>\n<td class=\"head2\" align=\"center\">".$lang['email']."</td>\n<td class=\"head2\" align=\"center\">".$lang['homepage']."</td>\n<td class=\"head2\" align=\"center\">".$lang['lang_total_user_comments']."</td>\n<td class=\"head2\" align=\"center\">".$lang['lang_total_user_images']."</td>\n<td class=\"head2\" align=\"center\">".$lang['lang_buddy_action']."</td>\n</tr>\n";
  
$count 0;
  
$bgcolor 0;
  while (
$user_row $site_db->fetch_array($result)){
  
$user_id "";
  
$user_name "";
  
$user_join_date "";
  
$user_email "";
  
$user_email_save "";
  
$user_mailform_link "";
  
$buddy_url="";
  
$buddy_button="";
  
$user_email_button "";
  
$total_user_images "";
  
$total_user_comments "";
  
$user_id $user_row['user_id'];
   
// --------------------------
   // COUNT users pics
   // --------------------------
   
$sql "SELECT COUNT(image_id) AS t_images
           FROM "
.IMAGES_TABLE."
           WHERE user_id = 
$user_id";
   
$count_t_images $site_db->query_firstrow($sql);
   
// --------------------------
   // UPDATE user_t_images field
   // --------------------------
   
$sql "UPDATE ".USERS_TABLE.
           SET user_t_images = "
.$count_t_images['t_images'].
           WHERE user_id = 
$user_id";
   
// --------------------------
   
$site_db->query($sql);
    
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$user_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$user_row['user_id'];
    
$user_name "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($user_row['user_name'])."</a>";
	
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;
	
if (!empty(
$user_homepage) && $user_homepage != REPLACE_EMPTY) {
      
$user_homepage_button "<a href=\"".$user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$user_homepage."\" /></a>";
    }
    else {
      
$user_homepage_button REPLACE_EMPTY;
    }
	

    
$buddy_url $self_url;
    
$buddy_url .= (!empty($mode)) ? ((strpos($buddy_url'?') !== false) ? "&amp;" "?")."mode=".$mode "";
    
$buddy_url .= strpos($buddy_url'?') !== false "&amp;" "?";
	

    
$buddy_url .= "action=removefrombuddy&amp;id=".$user_id;
    
//$buddy_button = "<a href=\"".$site_sess->url($buddy_url)."\"><img src=\"".get_gallery_image("buddy_yes.gif")."\" border=\"0\" alt=\"\" /></a>";

    
if (!empty($user_row['user_email']) && (!isset($user_row['user_showemail']) || (isset($user_row['user_showemail']) && $user_row['user_showemail'] == 1))) {
      
$user_email $user_row['user_email'];
      
$user_email_save str_replace("@"" at "$user_row['user_email']);
      if (!empty(
$url_mailform)) {
        
$user_mailform_link $site_sess->url(preg_replace("/{user_id}/"$user_row['user_id'], $url_mailform));
      }
      else {
        
$user_mailform_link $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$user_row['user_id']);
      }
      
$user_email_button "<a href=\"".$user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$user_email_save."\" /></a>";
    }
    
$user_join_date = (isset($user_row['user_joindate'])) ? format_date($config['date_format'], $user_row['user_joindate']) : REPLACE_EMPTY;
    
$total_user_comments $user_row['user_comments'];
    
$total_user_images $user_row['user_t_images'];
      if (
$total_user_images 0) {
        
$total_images_link $site_sess->url(ROOT_PATH."search.php?search_user=".$user_row['user_name']);
        
$total_user_images_link =  "<a href=\"".$total_images_link."\">".$total_user_images."</a>";
      } else {
       
$total_user_images_link $total_user_images;
      }
      
    
// ACCEPTED
    
if ($user_row['friendship_status'] == 1){
	
    
	
    
$buddy_button "<a href=\"buddy.php?action=removebuddy&id=".$user_row['friendship_id']."\">".$lang['buddy_remove']."</a> ";
	
    
	
    
    }
   
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$userlist .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
    
$userlist .= "<td valign=\"center\" align=\"left\">".$session_ip." ".$user_name."</td>\n";
    
$userlist .= "<td valign=\"center\" align=\"center\">".$user_email_button."</td>\n";
    
$userlist .= "<td valign=\"center\" align=\"center\">".$user_homepage_button."</td>\n";
    
$userlist .= "<td valign=\"center\" align=\"center\">".$total_user_comments."</td>\n";
    
$userlist .= "<td valign=\"center\" align=\"center\">".$total_user_images_link."</td>\n";
	
$userlist .= "<td valign=\"center\" align=\"center\">".$buddy_button."</td>";
    
$userlist .= "\n</tr>\n";
  }
  
$userlist .= "</table>\n";
  
$userlist .= "</td>\n</tr>\n</table>\n";
}

to
if (!$num_rows)  {
  
$userlist "";
  
$msg $lang['buddy_no_empty'];
}
else {
  
$userlist .= $site_template->parse_template("buddy_userlist_header");
  
$count 0;
  
$bgcolor 0;
  while (
$user_row $site_db->fetch_array($result)){
  
$user_id "";
  
$user_name "";
  
$user_join_date "";
  
$user_email "";
  
$user_email_save "";
  
$user_mailform_link "";
  
$buddy_url="";
  
$buddy_button="";
  
$user_email_button "";
  
$total_user_images "";
  
$total_user_comments "";
  
$user_id $user_row['user_id'];
   
// --------------------------
   // COUNT users pics
   // --------------------------
   
$sql "SELECT COUNT(image_id) AS t_images
           FROM "
.IMAGES_TABLE."
           WHERE user_id = 
$user_id";
   
$count_t_images $site_db->query_firstrow($sql);
   
// --------------------------
   // UPDATE user_t_images field
   // --------------------------
   
$sql "UPDATE ".USERS_TABLE.
           SET user_t_images = "
.$count_t_images['t_images'].
           WHERE user_id = 
$user_id";
   
// --------------------------
   
$site_db->query($sql);
    
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$user_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$user_row['user_id'];
    
$user_name "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($user_row['user_name'])."</a>";
	
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;
	
if (!empty(
$user_homepage) && $user_homepage != REPLACE_EMPTY) {
      
$user_homepage_button "<a href=\"".$user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$user_homepage."\" /></a>";
    }
    else {
      
$user_homepage_button REPLACE_EMPTY;
    }
	

    
$buddy_url $self_url;
    
$buddy_url .= (!empty($mode)) ? ((strpos($buddy_url'?') !== false) ? "&amp;" "?")."mode=".$mode "";
    
$buddy_url .= strpos($buddy_url'?') !== false "&amp;" "?";
	

    
$buddy_url .= "action=removefrombuddy&amp;id=".$user_id;
    
//$buddy_button = "<a href=\"".$site_sess->url($buddy_url)."\"><img src=\"".get_gallery_image("buddy_yes.gif")."\" border=\"0\" alt=\"\" /></a>";

    
if (!empty($user_row['user_email']) && (!isset($user_row['user_showemail']) || (isset($user_row['user_showemail']) && $user_row['user_showemail'] == 1))) {
      
$user_email $user_row['user_email'];
      
$user_email_save str_replace("@"" at "$user_row['user_email']);
      if (!empty(
$url_mailform)) {
        
$user_mailform_link $site_sess->url(preg_replace("/{user_id}/"$user_row['user_id'], $url_mailform));
      }
      else {
        
$user_mailform_link $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$user_row['user_id']);
      }
      
$user_email_button "<a href=\"".$user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$user_email_save."\" /></a>";
    }
    
$user_join_date = (isset($user_row['user_joindate'])) ? format_date($config['date_format'], $user_row['user_joindate']) : REPLACE_EMPTY;
    
$total_user_comments $user_row['user_comments'];
    
$total_user_images $user_row['user_t_images'];
      if (
$total_user_images 0) {
        
$total_images_link $site_sess->url(ROOT_PATH."search.php?search_user=".$user_row['user_name']);
        
$total_user_images_link =  "<a href=\"".$total_images_link."\">".$total_user_images."</a>";
      } else {
       
$total_user_images_link $total_user_images;
      }
      
    
// ACCEPTED
    
if ($user_row['friendship_status'] == 1){
	
    
	
    
$buddy_button "<a href=\"buddy.php?action=removebuddy&id=".$user_row['friendship_id']."\">".$lang['buddy_remove']."</a> ";
	
    
	
    
    }
   
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$userlist .= "";
    }
    
    
$userlist .= $site_template->parse_template("buddy_userlist");
  }
  
$userlist .= $site_template->parse_template("buddy_userlist_footer");
}
// END ALREADY BUDDY
$site_template->register_vars("buddy"$userlist);
$site_template->register_vars("buddy_msg"$msg);
unset(
$userlist,$msg);

But dont work

buddy_userlist_header.html
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td class="bordercolor"><table width="100%" border="0" cellpadding="2" cellspacing="1">
        <tr>
          <td class="head2" align="center">{lang_user_name}</td>
          <td class="head2" align="center">{lang_email}</td>
          <td class="head2" align="center">{lang_homepage}</td>
          <td class="head2" align="center">{lang_total_user_comments}</td>
          <td class="head2" align="center">{lang_total_user_images}</td>
          <td class="head2" align="center">{lang_buddy_action}</td>
        </tr>
buddy_userlist.html
Code: [Select]
        <tr class="imagerow{row_bg_number}">
          <td valign="center" align="left">{session}{user_name}</td>
          <td valign="center" align="center">{user_email_button}</td>
          <td valign="center" align="center">{user_homepage_button}</td>
          <td valign="center" align="center">{total_user_comments}</td>
          <td valign="center" align="center">{total_user_images_link}</td>
          <td valign="center" align="center">{buddy_button}</td>
        </tr>
buddy_userlist_footer.html
Code: [Select]
      </table></td>
  </tr>
</table>
Beste Gre
Benny

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #39 on: August 11, 2010, 12:45:51 PM »
Hello

What is the problem exactly. Vano was really helpful and kinf to me and i would like to repay this by helping u. What problem do u have and hopefully i may have the answers all thanks to Vano

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #40 on: August 11, 2010, 01:54:43 PM »
This has nothing to do with the other problems
I want to separate the HTML code from the PHP code
Beste Gre
Benny

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #41 on: August 11, 2010, 02:46:18 PM »
@Sumale.nin:
I think you should start over with explanation on what exactly you are trying to do and/or what is the problem. Your first reply was about error message, then you said my suggestion on repairing it didn't work (or at least whatever didn't work was without explanation about what you were trying to do...or you are quizzing us? :)), and lastly you are talking about separation of HTML from PHP...

As of html separation, you did almost everything right, except you missed the part that registers template tags for your buddy_userlist.html template. You must register these tags before you parsing the template.
$userlist "";
if (!
$num_rows)
{
  
$msg $lang['buddy_no_empty'];
}
else
{
  
$site_template->register_vars(array(
    
"lang_user_name" => $lang['user_name'],
    
"lang_email" => $lang['email'],
    
"lang_homepage" => $lang['homepage'],
    
"lang_user_comments" => $lang['lang_total_user_comments'],
    
"lang_user_images" => $lang['lang_total_user_images'],
    
"lang_buddy_action" => $lang['lang_buddy_action'],
  ));
  
$userlist $site_template->parse_template("buddy_userlist_header");
  
$count 0;
  
$bgcolor 0;
  while (
$user_row $site_db->fetch_array($result))
  {
    
$user_id "";
    
$user_name "";
    
$user_join_date "";
    
$user_email "";
    
$user_email_save "";
    
$user_mailform_link "";
    
$buddy_url="";
    
$buddy_button="";
    
$user_email_button "";
    
$total_user_images "";
    
$total_user_comments "";
    
$user_id $user_row['user_id'];
    
// --------------------------
    // COUNT users pics
    // --------------------------
    
$sql "SELECT COUNT(image_id) AS t_images
           FROM "
.IMAGES_TABLE."
           WHERE user_id = 
$user_id";
    
$count_t_images $site_db->query_firstrow($sql);
    
// --------------------------
    // UPDATE user_t_images field
    // --------------------------
    
$sql "UPDATE ".USERS_TABLE.
           SET user_t_images = "
.$count_t_images['t_images'].
           WHERE user_id = 
$user_id";
    
// --------------------------
    
$site_db->query($sql);
    
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$user_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$user_row['user_id'];
    
$user_name "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($user_row['user_name'])."</a>";
  
  
	

  
    
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;

	


    if (!empty(
$user_homepage) && $user_homepage != REPLACE_EMPTY) {
      
$user_homepage_button "<a href=\"".$user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$user_homepage."\" /></a>";
    }
    else {
      
$user_homepage_button REPLACE_EMPTY;
    }

	



    
$buddy_url $self_url;
    
$buddy_url .= (!empty($mode)) ? ((strpos($buddy_url'?') !== false) ? "&amp;" "?")."mode=".$mode "";
    
$buddy_url .= strpos($buddy_url'?') !== false "&amp;" "?";

	



    
$buddy_url .= "action=removefrombuddy&amp;id=".$user_id;
    
//$buddy_button = "<a href=\"".$site_sess->url($buddy_url)."\"><img src=\"".get_gallery_image("buddy_yes.gif")."\" border=\"0\" alt=\"\" /></a>";

    
if (!empty($user_row['user_email']) && (!isset($user_row['user_showemail']) || (isset($user_row['user_showemail']) && $user_row['user_showemail'] == 1))) {
      
$user_email $user_row['user_email'];
      
$user_email_save str_replace("@"" at "$user_row['user_email']);
      if (!empty(
$url_mailform)) {
        
$user_mailform_link $site_sess->url(preg_replace("/{user_id}/"$user_row['user_id'], $url_mailform));
      }
      else {
        
$user_mailform_link $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$user_row['user_id']);
      }
      
$user_email_button "<a href=\"".$user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$user_email_save."\" /></a>";
    }
    
$user_join_date = (isset($user_row['user_joindate'])) ? format_date($config['date_format'], $user_row['user_joindate']) : REPLACE_EMPTY;
    
$total_user_comments $user_row['user_comments'];
    
$total_user_images $user_row['user_t_images'];
    if (
$total_user_images 0) {
      
$total_images_link $site_sess->url(ROOT_PATH."search.php?search_user=".$user_row['user_name']);
      
$total_user_images_link =  "<a href=\"".$total_images_link."\">".$total_user_images."</a>";
    } else {
     
$total_user_images_link $total_user_images;
    }
      
    
// ACCEPTED
    
if ($user_row['friendship_status'] == 1){
      
$buddy_button "<a href=\"buddy.php?action=removebuddy&id=".$user_row['friendship_id']."\">".$lang['buddy_remove']."</a> ";
    }
   
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$userlist .= "";
    }
    
    
$site_template->register_vars(array(
      
"row_bg_number" => $row_bg_number,
      
"buddy_ip" => $session_ip,
      
"buddy_username" => $user_name,
      
"buddy_email_button" => $user_email_button,
      
"buddy_homepage_button" => $user_homepage_button,
      
"buddy_user_comments" => $total_user_comments,
      
"buddy_user_images" => $total_user_images_link,
      
"buddy_button" => $buddy_button,
    ));
    
$userlist .= $site_template->parse_template("buddy_userlist");
  }
  
$userlist .= $site_template->parse_template("buddy_userlist_footer");
}
// END ALREADY BUDDY
$site_template->register_vars("buddy"$userlist);
$site_template->register_vars("buddy_msg"$msg);
unset(
$userlist,$msg);


(note, I did not look what kind of tags you've used in your templates, so you'll need either rename them in templates or in my code to match.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #42 on: August 11, 2010, 07:15:26 PM »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Buddy List v1.0 - Buddy Request/Accept/Reject/Remove
« Reply #43 on: August 14, 2010, 07:58:31 PM »
@VANO

Listen im so sorry, today i think i have made alot of requests, its just im so close to finishing this site thanks to u. Right now im trying to find out how to put bbcode original into bbcode pmV2, also im trying to find out why i have 3 errors on new images, so im all over place.

Just have question as usual  :) Im trying to hide email button for user logged in, just like how before user cannot add themselves and u helped me hide the buddy button, can u plz show me how i can hide email button on comments for original user but show email button for other users.

Thank u so much Vano, i very much appreciate ur time that u take out to help me. God bless u sir with my heart