Bravo List
Register
Go Back   > Bravo List > Sourcecode > Torrent Trader > Mods & Themes
Reply
  #1  
Old 09-10-13, 20:24
soulblazer's Avatar
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, 47 views)

Last edited by soulblazer; 09-10-13 at 20:48.
Reply With Quote
  #2  
Old 01-11-16, 21:31
anaxu's Avatar
anaxu anaxu is offline
Member
 
Join Date: Sep 2016
P2P
Posts: 4
Default
amazing thnx
Reply With Quote
Reply

Tags
208 , blocked , friends , mod , users

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 12:08. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2017, vBulletin Solutions Inc.