Author Topic: Add/Remove Friend, Add/Remove Favorite Links  (Read 1512 times)

blueeyeddevil

  • Active Member
  • ***
  • Posts: 45
  • Karma: +3/-0
Add/Remove Friend, Add/Remove Favorite Links
« on: December 30, 2014, 11:03:02 PM »
Fix for Add/Remove Friend/Favorite links in members profile. Links are changing depending if user already connected or not (same as Block/Unblock user).
open file ROOT/profile_left.php
FIND:
Code: [Select]
$conn_net=is_network_member($_SESSION[_LICENSE_KEY_]['user']['user_id'],$output['uid'],0,array(NET_BLOCK));
REPLACE WITH:
Code: [Select]
if(is_network_member($_SESSION[_LICENSE_KEY_]['user']['user_id'],$output['uid'],NET_FAVES)) {
$output['unfav_user']=true;
}
if(is_network_member($_SESSION[_LICENSE_KEY_]['user']['user_id'],$output['uid'],NET_FRIENDS)) {
$output['unfriend_user']=true;
}
Save & Close file ROOT/profile_left.php


Open file ROOT/skins_site/def/profile_left.html
FIND:
Code: [Select]
<li class="first"><a class="content-link link_bookmark" href="{tplvars.relative_url}processors/net_adduser.php?uid={output.uid}&amp;net_id=3&amp;return={output.return2me}">Add to favorites</a></li>
<li><a class="content-link link_bookmark" href="{tplvars.relative_url}processors/net_adduser.php?uid={output.uid}&amp;net_id=1&amp;return={output.return2me}">Add to friends</a></li>
REPLACE WITH:
Code: [Select]
<li>
<!--opt name="output.unfav_user"--><a class="content-link link_bookmark" href="{tplvars.relative_url}processors/net_deluser.php?uid={output.uid}&amp;net_id=3&amp;return={output.return2me}">Remove from Favorites</a><!--/opt name="output.unfav_user"-->
<!--opt name="!output.unfav_user"--><a class="content-link link_bookmark" href="{tplvars.relative_url}processors/net_adduser.php?uid={output.uid}&amp;net_id=3&amp;return={output.return2me}">Add to Favorites</a><!--/opt name="!output.unfav_user"-->
</li>
<li>
<!--opt name="output.unfriend_user"--><a class="content-link link_bookmark" href="{tplvars.relative_url}processors/net_deluser.php?uid={output.uid}&amp;net_id=1&amp;return={output.return2me}">Remove from Friends</a><!--/opt name="output.unfriend_user"-->
<!--opt name="!output.unfriend_user"--><a class="content-link link_bookmark" href="{tplvars.relative_url}processors/net_adduser.php?uid={output.uid}&amp;net_id=1&amp;return={output.return2me}">Add to Friends</a><!--/opt name="!output.unfriend_user"-->
</li>
FIND AND REMOVE:
Code: [Select]
<!--loop name="conn_net"-->
<li><a class="content-link link_block" href="{tplvars.relative_url}processors/net_deluser.php?uid={output.uid}&amp;net_id={conn_net.net_id}&amp;return={output.return2me}">Remove from {conn_net.network}</a></li>
<!--/loop name="conn_net"-->
Save & Close file ROOT/skins_site/def/profile_left.html

KHDev

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 522
  • Karma: +45/-2
  • Etano Contributor (Skins & Mods)
Re: Add/Remove Friend, Add/Remove Favorite Links
« Reply #1 on: January 01, 2015, 09:20:37 AM »
Thanks for sharing this  :)