Advertisement
Guest User

mod/friend_request/views/default/friend_request/topbar.php

a guest
Sep 20th, 2010
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2.     /**
  3.      * Friend request plugin
  4.      * Extend the Elgg topbar with link to Friends request, if any
  5.      *
  6.      * @package friend_request
  7.      * @author ColdTrick IT Solutions
  8.      * @copyright Coldtrick IT Solutions 2009
  9.      * @link http://www.coldtrick.com/
  10.      * @version 2.0
  11.      */
  12.  
  13.     if(isloggedin()){
  14.         $user = get_loggedin_user();
  15.        
  16.         $count = elgg_get_entities_from_relationship(array(
  17.             'relationship'=>'friendrequest',
  18.             'relationship_guid' =>$user->guid,
  19.             'inverse_relationship'=>true
  20.             );
  21.        
  22.         if(!empty($count)){
  23.             echo "<a href='" . $CONFIG->wwwroot . "pg/friend_request' class='new_friendrequests' title='" . elgg_echo('friend_request:new') . "'>[" . $count . "]</a>";
  24.         }
  25.     }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement