public function __construct()
 {
     new Accesshandler("friends");
     if (loggedIn()) {
         new MenuItem(array("name" => "friends", "label" => translate("friends"), "page" => "friends", "menu" => "my_account", "weight" => 50));
         new MenuItem(array("name" => "friend_requests", "label" => translate("friend_requests"), "page" => "Friendrequests", "menu" => "my_account", "weight" => 100));
         new Usersetting(array("name" => "notify_when_friend_request_sent", "field_type" => "dropdown", "options" => array("email" => "Email", "site" => "Site", "both" => "Both", "none" => "None"), "tab" => "notifications", "default_value" => "both"));
         new Usersetting(array("name" => "notify_when_friend_request", "field_type" => "dropdown", "options" => array("email" => "Email", "site" => "Site", "both" => "Both", "none" => "None"), "tab" => "notifications", "default_value" => "both"));
         if (currentPage() == "profile" && pageArray(1)) {
             if (pageArray(1) != getLoggedInUserGuid()) {
                 if (!FriendsPlugin::requestSent(getLoggedInUserGuid(), pageArray(1))) {
                     if (!FriendsPlugin::friends(pageArray(1), getLoggedInUserGuid())) {
                         new MenuItem(array("name" => "add_friend", "label" => translate("add_friend"), "page" => addTokenToURL("action/addFriend/" . pageArray(1)), "menu" => "profile", "weight" => 10, "link_class" => "list-group-item list-group-item-info confirm"));
                     } else {
                         new MenuItem(array("name" => "remove_friend", "label" => translate("remove_friend"), "page" => addTokenToURL("action/removeFriend/" . pageArray(1)), "menu" => "profile", "weight" => 10, "link_class" => "list-group-item list-group-item-warning confirm"));
                     }
                 } else {
                     new MenuItem(array("name" => "friend_request_sent", "label" => translate("friendship_requested"), "page" => "friend", "menu" => "profile", "weight" => 20, "link_class" => "list-group-item confirm"));
                 }
             }
         }
     }
     new ViewExtension("profile/left", "friends/profile", "after");
     new ViewExtension('pages/home_stats', 'pages/friend_stats');
     new ViewExtension("user/buttons", "friends/friend_button");
 }
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$guid = Vars::get("guid");
if ($guid && loggedIn()) {
    if (getLoggedInUserGuid() != $guid) {
        if (FriendsPlugin::requestSent(getLoggedInUserGuid(), $guid)) {
            echo "<span class='btn btn-info btn-xs' title='Friendship Requested' data-toggle='tooltip'><i class='fa fa-user'></i></span>";
        } else {
            if (FriendsPlugin::friends($guid, getLoggedInUserGuid())) {
                $remove_friend_url = addTokenToURL(getSiteURL() . "action/removeFriend/{$guid}");
                echo "<a href='{$remove_friend_url}' data-toggle='tooltip' title='Remove Friend' class='btn btn-warning btn-xs'><i class='fa fa-minus'></i></a>";
            } else {
                $add_friend_url = addTokenToURL(getSiteURL() . "action/addFriend/{$guid}");
                echo "<a href='{$add_friend_url}' data-toggle='tooltip' title='Add Friend' class='btn btn-success btn-xs'><i class='fa fa-plus'></i></a>";
            }
        }
    }
}