COMMENTS BY AUTHOR - This is my first MOD and I hope you guys will enjoy it. This MOD is basically a different version of (ccsakuweb - friendlist mod), however, the concept of adding buddy (friend) is different. This MOD took me 3 hrs including writing this tutorial. This is my first PHP project and the code maybe a little un-organized. My main language is VB.NET.
DESCRIPTION - Send Buddy Request (next version will have send buddy request with message)
- Accept/Reject Buddy Request (next version will have reject buddy request with message)
- Remove Buddy/Delete Buddy List
- Display Buddies on your profile Page
- This is different from friendlist MOD because it is 2 ways buddies instead of 1 way. IE. If I requested to add you as a friend and you have accepted it, we will be each other buddy mean my name will be displayed on yours buddylist and yours will be displayed on mine. For ccsakuweb MOD you will be just adding the person without they even noticed it and they will not have you as friend even if you added them.
TEST PROOF: http://www.msislander.com/gallery user:test pass: test <-- this mod has been tested on a clean version of 4image gallery just to make sure it doesn't screw anyone up.
DEMO: http://www.henesys.com/gallery user:test pass: test
DOWNLOAD: Click HereBUG FIXED: -------------------------------------------------------------------------------------------------------------------------------------------------
v.1.1 Fixed:- Clear Buddy List (Empty Buddy List
If you have installed version 1.0 then do the steps below if not then ignore it
-----[OPEN]-------
buddy.php
-----[FIND]--------
action=clearbuddy
----[REPLACE]---
action=emptybuddy
-----[OPEN]-------
includes/function.php
-----[FIND]--------
$sql = "DELETE FROM ".USERS_FRIENDSHIP_TABLE."
WHERE user_id_primary = ".$user_info['user_id'].",
----[REPLACE]---
$sql = "DELETE FROM ".USERS_FRIENDSHIP_TABLE."
WHERE user_id_primary = ".$user_info['user_id']."
-------------------------------------------------------------------------------------------------------------------------------------------------
CAUTION: EVERYTHING BELOW ARE FOR INTEGRATION WITH OTHER MOD NOT THE MOD ITSELF. PLEASE DOWNLOAD THE ATTACHED RAR FILE FOR INSTRUCTION AND FILES FOR THIS MODINTEGRATION WITH OTHER MODS:MOD: Memberlist by Nicky -
http://www.4homepages.de/forum/index.php?topic=1954.0-----[OPEN]-------
memberlist.php
-----[FIND]--------
$userlist .="<tr>\n<td class=\"head2\" align=\"center\">".$lang['user_name']."</td>\n<td class=\"head2\" align=\"center\">".$lang['join_date']."</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</tr>\n";
----[REPLACE WITH ]----
//$userlist .="<tr>\n<td class=\"head2\" align=\"center\">".$lang['user_name']."</td>\n<td class=\"head2\" align=\"center\">".$lang['join_date']."</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</tr>\n";
$userlist .="<tr>\n<td class=\"head2\" align=\"center\">".$lang['user_name']."</td>\n<td class=\"head2\" align=\"center\">".$lang['join_date']."</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_friend']."</td>\n</tr>\n";
-----[FIND]--------
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$userlist .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
-----[AFTER, ADD]--------
//---[MOD] BUDDY V.1.0.0 beta ------------
//----2007 by eMagix for 4images gallery --
//----------- START CODE -----------------
if (($user_info['user_level'] != GUEST) && ($user_info['user_id'] != $user_row['user_id'])) {
$buddy_url = $self_url;
$buddy_url .= (!empty($mode)) ? ((strpos($buddy_url, '?') !== false) ? "&" : "?")."mode=".$mode : "";
$buddy_url .= strpos($buddy_url, '?') !== false ? "&" : "?";
// IF USER ALREADY A BUDDY SHOW ALREADY BUDDY TEXT
$buddy_status = check_buddy($user_row['user_id']);
if ($buddy_status == 1) {
$buddy_button = $lang['user_buddy_yes'];
}
// IF USER REQUEST PENDING SHOW PENDING TEXT
elseif ($buddy_status == 0) {
$buddy_button = $lang['user_buddy_pending'];
}
// IF NOT YET BUDDY SHOW BUTTON
elseif ($buddy_status == -1) {
$buddy_url .= "action=addbuddy&id=".$user_row['user_id']."";
$buddy_button = "<a href=\"".$site_sess->url($buddy_url)."\"><img src=\"".get_gallery_image("buddy_no.gif")."\" border=\"0\" alt=\"\" /></a>";
}
}
else {
// BUDDY BUTTON DISABLED
$buddy_button = "<img src=\"".get_gallery_image("buddy_off.gif")."\" border=\"0\" alt=\"\" />";
}
//----------- END CODE -----------------
-----[FIND]-------- Thanks loda for point it out - I totally forgot about it
$total_user_images = "";
-----[AFTER, ADD]--------
$buddy_button = "";
-----[FIND]-------- Thanks loda for point it out - I totally forgot about it
$userlist .= "<td valign=\"top\" align=\"center\">".$total_user_images_link."</td>\n";
-----[AFTER, ADD]--------
$userlist .= "<td valign=\"top\" align=\"left\"> ".$buddy_button." </td>\n";
- That is it now you can browse for buddies and add them at the same time