View Single Post
  #1  
Old 9th October 2013, 20:24
soulblazer soulblazer is offline
Member
 
Join Date: Oct 2013
P2P
Posts: 6
Talking Friends (and blocked users) Mod for 2.08
all credit for this mod goes to BigMax1... Im simply sharing it here...

Run into your database:
PHP Code:
CREATE TABLE IF NOT EXISTS `blocked` (   `idint(10unsigned NOT NULL auto_increment,   
`
useridint(10unsigned NOT NULL default '0',   
`
blockidint(10unsigned NOT NULL default '0',   
PRIMARY KEY  (`id`),   
UNIQUE KEY `userfriend` (`userid`,`blockid`)
 ) 
ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=;  

CREATE TABLE IF NOT EXISTS `friends` (   
`
idint(10unsigned NOT NULL auto_increment,   
`
useridint(10unsigned NOT NULL default '0',   
`
friendidint(10unsigned NOT NULL default '0',   
PRIMARY KEY  (`id`),   
UNIQUE KEY `userfriend` (`userid`,`friendid`) 
ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=
Into mailbox.php, before the line that begin with:

Code:
SQL_Query_exec("INSERT INTO `messages`
Copy this code:
Code:
//===| Start Blocked Users $blocked = SQL_Query_exec("SELECT id FROM blocked WHERE userid=$sendto AND blockid=$CURUSER[id]"); $show = mysql_num_rows($blocked); if ($show != 0 && $CURUSER["control_panel"] != "yes")     show_error_msg("Error", "<div style='margin-top:10px; margin-bottom:10px' align='center'><font size=2 color=#FF2000><b>You're blocked by this member and you can not send messages to him!</b></font></div>", 1); //===| End Blocked Users
Into account-details.php, before the line that begin with:
Code:
<?php echo T_("AGE"); ?>
Copy this code:
Code:
<!--| Start Friends |--> <div style="margin-bottom:10px"> <?php If ($CURUSER["id"] != $user["id"]) {     $r = mysql_query("SELECT id FROM friends WHERE userid=$CURUSER[id] AND friendid=$id");     $friend = mysql_num_rows($r);     $r = mysql_query("SELECT id FROM blocked WHERE userid=$CURUSER[id] AND blockid=$id");     $block = mysql_num_rows($r);      if ($friend)         print("[<a href=friends.php?action=delete&type=friend&targetid=$id>Remove from Friends</a>]\n");     elseif($block)         print("&nbsp;[<a href=friends.php?action=delete&type=block&targetid=$id>Remove from Blocked</a>]\n");     else     {         print("[<a href=friends.php?action=add&type=friend&targetid=$id><b>Add to Friends</b></a>]&nbsp;");         print("&nbsp;[<a href=friends.php?action=add&type=block&targetid=$id><b>Add to Blocked</b></a>]\n");     } } ?> </div> <!--| End Friends |-->
And after this line:
Code:
show_error_msg(T_("ERROR"), T_("NO_ACCESS_ACCOUNT_DISABLED"), 1);
Copy this code:
Code:
//===| Start Blocked Users $blocked = SQL_Query_exec("SELECT id FROM blocked WHERE userid=$user[id] AND blockid=$CURUSER[id]"); $show = mysql_num_rows($blocked); if ($show != 0 && $CURUSER["control_panel"] != "yes")     show_error_msg("Error", "<div style='margin-top:10px; margin-bottom:10px' align='center'><font size=2 color=#FF2000><b>You're blocked by this member and you can not see his profile!</b></font></div>", 1); //===| End Blocked Users
Into account.php, after this line:
Code:
<?php print("<a href='mailbox.php'><b>".T_("YOUR_MESSAGES")."</b></a>");?>
Copy this code:
Code:
&nbsp;|&nbsp;         <?php print("<a href='friends.php'><b>Your Friends</b></a>");?>
And finally, upload in your root the contents of friend.zip archive.
Attached Files
File Type: zip friends.zip (4.9 KB, 56 views)

Last edited by soulblazer; 9th October 2013 at 20:48.
Reply With Quote