|
#1
|
|||
|
|||
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:
Code:
SQL_Query_exec("INSERT INTO `messages` 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 Code:
<?php echo T_("AGE"); ?> 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(" [<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>] "); print(" [<a href=friends.php?action=add&type=block&targetid=$id><b>Add to Blocked</b></a>]\n"); } } ?> </div> <!--| End Friends |--> Code:
show_error_msg(T_("ERROR"), T_("NO_ACCESS_ACCOUNT_DISABLED"), 1); 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 Code:
<?php print("<a href='mailbox.php'><b>".T_("YOUR_MESSAGES")."</b></a>");?> Code:
| <?php print("<a href='friends.php'><b>Your Friends</b></a>");?> Last edited by soulblazer; 9th October 2013 at 20:48. |
#2
|
|||
|
|||
amazing thnx
|
Tags |
208 , blocked , friends , mod , users |
Thread Tools | |
|
|